PxVehicleNoDrive Class Reference

Data structure with instanced dynamics data and configuration data of a vehicle with no drive model. More...

#include <PxVehicleNoDrive.h>

Inheritance diagram for PxVehicleNoDrive:
Collaboration diagram for PxVehicleNoDrive:

Public Member Functions

void free ()
 Deallocate a PxVehicleNoDrive instance. More...
 
void setup (PxPhysics *physics, PxRigidDynamic *vehActor, const PxVehicleWheelsSimData &wheelsData)
 Set up a vehicle using simulation data for the wheels. More...
 
void setToRestState ()
 Set a vehicle to its rest state. Aside from the rigid body transform, this will set the vehicle and rigid body to the state they were in immediately after setup or create. More...
 
void setBrakeTorque (const PxU32 id, const PxReal brakeTorque)
 Set the brake torque to be applied to a specific wheel. More...
 
void setDriveTorque (const PxU32 id, const PxReal driveTorque)
 Set the drive torque to be applied to a specific wheel. More...
 
void setSteerAngle (const PxU32 id, const PxReal steerAngle)
 Set the steer angle to be applied to a specific wheel. More...
 
PxReal getBrakeTorque (const PxU32 id) const
 Get the brake torque that has been applied to a specific wheel. More...
 
PxReal getDriveTorque (const PxU32 id) const
 Get the drive torque that has been applied to a specific wheel. More...
 
PxReal getSteerAngle (const PxU32 id) const
 Get the steer angle that has been applied to a specific wheel. More...
 
 PxVehicleNoDrive (PxBaseFlags baseFlags)
 
virtual void exportExtraData (PxSerializationContext &)
 
void importExtraData (PxDeserializationContext &)
 
virtual const char * getConcreteTypeName () const
 Returns string name of dynamic type. More...
 
virtual bool isKindOf (const char *name) const
 Returns whether a given type name matches with the type of this instance. More...
 
PxU32 getNbSteerAngle () const
 
PxU32 getNbDriveTorque () const
 
PxU32 getNbBrakeTorque () const
 
- Public Member Functions inherited from PxVehicleWheels
PX_FORCE_INLINE PxU32 getVehicleType () const
 Return the type of vehicle. More...
 
PX_FORCE_INLINE PxRigidDynamicgetRigidDynamicActor ()
 Get non-const ptr to PxRigidDynamic instance that is the vehicle's physx representation. More...
 
PX_FORCE_INLINE const PxRigidDynamicgetRigidDynamicActor () const
 Get const ptr to PxRigidDynamic instance that is the vehicle's physx representation. More...
 
PxReal computeForwardSpeed () const
 Compute the rigid body velocity component along the forward vector of the rigid body transform. More...
 
PxReal computeSidewaysSpeed () const
 Compute the rigid body velocity component along the right vector of the rigid body transform. More...
 
virtual void requiresObjects (PxProcessPxBaseCallback &c)
 
virtual void preExportDataReset ()
 
void importExtraData (PxDeserializationContext &)
 
void resolveReferences (PxDeserializationContext &)
 
PX_FORCE_INLINE PxU32 getNbNonDrivenWheels () const
 
 PxVehicleWheels (PxType concreteType, PxBaseFlags baseFlags)
 
 PxVehicleWheels (PxBaseFlags baseFlags)
 
virtual ~PxVehicleWheels ()
 
virtual void release ()
 Releases the PxBase instance, please check documentation of release in derived class. More...
 
- Public Member Functions inherited from PxBase
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_FORCE_INLINE PxType getConcreteType () const
 Returns concrete type of object. More...
 
PX_FORCE_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag. More...
 
PX_FORCE_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags. More...
 
PX_FORCE_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags. More...
 
virtual bool isReleasable () const
 Whether the object is subordinate. More...
 

Static Public Member Functions

static PxVehicleNoDriveallocate (const PxU32 nbWheels)
 Allocate a PxVehicleNoDrive instance for a vehicle without drive model and with nbWheels. More...
 
static PxVehicleNoDrivecreate (PxPhysics *physics, PxRigidDynamic *vehActor, const PxVehicleWheelsSimData &wheelsData)
 Allocate and set up a vehicle using simulation data for the wheels. More...
 
static PxVehicleNoDrivecreateObject (PxU8 *&address, PxDeserializationContext &context)
 
static void getBinaryMetaData (PxOutputStream &stream)
 
- Static Public Member Functions inherited from PxVehicleWheels
static void getBinaryMetaData (PxOutputStream &stream)
 

Protected Member Functions

 PxVehicleNoDrive ()
 
 ~PxVehicleNoDrive ()
 
- Protected Member Functions inherited from PxVehicleWheels
void setToRestState ()
 Set all wheels to their rest state. More...
 
bool isValid () const
 Test that all configuration and instanced dynamics data is valid. More...
 
