PxVehicleDriveTankRawInputData Class Reference

Used to produce smooth analog tank control values from analog and digital inputs. More...

#include <PxVehicleUtilControl.h>

Public Member Functions

 PxVehicleDriveTankRawInputData (const PxVehicleDriveTankControlModel::Enum mode)
 
 ~PxVehicleDriveTankRawInputData ()
 
PxVehicleDriveTankControlModel::Enum getDriveModel () const
 Return the drive model (eDRIVE_MODEL_SPECIAL or eDRIVE_MODEL_STANDARD) More...
 
void setDigitalAccel (const bool b)
 Set if the accel button has been pressed on the keyboard. More...
 
void setDigitalLeftThrust (const bool b)
 Set if the left thrust button has been pressed on the keyboard. More...
 
void setDigitalRightThrust (const bool b)
 Set if the right thrust button has been pressed on the keyboard. More...
 
void setDigitalLeftBrake (const bool b)
 Set if the left brake button has been pressed on the keyboard. More...
 
void setDigitalRightBrake (const bool b)
 Set if the right brake button has been pressed on the keyboard. More...
 
bool getDigitalAccel () const
 Return if the accel button has been pressed on the keyboard. More...
 
bool getDigitalLeftThrust () const
 Return if the left thrust button has been pressed on the keyboard. More...
 
bool getDigitalRightThrust () const
 Return if the right thrust button has been pressed on the keyboard. More...
 
bool getDigitalLeftBrake () const
 Return if the left brake button has been pressed on the keyboard. More...
 
bool getDigitalRightBrake () const
 Return if the right brake button has been pressed on the keyboard. More...
 
void setAnalogAccel (const PxF32 accel)
 Set the analog accel value from the gamepad. More...
 
void setAnalogLeftThrust (const PxF32 leftThrust)
 Set the analog left thrust value from the gamepad. More...
 
void setAnalogRightThrust (const PxF32 rightThrust)
 Set the analog right thrust value from the gamepad. More...
 
void setAnalogLeftBrake (const PxF32 leftBrake)
 Set the analog left brake value from the gamepad. More...
 
void setAnalogRightBrake (const PxF32 rightBrake)
 Set the analog right brake value from the gamepad. More...
 
PxF32 getAnalogAccel () const
 Return the analog accel value from the gamepad. More...
 
PxF32 getAnalogLeftThrust () const
 Return the analog left thrust value from the gamepad. More...
 
PxF32 getAnalogRightThrust () const
 Return the analog right thrust value from the gamepad. More...
 
PxF32 getAnalogLeftBrake () const
 Return the analog left brake value from the gamepad. More...
 
PxF32 getAnalogRightBrake () const
 Return the analog right brake value from the gamepad. More...
 
void setGearUp (const bool gearUp)
 Record if the gear-up button has been pressed on keyboard or gamepad. More...
 
void setGearDown (const bool gearDown)
 Record if the gear-down button has been pressed on keyboard or gamepad. More...
 
bool getGearUp () const
 Return if the gear-up button has been pressed on keyboard or gamepad. More...
 
bool getGearDown () const
 Return if the gear-down button has been pressed on keyboard or gamepad. More...
 

Private Attributes

PxVehicleDriveTankControlModel::Enum mMode
 
PxReal mRawAnalogInputs [PxVehicleDriveTankControl::eMAX_NB_DRIVETANK_ANALOG_INPUTS]
 
bool mRawDigitalInputs [PxVehicleDriveTankControl::eMAX_NB_DRIVETANK_ANALOG_INPUTS]
 
bool mGearUp
 
bool mGearDown
 

Detailed Description

Used to produce smooth analog tank control values from analog and digital inputs.

See also
PxVehicleDriveTankSmoothDigitalRawInputsAndSetAnalogInputs, PxVehicleDriveTankSmoothAnalogRawInputsAndSetAnalogInputs

Constructor & Destructor Documentation

◆ PxVehicleDriveTankRawInputData()

PxVehicleDriveTankRawInputData::PxVehicleDriveTankRawInputData ( const PxVehicleDriveTankControlModel::Enum  mode)
inline

◆ ~PxVehicleDriveTankRawInputData()

PxVehicleDriveTankRawInputData::~PxVehicleDriveTankRawInputData ( )
inline

Member Function Documentation

◆ getAnalogAccel()

