31 #ifndef PX_VEHICLE_WHEELS_H 32 #define PX_VEHICLE_WHEELS_H 48 class PxVehicleWheels4SimData;
49 class PxVehicleWheels4DynData;
50 class PxVehicleTireForceCalculator;
75 eLIMIT_SUSPENSION_EXPANSION_VELOCITY = (1 << 0),
88 eDISABLE_INTERNAL_CYLINDER_PLANE_INTERSECTION_TEST = (1 << 1),
107 eDISABLE_SUSPENSION_FORCE_PROJECTION = (1 << 2)
137 friend class PxVehicleUpdate;
158 void setChassisMass(
const PxF32 chassisMass);
204 const PxVec3& getSuspTravelDirection(
const PxU32 id)
const;
210 const PxVec3& getSuspForceAppPointOffset(
const PxU32 id)
const;
216 const PxVec3& getTireForceAppPointOffset(
const PxU32 id)
const;
221 const PxVec3& getWheelCentreOffset(
const PxU32 id)
const;
232 PxI32 getWheelShapeMapping(
const PxU32 wheelId)
const;
245 return mNbActiveAntiRollBars;
263 return mNormalisedLoadFilter;
292 void setSuspTravelDirection(
const PxU32 id,
const PxVec3& dir);
300 void setSuspForceAppPointOffset(
const PxU32 id,
const PxVec3& offset);
308 void setTireForceAppPointOffset(
const PxU32 id,
const PxVec3& offset);
316 void setWheelCentreOffset(
const PxU32 id,
const PxVec3& offset);
338 void setWheelShapeMapping(
const PxU32 wheelId,
const PxI32 shapeId);
347 void setSceneQueryFilterData(
const PxU32 suspId,
const PxFilterData& sqFilterData);
409 void disableWheel(
const PxU32 wheel);
417 void enableWheel(
const PxU32 wheel);
423 bool getIsWheelDisabled(
const PxU32 wheel)
const;
455 void setSubStepCount(
const PxReal thresholdLongitudinalSpeed,
const PxU32 lowForwardSpeedSubStepCount,
const PxU32 highForwardSpeedSubStepCount);
473 void setMinLongSlipDenominator(
const PxReal minLongSlipDenominator);
577 bool isValid()
const;
582 static PxU32 computeByteSize(
const PxU32 numWheels);
635 friend class PxVehicleUpdate;
644 void setToRestState();
657 void setTireForceShaderData(
const PxU32 tireId,
const void* tireForceShaderData);
662 const void* getTireForceShaderData(
const PxU32 tireId)
const;
669 void setWheelRotationSpeed(
const PxU32 wheelIdx,
const PxReal speed);
674 PxReal getWheelRotationSpeed(
const PxU32 wheelIdx)
const;
681 void setWheelRotationAngle(
const PxU32 wheelIdx,
const PxReal angle);
686 PxReal getWheelRotationAngle(
const PxU32 wheelIdx)
const;
694 void setUserData(
const PxU32 tireIdx,
void* userData);
699 void* getUserData(
const PxU32 tireIdx)
const;
719 bool isValid()
const;
747 static PxU32 computeByteSize(
const PxU32 numWheels);
800 friend class PxVehicleUpdate;
801 friend class PxVehicleConstraintShader;
823 PxReal computeForwardSpeed()
const;
829 PxReal computeSidewaysSpeed()
const;
846 void setToRestState();
851 bool isValid()
const;
856 static PxU32 computeByteSize(
const PxU32 nbWheels);
858 virtual void init(
const PxU32 numWheels);
869 void onConstraintRelease();
877 const PxU32 nbDrivenWheels,
const PxU32 nbNonDrivenWheels);
931 #endif //PX_VEHICLE_WHEELS_H Definition: GuContactBuffer.h:37
PX_FORCE_INLINE PxU32 getNbNonDrivenWheels() const
Definition: PxVehicleWheels.h:917
PxU32 getNbWheelRotationAngle() const
Definition: PxVehicleWheels.h:755
PxU32 mNbNonDrivenWheels
Count the number of constraint connectors that have hit their callback when deleting a vehicle...
Definition: PxVehicleWheels.h:890
#define PX_MAX_NB_WHEELS
This number is the maximum number of wheels allowed for a vehicle.
Definition: PxVehicleSDK.h:81
~PxVehicleWheelsDynData()
Definition: PxVehicleWheels.h:638
PxU8 mType
Vehicle type (eVehicleDriveTypes)
Definition: PxVehicleWheels.h:899
PxVehicleWheels(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxVehicleWheels.h:918
Definition: PxVehicleComponents.h:960
~PxVehicleWheelsSimData()
Definition: PxVehicleWheels.h:614
PxU32 mFlags
The vehicle wheel simulation flags.
Definition: PxVehicleWheels.h:568
PxU32 getNbConstraints() const
Retrieve the number of PxConstraint objects associated with the vehicle.
Definition: PxVehicleWheels.h:768
PxRigidDynamic represents a dynamic rigid simulation object in the physics SDK.
Definition: PxRigidDynamic.h:83
float PxF32
Definition: PxSimpleTypes.h:76
PxFilterData is user-definable data which gets passed into the collision filtering shader and/or call...
Definition: PxFiltering.h:366
PxU32 getNbSuspTravelDirection() const
Definition: PxVehicleWheels.h:593
Data structure with instanced dynamics data and configuration data of a vehicle with no drive model...
Definition: PxVehicleNoDrive.h:56
PxU32 getNbWheelShapeMapping() const
Definition: PxVehicleWheels.h:598
PxF32 getThresholdLongSpeed() const
Definition: PxVehicleWheels.h:602
PxU32 getNbAntiRollBars4() const
Definition: PxVehicleWheels.h:610
Definition: PxVehicleComponents.h:818
Abstract class for collision shapes.
Definition: PxShape.h:142
#define PX_FORCE_INLINE
Definition: PxPreprocessor.h:351
Definition: PxVehicleComponents.h:1178
void ** mUserDatas
A userData pointer can be stored for each wheel.
Definition: PxVehicleWheels.h:730
float PxReal
Definition: PxSimpleTypes.h:78
PxF32 mMinLongSlipDenominator
Minimum long slip denominator.
Definition: PxVehicleWheels.h:561
virtual bool isKindOf(const char *superClass) const
Returns whether a given type name matches with the type of this instance.
Definition: PxBase.h:178
PX_FORCE_INLINE PxU32 getVehicleType() const
Return the type of vehicle.
Definition: PxVehicleWheels.h:807
PxU32 getNbWheelRotationSpeed() const
Definition: PxVehicleWheels.h:754
PX_FORCE_INLINE const PxVehicleTireLoadFilterData & getTireLoadFilterData() const
Return the data that describes the filtering of the tire load to produce smoother handling at large t...
Definition: PxVehicleWheels.h:261
PxF32 getMinLongSlipDenominator() const
Definition: PxVehicleWheels.h:600
Data structure with instanced dynamics data for wheels.
Definition: PxVehicleWheels.h:622
virtual ~PxVehicleWheels()
Definition: PxVehicleWheels.h:920
PxU32 mLowForwardSpeedSubStepCount
Number of sub-steps that will be performed if the longitudinal speed of the vehicle is smaller than m...
Definition: PxVehicleWheels.h:550
void(* PxVehicleComputeTireForce)(const void *shaderData, const PxF32 tireFriction, const PxF32 longSlip, const PxF32 latSlip, const PxF32 camber, const PxF32 wheelOmega, const PxF32 wheelRadius, const PxF32 recipWheelRadius, const PxF32 restTireLoad, const PxF32 normalisedTireLoad, const PxF32 tireLoad, const PxF32 gravity, const PxF32 recipGravity, PxF32 &wheelTorque, PxF32 &tireLongForceMag, PxF32 &tireLatForceMag, PxF32 &tireAlignMoment)
Prototype of shader function that is used to compute wheel torque and tire forces.
Definition: PxVehicleShaders.h:65
PxVehicleWheelsDynData mWheelsDynData
Data describing the dynamic state of all wheels/suspension/tires.
Definition: PxVehicleWheels.h:839
PxU32 getLowForwardSpeedSubStepCount() const
Definition: PxVehicleWheels.h:604
void setThresholdLongSpeed(const PxF32 f)
Definition: PxVehicleWheels.h:601
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition: PxVehicleWheels.h:911
PxVehicleWheels4SimData * mWheels4SimData
Wheels data organised in blocks of 4 wheels.
Definition: PxVehicleWheels.h:506
PX_FORCE_INLINE const PxRigidDynamic * getRigidDynamicActor() const
Get const ptr to PxRigidDynamic instance that is the vehicle's physx representation.
Definition: PxVehicleWheels.h:817
PxU32 getNbWheelData() const
Definition: PxVehicleWheels.h:592
PxU16 PxType
Definition: PxBase.h:49
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition: PxVehicleWheels.h:910
PxVehicleWheels4DynData * mWheels4DynData
Dynamics data arranged in blocks of 4 wheels.
Definition: PxVehicleWheels.h:714
Output stream class for I/O.
Definition: PxIO.h:114
PxFlags< PxVehicleWheelsSimFlag::Enum, PxU32 > PxVehicleWheelsSimFlags
Collection of set bits defined in PxVehicleWheelsSimFlag.
Definition: PxVehicleWheels.h:116
PxU32 mHighForwardSpeedSubStepCount
Number of sub-steps that will be performed if the longitudinal speed of the vehicle is greater than o...
Definition: PxVehicleWheels.h:556
void setLowForwardSpeedSubStepCount(const PxU32 f)
Definition: PxVehicleWheels.h:603
PxVehicleWheelsSimData()
Definition: PxVehicleWheels.h:613
PxU32 getNbWheels4() const
Definition: PxVehicleWheels.h:590
Data structure describing configuration data of a vehicle with up to 20 wheels.
Definition: PxVehicleWheels.h:123
PX_FORCE_INLINE PxRigidDynamic * getRigidDynamicActor()
Get non-const ptr to PxRigidDynamic instance that is the vehicle's physx representation.
Definition: PxVehicleWheels.h:812
PxU32 mNbActiveWheels
Number of actual wheels (<=(mNbWheels4*4))
Definition: PxVehicleWheels.h:516
virtual void release()
Releases the PxBase instance, please check documentation of release in derived class.
Definition: PxVehicleWheels.h:921
PxVehicleWheels4DynData * getWheel4DynData() const
Definition: PxVehicleWheels.h:756
PxU32 mNbActiveAntiRollBars
Number of active anti-roll bars.
Definition: PxVehicleWheels.h:531
PxU32 getNbWheelCentreOffset() const
Definition: PxVehicleWheels.h:597
PxU32 getNbWheels() const
Return the number of wheels.
Definition: PxVehicleWheels.h:184
PxU16 flags
a set of Px1DConstraintFlags
Definition: PxConstraintDesc.h:110
PxVehicleWheelsSimData(const PxEMPTY)
Definition: PxVehicleWheels.h:588
uint8_t PxU8
Definition: PxSimpleTypes.h:75
PxVehicleAntiRollBarData * mAntiRollBars
Anti-roll bars.
Definition: PxVehicleWheels.h:521
A plugin class for implementing constraints.
Definition: PxConstraint.h:108
PxU32 mNbWheels4
Number of blocks of 4 wheels.
Definition: PxVehicleWheels.h:511
PxVehicleTireForceCalculator * mTireForceCalculators
Shader data and function for tire force calculations.
Definition: PxVehicleWheels.h:724
bool getWheelEnabledState(const PxU32 wheel) const
Definition: PxVehicleWheels.h:608
PxU32 getNbSuspensionData() const
Definition: PxVehicleWheels.h:591
Definition: PxVehicleComponents.h:1138
virtual void preExportDataReset()
Definition: PxVehicleWheels.h:912
PxU32 getNbTireData() const
Definition: PxVehicleWheels.h:594
#define PX_COMPILE_TIME_ASSERT(exp)
Definition: PxPreprocessor.h:434
PxVehicleWheels(PxBaseFlags baseFlags)
Definition: PxVehicleWheels.h:919
void setWheelEnabledState(const PxU32 wheel, const bool state)
Definition: PxVehicleWheels.h:607
PxU32 mNbActiveWheels
Number of wheels (mNbActiveWheels <= (mNbWheels4*4))
Definition: PxVehicleWheels.h:740
Data structure with instanced dynamics data and configuration data of a vehicle with up to 4 driven w...
Definition: PxVehicleDrive4W.h:176
PxF32 mThresholdLongitudinalSpeed
Threshold longitudinal speed used to decide whether to use mLowForwardSpeedSubStepCount or mHighForwa...
Definition: PxVehicleWheels.h:544
int32_t PxI32
Definition: PxSimpleTypes.h:70
PxU8 mOnConstraintReleaseCounter
Definition: PxVehicleWheels.h:892
PxVehicleWheelsDynData()
Definition: PxVehicleWheels.h:637
Flags to configure the vehicle wheel simulation.
Definition: PxVehicleWheels.h:60
PxU32 getNbAntiRollBars() const
Return the number of unique anti-roll bars that have been added with addAntiRollBarData.
Definition: PxVehicleWheels.h:243
PxU32 getNbAntiRollBarData() const
Definition: PxVehicleWheels.h:611
PxVehicleWheelsSimData mWheelsSimData
Data describing the setup of all the wheels/suspensions/tires.
Definition: PxVehicleWheels.h:834
Data structure with instanced dynamics data and configuration data of a vehicle with just wheels...
Definition: PxVehicleWheels.h:790
PxEMPTY
Definition: Px.h:70
PxU32 getNbWheelEnabledState() const
Definition: PxVehicleWheels.h:609
Binary deserialization context class.
Definition: PxSerialFramework.h:174
Material class to represent a set of surface properties.
Definition: PxMaterial.h:143
void setHighForwardSpeedSubStepCount(const PxU32 f)
Definition: PxVehicleWheels.h:605
PxU32 mNbAntiRollBars4
2 anti-rollbars allocated for each block of 4 wheels.
Definition: PxVehicleWheels.h:526
Container for bitfield flag variables associated with a specific enum type.
Definition: PxFlags.h:73
Abstract singleton factory class used for instancing objects in the Physics SDK.
Definition: PxPhysics.h:71
Enum
Definition: PxVehicleWheels.h:62
PxU32 getHighForwardSpeedSubStepCount() const
Definition: PxVehicleWheels.h:606
uint32_t PxU32
Definition: Px.h:48
PxRigidDynamic * mActor
The rigid body actor that represents the vehicle in the PhysX SDK.
Definition: PxVehicleWheels.h:882
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
PxU32 mNbWheels4
Number of blocks of 4 wheels.
Definition: PxVehicleWheels.h:735
PxU32 getNbSuspForceAppPointOffset() const
Definition: PxVehicleWheels.h:595
Data structure with instanced dynamics data and configuration data of a tank.
Definition: PxVehicleDriveTank.h:150
Base class for objects that can be members of a PxCollection.
Definition: PxBase.h:73
Binary serialization context class.
Definition: PxSerialFramework.h:99
PxU32 getNbTireForceAppPointOffset() const
Definition: PxVehicleWheels.h:596
Callback class used to process PxBase objects.
Definition: PxSerialFramework.h:81
PxU32 getNbSceneQueryFilterData() const
Definition: PxVehicleWheels.h:599
PxVehicleTireLoadFilterData mNormalisedLoadFilter
Graph to filter normalised load.
Definition: PxVehicleWheels.h:501
3 Element vector class.
Definition: PxVec3.h:49