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

Friction for each combination of driving surface type and tire type. More...

#include <PxVehicleTireFriction.h>

Public Types

enum  { eMAX_NB_SURFACE_TYPES =256 }
 

Public Member Functions

void setup (const PxU32 nbTireTypes, const PxU32 nbSurfaceTypes, const PxMaterial **drivableSurfaceMaterials, const PxVehicleDrivableSurfaceType *drivableSurfaceTypes)
 Set up a PxVehicleDrivableSurfaceToTireFrictionPairs instance for combinations of nbTireTypes tire types and nbSurfaceTypes surface types.
 
void release ()
 Deallocate a PxVehicleDrivableSurfaceToTireFrictionPairs instance.
 
void setTypePairFriction (const PxU32 surfaceType, const PxU32 tireType, const PxReal value)
 Set the friction for a specified pair of tire type and drivable surface type.
 
PxU32 getSurfaceType (const PxMaterial &surfaceMaterial) const
 Compute the surface type associated with a specified PxMaterial instance.
 
PxReal getTypePairFriction (const PxU32 surfaceType, const PxU32 tireType) const
 Return the friction for a specified combination of surface type and tire type.
 
PxReal getTypePairFriction (const PxMaterial &surfaceMaterial, const PxU32 tireType) const
 Return the friction for a specified combination of PxMaterial and tire type.
 
PX_FORCE_INLINE PxU32 getMaxNbSurfaceTypes () const
 Return the maximum number of surface types.
 
PX_FORCE_INLINE PxU32 getMaxNbTireTypes () const
 Return the maximum number of tire types.
 

Static Public Member Functions

static PxVehicleDrivableSurfaceToTireFrictionPairs * allocate (const PxU32 maxNbTireTypes, const PxU32 maxNbSurfaceTypes)
 Allocate the memory for a PxVehicleDrivableSurfaceToTireFrictionPairs instance that can hold data for combinations of tire type and surface type with up to maxNbTireTypes types of tire and maxNbSurfaceTypes types of surface.
 
static void serializeToBinary (const PxVehicleDrivableSurfaceToTireFrictionPairs &frictionTable, const PxSerialObjectId *materialIds, const PxU32 nbMaterialIds, PxCollection *collection, PxOutputStream &stream)
 Binary serialization of a PxVehicleDrivableSurfaceToTireFrictionPairs instance.
The PxVehicleDrivableSurfaceToTireFrictionPairs instance is serialized to a PxOutputStream.
The materials referenced by the PxVehicleDrivableSurfaceToTireFrictionPairs instance are serialized to a PxCollection.
 
static PxVehicleDrivableSurfaceToTireFrictionPairs * deserializeFromBinary (const PxCollection &collection, void *memBlock)
 Deserialize from a memory block to create a PxVehicleDrivableSurfaceToTireFrictionPairs instance.
 

Friends

class VehicleSurfaceTypeHashTable
 

Detailed Description

Friction for each combination of driving surface type and tire type.

See also
PxVehicleDrivableSurfaceType, PxVehicleTireData::mType

Member Function Documentation

◆ allocate()

PxVehicleDrivableSurfaceToTireFrictionPairs * physx::PxVehicleDrivableSurfaceToTireFrictionPairs::allocate ( const PxU32  maxNbTireTypes,
const PxU32  maxNbSurfaceTypes 
)
static

Allocate the memory for a PxVehicleDrivableSurfaceToTireFrictionPairs instance that can hold data for combinations of tire type and surface type with up to maxNbTireTypes types of tire and maxNbSurfaceTypes types of surface.

Parameters
[in]maxNbTireTypesis the maximum number of allowed tire types.
[in]maxNbSurfaceTypesis the maximum number of allowed surface types. Must be less than or equal to eMAX_NB_SURFACE_TYPES
Returns
a PxVehicleDrivableSurfaceToTireFrictionPairs instance that can be reused later with new type and friction data.
See also
setup

◆ deserializeFromBinary()

PxVehicleDrivableSurfaceToTireFrictionPairs * physx::PxVehicleDrivableSurfaceToTireFrictionPairs::deserializeFromBinary ( const PxCollection &  collection,
void *  memBlock 
)
static

Deserialize from a memory block to create a PxVehicleDrivableSurfaceToTireFrictionPairs instance.

Parameters
[in]collectioncontains the PxMaterial instances that will be referenced by the friction table.
[in]memBlockis a binary array that may be retrieved or copied from the stream in the complementary serializeToBinary function.
Returns
A PxVehicleDrivableSurfaceToTireFrictionPairs instance whose base address is equal to the memBlock ptr.
See also
serializeToBinary

◆ getMaxNbSurfaceTypes()

PX_FORCE_INLINE PxU32 physx::PxVehicleDrivableSurfaceToTireFrictionPairs::getMaxNbSurfaceTypes ( ) const
inline

Return the maximum number of surface types.

Returns
The maximum number of surface types
See also
allocate

◆ getMaxNbTireTypes()

PX_FORCE_INLINE PxU32 physx::PxVehicleDrivableSurfaceToTireFrictionPairs::getMaxNbTireTypes ( ) const
inline

Return the maximum number of tire types.

Returns
The maximum number of tire types
See also
allocate

◆ getSurfaceType()

PxU32 physx::PxVehicleDrivableSurfaceToTireFrictionPairs::getSurfaceType ( const PxMaterial &  surfaceMaterial) const

Compute the surface type associated with a specified PxMaterial instance.