PxF32 PxVehicleDriveTankRawInputData::getAnalogAccel ( ) const
inline

Return the analog accel value from the gamepad.

Returns
The analog accel value.

References PxVehicleDriveTankControl::eANALOG_INPUT_ACCEL.

◆ getAnalogLeftBrake()

PxF32 PxVehicleDriveTankRawInputData::getAnalogLeftBrake ( ) const
inline

Return the analog left brake value from the gamepad.

Returns
The analog left brake value.

References PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_LEFT.

◆ getAnalogLeftThrust()

PxF32 PxVehicleDriveTankRawInputData::getAnalogLeftThrust ( ) const
inline

Return the analog left thrust value from the gamepad.

Returns
The analog left thrust value.

References PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_LEFT.

◆ getAnalogRightBrake()

PxF32 PxVehicleDriveTankRawInputData::getAnalogRightBrake ( ) const
inline

Return the analog right brake value from the gamepad.

Returns
The analog right brake value.

References PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_RIGHT.

◆ getAnalogRightThrust()

PxF32 PxVehicleDriveTankRawInputData::getAnalogRightThrust ( ) const
inline

Return the analog right thrust value from the gamepad.

Returns
The analog right thrust value.

References PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_RIGHT.

◆ getDigitalAccel()

bool PxVehicleDriveTankRawInputData::getDigitalAccel ( ) const
inline

Return if the accel button has been pressed on the keyboard.

Returns
True if the accel button has been pressed, false otherwise.

References PxVehicleDriveTankControl::eANALOG_INPUT_ACCEL.

◆ getDigitalLeftBrake()

bool PxVehicleDriveTankRawInputData::getDigitalLeftBrake ( ) const
inline

Return if the left brake button has been pressed on the keyboard.

Returns
True if the left brake button has been pressed, false otherwise.

References PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_LEFT.

◆ getDigitalLeftThrust()

bool PxVehicleDriveTankRawInputData::getDigitalLeftThrust ( ) const
inline

Return if the left thrust button has been pressed on the keyboard.

Returns
True if the left thrust button has been pressed, false otherwise.

References PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_LEFT.

◆ getDigitalRightBrake()

bool PxVehicleDriveTankRawInputData::getDigitalRightBrake ( ) const
inline

Return if the right brake button has been pressed on the keyboard.

Returns
True if the right brake button has been pressed, false otherwise.

References PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_RIGHT.

◆ getDigitalRightThrust()

bool PxVehicleDriveTankRawInputData::getDigitalRightThrust ( ) const
inline

Return if the right thrust button has been pressed on the keyboard.

Returns
True if the right thrust button has been pressed, false otherwise.

References PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_RIGHT.

◆ getDriveModel()

PxVehicleDriveTankControlModel::Enum PxVehicleDriveTankRawInputData::getDriveModel ( ) const
inline

Return the drive model (eDRIVE_MODEL_SPECIAL or eDRIVE_MODEL_STANDARD)

Returns
The chosen tank drive model.

◆ getGearDown()

bool PxVehicleDriveTankRawInputData::getGearDown ( ) const
inline

Return if the gear-down button has been pressed on keyboard or gamepad.

Returns
True if the gear-down button has been pressed, false otherwise.

◆ getGearUp()

bool PxVehicleDriveTankRawInputData::getGearUp ( ) const
inline

Return if the gear-up button has been pressed on keyboard or gamepad.

Returns
True if the gear-up button has been pressed, false otherwise.

◆ setAnalogAccel()

void PxVehicleDriveTankRawInputData::setAnalogAccel ( const PxF32  accel)
inline

Set the analog accel value from the gamepad.

Parameters
[in]accelis a value in range (0,1) where 1 represents the accelerator pedal fully pressed and 0 represents the pedal in its rest state. In range (0,1).

References PxVehicleDriveTankControl::eANALOG_INPUT_ACCEL.

◆ setAnalogLeftBrake()

void PxVehicleDriveTankRawInputData::setAnalogLeftBrake ( const PxF32  leftBrake)
inline

Set the analog left brake value from the gamepad.

Parameters
[in]leftBrakeis a value in range (0,1) where 1 represents the left brake pedal fully pressed and 0 represents the left brake pedal in its rest state.
Note
In range (0,1).

References PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_LEFT.

◆ setAnalogLeftThrust()

