PxVehicleDriveDynData Class Reference

Data structure with instanced dynamics data for vehicle with engine, clutch, gears, autobox. More...

#include <PxVehicleDrive.h>

Public Types

enum  { eMAX_NB_ANALOG_INPUTS =16 }
 

Public Member Functions

void setToRestState ()
 Set all dynamics data to zero to bring the vehicle to rest. More...
 
void setAnalogInput (const PxU32 type, const PxReal analogVal)
 Set an analog control value to drive the vehicle. More...
 
PxReal getAnalogInput (const PxU32 type) const
 Get the analog control value that has been applied to the vehicle. More...
 
void setGearUp (const bool digitalVal)
 Inform the vehicle that the gear-up button has been pressed. More...
 
void setGearDown (const bool digitalVal)
 Set that the gear-down button has been pressed. More...
 
bool getGearUp () const
 Check if the gear-up button has been pressed. More...
 
bool getGearDown () const
 Check if the gear-down button has been pressed. More...
 
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 active. More...
 
PX_FORCE_INLINE bool getUseAutoGears () const
 Get the flag status that is used to select auto-gears. More...
 
PX_FORCE_INLINE void toggleAutoGears ()
 Toggle the auto-gears flag If useAutoGears is true the auto-box will be active. More...
 
PX_FORCE_INLINE void setCurrentGear (PxU32 currentGear)
 Set the current gear. More...
 
PX_FORCE_INLINE PxU32 getCurrentGear () const
 Get the current gear. More...
 
PX_FORCE_INLINE void setTargetGear (PxU32 targetGear)
 Set the target gear. More...
 
PX_FORCE_INLINE PxU32 getTargetGear () const
 Get the target gear. More...
 
PX_FORCE_INLINE void startGearChange (const PxU32 targetGear)
 Start a gear change to a target gear. More...
 
PX_FORCE_INLINE void forceGearChange (const PxU32 targetGear)
 Force an immediate gear change to a target gear. More...
 
PX_FORCE_INLINE void setEngineRotationSpeed (const PxF32 speed)
 Set the rotation speed of the engine (radians per second) More...
 
PX_FORCE_INLINE PxReal getEngineRotationSpeed () const
 Return the rotation speed of the engine (radians per second) More...
 
PX_FORCE_INLINE PxReal getGearSwitchTime () const
 Return the time that has passed since the current gear change was initiated. More...
 
PX_FORCE_INLINE PxReal getAutoBoxSwitchTime () const
 Return the time that has passed since the autobox last initiated a gear change. More...
 
 PxVehicleDriveDynData ()
 
 PxVehicleDriveDynData (const PxEMPTY)
 
PxU32 getNbAnalogInput () const
 
PX_FORCE_INLINE void setGearChange (const PxU32 gearChange)
 
PX_FORCE_INLINE PxU32 getGearChange () const
 
PX_FORCE_INLINE void setGearSwitchTime (const PxReal switchTime)
 
PX_FORCE_INLINE void setAutoBoxSwitchTime (const PxReal autoBoxSwitchTime)
 

Public Attributes

PxReal mControlAnalogVals [eMAX_NB_ANALOG_INPUTS]
 All dynamic data values are public for fast access. More...
 
bool mUseAutoGears
 Auto-gear flag used by vehicle simulation. Set true to enable the autobox, false to disable the autobox. More...
 
bool mGearUpPressed
 Gear-up digital control value used by vehicle simulation. More...
 
bool mGearDownPressed
 Gear-down digital control value used by vehicle simulation. More...
 
PxU32 mCurrentGear
 Current gear. More...
 
PxU32 mTargetGear
 Target gear (different from current gear if a gear change is underway) More...
 
PxReal mEnginespeed
 Rotation speed of engine. More...
 
PxReal mGearSwitchTime
 Reported time that has passed since gear change started. More...
 
PxReal mAutoBoxSwitchTime
 Reported time that has passed since last autobox gearup/geardown decision. More...
 

Private Member Functions

bool isValid () const
 Test that a PxVehicleDriveDynData instance has legal values. More...
 

Private Attributes

PxU32 mPad [2]
 

Friends

class PxVehicleDrive
 

Detailed Description

Data structure with instanced dynamics data for vehicle with engine, clutch, gears, autobox.

See also
PxVehicleWheelsDynData for wheels dynamics data.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
eMAX_NB_ANALOG_INPUTS 

Constructor & Destructor Documentation

◆ PxVehicleDriveDynData() [1/2]

PxVehicleDriveDynData::PxVehicleDriveDynData ( )

◆ PxVehicleDriveDynData() [2/2]

PxVehicleDriveDynData::PxVehicleDriveDynData ( const PxEMPTY  )
inline

Member Function Documentation

