#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. | |
void | setAnalogInput (const PxU32 type, const PxReal analogVal) |
Set an analog control value to drive the vehicle. | |
PxReal | getAnalogInput (const PxU32 type) const |
Get the analog control value that has been applied to the vehicle. | |
void | setGearUp (const bool digitalVal) |
Inform the vehicle that the gear-up button has been pressed. | |
void | setGearDown (const bool digitalVal) |
Set that the gear-down button has been pressed. | |
bool | getGearUp () const |
Check if the gear-up button has been pressed. | |
bool | getGearDown () const |
Check if the gear-down button has been pressed. | |
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. | |
PX_FORCE_INLINE bool | getUseAutoGears () const |
Get the flag status that is used to select auto-gears. | |
PX_FORCE_INLINE void | toggleAutoGears () |
Toggle the auto-gears flag If useAutoGears is true the auto-box will be active. | |
PX_FORCE_INLINE void | setCurrentGear (PxU32 currentGear) |
Set the current gear. | |
PX_FORCE_INLINE PxU32 | getCurrentGear () const |
Get the current gear. | |
PX_FORCE_INLINE void | setTargetGear (PxU32 targetGear) |
Set the target gear. | |
PX_FORCE_INLINE PxU32 | getTargetGear () const |
Get the target gear. | |
PX_FORCE_INLINE void | startGearChange (const PxU32 targetGear) |
Start a gear change to a target gear. | |
PX_FORCE_INLINE void | forceGearChange (const PxU32 targetGear) |
Force an immediate gear change to a target gear. | |
PX_FORCE_INLINE void | setEngineRotationSpeed (const PxF32 speed) |
Set the rotation speed of the engine (radians per second). | |
PX_FORCE_INLINE PxReal | getEngineRotationSpeed () const |
Return the rotation speed of the engine (radians per second). | |
PX_FORCE_INLINE PxReal | getGearSwitchTime () const |
Return the time that has passed since the current gear change was initiated. | |
PX_FORCE_INLINE PxReal | getAutoBoxSwitchTime () const |
Return the time that has passed since the autobox last initiated a gear change. | |
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. | |
bool | mUseAutoGears |
Auto-gear flag used by vehicle simulation. Set true to enable the autobox, false to disable the autobox. | |
bool | mGearUpPressed |
Gear-up digital control value used by vehicle simulation. | |
bool | mGearDownPressed |
Gear-down digital control value used by vehicle simulation. | |
PxU32 | mCurrentGear |
Current gear. | |
PxU32 | mTargetGear |
Target gear (different from current gear if a gear change is underway). | |
PxReal | mEnginespeed |
Rotation speed of engine. | |
PxReal | mGearSwitchTime |
Reported time that has passed since gear change started. | |
PxReal | mAutoBoxSwitchTime |
Reported time that has passed since last autobox gearup/geardown decision. | |
Private Member Functions | |
bool | isValid () const |
Test that a PxVehicleDriveDynData instance has legal values. | |
Private Attributes | |
PxU32 | mPad [2] |
Friends | |
class | PxVehicleDrive |
PxVehicleDriveDynData::PxVehicleDriveDynData | ( | ) |
PxVehicleDriveDynData::PxVehicleDriveDynData | ( | const | PxEMPTY | ) | [inline] |
PX_FORCE_INLINE void PxVehicleDriveDynData::forceGearChange | ( | const PxU32 | targetGear | ) | [inline] |
Force an immediate gear change to a target gear.
[in] | targetGear | is the gear the vehicle will be given immediately. |
PxReal PxVehicleDriveDynData::getAnalogInput | ( | const PxU32 | type | ) | const |
Get the analog control value that has been applied to the vehicle.
PX_FORCE_INLINE PxReal PxVehicleDriveDynData::getAutoBoxSwitchTime | ( | ) | const [inline] |
Return the time that has passed since the autobox last initiated a gear change.
PX_FORCE_INLINE PxU32 PxVehicleDriveDynData::getCurrentGear | ( | ) | const [inline] |
Get the current gear.
PX_FORCE_INLINE PxReal PxVehicleDriveDynData::getEngineRotationSpeed | ( | ) | const [inline] |
Return the rotation speed of the engine (radians per second).
PX_FORCE_INLINE PxU32 PxVehicleDriveDynData::getGearChange | ( | ) | const [inline] |
bool PxVehicleDriveDynData::getGearDown | ( | ) | const [inline] |
Check if the gear-down button has been pressed.
PX_FORCE_INLINE PxReal PxVehicleDriveDynData::getGearSwitchTime | ( | ) | const [inline] |
Return the time that has passed since the current gear change was initiated.
bool PxVehicleDriveDynData::getGearUp | ( | ) | const [inline] |
Check if the gear-up button has been pressed.
PxU32 PxVehicleDriveDynData::getNbAnalogInput | ( | ) | const [inline] |
PX_FORCE_INLINE PxU32 PxVehicleDriveDynData::getTargetGear | ( | ) | const [inline] |
PX_FORCE_INLINE bool PxVehicleDriveDynData::getUseAutoGears | ( | ) | const [inline] |
Get the flag status that is used to select auto-gears.
bool PxVehicleDriveDynData::isValid | ( | ) | const [private] |
void PxVehicleDriveDynData::setAnalogInput | ( | const PxU32 | type, | |
const PxReal | analogVal | |||
) |
Set an analog control value to drive the vehicle.
[in] | type | describes the type of analog control being modified |
[in] | analogVal | is the new value of the specific analog control. |
PX_FORCE_INLINE void PxVehicleDriveDynData::setAutoBoxSwitchTime | ( | const PxReal | autoBoxSwitchTime | ) | [inline] |
PX_FORCE_INLINE void PxVehicleDriveDynData::setCurrentGear | ( | PxU32 | currentGear | ) | [inline] |
Set the current gear.
[in] | currentGear | is the vehicle's gear. |
PX_FORCE_INLINE void PxVehicleDriveDynData::setEngineRotationSpeed | ( | const PxF32 | speed | ) | [inline] |
Set the rotation speed of the engine (radians per second).
[in] | speed | is the rotational speed (radians per second) to apply to the engine. |
PX_FORCE_INLINE void PxVehicleDriveDynData::setGearChange | ( | const PxU32 | gearChange | ) | [inline] |
void PxVehicleDriveDynData::setGearDown | ( | const bool | digitalVal | ) | [inline] |
Set that the gear-down button has been pressed.
[in] | digitalVal | is the state of the gear-down button. |
The value of mGearDownPressed is not reset by PxVehicleUpdates
PX_FORCE_INLINE void PxVehicleDriveDynData::setGearSwitchTime | ( | const PxReal | switchTime | ) | [inline] |
void PxVehicleDriveDynData::setGearUp | ( | const bool | digitalVal | ) | [inline] |
Inform the vehicle that the gear-up button has been pressed.
[in] | digitalVal | is the state of the gear-up button. |
The value of mGearUpPressed is not reset by PxVehicleUpdates
PX_FORCE_INLINE void PxVehicleDriveDynData::setTargetGear | ( | PxU32 | targetGear | ) | [inline] |
Set the target gear.
[in] | targetGear | is the vehicle's target gear. |
void PxVehicleDriveDynData::setToRestState | ( | ) |
Set all dynamics data to zero to bring the vehicle to rest.
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.
[in] | useAutoGears | is the active state of the auto-box. |
PX_FORCE_INLINE void PxVehicleDriveDynData::startGearChange | ( | const PxU32 | targetGear | ) | [inline] |
Start a gear change to a target gear.
[in] | targetGear | is the gear the vehicle will begin a transition towards. |
PX_FORCE_INLINE void PxVehicleDriveDynData::toggleAutoGears | ( | ) | [inline] |
Toggle the auto-gears flag If useAutoGears is true the auto-box will be active.
friend class PxVehicleDrive [friend] |
Reported time that has passed since last autobox gearup/geardown decision.
PxReal PxVehicleDriveDynData::mControlAnalogVals[eMAX_NB_ANALOG_INPUTS] |
All dynamic data values are public for fast access.
Analog control values used by vehicle simulation.
Gear-down digital control value used by vehicle simulation.
Reported time that has passed since gear change started.
Gear-up digital control value used by vehicle simulation.
PxU32 PxVehicleDriveDynData::mPad[2] [private] |
Target gear (different from current gear if a gear change is underway).
Auto-gear flag used by vehicle simulation. Set true to enable the autobox, false to disable the autobox.