22BulletWheel(btWheelInfo &info) : _info(info) {
33 static btWheelInfoConstructionInfo ci {};
34 static btWheelInfo info(ci);
42BulletWheelRaycastInfo::
43BulletWheelRaycastInfo(btWheelInfo::RaycastInfo &info) : _info(info) {
51get_raycast_info()
const {
64 return (PN_stdfloat)_info.getSuspensionRestLength();
74 _info.m_suspensionStiffness = (btScalar)value;
84 return (PN_stdfloat)_info.m_suspensionStiffness;
95 _info.m_maxSuspensionTravelCm = (btScalar)value;
101PN_stdfloat BulletWheel::
102get_max_suspension_travel_cm()
const {
105 return (PN_stdfloat)_info.m_maxSuspensionTravelCm;
115 _info.m_frictionSlip = (btScalar)value;
125 return (PN_stdfloat)_info.m_frictionSlip;
135 _info.m_maxSuspensionForce = (btScalar)value;
145 return (PN_stdfloat)_info.m_maxSuspensionForce;
155 _info.m_wheelsDampingCompression = (btScalar)value;
165 return (PN_stdfloat)_info.m_wheelsDampingCompression;
175 _info.m_wheelsDampingRelaxation = (btScalar)value;
185 return (PN_stdfloat)_info.m_wheelsDampingRelaxation;
198 _info.m_rollInfluence = (btScalar)value;
209 return (PN_stdfloat)_info.m_rollInfluence;
219 _info.m_wheelsRadius = (btScalar)value;
229 return (PN_stdfloat)_info.m_wheelsRadius;
239 _info.m_steering = (btScalar)value;
249 return (PN_stdfloat)_info.m_steering;
256set_rotation(PN_stdfloat value) {
259 _info.m_rotation = (btScalar)value;
265PN_stdfloat BulletWheel::
266get_rotation()
const {
269 return (PN_stdfloat)_info.m_rotation;
276set_delta_rotation(PN_stdfloat value) {
279 _info.m_deltaRotation = (btScalar)value;
285PN_stdfloat BulletWheel::
286get_delta_rotation()
const {
289 return (PN_stdfloat)_info.m_deltaRotation;
299 _info.m_engineForce = (btScalar)value;
309 return (PN_stdfloat)_info.m_engineForce;
316set_brake(PN_stdfloat value) {
319 _info.m_brake = (btScalar)value;
329 return (PN_stdfloat)_info.m_brake;
336set_skid_info(PN_stdfloat value) {
339 _info.m_skidInfo = (btScalar)value;
345PN_stdfloat BulletWheel::
346get_skid_info()
const {
349 return (PN_stdfloat)_info.m_skidInfo;
356set_wheels_suspension_force(PN_stdfloat value) {
359 _info.m_wheelsSuspensionForce = (btScalar)value;
365PN_stdfloat BulletWheel::
366get_wheels_suspension_force()
const {
369 return (PN_stdfloat)_info.m_wheelsSuspensionForce;
376set_suspension_relative_velocity(PN_stdfloat value) {
379 _info.m_suspensionRelativeVelocity = (btScalar)value;
385PN_stdfloat BulletWheel::
386get_suspension_relative_velocity()
const {
389 return (PN_stdfloat)_info.m_suspensionRelativeVelocity;
396set_clipped_inv_connection_point_cs(PN_stdfloat value) {
399 _info.m_clippedInvContactDotSuspension = (btScalar)value;
405PN_stdfloat BulletWheel::
406get_clipped_inv_connection_point_cs()
const {
409 return (PN_stdfloat)_info.m_clippedInvContactDotSuspension;
419 nassertv(!pos.is_nan());
420 _info.m_chassisConnectionPointCS = LVecBase3_to_btVector3(pos);
430 return btVector3_to_LPoint3(_info.m_chassisConnectionPointCS);
441 nassertv(!dir.is_nan());
442 _info.m_wheelDirectionCS = LVecBase3_to_btVector3(dir);
452 return btVector3_to_LVector3(_info.m_wheelDirectionCS);
462 nassertv(!axle.is_nan());
463 _info.m_wheelAxleCS = LVecBase3_to_btVector3(axle);
473 return btVector3_to_LVector3(_info.m_wheelAxleCS);
480set_world_transform(
const LMatrix4 &mat) {
483 nassertv(!mat.is_nan());
484 _info.m_worldTransform = LMatrix4_to_btTrans(mat);
490LMatrix4 BulletWheel::
491get_world_transform()
const {
494 return btTrans_to_LMatrix4(_info.m_worldTransform);
504 _info.m_bIsFrontWheel = value;
514 return _info.m_bIsFrontWheel;
524 _info.m_clientInfo = (
void *)node;
535 return (_info.m_clientInfo ==
nullptr) ? nullptr : (
PandaNode *)_info.m_clientInfo;
541bool BulletWheelRaycastInfo::
542is_in_contact()
const {
545 return _info.m_isInContact;
551PN_stdfloat BulletWheelRaycastInfo::
552get_suspension_length()
const {
555 return _info.m_suspensionLength;
561LPoint3 BulletWheelRaycastInfo::
562get_contact_point_ws()
const {
565 return btVector3_to_LPoint3(_info.m_contactPointWS);
571LPoint3 BulletWheelRaycastInfo::
572get_hard_point_ws()
const {
575 return btVector3_to_LPoint3(_info.m_hardPointWS);
581LVector3 BulletWheelRaycastInfo::
582get_contact_normal_ws()
const {
585 return btVector3_to_LVector3(_info.m_contactNormalWS);
591LVector3 BulletWheelRaycastInfo::
592get_wheel_direction_ws()
const {
595 return btVector3_to_LVector3(_info.m_wheelDirectionWS);
601LVector3 BulletWheelRaycastInfo::
602get_wheel_axle_ws()
const {
605 return btVector3_to_LVector3(_info.m_wheelAxleWS);
612get_ground_object()
const {
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.
One wheel of a BulletVehicle.
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.
Similar to MutexHolder, but for a light mutex.
A basic node of the scene graph or data graph.