RavEngine
Loading...
Searching...
No Matches
physx::PxVehicleWheelsDynData Class Reference

Data structure with instanced dynamics data for wheels. More...

#include <PxVehicleWheels.h>

Public Member Functions

void setToRestState ()
 Set all wheels to their rest state.
 
void setTireForceShaderFunction (PxVehicleComputeTireForce tireForceShaderFn)
 Set the tire force shader function.
 
void setTireForceShaderData (const PxU32 tireId, const void *tireForceShaderData)
 Set the tire force shader data for a specific tire.
 
const void * getTireForceShaderData (const PxU32 tireId) const
 Get the tire force shader data for a specific tire.
 
void setWheelRotationSpeed (const PxU32 wheelIdx, const PxReal speed)
 Set the wheel rotation speed (radians per second) about the rolling axis for the specified wheel.
 
PxReal getWheelRotationSpeed (const PxU32 wheelIdx) const
 Return the rotation speed about the rolling axis of a specified wheel .
 
void setWheelRotationAngle (const PxU32 wheelIdx, const PxReal angle)
 Set the wheel rotation angle (radians) about the rolling axis of the specified wheel.
 
PxReal getWheelRotationAngle (const PxU32 wheelIdx) const
 Return the rotation angle about the rolling axis for the specified wheel.
 
void setUserData (const PxU32 tireIdx, void *userData)
 Set the user data pointer for the specified wheel It has a default value of NULL.
 
void * getUserData (const PxU32 tireIdx) const
 Get the user data pointer that was set for the specified wheel.
 
void copy (const PxVehicleWheelsDynData &src, const PxU32 srcWheel, const PxU32 trgWheel)
 Copy the dynamics data of a single wheel unit (wheel, suspension, tire) from srcWheel of src to trgWheel.
 
void setTireContacts (const PxU32 *nbHits, const PxPlane *contactPlanes, const PxReal *contactFrictions, const PxTireContactIntersectionMethod::Enum *intersectionMethods, const PxU32 nbWheels)
 Directly set tire contact plane and friction for all tires on the vehicle as an alternative to using PxVehicleSuspensionSweeps() or PxVehicleSuspensionRaycasts().
 
PxU32 getNbWheelRotationSpeed () const
 
PxU32 getNbWheelRotationAngle () const
 
PxVehicleWheels4DynData * getWheel4DynData () const
 
PxU32 getNbConstraints () const
 Retrieve the number of PxConstraint objects associated with the vehicle.
 
