PxVehicleSuspensionData Class Reference

#include <PxVehicleComponents.h>

Public Member Functions

 PxVehicleSuspensionData ()
 
PX_FORCE_INLINE PxReal getRecipMaxCompression () const
 Reciprocal of maximum compression. More...
 
PX_FORCE_INLINE PxReal getRecipMaxDroop () const
 Reciprocal of maximum droop. More...
 
void setMassAndPreserveNaturalFrequency (const PxReal newSprungMass)
 Set a new sprung mass for the suspension and modify the spring strength so that the natural frequency of the spring is preserved. More...
 

Public Attributes

PxReal mSpringStrength
 Spring strength of suspension unit. More...
 
PxReal mSpringDamperRate
 Spring damper rate of suspension unit. More...
 
PxReal mMaxCompression
 Maximum compression allowed by suspension spring. More...
 
PxReal mMaxDroop
 Maximum elongation allowed by suspension spring. More...
 
PxReal mSprungMass
 Mass of vehicle that is supported by suspension spring. More...
 
PxReal mCamberAtRest
 Camber angle (in radians) of wheel when the suspension is at its rest position. More...
 
PxReal mCamberAtMaxCompression
 Camber angle (in radians) of wheel when the suspension is at maximum compression. More...
 
PxReal mCamberAtMaxDroop
 Camber angle (in radians) of wheel when the suspension is at maximum droop. More...
 

Private Member Functions

bool isValid () const
 

Private Attributes

PxReal mRecipMaxCompression
 Cached value of 1.0f/mMaxCompression. More...
 
PxReal mRecipMaxDroop
 Cached value of 1.0f/mMaxDroop. More...
 
PxReal mPad [2]
 

Friends

class PxVehicleWheels4SimData
 

Constructor & Destructor Documentation

◆ PxVehicleSuspensionData()

PxVehicleSuspensionData::PxVehicleSuspensionData ( )
inline

Member Function Documentation

◆ getRecipMaxCompression()

PX_FORCE_INLINE PxReal PxVehicleSuspensionData::getRecipMaxCompression ( ) const
inline

Reciprocal of maximum compression.

Note
Not necessary to set this value because it is set by PxVehicleWheelsSimData::setSuspensionData

Range: [0, PX_MAX_F32)

◆ getRecipMaxDroop()

PX_FORCE_INLINE PxReal PxVehicleSuspensionData::getRecipMaxDroop ( ) const
inline

Reciprocal of maximum droop.

Note
Not necessary to set this value because it is set by PxVehicleWheelsSimData::setSuspensionData

Range: [0, PX_MAX_F32)

◆ isValid()

bool PxVehicleSuspensionData::isValid ( ) const
private

◆ setMassAndPreserveNaturalFrequency()

void PxVehicleSuspensionData::setMassAndPreserveNaturalFrequency ( const PxReal  newSprungMass)
inline

Set a new sprung mass for the suspension and modify the spring strength so that the natural frequency of the spring is preserved.

Parameters
[in]newSprungMassis the new mass that the suspension spring will support.

Friends And Related Function Documentation

◆ PxVehicleWheels4SimData

friend class PxVehicleWheels4SimData
friend

Member Data Documentation

◆ mCamberAtMaxCompression

PxReal PxVehicleSuspensionData::mCamberAtMaxCompression

Camber angle (in radians) of wheel when the suspension is at maximum compression.

Note
For compressed suspensions the camber angle is a linear interpolation of mCamberAngleAtRest and mCamberAtMaxCompression
Specified in radians.

Range: [-pi/2, pi/2]

◆ mCamberAtMaxDroop

PxReal PxVehicleSuspensionData::mCamberAtMaxDroop

Camber angle (in radians) of wheel when the suspension is at maximum droop.

Note
For extended suspensions the camber angle is linearly interpolation of mCamberAngleAtRest and mCamberAtMaxDroop
Specified in radians.

