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

Class to define the scale at which simulation runs. Most simulation tolerances are calculated in terms of the values here. More...

#include <PxTolerancesScale.h>

Public Member Functions

PX_INLINE PxTolerancesScale (float defaultLength=1.0f, float defaultSpeed=10.0f)
 constructor sets to default
 
PX_INLINE bool isValid () const
 Returns true if the descriptor is valid.
 

Public Attributes

PxReal length
 The approximate size of objects in the simulation.
 
PxReal speed
 The typical magnitude of velocities of objects in simulation. This is used to estimate whether a contact should be treated as bouncing or resting based on its impact velocity, and a kinetic energy threshold below which the simulation may put objects to sleep.
 

Detailed Description

Class to define the scale at which simulation runs. Most simulation tolerances are calculated in terms of the values here.

Note
if you change the simulation scale, you will probably also wish to change the scene's default value of gravity, and stable simulation will probably require changes to the scene's bounceThreshold also.

Constructor & Destructor Documentation

◆ PxTolerancesScale()

PX_INLINE physx::PxTolerancesScale::PxTolerancesScale ( float  defaultLength = 1.0f,
float  defaultSpeed = 10.0f 
)

constructor sets to default

Parameters
[in]defaultLengthDefault length
[in]defaultSpeedDefault speed

Member Function Documentation

◆ isValid()

PX_INLINE bool physx::PxTolerancesScale::isValid ( ) const

Returns true if the descriptor is valid.

Returns
true if the current settings are valid (returns always true).

Member Data Documentation

◆ length

PxReal physx::PxTolerancesScale::length

The approximate size of objects in the simulation.

For simulating roughly human-sized in metric units, 1 is a good choice. If simulation is done in centimetres, use 100 instead. This is used to estimate certain length-related tolerances.

◆ speed

PxReal physx::PxTolerancesScale::speed

The typical magnitude of velocities of objects in simulation. This is used to estimate whether a contact should be treated as bouncing or resting based on its impact velocity, and a kinetic energy threshold below which the simulation may put objects to sleep.

For normal physical environments, a good choice is the approximate speed of an object falling under gravity for one second.


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