PxU32 getConstraints (PxConstraint **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const
 Retrieve all the PxConstraint objects associated with the vehicle.
 

Static Public Member Functions

static void getBinaryMetaData (PxOutputStream &stream)
 

Friends

class PxVehicleWheels
 
class PxVehicleDrive4W
 
class PxVehicleDriveTank
 
class PxVehicleUpdate
 

Detailed Description

Data structure with instanced dynamics data for wheels.

Member Function Documentation

◆ copy()

void physx::PxVehicleWheelsDynData::copy ( const PxVehicleWheelsDynData &  src,
const PxU32  srcWheel,
const PxU32  trgWheel 
)

Copy the dynamics data of a single wheel unit (wheel, suspension, tire) from srcWheel of src to trgWheel.

Parameters
[in]srcis the data to be copied.
[in]srcWheelis the wheel whose data will be copied from src.
[in]trgWheelis the wheel that will be assigned the copied data.

◆ getConstraints()

PxU32 physx::PxVehicleWheelsDynData::getConstraints ( PxConstraint **  userBuffer,
PxU32  bufferSize,
PxU32  startIndex = 0 
) const

Retrieve all the PxConstraint objects associated with the vehicle.

There is one PxConstraint per block of 4 wheels. The count can be extracted through getNbConstraints()

Parameters
[out]userBufferThe buffer to store the constraint pointers.
[in]bufferSizeSize of provided user buffer.
[in]startIndexIndex of first constraint pointer to be retrieved
Returns
Number of constraint pointers written to the buffer.
See also
PxConstraint getNbConstraints()

◆ getNbConstraints()

PxU32 physx::PxVehicleWheelsDynData::getNbConstraints ( ) const
inline

Retrieve the number of PxConstraint objects associated with the vehicle.

You can use getConstraints() to retrieve the constraint pointers.

Returns
Number of constraints associated with this vehicle.
See also
PxConstraint getConstraints()

◆ setTireContacts()

void physx::PxVehicleWheelsDynData::setTireContacts ( const PxU32 *  nbHits,
const PxPlane *  contactPlanes,
const PxReal *  contactFrictions,
const PxTireContactIntersectionMethod::Enum *  intersectionMethods,
const PxU32  nbWheels 
)

Directly set tire contact plane and friction for all tires on the vehicle as an alternative to using PxVehicleSuspensionSweeps() or PxVehicleSuspensionRaycasts().

Parameters
[in]nbHitsis an array describing whether each tire has a contact plane or not. Each element of the array is either 0 (no contact) or 1 (contact).
[in]contactPlanesis an array of contact planes describing the contact plane per tire.
[in]contactFrictionsis the friction value of each tire contact with the drivable surface.
[in]intersectionMethodsdescribes how each tire will individually interact with its contact plane in order to compute the spring compression that places the tire on the contact plane. A value of eCYLINDER will compute the spring compression by intersecting the wheel's cylindrical shape with the contact plane. A value of eRAY will compute the spring compression by casting a ray through the wheel center and along the suspension direction until it hits the contact plane.
[in]nbWheelsis the length of the arrays nbContacts, contactPlanes, contactFrictions and intersectionMethods.
Note
Each contact plane (n, d) obeys the rule that all points P on the plane satisfy n.dot(P) + d = 0.0.
The contact planes specified by setTireContacts() will persist as driving surfaces until either the next call to setTireContacts() or the next call to
The friction values are scaled by PxVehicleTireData::mFrictionVsSlipGraph before being applied to the tire.
The vehicle model assumes that the tire contacts are with static objects. PxVehicleSuspensionSweeps() or PxVehicleSuspensionRaycasts().

◆ setTireForceShaderData()

void physx::PxVehicleWheelsDynData::setTireForceShaderData ( const PxU32  tireId,
const void *  tireForceShaderData 
)

Set the tire force shader data for a specific tire.

Parameters
[in]tireIdis the wheel index
[in]tireForceShaderDatais the data describing the tire.

◆ setTireForceShaderFunction()

void physx::PxVehicleWheelsDynData::setTireForceShaderFunction ( PxVehicleComputeTireForce  tireForceShaderFn)

Set the tire force shader function.

Parameters
[in]tireForceShaderFnis the shader function that will be used to compute tire forces.

◆ setToRestState()

void physx::PxVehicleWheelsDynData::setToRestState ( )

Set all wheels to their rest state.

See also
setup

◆ setUserData()

void physx::PxVehicleWheelsDynData::setUserData ( const PxU32  tireIdx,
void *  userData 
)

Set the user data pointer for the specified wheel It has a default value of NULL.

Parameters
[in]tireIdxis the wheel index
[in]userDatais the data to be associated with the wheel.

◆ setWheelRotationAngle()

void physx::PxVehicleWheelsDynData::setWheelRotationAngle ( const PxU32  wheelIdx,
const PxReal  angle 
)

Set the wheel rotation angle (radians) about the rolling axis of the specified wheel.

Parameters
[in]wheelIdxis the wheel index
[in]angleis the rotation angle to be applied to the wheel.

◆ setWheelRotationSpeed()

void physx::PxVehicleWheelsDynData::setWheelRotationSpeed ( const PxU32  wheelIdx,
const PxReal  speed 
)

Set the wheel rotation speed (radians per second) about the rolling axis for the specified wheel.

Parameters
[in]wheelIdxis the wheel index
[in]speedis the rotation speed to be applied to the wheel.

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