virtual void init (const PxU32 numWheels)
 
void free ()
 Deallocate a PxVehicleWheels instance. More...
 
void onConstraintRelease ()
 
void setup (PxPhysics *physics, PxRigidDynamic *vehActor, const PxVehicleWheelsSimData &wheelsData, const PxU32 nbDrivenWheels, const PxU32 nbNonDrivenWheels)
 
- Protected Member Functions inherited from PxBase
PX_INLINE PxBase (PxType concreteType, PxBaseFlags baseFlags)
 Constructor setting concrete type and base flags. More...
 
PX_INLINE PxBase (PxBaseFlags baseFlags)
 Deserialization constructor setting base flags. More...
 
virtual ~PxBase ()
 Destructor. More...
 
template<class T >
bool typeMatch () const
 

Private Member Functions

bool isValid () const
 Test if the instanced dynamics and configuration data has legal values. More...
 

Private Attributes

PxReal * mSteerAngles
 
PxReal * mDriveTorques
 
PxReal * mBrakeTorques
 
PxU32 mPad [1]
 

Friends

class PxVehicleUpdate
 

Additional Inherited Members

- Public Attributes inherited from PxVehicleWheels
PxVehicleWheelsSimData mWheelsSimData
 Data describing the setup of all the wheels/suspensions/tires. More...
 
PxVehicleWheelsDynData mWheelsDynData
 Data describing the dynamic state of all wheels/suspension/tires. More...
 
- Static Protected Member Functions inherited from PxVehicleWheels
static PxU32 computeByteSize (const PxU32 nbWheels)
 
static PxU8 * patchupPointers (const PxU32 nbWheels, PxVehicleWheels *vehWheels, PxU8 *ptr)
 
- Protected Attributes inherited from PxVehicleWheels
PxRigidDynamicmActor
 The rigid body actor that represents the vehicle in the PhysX SDK. More...
 
PxU8 mType
 Vehicle type (eVehicleDriveTypes) More...
 
PxU8 mPad0 [14]
 
- Protected Attributes inherited from PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 

Detailed Description

Data structure with instanced dynamics data and configuration data of a vehicle with no drive model.

Constructor & Destructor Documentation

◆ PxVehicleNoDrive() [1/2]

PxVehicleNoDrive::PxVehicleNoDrive ( PxBaseFlags  baseFlags)
inline

◆ PxVehicleNoDrive() [2/2]

PxVehicleNoDrive::PxVehicleNoDrive ( )
protected

◆ ~PxVehicleNoDrive()

PxVehicleNoDrive::~PxVehicleNoDrive ( )
inlineprotected

Member Function Documentation

◆ allocate()

static PxVehicleNoDrive* PxVehicleNoDrive::allocate ( const PxU32  nbWheels)
static

Allocate a PxVehicleNoDrive instance for a vehicle without drive model and with nbWheels.

Parameters
[in]nbWheelsis the number of wheels on the vehicle.
Returns
The instantiated vehicle.
See also
free, setup

◆ create()

static PxVehicleNoDrive* PxVehicleNoDrive::create ( PxPhysics physics,
PxRigidDynamic vehActor,
const PxVehicleWheelsSimData wheelsData 
)
static

Allocate and set up a vehicle using simulation data for the wheels.

Parameters
[in]physicsis a PxPhysics instance that is needed to create special vehicle constraints that are maintained by the vehicle.
[in]vehActoris a PxRigidDynamic instance that is used to represent the vehicle in the PhysX SDK.
[in]wheelsDatadescribes the configuration of all suspension/tires/wheels of the vehicle. The vehicle instance takes a copy of this data.
Note
It is assumed that the first shapes of the actor are the wheel shapes, followed by the chassis shapes. To break this assumption use PxVehicleWheels::setWheelShapeMapping.
Returns
The instantiated vehicle.
See also
allocate, free, setToRestState, PxVehicleWheels::setWheelShapeMapping

◆ createObject()

static PxVehicleNoDrive* PxVehicleNoDrive::createObject ( PxU8 *&  address,
PxDeserializationContext context 
)
static

◆ exportExtraData()

virtual void PxVehicleNoDrive::exportExtraData ( PxSerializationContext )
virtual

Reimplemented from PxVehicleWheels.

◆ free()

void PxVehicleNoDrive::free ( )

Deallocate a PxVehicleNoDrive instance.

See also
allocate

◆ getBinaryMetaData()

static void PxVehicleNoDrive::getBinaryMetaData ( PxOutputStream stream)
static

◆ getBrakeTorque()

PxReal PxVehicleNoDrive::getBrakeTorque ( const PxU32  id) const

Get the brake torque that has been applied to a specific wheel.

Parameters
[in]idis the wheel being queried for its brake torque
Returns
The brake torque applied to the queried wheel.

