22 BulletWheel(btWheelInfo &info) : _info(info) {
29 BulletWheelRaycastInfo::
30 BulletWheelRaycastInfo(btWheelInfo::RaycastInfo &info) : _info(info) {
38 get_raycast_info()
const {
47 PN_stdfloat BulletWheel::
48 get_suspension_rest_length()
const {
51 return (PN_stdfloat)_info.getSuspensionRestLength();
61 _info.m_suspensionStiffness = (btScalar)value;
67 PN_stdfloat BulletWheel::
68 get_suspension_stiffness()
const {
71 return (PN_stdfloat)_info.m_suspensionStiffness;
82 _info.m_maxSuspensionTravelCm = (btScalar)value;
88 PN_stdfloat BulletWheel::
89 get_max_suspension_travel_cm()
const {
92 return (PN_stdfloat)_info.m_maxSuspensionTravelCm;
102 _info.m_frictionSlip = (btScalar)value;
108 PN_stdfloat BulletWheel::
109 get_friction_slip()
const {
112 return (PN_stdfloat)_info.m_frictionSlip;
122 _info.m_maxSuspensionForce = (btScalar)value;
128 PN_stdfloat BulletWheel::
129 get_max_suspension_force()
const {
132 return (PN_stdfloat)_info.m_maxSuspensionForce;
142 _info.m_wheelsDampingCompression = (btScalar)value;
148 PN_stdfloat BulletWheel::
149 get_wheels_damping_compression()
const {
152 return (PN_stdfloat)_info.m_wheelsDampingCompression;
162 _info.m_wheelsDampingRelaxation = (btScalar)value;
168 PN_stdfloat BulletWheel::
169 get_wheels_damping_relaxation()
const {
172 return (PN_stdfloat)_info.m_wheelsDampingRelaxation;
185 _info.m_rollInfluence = (btScalar)value;
192 PN_stdfloat BulletWheel::
193 get_roll_influence()
const {
196 return (PN_stdfloat)_info.m_rollInfluence;
206 _info.m_wheelsRadius = (btScalar)value;
212 PN_stdfloat BulletWheel::
213 get_wheel_radius()
const {
216 return (PN_stdfloat)_info.m_wheelsRadius;
226 _info.m_steering = (btScalar)value;
232 PN_stdfloat BulletWheel::
233 get_steering()
const {
236 return (PN_stdfloat)_info.m_steering;
243 set_rotation(PN_stdfloat value) {
246 _info.m_rotation = (btScalar)value;
252 PN_stdfloat BulletWheel::
253 get_rotation()
const {
256 return (PN_stdfloat)_info.m_rotation;
263 set_delta_rotation(PN_stdfloat value) {
266 _info.m_deltaRotation = (btScalar)value;
272 PN_stdfloat BulletWheel::
273 get_delta_rotation()
const {
276 return (PN_stdfloat)_info.m_deltaRotation;
286 _info.m_engineForce = (btScalar)value;
292 PN_stdfloat BulletWheel::
293 get_engine_force()
const {
296 return (PN_stdfloat)_info.m_engineForce;
303 set_brake(PN_stdfloat value) {
306 _info.m_brake = (btScalar)value;
312 PN_stdfloat BulletWheel::
316 return (PN_stdfloat)_info.m_brake;
323 set_skid_info(PN_stdfloat value) {
326 _info.m_skidInfo = (btScalar)value;
332 PN_stdfloat BulletWheel::
333 get_skid_info()
const {
336 return (PN_stdfloat)_info.m_skidInfo;
343 set_wheels_suspension_force(PN_stdfloat value) {
346 _info.m_wheelsSuspensionForce = (btScalar)value;
352 PN_stdfloat BulletWheel::
353 get_wheels_suspension_force()
const {
356 return (PN_stdfloat)_info.m_wheelsSuspensionForce;
363 set_suspension_relative_velocity(PN_stdfloat value) {
366 _info.m_suspensionRelativeVelocity = (btScalar)value;
372 PN_stdfloat BulletWheel::
373 get_suspension_relative_velocity()
const {
376 return (PN_stdfloat)_info.m_suspensionRelativeVelocity;
383 set_clipped_inv_connection_point_cs(PN_stdfloat value) {
386 _info.m_clippedInvContactDotSuspension = (btScalar)value;
392 PN_stdfloat BulletWheel::
393 get_clipped_inv_connection_point_cs()
const {
396 return (PN_stdfloat)_info.m_clippedInvContactDotSuspension;
406 nassertv(!pos.is_nan());
407 _info.m_chassisConnectionPointCS = LVecBase3_to_btVector3(pos);
413 LPoint3 BulletWheel::
414 get_chassis_connection_point_cs()
const {
417 return btVector3_to_LPoint3(_info.m_chassisConnectionPointCS);
428 nassertv(!dir.is_nan());
429 _info.m_wheelDirectionCS = LVecBase3_to_btVector3(dir);
435 LVector3 BulletWheel::
436 get_wheel_direction_cs()
const {
439 return btVector3_to_LVector3(_info.m_wheelDirectionCS);
449 nassertv(!axle.is_nan());
450 _info.m_wheelAxleCS = LVecBase3_to_btVector3(axle);
456 LVector3 BulletWheel::
457 get_wheel_axle_cs()
const {
460 return btVector3_to_LVector3(_info.m_wheelAxleCS);
467 set_world_transform(
const LMatrix4 &mat) {
470 nassertv(!mat.is_nan());
471 _info.m_worldTransform = LMatrix4_to_btTrans(mat);
477 LMatrix4 BulletWheel::
478 get_world_transform()
const {
481 return btTrans_to_LMatrix4(_info.m_worldTransform);
491 _info.m_bIsFrontWheel = value;
498 is_front_wheel()
const {
501 return _info.m_bIsFrontWheel;
511 _info.m_clientInfo = (
void *)node;
522 return (_info.m_clientInfo ==
nullptr) ? nullptr : (
PandaNode *)_info.m_clientInfo;
528 bool BulletWheelRaycastInfo::
529 is_in_contact()
const {
532 return _info.m_isInContact;
538 PN_stdfloat BulletWheelRaycastInfo::
539 get_suspension_length()
const {
542 return _info.m_suspensionLength;
548 LPoint3 BulletWheelRaycastInfo::
549 get_contact_point_ws()
const {
552 return btVector3_to_LPoint3(_info.m_contactPointWS);
558 LPoint3 BulletWheelRaycastInfo::
559 get_hard_point_ws()
const {
562 return btVector3_to_LPoint3(_info.m_hardPointWS);
568 LVector3 BulletWheelRaycastInfo::
569 get_contact_normal_ws()
const {
572 return btVector3_to_LVector3(_info.m_contactNormalWS);
578 LVector3 BulletWheelRaycastInfo::
579 get_wheel_direction_ws()
const {
582 return btVector3_to_LVector3(_info.m_wheelDirectionWS);
588 LVector3 BulletWheelRaycastInfo::
589 get_wheel_axle_ws()
const {
592 return btVector3_to_LVector3(_info.m_wheelAxleWS);
599 get_ground_object()
const {
602 return _info.m_groundObject ? (
PandaNode *)_info.m_groundObject :
nullptr;
set_wheel_direction_cs
Sets the wheel's forward vector.
set_steering
Sets the steering angle.
A basic node of the scene graph or data graph.
set_wheels_damping_relaxation
Sets the damping forces applied when the suspension relaxes.
set_wheels_damping_compression
Sets the damping forces applied when the suspension gets compressed.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
Similar to MutexHolder, but for a light mutex.
set_chassis_connection_point_cs
Sets the point where the wheel is connected to the chassis.
set_front_wheel
Sets if the wheel is steerable.
set_wheel_axle_cs
Determines the wheel axle normal vector.
set_max_suspension_force
Sets the maximum suspension force the wheel can handle.
set_max_suspension_travel_cm
Sets the maximum distance the suspension can travel out of the resting position in centimeters.
set_engine_force
Defines how much force should be used to rotate the wheel.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
set_node
Sets the PandaNode which representates the visual appearance of this wheel.
set_suspension_stiffness
Sets how stiff the suspension shall be.
set_roll_influence
Defines a scaling factor for roll forces that affect the chassis.
set_friction_slip
Sets the slipperyness of the tyre.
set_wheel_radius
Sets the wheel radius.