30 #ifndef PX_VEHICLE_CORE_COMPONENTS_H 31 #define PX_VEHICLE_CORE_COMPONENTS_H 97 eMAX_NB_ENGINE_TORQUE_CURVE_ENTRIES = 8
104 mDampingRateFullThrottle(0.15f),
105 mDampingRateZeroThrottleClutchEngaged(2.0f),
106 mDampingRateZeroThrottleClutchDisengaged(0.35f)
108 mTorqueCurve.addPair(0.0f, 0.8f);
109 mTorqueCurve.addPair(0.33f, 1.0f);
110 mTorqueCurve.addPair(1.0f, 0.8f);
113 mRecipMaxOmega=1.0f/mMaxOmega;
358 mDownRatios[i]=0.50f;
448 : mFrontRearSplit(0.45f),
449 mFrontLeftRightSplit(0.5f),
450 mRearLeftRightSplit(0.5f),
540 friend class PxVehicleUpdate;
546 mInvNbDrivenWheels=0.0f;
556 void setDrivenWheel(
const PxU32 wheelId,
const bool drivenState);
561 bool getIsDrivenWheel(
const PxU32 wheelId)
const;
570 bool isValid()
const;
575 PxU32 getDrivenWheelStatus()
const;
576 void setDrivenWheelStatus(
PxU32 status);
592 mAxleSeparation(0.0f)
673 mEstimateIterations(5)
769 : mMinNormalisedLoad(0),
770 mMinFilteredNormalisedLoad(0.2308f),
771 mMaxNormalisedLoad(3.0f),
772 mMaxFilteredNormalisedLoad(3.0f)
774 mDenominator=1.0f/(mMaxNormalisedLoad - mMinNormalisedLoad);
822 friend class PxVehicleWheels4SimData;
830 mMaxBrakeTorque(1500.0f),
831 mMaxHandBrakeTorque(0.0f),
956 bool isValid()
const;
964 friend class PxVehicleWheels4SimData;
967 : mSpringStrength(0.0f),
968 mSpringDamperRate(0.0f),
969 mMaxCompression(0.3f),
973 mCamberAtMaxCompression(0.0f),
974 mCamberAtMaxDroop(0.0f),
975 mRecipMaxCompression(1.0f),
1108 const PxF32 oldStrength = mSpringStrength;
1109 const PxF32 oldSprungMass = mSprungMass;
1110 const PxF32 newStrength = oldStrength * (newSprungMass / oldSprungMass);
1111 mSpringStrength = newStrength;
1112 mSprungMass = newSprungMass;
1134 bool isValid()
const;
1145 : mWheel0(0xffffffff),
1146 mWheel1(0xffffffff),
1181 friend class PxVehicleWheels4SimData;
1185 mLatStiffY(0.3125f*(180.0f /
PxPi)),
1186 mLongitudinalStiffnessPerUnitGravity(1000.0f),
1187 mCamberStiffnessPerUnitGravity(0.1f*(180.0f /
PxPi)),
1190 mFrictionVsSlipGraph[0][0]=0.0f;
1191 mFrictionVsSlipGraph[0][1]=1.0f;
1192 mFrictionVsSlipGraph[1][0]=0.1f;
1193 mFrictionVsSlipGraph[1][1]=1.0f;
1194 mFrictionVsSlipGraph[2][0]=1.0f;
1195 mFrictionVsSlipGraph[2][1]=1.0f;
1197 mRecipLongitudinalStiffnessPerUnitGravity=1.0f/mLongitudinalStiffnessPerUnitGravity;
1199 mFrictionVsSlipGraphRecipx1Minusx0=1.0f/(mFrictionVsSlipGraph[1][0]-mFrictionVsSlipGraph[0][0]);
1200 mFrictionVsSlipGraphRecipx2Minusx1=1.0f/(mFrictionVsSlipGraph[2][0]-mFrictionVsSlipGraph[1][0]);
1351 bool isValid()
const;
1359 #endif //PX_VEHICLE_CORE_COMPONENTS_H Definition: GuContactBuffer.h:37
Definition: PxVehicleComponents.h:256
PX_FORCE_INLINE PxReal getRecipRadius() const
Return value equal to 1.0f/mRadius.
Definition: PxVehicleComponents.h:925
PxU32 mWheel1
Definition: PxVehicleComponents.h:1159
PxReal mCamberStiffnessPerUnitGravity
tire Tire camber stiffness per unity gravitational acceleration.
Definition: PxVehicleComponents.h:1253
PxVehicleAntiRollBarData()
Definition: PxVehicleComponents.h:1144
PxU32 mPad
Definition: PxVehicleComponents.h:568
PxVehicleClutchAccuracyMode::Enum mAccuracyMode
The engine and wheel rotation speeds that are coupled through the clutch can be updated by choosing o...
Definition: PxVehicleComponents.h:711
PxReal mMaxCompression
Maximum compression allowed by suspension spring.
Definition: PxVehicleComponents.h:1005
Enum
Definition: PxVehicleComponents.h:436
#define PX_MAX_NB_WHEELS
This number is the maximum number of wheels allowed for a vehicle.
Definition: PxVehicleSDK.h:81
PxReal mRecipMOI
Reciprocal of the engine moment of inertia.
Definition: PxVehicleComponents.h:221
PxReal mRecipRadius
Reciprocal of radius of unit that includes metal wheel plus rubber tire.
Definition: PxVehicleComponents.h:943
PxVehicleTireLoadFilterData(const PxEMPTY)
Definition: PxVehicleComponents.h:813
Definition: PxVehicleComponents.h:430
PxReal mRearBias
Maximum allowed ratio of rear-left and rear-right wheel rotation speeds. The differential will divert...
Definition: PxVehicleComponents.h:513
Definition: PxVehicleComponents.h:253
PxReal pad
Definition: PxVehicleComponents.h:83
Definition: PxVehicleComponents.h:960
PxReal mAxleSeparation
Distance between center of front axle and center of rear axle.
Definition: PxVehicleComponents.h:638
PxU32 mType
Tire type denoting slicks, wets, snow, winter, summer, all-terrain, mud etc.
Definition: PxVehicleComponents.h:1297
float PxF32
Definition: PxSimpleTypes.h:76
Definition: PxVehicleComponents.h:272
Definition: PxVehicleComponents.h:280
PxVehicleClutchData()
Definition: PxVehicleComponents.h:670
PxReal mMaxNormalisedLoad
Graph point (mMaxNormalisedLoad,mMaxFilteredNormalisedLoad)
Definition: PxVehicleComponents.h:790
PxReal mRecipMaxCompression
Cached value of 1.0f/mMaxCompression.
Definition: PxVehicleComponents.h:1122
static const float PxPi
Definition: PxMath.h:58
Definition: PxVehicleComponents.h:261
Definition: PxVehicleComponents.h:270
Definition: PxVehicleComponents.h:818
PxReal mMaxSteer
Max steer angle that can be achieved by the wheel.
Definition: PxVehicleComponents.h:909
Definition: PxVehicleComponents.h:664
#define PX_FORCE_INLINE
Definition: PxPreprocessor.h:351
Definition: PxVehicleComponents.h:1178
float PxReal
Definition: PxSimpleTypes.h:78
PxReal mFrictionVsSlipGraphRecipx2Minusx1
Cached value of 1.0f/(mFrictionVsSlipGraph[2][0]-mFrictionVsSlipGraph[1][0])
Definition: PxVehicleComponents.h:1347
PxReal mFrontWidth
Distance between center-point of the two front wheels.
Definition: PxVehicleComponents.h:620
void setGearRatio(PxVehicleGearsData::Enum a, PxReal ratio)
Definition: PxVehicleComponents.h:342
Definition: PxVehicleComponents.h:267
Definition: PxVehicleComponents.h:439
Definition: PxVehicleComponents.h:440
PxReal mRadius
Radius of unit that includes metal wheel plus rubber tire.
Definition: PxVehicleComponents.h:846
PxReal mSpringDamperRate
Spring damper rate of suspension unit.
Definition: PxVehicleComponents.h:996
Choose between a potentially more expensive but more accurate solution to the clutch model or a poten...
Definition: PxVehicleComponents.h:655
Definition: PxVehicleComponents.h:441
Definition: PxVehicleComponents.h:252
Definition: PxVehicleComponents.h:269
void setDownRatios(PxVehicleGearsData::Enum a, PxReal ratio)
Definition: PxVehicleComponents.h:425
PxVehicleDifferential4WData(const PxEMPTY)
Definition: PxVehicleComponents.h:530
PX_FORCE_INLINE PxReal getRecipMaxCompression() const
Reciprocal of maximum compression.
Definition: PxVehicleComponents.h:1090
PxReal mRecipMaxOmega
Reciprocal of the maximum rotation speed of the engine.
Definition: PxVehicleComponents.h:230
PxU32 mNbRatios
Number of gears (including reverse and neutral).
Definition: PxVehicleComponents.h:321
Definition: PxVehicleComponents.h:279
PxReal mCamberAtMaxCompression
Camber angle (in radians) of wheel when the suspension is at maximum compression. ...
Definition: PxVehicleComponents.h:1069
PxVehicleAckermannGeometryData()
Definition: PxVehicleComponents.h:588
PxReal mSwitchTime
Time it takes to switch gear.
Definition: PxVehicleComponents.h:330
PxReal mMaxOmega
Maximum rotation speed of the engine.
Definition: PxVehicleComponents.h:148
Definition: PxVehicleComponents.h:264
bool isValid() const
Test that a PxVehicleDriveSimData instance has been configured with legal data. Call only after setti...
PxVehicleDifferentialNWData()
Definition: PxVehicleComponents.h:542
PxReal getGearRatio(PxVehicleGearsData::Enum a) const
Definition: PxVehicleComponents.h:341
PxReal mDenominator
Not necessary to set this value.
Definition: PxVehicleComponents.h:805
PX_FORCE_INLINE PxReal getDenominator() const
Definition: PxVehicleComponents.h:797
PX_FORCE_INLINE PxReal getRecipMaxOmega() const
Return value of mRecipMaxOmega( = 1.0f / mMaxOmega ) that is automatically set by PxVehicleDriveSimDa...
Definition: PxVehicleComponents.h:210
PxReal mMaxBrakeTorque
Max brake torque that can be applied to wheel.
Definition: PxVehicleComponents.h:891
void setMassAndPreserveNaturalFrequency(const PxReal newSprungMass)
Set a new sprung mass for the suspension and modify the spring strength so that the natural frequency...
Definition: PxVehicleComponents.h:1106
PxVec3 mMOI
Moment of inertia of vehicle rigid body actor.
Definition: PxVehicleComponents.h:65
PxVehicleTireData()
Definition: PxVehicleComponents.h:1183
Definition: PxVehicleComponents.h:442
PxF32 mStiffness
Definition: PxVehicleComponents.h:1168
PxReal getDownRatios(PxVehicleGearsData::Enum a) const
Definition: PxVehicleComponents.h:424
PxReal getUpRatios(PxVehicleGearsData::Enum a) const
Definition: PxVehicleComponents.h:421
Data structure describing non-wheel configuration data of a vehicle that has engine, gears, clutch, and auto-box.
Definition: PxVehicleDrive.h:56
Definition: PxVehicleComponents.h:271
PxReal mCamberAtRest
Camber angle (in radians) of wheel when the suspension is at its rest position.
Definition: PxVehicleComponents.h:1057
Definition: PxVehicleComponents.h:255
PX_FORCE_INLINE PxReal getRecipLongitudinalStiffnessPerUnitGravity() const
Return Cached value of 1.0/mLongitudinalStiffnessPerUnitGravity.
Definition: PxVehicleComponents.h:1304
Definition: PxVehicleComponents.h:266
PxReal mDampingRateZeroThrottleClutchDisengaged
Damping rate of engine when full throttle is applied.
Definition: PxVehicleComponents.h:200
PxReal mPad
Definition: PxVehicleComponents.h:334
PxVehicleAckermannGeometryData(const PxEMPTY)
Definition: PxVehicleComponents.h:646
Definition: PxVehicleComponents.h:274
PxVehicleSuspensionData()
Definition: PxVehicleComponents.h:966
Definition: PxVehicleComponents.h:258
Data structure describing configuration data of a vehicle with up to 20 wheels.
Definition: PxVehicleWheels.h:123
Definition: PxVehicleComponents.h:89
PX_COMPILE_TIME_ASSERT(0==(sizeof(PxVehicleChassisData)&0x0f))
Data structure describing configuration data of a vehicle with up to PX_MAX_NB_WHEELS driven equally ...
Definition: PxVehicleDriveNW.h:58
Enum
Definition: PxVehicleComponents.h:248
PxFixedSizeLookupTable< eMAX_NB_ENGINE_TORQUE_CURVE_ENTRIES > mTorqueCurve
Graph of normalized torque (torque/mPeakTorque) against normalized engine speed ( engineRotationSpeed...
Definition: PxVehicleComponents.h:121
PxReal mStrength
Strength of clutch.
Definition: PxVehicleComponents.h:695
Definition: PxVehicleComponents.h:257
Definition: PxVehicleComponents.h:263
PxReal mMOI
Moment of inertia of unit that includes wheel plus tire about the rolling axis.
Definition: PxVehicleComponents.h:873
PxReal mRearWidth
Distance between center-point of the two rear wheels.
Definition: PxVehicleComponents.h:629
Definition: PxVehicleComponents.h:281
PxU32 mNbDrivenWheels
Definition: PxVehicleComponents.h:566
bool isValid() const
Test if the 4W-drive simulation data has been setup with legal data.
Definition: PxVehicleComponents.h:262
PX_FORCE_INLINE PxReal getFrictionVsSlipGraphRecipx2Minusx1() const
Return Cached value of 1.0f/(mFrictionVsSlipGraph[2][0]-mFrictionVsSlipGraph[1][0]) ...
Definition: PxVehicleComponents.h:1318
PxReal getLatency() const
Get the latency time of the autobox.
Definition: PxVehicleComponents.h:409
PxReal mToeAngle
Wheel toe angle. This value is ignored by PxVehicleDriveTank and PxVehicleNoDrive.
Definition: PxVehicleComponents.h:918
PX_FORCE_INLINE PxReal getRecipMOI() const
Return value of mRecipMOI(=1.0f/mMOI) that is automatically set by PxVehicleDriveSimData::setEngineDa...
Definition: PxVehicleComponents.h:205
PxReal mMaxFilteredNormalisedLoad
Graph point (mMaxNormalisedLoad,mMaxFilteredNormalisedLoad)
Definition: PxVehicleComponents.h:795
Definition: PxVehicleComponents.h:47
Definition: PxVehicleComponents.h:277
PxVehicleGearsData()
Definition: PxVehicleComponents.h:285
PxReal mFrictionVsSlipGraphRecipx1Minusx0
Cached value of 1.0f/(mFrictionVsSlipGraph[1][0]-mFrictionVsSlipGraph[0][0])
Definition: PxVehicleComponents.h:1338
PxReal mCentreBias
Maximum allowed ratio of average front wheel rotation speed and rear wheel rotation speeds The differ...
Definition: PxVehicleComponents.h:493
PxReal mRecipLongitudinalStiffnessPerUnitGravity
Cached value of 1.0/mLongitudinalStiffnessPerUnitGravity.
Definition: PxVehicleComponents.h:1329
uint8_t PxU8
Definition: PxSimpleTypes.h:75
PxReal mInvNbDrivenWheels
Definition: PxVehicleComponents.h:567
PxReal mAccuracy
Accuracy of Ackermann steer calculation.
Definition: PxVehicleComponents.h:611
PxReal mFinalRatio
Gear ratio applied is mRatios[currentGear]*finalRatio.
Definition: PxVehicleComponents.h:314
PxVehicleEngineData()
Definition: PxVehicleComponents.h:100
PxVehicleAutoBoxData()
Definition: PxVehicleComponents.h:353
Definition: PxVehicleComponents.h:276
PxReal mDampingRate
Damping rate applied to wheel.
Definition: PxVehicleComponents.h:882
PxReal mLatStiffX
Tire lateral stiffness is a graph of tire load that has linear behavior near zero load and flattens a...
Definition: PxVehicleComponents.h:1210
PxReal mRearLeftRightSplit
Ratio of torque split between rear-left and rear-right (>0.5 means more to rear-left, <0.5 means more to rear-right).
Definition: PxVehicleComponents.h:483
Enum
Definition: PxVehicleComponents.h:657
PxVehicleEngineData(const PxEMPTY)
Definition: PxVehicleComponents.h:237
PX_FORCE_INLINE PxReal getFrictionVsSlipGraphRecipx1Minusx0() const
Return Cached value of 1.0f/(mFrictionVsSlipGraph[1][0]-mFrictionVsSlipGraph[0][0]) ...
Definition: PxVehicleComponents.h:1311
PxReal mSprungMass
Mass of vehicle that is supported by suspension spring.
Definition: PxVehicleComponents.h:1047
PxReal mRecipMaxDroop
Cached value of 1.0f/mMaxDroop.
Definition: PxVehicleComponents.h:1129
PxReal mWidth
Maximum width of unit that includes wheel plus tire.
Definition: PxVehicleComponents.h:855
Definition: PxVehicleComponents.h:1138
void setUpRatios(PxVehicleGearsData::Enum a, PxReal ratio)
Definition: PxVehicleComponents.h:422
Definition: PxVehicleComponents.h:443
PxVehicleDifferential4WData()
Definition: PxVehicleComponents.h:447
Definition: PxVehicleComponents.h:259
PxReal mMass
Mass of vehicle rigid body actor.
Definition: PxVehicleComponents.h:72
PxReal mRecipMOI
Reciprocal of moment of inertia of unit that includes wheel plus tire about single allowed axis of ro...
Definition: PxVehicleComponents.h:952
PxReal mSpringStrength
Spring strength of suspension unit.
Definition: PxVehicleComponents.h:987
PxReal mFrontBias
Maximum allowed ratio of front-left and front-right wheel rotation speeds. The differential will dive...
Definition: PxVehicleComponents.h:503
Definition: PxVehicleComponents.h:438
PxReal mMinNormalisedLoad
Graph point (mMinNormalisedLoad,mMinFilteredNormalisedLoad)
Definition: PxVehicleComponents.h:780
PX_FORCE_INLINE PxReal getRecipMOI() const
Return value equal to 1.0f/mRecipMOI.
Definition: PxVehicleComponents.h:932
Definition: PxVehicleComponents.h:251
void setLatency(const PxReal latency)
Set the latency time of the autobox.
Definition: PxVehicleComponents.h:397
PxReal mDampingRateZeroThrottleClutchEngaged
Damping rate of engine when full throttle is applied.
Definition: PxVehicleComponents.h:183
PxReal mMaxHandBrakeTorque
Max handbrake torque that can be applied to wheel.
Definition: PxVehicleComponents.h:900
PxVehicleDifferentialNWData(const PxEMPTY)
Definition: PxVehicleComponents.h:574
PxReal mMass
Mass of unit that includes wheel plus tire.
Definition: PxVehicleComponents.h:864
PxEMPTY
Definition: Px.h:70
PxVehicleDifferential4WData::Enum mType
Type of differential.
Definition: PxVehicleComponents.h:520
PxReal mCamberAtMaxDroop
Camber angle (in radians) of wheel when the suspension is at maximum droop.
Definition: PxVehicleComponents.h:1081
bool isValid() const
Test if wheel simulation data has been setup with legal values.
Definition: PxVehicleComponents.h:268
Definition: PxVehicleComponents.h:347
PxReal mMinFilteredNormalisedLoad
Graph point (mMinNormalisedLoad,mMinFilteredNormalisedLoad)
Definition: PxVehicleComponents.h:785
PxReal mLongitudinalStiffnessPerUnitGravity
Tire Longitudinal stiffness per unit gravitational acceleration.
Definition: PxVehicleComponents.h:1240
PxReal mMOI
Moment of inertia of the engine around the axis of rotation.
Definition: PxVehicleComponents.h:128
Definition: PxVehicleComponents.h:275
PxReal mDampingRateFullThrottle
Damping rate of engine when full throttle is applied.
Definition: PxVehicleComponents.h:165
PxVehicleGearsData(const PxEMPTY)
Definition: PxVehicleComponents.h:340
PxReal mFrontLeftRightSplit
Ratio of torque split between front-left and front-right (>0.5 means more to front-left, <0.5 means more to front-right).
Definition: PxVehicleComponents.h:474
Definition: PxVehicleComponents.h:254
PX_FORCE_INLINE PxReal getRecipMaxDroop() const
Reciprocal of maximum droop.
Definition: PxVehicleComponents.h:1099
Definition: PxVehicleComponents.h:535
Definition: PxVehicleComponents.h:242
PxVec3 mCMOffset
Center of mass offset of vehicle rigid body actor.
Definition: PxVehicleComponents.h:79
PxReal mPeakTorque
Maximum torque available to apply to the engine when the accelerator pedal is at maximum.
Definition: PxVehicleComponents.h:139
PxU32 mWheel0
Definition: PxVehicleComponents.h:1154
uint32_t PxU32
Definition: Px.h:48
Definition: PxVehicleComponents.h:273
Tire load variation can be strongly dependent on the time-step so it is a good idea to filter it to g...
Definition: PxVehicleComponents.h:762
PxVehicleChassisData()
Definition: PxVehicleComponents.h:53
Definition: PxVehicleComponents.h:582
PxVehicleAutoBoxData(const PxEMPTY)
Definition: PxVehicleComponents.h:419
Definition: PxVehicleComponents.h:265
PxReal mFrontRearSplit
Ratio of torque split between front and rear (>0.5 means more to front, <0.5 means more to rear)...
Definition: PxVehicleComponents.h:465
PxReal mMaxDroop
Maximum elongation allowed by suspension spring.
Definition: PxVehicleComponents.h:1014
Definition: PxVehicleComponents.h:250
PxVehicleClutchData(const PxEMPTY)
Definition: PxVehicleComponents.h:734
Definition: PxVehicleComponents.h:282
Definition: PxVehicleComponents.h:260
PxU32 mEstimateIterations
Tune the mathematical accuracy and computational cost of the computed estimate to the wheel and engin...
Definition: PxVehicleComponents.h:724
PxVehicleWheelData()
Definition: PxVehicleComponents.h:824
PxReal mLatStiffY
Tire lateral stiffness is a graph of tire load that has linear behavior near zero load and flattens a...
Definition: PxVehicleComponents.h:1227
PxVehicleTireLoadFilterData()
Definition: PxVehicleComponents.h:768
3 Element vector class.
Definition: PxVec3.h:49
Data structure describing the drive model components of a vehicle with up to 4 driven wheels and up t...
Definition: PxVehicleDrive4W.h:59
PX_FORCE_INLINE void * PxMemSet(void *dest, PxI32 c, PxU32 count)
Sets the bytes of the provided buffer to the specified value.
Definition: PxMemory.h:68
Definition: PxVehicleComponents.h:278