30 #ifndef PX_VEHICLE_DRIVE_H 31 #define PX_VEHICLE_DRIVE_H 178 eMAX_NB_ANALOG_INPUTS=16
194 void setAnalogInput(
const PxU32 type,
const PxReal analogVal);
214 mGearUpPressed = digitalVal;
228 mGearDownPressed = digitalVal;
237 return mGearUpPressed;
246 return mGearDownPressed;
256 mUseAutoGears=useAutoGears;
265 return mUseAutoGears;
274 mUseAutoGears = !mUseAutoGears;
290 mCurrentGear = currentGear;
318 mTargetGear = targetGear;
344 mTargetGear=targetGear;
356 mTargetGear=targetGear;
357 mCurrentGear=targetGear;
367 mEnginespeed = speed;
391 return mGearSwitchTime;
403 return mAutoBoxSwitchTime;
415 PxReal mControlAnalogVals[eMAX_NB_ANALOG_INPUTS];
507 friend class PxVehicleUpdate;
520 bool isValid()
const;
525 void setToRestState();
530 static PxU32 computeByteSize(
const PxU32 numWheels);
532 virtual void init(
const PxU32 numWheels);
546 const PxU32 nbDrivenWheels,
const PxU32 nbNonDrivenWheels);
566 #endif //PX_VEHICLE_DRIVE_H Definition: GuContactBuffer.h:37
bool mUseAutoGears
Auto-gear flag used by vehicle simulation. Set true to enable the autobox, false to disable the autob...
Definition: PxVehicleDrive.h:421
Friction for each combination of driving surface type and tire type.
Definition: PxVehicleTireFriction.h:62
PX_FORCE_INLINE PxReal getEngineRotationSpeed() const
Return the rotation speed of the engine (radians per second)
Definition: PxVehicleDrive.h:375
static void getBinaryMetaData(PxOutputStream &stream)
PX_FORCE_INLINE PxU32 getCurrentGear() const
Get the current gear.
Definition: PxVehicleDrive.h:300
PxVehicleGearsData mGears
Definition: PxVehicleDrive.h:136
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
PX_FORCE_INLINE PxU32 getGearChange() const
Definition: PxVehicleDrive.h:486
Abstract class for collision shapes.
Definition: PxShape.h:142
Definition: PxVehicleComponents.h:664
#define PX_FORCE_INLINE
Definition: PxPreprocessor.h:364
Batched queries object. This is used to perform several queries at the same time. ...
Definition: PxBatchQuery.h:57
float PxReal
Definition: PxSimpleTypes.h:78
virtual bool isKindOf(const char *superClass) const
Returns whether a given type name matches with the type of this instance.
Definition: PxBase.h:178
void setToRestState()
Set vehicle to rest.
PxU32 mCurrentGear
Current gear.
Definition: PxVehicleDrive.h:445
PxReal mGearSwitchTime
Reported time that has passed since gear change started.
Definition: PxVehicleDrive.h:463
void setGearUp(const bool digitalVal)
Inform the vehicle that the gear-up button has been pressed.
Definition: PxVehicleDrive.h:212
Data structure with instanced dynamics data for vehicle with engine, clutch, gears, autobox.
Definition: PxVehicleDrive.h:172
bool mGearUpPressed
Gear-up digital control value used by vehicle simulation.
Definition: PxVehicleDrive.h:430
A geometry object.
Definition: PxGeometry.h:75
PX_FORCE_INLINE PxReal getAutoBoxSwitchTime() const
Return the time that has passed since the autobox last initiated a gear change.
Definition: PxVehicleDrive.h:401
bool getGearDown() const
Check if the gear-down button has been pressed.
Definition: PxVehicleDrive.h:244
PxU16 PxType
Definition: PxBase.h:49
PX_FORCE_INLINE void setGearSwitchTime(const PxReal switchTime)
Definition: PxVehicleDrive.h:487
PxReal mEnginespeed
Rotation speed of engine.
Definition: PxVehicleDrive.h:457
PxVehicleDriveDynData mDriveDynData
Dynamics data of vehicle instance.
Definition: PxVehicleDrive.h:513
Output stream class for I/O.
Definition: PxIO.h:114
PX_FORCE_INLINE const PxVehicleEngineData & getEngineData() const
Return the engine data.
Definition: PxVehicleDrive.h:72
PX_FORCE_INLINE void setTargetGear(PxU32 targetGear)
Set the target gear.
Definition: PxVehicleDrive.h:316
Data structure describing non-wheel configuration data of a vehicle that has engine, gears, clutch, and auto-box.
Definition: PxVehicleDrive.h:57
PX_FORCE_INLINE void setAutoBoxSwitchTime(const PxReal autoBoxSwitchTime)
Definition: PxVehicleDrive.h:488
PX_FORCE_INLINE void setGearChange(const PxU32 gearChange)
Definition: PxVehicleDrive.h:485
virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
Definition: PxVehicleDrive.h:556
PX_FORCE_INLINE void toggleAutoGears()
Toggle the auto-gears flag If useAutoGears is true the auto-box will be active.
Definition: PxVehicleDrive.h:272
PX_FORCE_INLINE const PxVehicleAutoBoxData & getAutoBoxData() const
Return the autobox data.
Definition: PxVehicleDrive.h:114
Data structure describing configuration data of a vehicle with up to 20 wheels.
Definition: PxVehicleWheels.h:59
Definition: PxVehicleComponents.h:89
PX_FORCE_INLINE const PxVehicleClutchData & getClutchData() const
Return the clutch data.
Definition: PxVehicleDrive.h:100
A complete vehicle with instance dynamics data and configuration data for wheels and engine...
Definition: PxVehicleDrive.h:497
PX_FORCE_INLINE const PxVehicleGearsData & getGearsData() const
Return the gears data.
Definition: PxVehicleDrive.h:86
PX_FORCE_INLINE void startGearChange(const PxU32 targetGear)
Start a gear change to a target gear.
Definition: PxVehicleDrive.h:342
PxVehicleDriveSimData()
Definition: PxVehicleDrive.h:160
uint8_t PxU8
Definition: PxSimpleTypes.h:75
bool isValid() const
Test that all instanced dynamics data and configuration data have legal values.
PxVehicleAutoBoxData mAutoBox
Definition: PxVehicleDrive.h:148
PxU32 getNbAnalogInput() const
Definition: PxVehicleDrive.h:484
void setGearDown(const bool digitalVal)
Set that the gear-down button has been pressed.
Definition: PxVehicleDrive.h:226
PxVehicleDriveDynData(const PxEMPTY)
Definition: PxVehicleDrive.h:483
PX_FORCE_INLINE void setCurrentGear(PxU32 currentGear)
Set the current gear.
Definition: PxVehicleDrive.h:288
PxVehicleClutchData mClutch
Definition: PxVehicleDrive.h:142
PX_FORCE_INLINE PxU32 getTargetGear() const
Get the target gear.
Definition: PxVehicleDrive.h:328
#define PX_COMPILE_TIME_ASSERT(exp)
Definition: PxPreprocessor.h:447
PX_FORCE_INLINE bool getUseAutoGears() const
Get the flag status that is used to select auto-gears.
Definition: PxVehicleDrive.h:263
PxReal mAutoBoxSwitchTime
Reported time that has passed since last autobox gearup/geardown decision.
Definition: PxVehicleDrive.h:469
PX_FORCE_INLINE void setEngineRotationSpeed(const PxF32 speed)
Set the rotation speed of the engine (radians per second)
Definition: PxVehicleDrive.h:365
PxU32 mTargetGear
Target gear (different from current gear if a gear change is underway)
Definition: PxVehicleDrive.h:451
Data structure with instanced dynamics data and configuration data of a vehicle with just wheels...
Definition: PxVehicleWheels.h:676
PxEMPTY
Definition: Px.h:70
Definition: PxVehicleComponents.h:347
Material class to represent a set of surface properties.
Definition: PxMaterial.h:130
bool isValid() const
Test if the instanced dynamics and configuration data has legal values.
PX_FORCE_INLINE void forceGearChange(const PxU32 targetGear)
Force an immediate gear change to a target gear.
Definition: PxVehicleDrive.h:354
Abstract singleton factory class used for instancing objects in the Physics SDK.
Definition: PxPhysics.h:71
bool getGearUp() const
Check if the gear-up button has been pressed.
Definition: PxVehicleDrive.h:235
Definition: PxVehicleComponents.h:242
~PxVehicleDrive()
Definition: PxVehicleDrive.h:555
PxVehicleDrive(PxType concreteType, PxBaseFlags baseFlags)
Definition: PxVehicleDrive.h:554
bool mGearDownPressed
Gear-down digital control value used by vehicle simulation.
Definition: PxVehicleDrive.h:439
uint32_t PxU32
Definition: Px.h:48
Data structure with instanced dynamics data and configuration data of a tank.
Definition: PxVehicleDriveTank.h:151
PX_FORCE_INLINE PxReal getGearSwitchTime() const
Return the time that has passed since the current gear change was initiated.
Definition: PxVehicleDrive.h:389
PxVehicleDriveSimData(const PxEMPTY)
Definition: PxVehicleDrive.h:161
PxVehicleEngineData mEngine
Definition: PxVehicleDrive.h:130
virtual const char * getConcreteTypeName() const
Returns string name of dynamic type.
Definition: PxVehicleDrive.h:552
PxVehicleDrive(PxBaseFlags baseFlags)
Definition: PxVehicleDrive.h:551
PX_FORCE_INLINE void setUseAutoGears(const bool useAutoGears)
Set the flag that will be used to select auto-gears If useAutoGears is true the auto-box will be acti...
Definition: PxVehicleDrive.h:254