◆ forceGearChange()

PX_FORCE_INLINE void PxVehicleDriveDynData::forceGearChange ( const PxU32  targetGear)
inline

Force an immediate gear change to a target gear.

Parameters
[in]targetGearis the gear the vehicle will be given immediately.
See also
PxVehicleGearsData

◆ getAnalogInput()

PxReal PxVehicleDriveDynData::getAnalogInput ( const PxU32  type) const

Get the analog control value that has been applied to the vehicle.

Returns
The value of the specified analog control value.
See also
PxVehicleDrive4WControl, PxVehicleDriveNWControl, PxVehicleDriveTankControl

◆ getAutoBoxSwitchTime()

PX_FORCE_INLINE PxReal PxVehicleDriveDynData::getAutoBoxSwitchTime ( ) const
inline

Return the time that has passed since the autobox last initiated a gear change.

Returns
The time that has passed since the autobox last initiated a gear change.
See also
PxVehicleAutoBoxData::setLatency, PxVehicleAutoBoxData::getLatency

◆ getCurrentGear()

PX_FORCE_INLINE PxU32 PxVehicleDriveDynData::getCurrentGear ( ) const
inline

Get the current gear.

Returns
The vehicle's current gear.
See also
getTargetGear, PxVehicleGearsData

◆ getEngineRotationSpeed()

PX_FORCE_INLINE PxReal PxVehicleDriveDynData::getEngineRotationSpeed ( ) const
inline

Return the rotation speed of the engine (radians per second)

Returns
The rotational speed (radians per second) of the engine.

◆ getGearChange()

PX_FORCE_INLINE PxU32 PxVehicleDriveDynData::getGearChange ( ) const
inline

◆ getGearDown()

bool PxVehicleDriveDynData::getGearDown ( ) const
inline

Check if the gear-down button has been pressed.

Returns
The state of the gear-down button.

◆ getGearSwitchTime()

PX_FORCE_INLINE PxReal PxVehicleDriveDynData::getGearSwitchTime ( ) const
inline

Return the time that has passed since the current gear change was initiated.

Returns
The time that has passed since the current gear change was initiated.
Note
If no gear change is in process the gear switch time will be zero.
See also
PxVehicleGearsData.mSwitchTime

◆ getGearUp()

bool PxVehicleDriveDynData::getGearUp ( ) const
inline

Check if the gear-up button has been pressed.

Returns
The state of the gear-up button.

◆ getNbAnalogInput()

PxU32 PxVehicleDriveDynData::getNbAnalogInput ( ) const
inline

◆ getTargetGear()

PX_FORCE_INLINE PxU32 PxVehicleDriveDynData::getTargetGear ( ) const
inline

Get the target gear.

Returns
The vehicle's target gear.
See also
setTargetGear, PxVehicleGearsData

◆ getUseAutoGears()

PX_FORCE_INLINE bool PxVehicleDriveDynData::getUseAutoGears ( ) const
inline

Get the flag status that is used to select auto-gears.

Returns
The active status of the auto-box.

◆ isValid()

bool PxVehicleDriveDynData::isValid ( ) const
private

Test that a PxVehicleDriveDynData instance has legal values.

See also
setToRestState

◆ setAnalogInput()

void PxVehicleDriveDynData::setAnalogInput ( const PxU32  type,
const PxReal  analogVal 
)

Set an analog control value to drive the vehicle.

Parameters
[in]typedescribes the type of analog control being modified
[in]analogValis the new value of the specific analog control.
See also
PxVehicleDrive4WControl, PxVehicleDriveNWControl, PxVehicleDriveTankControl

◆ setAutoBoxSwitchTime()

PX_FORCE_INLINE void PxVehicleDriveDynData::setAutoBoxSwitchTime ( const PxReal  autoBoxSwitchTime)
inline

◆ setCurrentGear()

PX_FORCE_INLINE void PxVehicleDriveDynData::setCurrentGear ( PxU32  currentGear)
inline

Set the current gear.

Parameters
[in]currentGearis the vehicle's gear.
Note
If the target gear is different from the current gear the vehicle will attempt to start a gear change from the current gear that has just been set towards the target gear at the next call to PxVehicleUpdates.
See also
setTargetGear, PxVehicleGearsData

◆ setEngineRotationSpeed()

PX_FORCE_INLINE void PxVehicleDriveDynData::setEngineRotationSpeed ( const PxF32  speed)
inline

Set the rotation speed of the engine (radians per second)

Parameters
[in]speedis the rotational speed (radians per second) to apply to the engine.

◆ setGearChange()

PX_FORCE_INLINE void PxVehicleDriveDynData::setGearChange ( const PxU32  gearChange)
inline

◆ setGearDown()

void PxVehicleDriveDynData::setGearDown ( const bool  digitalVal)
inline