Range: [-pi/2, pi/2]

◆ mCamberAtRest

PxReal PxVehicleSuspensionData::mCamberAtRest

Camber angle (in radians) of wheel when the suspension is at its rest position.

Note
Specified in radians.

Range: [-pi/2, pi/2]

◆ mMaxCompression

PxReal PxVehicleSuspensionData::mMaxCompression

Maximum compression allowed by suspension spring.

Note
Specified in metres (m).

Range: [0, PX_MAX_F32)

◆ mMaxDroop

PxReal PxVehicleSuspensionData::mMaxDroop

Maximum elongation allowed by suspension spring.

Note
Specified in metres (m).

Range: [0, PX_MAX_F32)

◆ mPad

PxReal PxVehicleSuspensionData::mPad[2]
private

◆ mRecipMaxCompression

PxReal PxVehicleSuspensionData::mRecipMaxCompression
private

Cached value of 1.0f/mMaxCompression.

Note
Not necessary to set this value because it is set by PxVehicleWheelsSimData::setSuspensionData

◆ mRecipMaxDroop

PxReal PxVehicleSuspensionData::mRecipMaxDroop
private

Cached value of 1.0f/mMaxDroop.

Note
Not necessary to set this value because it is set by PxVehicleWheelsSimData::setSuspensionData

◆ mSpringDamperRate

PxReal PxVehicleSuspensionData::mSpringDamperRate

Spring damper rate of suspension unit.

Note
Specified in kilograms per second (kg s^-1).

Range: [0, PX_MAX_F32)

◆ mSpringStrength

PxReal PxVehicleSuspensionData::mSpringStrength

Spring strength of suspension unit.

Note
Specified in kilograms per second-squared (kg s^-2).

Range: [0, PX_MAX_F32)

◆ mSprungMass

PxReal PxVehicleSuspensionData::mSprungMass

Mass of vehicle that is supported by suspension spring.

Note
Specified in kilograms (kg).
Each suspension is guaranteed to generate an upwards force of |gravity|*mSprungMass along the suspension direction when the wheel is perfectly at rest and sitting at the rest pose defined by the wheel centre offset.
The sum of the sprung masses of all suspensions of a vehicle should match the mass of the PxRigidDynamic associated with the vehicle. When this condition is satisfied for a vehicle on a horizontal plane the wheels of the vehicle are guaranteed to sit at the rest pose defined by the wheel centre offset. The mass matching condition is not enforced.
As the wheel compresses or elongates along the suspension direction the force generated by the spring is F = |gravity|*mSprungMass + deltaX*mSpringStrength + deltaXDot*mSpringDamperRate where deltaX is the deviation from the defined rest pose and deltaXDot is the velocity of the sprung mass along the suspension direction. In practice, deltaXDot is computed by comparing the current and previous deviation from the rest pose and dividing the difference by the simulation timestep.
If a single suspension spring is hanging in the air and generates zero force the remaining springs of the vehicle will necessarily sit in a compressed configuration. In summary, the sum of the remaining suspension forces cannot balance the downwards gravitational force acting on the vehicle without extra force arising from the deltaX*mSpringStrength force term.
Theoretically, a suspension spring should generate zero force at maximum elongation and increase linearly as the suspension approaches the rest pose. PxVehicleSuspensionData will only enforce this physical law if the spring is configured so that |gravity|*mSprungMass == mMaxDroop*mSpringStrength. To help decouple vehicle handling from visual wheel positioning this condition is not enforced. In practice, the value of |gravity|*mSprungMass + deltaX*mSpringStrength is clamped at zero to ensure it never falls negative.
See also
PxVehicleComputeSprungMasses, PxVehicleWheelsSimData::setWheelCentreOffset, PxVehicleSuspensionData::mSpringStrength, PxVehicleSuspensionData::mSpringDamperRate, PxVehicleSuspensionData::mMaxDroop

Range: [0, PX_MAX_F32)


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