Parameters
[in]surfaceMaterialis the material to be queried for its associated surface type.
Note
The surface type may be used to query the friction of a surface type/tire type pair using getTypePairFriction()
Returns
The surface type associated with a specified PxMaterial instance.
If surfaceMaterial is not referenced by the PxVehicleDrivableSurfaceToTireFrictionPairs a value of 0 will be returned.
See also
setup
getTypePairFriction

◆ getTypePairFriction() [1/2]

PxReal physx::PxVehicleDrivableSurfaceToTireFrictionPairs::getTypePairFriction ( const PxMaterial &  surfaceMaterial,
const PxU32  tireType 
) const

Return the friction for a specified combination of PxMaterial and tire type.

Returns
The friction for a specified combination of PxMaterial and tire type.
Note
The final friction value used by the tire model is the value returned by getTypePairFriction multiplied by the value computed from PxVehicleTireData::mFrictionVsSlipGraph
If surfaceMaterial is not referenced by the PxVehicleDrivableSurfaceToTireFrictionPairs a surfaceType of value 0 will be assumed and the corresponding friction value will be returned.
See also
PxVehicleTireData::mFrictionVsSlipGraph

◆ getTypePairFriction() [2/2]

PxReal physx::PxVehicleDrivableSurfaceToTireFrictionPairs::getTypePairFriction ( const PxU32  surfaceType,
const PxU32  tireType 
) const

Return the friction for a specified combination of surface type and tire type.

Returns
The friction for a specified combination of surface type and tire type.
Note
The final friction value used by the tire model is the value returned by getTypePairFriction multiplied by the value computed from PxVehicleTireData::mFrictionVsSlipGraph
The surface type is associated with a PxMaterial. The mapping between the two may be queried using getSurfaceType().
See also
PxVehicleTireData::mFrictionVsSlipGraph
getSurfaceType

◆ serializeToBinary()

void physx::PxVehicleDrivableSurfaceToTireFrictionPairs::serializeToBinary ( const PxVehicleDrivableSurfaceToTireFrictionPairs &  frictionTable,
const PxSerialObjectId *  materialIds,
const PxU32  nbMaterialIds,
PxCollection *  collection,
PxOutputStream &  stream 
)
static

Binary serialization of a PxVehicleDrivableSurfaceToTireFrictionPairs instance.
The PxVehicleDrivableSurfaceToTireFrictionPairs instance is serialized to a PxOutputStream.
The materials referenced by the PxVehicleDrivableSurfaceToTireFrictionPairs instance are serialized to a PxCollection.

Parameters
[in]frictionTableis the PxVehicleDrivableSurfaceToTireFrictionPairs instance to be serialized.
[in]materialIdsare unique ids that will be used to add the materials to the collection.
[in]nbMaterialIdsis the length of the materialIds array. It must be sufficient to cover all materials.
[out]collectionis the PxCollection instance that is to be used to serialize the PxMaterial instances referenced by the PxVehicleDrivableSurfaceToTireFrictionPairs instance.
[out]streamcontains the memory block for the binary serialized friction table.
Note
If a material has already been added to the collection with a PxSerialObjectId, it will not be added again.
If all materials have already been added to the collection with a PxSerialObjectId, it is legal to pass a NULL ptr for the materialIds array.
frictionTable references PxMaterial instances, which are serialized using PxCollection. The PxCollection instance may be used to serialize an entire scene that also references some or none of those material instances or particular objects in a scene or nothing at all. The complementary deserialize() function requires the same collection instance or more typically a deserialized copy of the collection to be passed as a function argument.
See also
deserializeFromBinary

◆ setTypePairFriction()

void physx::PxVehicleDrivableSurfaceToTireFrictionPairs::setTypePairFriction ( const PxU32  surfaceType,
const PxU32  tireType,
const PxReal  value 
)

Set the friction for a specified pair of tire type and drivable surface type.

Parameters
[in]surfaceTypedescribes the surface type
[in]tireTypedescribes the tire type.
[in]valuedescribes the friction coefficient for the combination of surface type and tire type.

◆ setup()

void physx::PxVehicleDrivableSurfaceToTireFrictionPairs::setup ( const PxU32  nbTireTypes,
const PxU32  nbSurfaceTypes,
const PxMaterial **  drivableSurfaceMaterials,
const PxVehicleDrivableSurfaceType *  drivableSurfaceTypes 
)

Set up a PxVehicleDrivableSurfaceToTireFrictionPairs instance for combinations of nbTireTypes tire types and nbSurfaceTypes surface types.

Parameters
[in]nbTireTypesis the number of different types of tire. This value must be less than or equal to maxNbTireTypes specified in allocate().
[in]nbSurfaceTypesis the number of different types of surface. This value must be less than or equal to maxNbSurfaceTypes specified in allocate().
[in]drivableSurfaceMaterialsis an array of PxMaterial pointers of length nbSurfaceTypes.
[in]drivableSurfaceTypesis an array of PxVehicleDrivableSurfaceType instances of length nbSurfaceTypes.
Note
If the pointer to the PxMaterial that touches the tire is found in drivableSurfaceMaterials[x] then the surface type is drivableSurfaceTypes[x].mType and the friction is the value that is set with setTypePairFriction(drivableSurfaceTypes[x].mType, PxVehicleTireData::mType, frictionValue).
A friction value of 1.0 will be assigned as default to each combination of tire and surface type. To override this use setTypePairFriction.
See also
release, setTypePairFriction, getTypePairFriction, PxVehicleTireData.mType

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