Set that the gear-down button has been pressed.

Parameters
[in]digitalValis the state of the gear-down button.
Note
If digitalVal is true the vehicle will attempt to initiate a gear change at the next call to PxVehicleUpdates.
The value of mGearDownPressed is not reset by PxVehicleUpdates

◆ setGearSwitchTime()

PX_FORCE_INLINE void PxVehicleDriveDynData::setGearSwitchTime ( const PxReal  switchTime)
inline

◆ setGearUp()

void PxVehicleDriveDynData::setGearUp ( const bool  digitalVal)
inline

Inform the vehicle that the gear-up button has been pressed.

Parameters
[in]digitalValis the state of the gear-up button.
Note
If digitalVal is true the vehicle will attempt to initiate a gear change at the next call to PxVehicleUpdates.
The value of mGearUpPressed is not reset by PxVehicleUpdates

◆ setTargetGear()

PX_FORCE_INLINE void PxVehicleDriveDynData::setTargetGear ( PxU32  targetGear)
inline

Set the target gear.

Parameters
[in]targetGearis the vehicle's target gear.
Note
If the target gear is different from the current gear the vehicle will attempt to start a gear change towards the target gear at the next call to PxVehicleUpdates.
See also
PxVehicleGearsData

◆ setToRestState()

void PxVehicleDriveDynData::setToRestState ( )

Set all dynamics data to zero to bring the vehicle to rest.

◆ setUseAutoGears()

PX_FORCE_INLINE void PxVehicleDriveDynData::setUseAutoGears ( const bool  useAutoGears)
inline

Set the flag that will be used to select auto-gears If useAutoGears is true the auto-box will be active.

Parameters
[in]useAutoGearsis the active state of the auto-box.

◆ startGearChange()

PX_FORCE_INLINE void PxVehicleDriveDynData::startGearChange ( const PxU32  targetGear)
inline

Start a gear change to a target gear.

Parameters
[in]targetGearis the gear the vehicle will begin a transition towards.
Note
The gear change will begin at the next call to PxVehicleUpadates.
See also
PxVehicleGearsData

◆ toggleAutoGears()

PX_FORCE_INLINE void PxVehicleDriveDynData::toggleAutoGears ( )
inline

Toggle the auto-gears flag If useAutoGears is true the auto-box will be active.

Friends And Related Function Documentation

◆ PxVehicleDrive

friend class PxVehicleDrive
friend

Member Data Documentation

◆ mAutoBoxSwitchTime

PxReal PxVehicleDriveDynData::mAutoBoxSwitchTime

Reported time that has passed since last autobox gearup/geardown decision.

See also
setToRestState, PxVehicleAutoBoxData::setLatency

◆ mControlAnalogVals

PxReal PxVehicleDriveDynData::mControlAnalogVals[eMAX_NB_ANALOG_INPUTS]

All dynamic data values are public for fast access.

Analog control values used by vehicle simulation.

See also
setAnalogInput, getAnalogInput, PxVehicleDrive4WControl, PxVehicleDriveNWControl, PxVehicleDriveTankControl

◆ mCurrentGear

PxU32 PxVehicleDriveDynData::mCurrentGear

◆ mEnginespeed

PxReal PxVehicleDriveDynData::mEnginespeed

Rotation speed of engine.

See also
setToRestState, getEngineRotationSpeed

◆ mGearDownPressed

bool PxVehicleDriveDynData::mGearDownPressed

Gear-down digital control value used by vehicle simulation.

Note
If true a gear change will be initiated towards currentGear-1 (or to reverse if in first).
See also
setDigitalInput, getDigitalInput

◆ mGearSwitchTime

PxReal PxVehicleDriveDynData::mGearSwitchTime

Reported time that has passed since gear change started.

See also
setToRestState, startGearChange, PxVehicleGearsData::mSwitchTime

◆ mGearUpPressed

bool PxVehicleDriveDynData::mGearUpPressed

Gear-up digital control value used by vehicle simulation.

Note
If true a gear change will be initiated towards currentGear+1 (or to first gear if in reverse).
See also
setDigitalInput, getDigitalInput

◆ mPad

PxU32 PxVehicleDriveDynData::mPad[2]
private

◆ mTargetGear

PxU32 PxVehicleDriveDynData::mTargetGear

Target gear (different from current gear if a gear change is underway)

See also
startGearChange, forceGearChange, getTargetGear, PxVehicleGearsData

◆ mUseAutoGears

bool PxVehicleDriveDynData::mUseAutoGears

Auto-gear flag used by vehicle simulation. Set true to enable the autobox, false to disable the autobox.

See also
setUseAutoGears, setUseAutoGears, toggleAutoGears, PxVehicleAutoBoxData

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