◆ getConcreteTypeName()

virtual const char* PxVehicleNoDrive::getConcreteTypeName ( ) const
inlinevirtual

Returns string name of dynamic type.

Returns
Class name of most derived type of this object.

Reimplemented from PxVehicleWheels.

◆ getDriveTorque()

PxReal PxVehicleNoDrive::getDriveTorque ( const PxU32  id) const

Get the drive torque that has been applied to a specific wheel.

Parameters
[in]idis the wheel being queried for its drive torque
Returns
The drive torque applied to the queried wheel.

◆ getNbBrakeTorque()

PxU32 PxVehicleNoDrive::getNbBrakeTorque ( ) const
inline

◆ getNbDriveTorque()

PxU32 PxVehicleNoDrive::getNbDriveTorque ( ) const
inline

◆ getNbSteerAngle()

PxU32 PxVehicleNoDrive::getNbSteerAngle ( ) const
inline

◆ getSteerAngle()

PxReal PxVehicleNoDrive::getSteerAngle ( const PxU32  id) const

Get the steer angle that has been applied to a specific wheel.

Parameters
[in]idis the wheel being queried for its steer angle
Returns
The steer angle (in radians) applied to the queried wheel.

◆ importExtraData()

void PxVehicleNoDrive::importExtraData ( PxDeserializationContext )

◆ isKindOf()

virtual bool PxVehicleNoDrive::isKindOf ( const char *  superClass) const
inlinevirtual

Returns whether a given type name matches with the type of this instance.

Reimplemented from PxVehicleWheels.

References PxBase::isKindOf().

◆ isValid()

bool PxVehicleNoDrive::isValid ( ) const
private

Test if the instanced dynamics and configuration data has legal values.

◆ setBrakeTorque()

void PxVehicleNoDrive::setBrakeTorque ( const PxU32  id,
const PxReal  brakeTorque 
)

Set the brake torque to be applied to a specific wheel.

Note
The applied brakeTorque persists until the next call to setBrakeTorque
The brake torque is specified in Newton metres.
Parameters
[in]idis the wheel being given the brake torque
[in]brakeTorqueis the value of the brake torque

◆ setDriveTorque()

void PxVehicleNoDrive::setDriveTorque ( const PxU32  id,
const PxReal  driveTorque 
)

Set the drive torque to be applied to a specific wheel.

Note
The applied driveTorque persists until the next call to setDriveTorque
The brake torque is specified in Newton metres.
Parameters
[in]idis the wheel being given the brake torque
[in]driveTorqueis the value of the brake torque

◆ setSteerAngle()

void PxVehicleNoDrive::setSteerAngle ( const PxU32  id,
const PxReal  steerAngle 
)

Set the steer angle to be applied to a specific wheel.

Note
The applied steerAngle persists until the next call to setSteerAngle
The steer angle is specified in radians.
Parameters
[in]idis the wheel being given the steer angle
[in]steerAngleis the value of the steer angle in radians.

◆ setToRestState()

void PxVehicleNoDrive::setToRestState ( )

Set a vehicle to its rest state. Aside from the rigid body transform, this will set the vehicle and rigid body to the state they were in immediately after setup or create.

Note
Calling setToRestState invalidates the cached raycast hit planes under each wheel meaning that suspension line raycasts need to be performed at least once with PxVehicleSuspensionRaycasts before calling PxVehicleUpdates.
See also
setup, create, PxVehicleSuspensionRaycasts, PxVehicleUpdates

◆ setup()

void PxVehicleNoDrive::setup ( PxPhysics physics,
PxRigidDynamic vehActor,
const PxVehicleWheelsSimData wheelsData 
)

Set up a vehicle using simulation data for the wheels.

Parameters
[in]physicsis a PxPhysics instance that is needed to create special vehicle constraints that are maintained by the vehicle.
[in]vehActoris a PxRigidDynamic instance that is used to represent the vehicle in the PhysX SDK.
[in]wheelsDatadescribes the configuration of all suspension/tires/wheels of the vehicle. The vehicle instance takes a copy of this data.
Note
It is assumed that the first shapes of the actor are the wheel shapes, followed by the chassis shapes. To break this assumption use PxVehicleWheels::setWheelShapeMapping.
See also
allocate, free, setToRestState, PxVehicleWheels::setWheelShapeMapping

Friends And Related Function Documentation

◆ PxVehicleUpdate

friend class PxVehicleUpdate
friend

Member Data Documentation

◆ mBrakeTorques

PxReal* PxVehicleNoDrive::mBrakeTorques
private

◆ mDriveTorques

PxReal* PxVehicleNoDrive::mDriveTorques
private

◆ mPad

PxU32 PxVehicleNoDrive::mPad[1]
private

◆ mSteerAngles

PxReal* PxVehicleNoDrive::mSteerAngles
private

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