void PxVehicleDriveTankRawInputData::setAnalogLeftThrust ( const PxF32  leftThrust)
inline

Set the analog left thrust value from the gamepad.

Parameters
[in]leftThrustrepresents the state of the left stick.
Note
In range (0,1) for standard mode (eSTANDARD), in range (-1,1) for special mode (eSPECIAL)

References PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_LEFT, and PxVehicleDriveTankControlModel::eSPECIAL.

◆ setAnalogRightBrake()

void PxVehicleDriveTankRawInputData::setAnalogRightBrake ( const PxF32  rightBrake)
inline

Set the analog right brake value from the gamepad.

Parameters
[in]rightBrakeis a value in range (0,1) where 1 represents the right brake pedal fully pressed and 0 represents the right brake pedal in its rest state.
Note
In range (0,1).

References PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_RIGHT.

◆ setAnalogRightThrust()

void PxVehicleDriveTankRawInputData::setAnalogRightThrust ( const PxF32  rightThrust)
inline

Set the analog right thrust value from the gamepad.

Parameters
[in]rightThrustrepresents the state of the right stick.
Note
In range (0,1) for standard mode (eSTANDARD), in range (-1,1) for special mode (eSPECIAL)

References PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_RIGHT, and PxVehicleDriveTankControlModel::eSPECIAL.

◆ setDigitalAccel()

void PxVehicleDriveTankRawInputData::setDigitalAccel ( const bool  b)
inline

Set if the accel button has been pressed on the keyboard.

Parameters
[in]bis true if the digital accel button has been pressed, false otherwise.

References PxVehicleDriveTankControl::eANALOG_INPUT_ACCEL.

◆ setDigitalLeftBrake()

void PxVehicleDriveTankRawInputData::setDigitalLeftBrake ( const bool  b)
inline

Set if the left brake button has been pressed on the keyboard.

Parameters
[in]bis true if the digital left brake button has been pressed, false otherwise.

References PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_LEFT.

◆ setDigitalLeftThrust()

void PxVehicleDriveTankRawInputData::setDigitalLeftThrust ( const bool  b)
inline

Set if the left thrust button has been pressed on the keyboard.

Parameters
[in]bis true if the digital left thrust button has been pressed, false otherwise.

References PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_LEFT.

◆ setDigitalRightBrake()

void PxVehicleDriveTankRawInputData::setDigitalRightBrake ( const bool  b)
inline

Set if the right brake button has been pressed on the keyboard.

Parameters
[in]bis true if the digital right brake button has been pressed, false otherwise.

References PxVehicleDriveTankControl::eANALOG_INPUT_BRAKE_RIGHT.

◆ setDigitalRightThrust()

void PxVehicleDriveTankRawInputData::setDigitalRightThrust ( const bool  b)
inline

Set if the right thrust button has been pressed on the keyboard.

Parameters
[in]bis true if the digital right thrust button has been pressed, false otherwise.

References PxVehicleDriveTankControl::eANALOG_INPUT_THRUST_RIGHT.

◆ setGearDown()

void PxVehicleDriveTankRawInputData::setGearDown ( const bool  gearDown)
inline

Record if the gear-down button has been pressed on keyboard or gamepad.

Parameters
[in]gearDownis true if the gear-down button has been pressed, false otherwise.

◆ setGearUp()

void PxVehicleDriveTankRawInputData::setGearUp ( const bool  gearUp)
inline

Record if the gear-up button has been pressed on keyboard or gamepad.

Parameters
[in]gearUpis true if the gear-up button has been pressed, false otherwise.

Member Data Documentation

◆ mGearDown

bool PxVehicleDriveTankRawInputData::mGearDown
private

◆ mGearUp

bool PxVehicleDriveTankRawInputData::mGearUp
private

◆ mMode

PxVehicleDriveTankControlModel::Enum PxVehicleDriveTankRawInputData::mMode
private

◆ mRawAnalogInputs

PxReal PxVehicleDriveTankRawInputData::mRawAnalogInputs[PxVehicleDriveTankControl::eMAX_NB_DRIVETANK_ANALOG_INPUTS]
private

◆ mRawDigitalInputs

bool PxVehicleDriveTankRawInputData::mRawDigitalInputs[PxVehicleDriveTankControl::eMAX_NB_DRIVETANK_ANALOG_INPUTS]
private

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