22BulletWheel(btWheelInfo &info) : _info(info) {
33 static btWheelInfoConstructionInfo ci {};
34 static btWheelInfo info(ci);
36 return BulletWheel(info);
42BulletWheelRaycastInfo::
43BulletWheelRaycastInfo(btWheelInfo::RaycastInfo &info) : _info(info) {
51get_raycast_info()
const {
52 LightMutexHolder holder(BulletWorld::get_global_lock());
54 return BulletWheelRaycastInfo(_info.m_raycastInfo);
62 LightMutexHolder holder(BulletWorld::get_global_lock());
64 return (PN_stdfloat)_info.getSuspensionRestLength();
72 LightMutexHolder holder(BulletWorld::get_global_lock());
74 _info.m_suspensionStiffness = (btScalar)value;
82 LightMutexHolder holder(BulletWorld::get_global_lock());
84 return (PN_stdfloat)_info.m_suspensionStiffness;
93 LightMutexHolder holder(BulletWorld::get_global_lock());
95 _info.m_maxSuspensionTravelCm = (btScalar)value;
101PN_stdfloat BulletWheel::
102get_max_suspension_travel_cm()
const {
103 LightMutexHolder holder(BulletWorld::get_global_lock());
105 return (PN_stdfloat)_info.m_maxSuspensionTravelCm;
113 LightMutexHolder holder(BulletWorld::get_global_lock());
115 _info.m_frictionSlip = (btScalar)value;
123 LightMutexHolder holder(BulletWorld::get_global_lock());
125 return (PN_stdfloat)_info.m_frictionSlip;
133 LightMutexHolder holder(BulletWorld::get_global_lock());
135 _info.m_maxSuspensionForce = (btScalar)value;
143 LightMutexHolder holder(BulletWorld::get_global_lock());
145 return (PN_stdfloat)_info.m_maxSuspensionForce;
153 LightMutexHolder holder(BulletWorld::get_global_lock());
155 _info.m_wheelsDampingCompression = (btScalar)value;
163 LightMutexHolder holder(BulletWorld::get_global_lock());
165 return (PN_stdfloat)_info.m_wheelsDampingCompression;
173 LightMutexHolder holder(BulletWorld::get_global_lock());
175 _info.m_wheelsDampingRelaxation = (btScalar)value;
183 LightMutexHolder holder(BulletWorld::get_global_lock());
185 return (PN_stdfloat)_info.m_wheelsDampingRelaxation;
196 LightMutexHolder holder(BulletWorld::get_global_lock());
198 _info.m_rollInfluence = (btScalar)value;
207 LightMutexHolder holder(BulletWorld::get_global_lock());
209 return (PN_stdfloat)_info.m_rollInfluence;
217 LightMutexHolder holder(BulletWorld::get_global_lock());
219 _info.m_wheelsRadius = (btScalar)value;
227 LightMutexHolder holder(BulletWorld::get_global_lock());
229 return (PN_stdfloat)_info.m_wheelsRadius;
237 LightMutexHolder holder(BulletWorld::get_global_lock());
239 _info.m_steering = (btScalar)value;
247 LightMutexHolder holder(BulletWorld::get_global_lock());
249 return (PN_stdfloat)_info.m_steering;
256set_rotation(PN_stdfloat value) {
257 LightMutexHolder holder(BulletWorld::get_global_lock());
259 _info.m_rotation = (btScalar)value;
265PN_stdfloat BulletWheel::
266get_rotation()
const {
267 LightMutexHolder holder(BulletWorld::get_global_lock());
269 return (PN_stdfloat)_info.m_rotation;
276set_delta_rotation(PN_stdfloat value) {
277 LightMutexHolder holder(BulletWorld::get_global_lock());
279 _info.m_deltaRotation = (btScalar)value;
285PN_stdfloat BulletWheel::
286get_delta_rotation()
const {
287 LightMutexHolder holder(BulletWorld::get_global_lock());
289 return (PN_stdfloat)_info.m_deltaRotation;
297 LightMutexHolder holder(BulletWorld::get_global_lock());
299 _info.m_engineForce = (btScalar)value;
307 LightMutexHolder holder(BulletWorld::get_global_lock());
309 return (PN_stdfloat)_info.m_engineForce;
316set_brake(PN_stdfloat value) {
317 LightMutexHolder holder(BulletWorld::get_global_lock());
319 _info.m_brake = (btScalar)value;
327 LightMutexHolder holder(BulletWorld::get_global_lock());
329 return (PN_stdfloat)_info.m_brake;
336set_skid_info(PN_stdfloat value) {
337 LightMutexHolder holder(BulletWorld::get_global_lock());
339 _info.m_skidInfo = (btScalar)value;
345PN_stdfloat BulletWheel::
346get_skid_info()
const {
347 LightMutexHolder holder(BulletWorld::get_global_lock());
349 return (PN_stdfloat)_info.m_skidInfo;
356set_wheels_suspension_force(PN_stdfloat value) {
357 LightMutexHolder holder(BulletWorld::get_global_lock());
359 _info.m_wheelsSuspensionForce = (btScalar)value;
365PN_stdfloat BulletWheel::
366get_wheels_suspension_force()
const {
367 LightMutexHolder holder(BulletWorld::get_global_lock());
369 return (PN_stdfloat)_info.m_wheelsSuspensionForce;
376set_suspension_relative_velocity(PN_stdfloat value) {
377 LightMutexHolder holder(BulletWorld::get_global_lock());
379 _info.m_suspensionRelativeVelocity = (btScalar)value;
385PN_stdfloat BulletWheel::
386get_suspension_relative_velocity()
const {
387 LightMutexHolder holder(BulletWorld::get_global_lock());
389 return (PN_stdfloat)_info.m_suspensionRelativeVelocity;
396set_clipped_inv_connection_point_cs(PN_stdfloat value) {
397 LightMutexHolder holder(BulletWorld::get_global_lock());
399 _info.m_clippedInvContactDotSuspension = (btScalar)value;
405PN_stdfloat BulletWheel::
406get_clipped_inv_connection_point_cs()
const {
407 LightMutexHolder holder(BulletWorld::get_global_lock());
409 return (PN_stdfloat)_info.m_clippedInvContactDotSuspension;
417 LightMutexHolder holder(BulletWorld::get_global_lock());
419 nassertv(!pos.is_nan());
420 _info.m_chassisConnectionPointCS = LVecBase3_to_btVector3(pos);
428 LightMutexHolder holder(BulletWorld::get_global_lock());
430 return btVector3_to_LPoint3(_info.m_chassisConnectionPointCS);
439 LightMutexHolder holder(BulletWorld::get_global_lock());
441 nassertv(!dir.is_nan());
442 _info.m_wheelDirectionCS = LVecBase3_to_btVector3(dir);
450 LightMutexHolder holder(BulletWorld::get_global_lock());
452 return btVector3_to_LVector3(_info.m_wheelDirectionCS);
460 LightMutexHolder holder(BulletWorld::get_global_lock());
462 nassertv(!axle.is_nan());
463 _info.m_wheelAxleCS = LVecBase3_to_btVector3(axle);
471 LightMutexHolder holder(BulletWorld::get_global_lock());
473 return btVector3_to_LVector3(_info.m_wheelAxleCS);
480set_world_transform(
const LMatrix4 &mat) {
481 LightMutexHolder holder(BulletWorld::get_global_lock());
483 nassertv(!mat.is_nan());
484 _info.m_worldTransform = LMatrix4_to_btTrans(mat);
490LMatrix4 BulletWheel::
491get_world_transform()
const {
492 LightMutexHolder holder(BulletWorld::get_global_lock());
494 return btTrans_to_LMatrix4(_info.m_worldTransform);
502 LightMutexHolder holder(BulletWorld::get_global_lock());
504 _info.m_bIsFrontWheel = value;
512 LightMutexHolder holder(BulletWorld::get_global_lock());
514 return _info.m_bIsFrontWheel;
522 LightMutexHolder holder(BulletWorld::get_global_lock());
524 _info.m_clientInfo = (
void *)node;
533 LightMutexHolder holder(BulletWorld::get_global_lock());
535 return (_info.m_clientInfo ==
nullptr) ? nullptr : (PandaNode *)_info.m_clientInfo;
541bool BulletWheelRaycastInfo::
542is_in_contact()
const {
543 LightMutexHolder holder(BulletWorld::get_global_lock());
545 return _info.m_isInContact;
551PN_stdfloat BulletWheelRaycastInfo::
552get_suspension_length()
const {
553 LightMutexHolder holder(BulletWorld::get_global_lock());
555 return _info.m_suspensionLength;
561LPoint3 BulletWheelRaycastInfo::
562get_contact_point_ws()
const {
563 LightMutexHolder holder(BulletWorld::get_global_lock());
565 return btVector3_to_LPoint3(_info.m_contactPointWS);
571LPoint3 BulletWheelRaycastInfo::
572get_hard_point_ws()
const {
573 LightMutexHolder holder(BulletWorld::get_global_lock());
575 return btVector3_to_LPoint3(_info.m_hardPointWS);
581LVector3 BulletWheelRaycastInfo::
582get_contact_normal_ws()
const {
583 LightMutexHolder holder(BulletWorld::get_global_lock());
585 return btVector3_to_LVector3(_info.m_contactNormalWS);
591LVector3 BulletWheelRaycastInfo::
592get_wheel_direction_ws()
const {
593 LightMutexHolder holder(BulletWorld::get_global_lock());
595 return btVector3_to_LVector3(_info.m_wheelDirectionWS);
601LVector3 BulletWheelRaycastInfo::
602get_wheel_axle_ws()
const {
603 LightMutexHolder holder(BulletWorld::get_global_lock());
605 return btVector3_to_LVector3(_info.m_wheelAxleWS);
612get_ground_object()
const {
613 LightMutexHolder holder(BulletWorld::get_global_lock());
615 return _info.m_groundObject ? (PandaNode *)_info.m_groundObject : nullptr;
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
PANDA 3D SOFTWARE Copyright (c) Carnegie Mellon University.
set_front_wheel
Sets if the wheel is steerable.
get_friction_slip
Returns how slippery the tyres are.
get_engine_force
Returns the amount of accelleration force currently applied.
get_wheel_radius
Returns the wheel radius.
set_roll_influence
Defines a scaling factor for roll forces that affect the chassis.
get_wheel_axle_cs
Returns the normal vector of the wheel axle.
set_friction_slip
Sets the slipperyness of the tyre.
set_wheel_axle_cs
Determines the wheel axle normal vector.
get_brake
Returns the amount of braking force currently applied.
set_chassis_connection_point_cs
Sets the point where the wheel is connected to the chassis.
static BulletWheel empty()
Named constructor intended to be used for asserts with have to return a concrete value.
set_max_suspension_travel_cm
Sets the maximum distance the suspension can travel out of the resting position in centimeters.
get_wheels_damping_compression
Returns the damping applied to the compressing suspension.
get_suspension_rest_length
Returns the length of the suspension when the vehicle is standing still.
set_wheels_damping_relaxation
Sets the damping forces applied when the suspension relaxes.
set_wheel_direction_cs
Sets the wheel's forward vector.
set_node
Sets the PandaNode which representates the visual appearance of this wheel.
get_suspension_stiffness
Returns the stiffness of the suspension.
set_wheels_damping_compression
Sets the damping forces applied when the suspension gets compressed.
set_steering
Sets the steering angle.
set_suspension_stiffness
Sets how stiff the suspension shall be.
get_steering
Returns the steering angle in degrees.
is_front_wheel
Determines if a wheel is steerable.
set_wheel_radius
Sets the wheel radius.
get_wheel_direction_cs
Returns the wheel's forward vector relative to the chassis.
get_node
Returns the PandaNode which representates the visual appearance of this wheel, if such a representati...
get_chassis_connection_point_cs
Returns the point where the wheel is connected to the chassis.
set_max_suspension_force
Sets the maximum suspension force the wheel can handle.
get_roll_influence
Returns the factor by which roll forces are scaled.
get_max_suspension_force
Returns the maximum force (weight) the suspension can handle.
set_engine_force
Defines how much force should be used to rotate the wheel.
get_wheels_damping_relaxation
Returns the damping applied to the relaxing suspension.
A basic node of the scene graph or data graph.