Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
WheelSettingsWV Class Reference

WheelSettings object specifically for WheeledVehicleController. More...

#include <WheeledVehicleController.h>

Inheritance diagram for WheelSettingsWV:
WheelSettings SerializableObject RefTarget< WheelSettings > NonCopyable

Public Member Functions

 WheelSettingsWV ()
 Constructor. More...
 
virtual void SaveBinaryState (StreamOut &inStream) const override
 Saves the contents in binary form to inStream. More...
 
virtual void RestoreBinaryState (StreamIn &inStream) override
 Restores the contents in binary form to inStream. More...
 
virtual void SaveBinaryState (StreamOut &inStream) const
 Saves the contents in binary form to inStream. More...
 
virtual void RestoreBinaryState (StreamIn &inStream)
 Restores the contents in binary form to inStream. More...
 
- Public Member Functions inherited from SerializableObject
virtual ~SerializableObject ()=default
 Constructor. More...
 
- Public Member Functions inherited from RefTarget< WheelSettings >
 RefTarget ()=default
 Constructor. More...
 
 RefTarget (const RefTarget &)
 
 ~RefTarget ()
 assert no one is referencing us More...
 
void SetEmbedded () const
 
RefTargetoperator= (const RefTarget &)
 Assignment operator. More...
 
uint32 GetRefCount () const
 Get current refcount of this object. More...
 
void AddRef () const
 Add or release a reference to this object. More...
 
void Release () const
 
- Public Member Functions inherited from NonCopyable
 NonCopyable ()=default
 
 NonCopyable (const NonCopyable &)=delete
 
void operator= (const NonCopyable &)=delete
 

Public Attributes

float mInertia = 0.9f
 Moment of inertia (kg m^2), for a cylinder this would be 0.5 * M * R^2 which is 0.9 for a wheel with a mass of 20 kg and radius 0.3 m. More...
 
float mAngularDamping = 0.2f
 Angular damping factor of the wheel: dw/dt = -c * w. More...
 
float mMaxSteerAngle = DegreesToRadians(70.0f)
 How much this wheel can steer (radians) More...
 
LinearCurve mLongitudinalFriction
 Friction in forward direction of tire as a function of the slip ratio (fraction): (omega_wheel * r_wheel - v_longitudinal) / |v_longitudinal|. More...
 
LinearCurve mLateralFriction
 Friction in sideway direction of tire as a function of the slip angle (degrees): angle between relative contact velocity and vehicle direction. More...
 
float mMaxBrakeTorque = 1500.0f
 How much torque (Nm) the brakes can apply to this wheel. More...
 
float mMaxHandBrakeTorque = 4000.0f
 How much torque (Nm) the hand brake can apply to this wheel (usually only applied to the rear wheels) More...
 
- Public Attributes inherited from WheelSettings
Vec3 mPosition { 0, 0, 0 }
 Attachment point of wheel suspension in local space of the body. More...
 
Vec3 mSuspensionDirection { 0, -1, 0 }
 Direction of the suspension in local space of the body, should point down. More...
 
Vec3 mSteeringAxis { 0, 1, 0 }
 Direction of the steering axis in local space of the body, should point up (e.g. for a bike would be -mSuspensionDirection) More...
 
Vec3 mWheelUp { 0, 1, 0 }
 Up direction when the wheel is in the neutral steering position (usually VehicleConstraintSettings::mUp but can be used to give the wheel camber or for a bike would be -mSuspensionDirection) More...
 
Vec3 mWheelForward { 0, 0, 1 }
 Forward direction when the wheel is in the neutral steering position (usually VehicleConstraintSettings::mForward but can be used to give the wheel toe, does not need to be perpendicular to mWheelUp) More...
 
float mSuspensionMinLength = 0.3f
 How long the suspension is in max raised position relative to the attachment point (m) More...
 
float mSuspensionMaxLength = 0.5f
 How long the suspension is in max droop position relative to the attachment point (m) More...
 
float mSuspensionPreloadLength = 0.0f
 The natural length (m) of the suspension spring is defined as mSuspensionMaxLength + mSuspensionPreloadLength. Can be used to preload the suspension as the spring is compressed by mSuspensionPreloadLength when the suspension is in max droop position. Note that this means when the vehicle touches the ground there is a discontinuity so it will also make the vehicle more bouncy as we're updating with discrete time steps. More...
 
float mSuspensionFrequency = 1.5f
 Natural frequency of the suspension spring (Hz) More...
 
float mSuspensionDamping = 0.5f
 Damping factor of the suspension spring (0 = no damping, 1 = critical damping) More...
 
float mRadius = 0.3f
 Radius of the wheel (m) More...
 
float mWidth = 0.1f
 Width of the wheel (m) More...
 

Additional Inherited Members

- Static Public Member Functions inherited from RefTarget< WheelSettings >
static int sInternalGetRefCountOffset ()
 INTERNAL HELPER FUNCTION USED BY SERIALIZATION. More...
 
- Protected Attributes inherited from RefTarget< WheelSettings >
atomic< uint32mRefCount
 Current reference count. More...
 
- Static Protected Attributes inherited from RefTarget< WheelSettings >
static constexpr uint32 cEmbedded
 A large value that gets added to the refcount to mark the object as embedded. More...
 

Detailed Description

WheelSettings object specifically for WheeledVehicleController.

Constructor & Destructor Documentation

◆ WheelSettingsWV()

WheelSettingsWV::WheelSettingsWV ( )

Constructor.

Member Function Documentation

◆ RestoreBinaryState()

void WheelSettingsWV::RestoreBinaryState ( StreamIn inStream)
overridevirtual

Restores the contents in binary form to inStream.

Reimplemented from WheelSettings.

◆ SaveBinaryState()

void WheelSettingsWV::SaveBinaryState ( StreamOut inStream) const
overridevirtual

Saves the contents in binary form to inStream.

Reimplemented from WheelSettings.

Member Data Documentation

◆ mAngularDamping

float WheelSettingsWV::mAngularDamping = 0.2f

Angular damping factor of the wheel: dw/dt = -c * w.

◆ mInertia

float WheelSettingsWV::mInertia = 0.9f

Moment of inertia (kg m^2), for a cylinder this would be 0.5 * M * R^2 which is 0.9 for a wheel with a mass of 20 kg and radius 0.3 m.

◆ mLateralFriction

LinearCurve WheelSettingsWV::mLateralFriction

Friction in sideway direction of tire as a function of the slip angle (degrees): angle between relative contact velocity and vehicle direction.

◆ mLongitudinalFriction

LinearCurve WheelSettingsWV::mLongitudinalFriction

Friction in forward direction of tire as a function of the slip ratio (fraction): (omega_wheel * r_wheel - v_longitudinal) / |v_longitudinal|.

◆ mMaxBrakeTorque

float WheelSettingsWV::mMaxBrakeTorque = 1500.0f

How much torque (Nm) the brakes can apply to this wheel.

◆ mMaxHandBrakeTorque

float WheelSettingsWV::mMaxHandBrakeTorque = 4000.0f

How much torque (Nm) the hand brake can apply to this wheel (usually only applied to the rear wheels)

◆ mMaxSteerAngle

float WheelSettingsWV::mMaxSteerAngle = DegreesToRadians(70.0f)

How much this wheel can steer (radians)


The documentation for this class was generated from the following files: