#include <PxArticulation.h>
Public Member Functions | |
virtual void | release ()=0 |
Deletes the articulation. | |
virtual PxScene * | getScene () const =0 |
Retrieves the scene which this articulation belongs to. | |
virtual void | setMaxProjectionIterations (PxU32 iterations)=0 |
sets maxProjectionIterations. | |
virtual PxU32 | getMaxProjectionIterations () const =0 |
gets maxProjectionIterations. | |
virtual void | setSeparationTolerance (PxReal tolerance)=0 |
sets separationTolerance. | |
virtual PxReal | getSeparationTolerance () const =0 |
gets separationTolerance. | |
virtual void | setInternalDriveIterations (PxU32 iterations)=0 |
sets the number of iterations used to compute the drive response to internal forces | |
virtual PxU32 | getInternalDriveIterations () const =0 |
gets internal driveIterations. | |
virtual void | setExternalDriveIterations (PxU32 iterations)=0 |
sets the number of iterations for drive response to external forces. | |
virtual PxU32 | getExternalDriveIterations () const =0 |
gets externalDriveIterations. | |
virtual void | setSolverIterationCounts (PxU32 minPositionIters, PxU32 minVelocityIters=1)=0 |
Sets the solver iteration counts for the articulation. | |
virtual void | getSolverIterationCounts (PxU32 &minPositionIters, PxU32 &minVelocityIters) const =0 |
Retrieves the solver iteration counts. | |
virtual bool | isSleeping () const =0 |
Returns true if this articulation is sleeping. | |
virtual void | setSleepThreshold (PxReal threshold)=0 |
Sets the mass-normalized energy threshold below which an articulation may go to sleep. | |
virtual PxReal | getSleepThreshold () const =0 |
Returns the mass-normalized energy below which an articulation may go to sleep. | |
virtual void | setStabilizationThreshold (PxReal threshold)=0 |
Sets the mass-normalized kinetic energy threshold below which an articulation may participate in stabilization. | |
virtual PxReal | getStabilizationThreshold () const =0 |
Returns the mass-normalized kinetic energy below which an articulation may participate in stabilization. | |
virtual void | setWakeCounter (PxReal wakeCounterValue)=0 |
Sets the wake counter for the articulation. | |
virtual PxReal | getWakeCounter () const =0 |
Returns the wake counter of the articulation. | |
virtual void | wakeUp ()=0 |
Wakes up the articulation if it is sleeping. | |
virtual void | putToSleep ()=0 |
Forces the articulation to sleep. | |
virtual PxArticulationLink * | createLink (PxArticulationLink *parent, const PxTransform &pose)=0 |
adds a link to the articulation with default attribute values. | |
virtual PxU32 | getNbLinks () const =0 |
returns the number of links in the articulation | |
virtual PxU32 | getLinks (PxArticulationLink **userBuffer, PxU32 bufferSize, PxU32 startIndex=0) const =0 |
returns the set of links in the articulation | |
virtual void | setName (const char *name)=0 |
Sets a name string for the object that can be retrieved with getName(). | |
virtual const char * | getName () const =0 |
Retrieves the name string set with setName(). | |
virtual PxBounds3 | getWorldBounds (float inflation=1.01f) const =0 |
Retrieves the axis aligned bounding box enclosing the articulation. | |
virtual PxAggregate * | getAggregate () const =0 |
Retrieves the aggregate the articulation might be a part of. | |
virtual PxArticulationDriveCache * | createDriveCache (PxReal compliance, PxU32 driveIterations) const =0 |
create a drive cache for applying impulses which are propagated to the entire articulation | |
virtual void | updateDriveCache (PxArticulationDriveCache &driveCache, PxReal compliance, PxU32 driveIterations) const =0 |
update a drive cache | |
virtual void | releaseDriveCache (PxArticulationDriveCache &driveCache) const =0 |
release a drive cache | |
virtual void | applyImpulse (PxArticulationLink *link, const PxArticulationDriveCache &driveCache, const PxVec3 &linearImpulse, const PxVec3 &angularImpulse)=0 |
apply an impulse to an entire articulation | |
virtual void | computeImpulseResponse (PxArticulationLink *link, PxVec3 &linearResponse, PxVec3 &angularResponse, const PxArticulationDriveCache &driveCache, const PxVec3 &linearImpulse, const PxVec3 &angularImpulse) const =0 |
determine the effect of applying an impulse to an entire articulation, without applying the impulse | |
virtual const char * | getConcreteTypeName () const |
Returns string name of dynamic type. | |
Public Attributes | |
void * | userData |
user can assign this to whatever, usually to create a 1:1 relationship with a user object. | |
Protected Member Functions | |
PX_INLINE | PxArticulation (PxType concreteType, PxBaseFlags baseFlags) |
PX_INLINE | PxArticulation (PxBaseFlags baseFlags) |
virtual | ~PxArticulation () |
virtual bool | isKindOf (const char *name) const |
Returns whether a given type name matches with the type of this instance. |
Articulations are more expensive to simulate than the equivalent collection of PxRigidDynamic and PxJoint structures, but because the dynamics solver treats each articulation as a single object, they are much less prone to separation and have better support for actuation. An articulation may have at most 64 links.
PX_INLINE PxArticulation::PxArticulation | ( | PxType | concreteType, | |
PxBaseFlags | baseFlags | |||
) | [inline, protected] |
PX_INLINE PxArticulation::PxArticulation | ( | PxBaseFlags | baseFlags | ) | [inline, protected] |
virtual PxArticulation::~PxArticulation | ( | ) | [inline, protected, virtual] |
virtual void PxArticulation::applyImpulse | ( | PxArticulationLink * | link, | |
const PxArticulationDriveCache & | driveCache, | |||
const PxVec3 & | linearImpulse, | |||
const PxVec3 & | angularImpulse | |||
) | [pure virtual] |
apply an impulse to an entire articulation
[in] | link | the link to which to apply the impulse |
[in] | driveCache | the drive cache |
[in] | linearImpulse | the linear impulse to apply |
[in] | angularImpulse | the angular impulse to apply |
virtual void PxArticulation::computeImpulseResponse | ( | PxArticulationLink * | link, | |
PxVec3 & | linearResponse, | |||
PxVec3 & | angularResponse, | |||
const PxArticulationDriveCache & | driveCache, | |||
const PxVec3 & | linearImpulse, | |||
const PxVec3 & | angularImpulse | |||
) | const [pure virtual] |
determine the effect of applying an impulse to an entire articulation, without applying the impulse
[in] | link | the link to which to apply the impulse |
[out] | linearResponse | the change in linear velocity of the articulation link |
[out] | angularResponse | the change in angular velocity of the articulation link |
[in] | driveCache | the drive cache |
[in] | linearImpulse | the linear impulse to apply |
[in] | angularImpulse | the angular impulse to apply |
virtual PxArticulationDriveCache* PxArticulation::createDriveCache | ( | PxReal | compliance, | |
PxU32 | driveIterations | |||
) | const [pure virtual] |
create a drive cache for applying impulses which are propagated to the entire articulation
[in] | compliance | the compliance value to use at all joints of the articulation. This is equivalent to the external compliance parameter for articulation joints, as the impulse is treated as an external force |
[in] | driveIterations | the number of iterations to use to evaluate the drive strengths |
virtual PxArticulationLink* PxArticulation::createLink | ( | PxArticulationLink * | parent, | |
const PxTransform & | pose | |||
) | [pure virtual] |
adds a link to the articulation with default attribute values.
[in] | parent | the parent link of the articulation. Should be NULL if (and only if) this is the root link |
[in] | pose | the initial pose of the new link. Must be a valid transform |
virtual PxAggregate* PxArticulation::getAggregate | ( | ) | const [pure virtual] |
Retrieves the aggregate the articulation might be a part of.
virtual const char* PxArticulation::getConcreteTypeName | ( | ) | const [inline, virtual] |
Returns string name of dynamic type.
Implements PxBase.
virtual PxU32 PxArticulation::getExternalDriveIterations | ( | ) | const [pure virtual] |
gets externalDriveIterations.
virtual PxU32 PxArticulation::getInternalDriveIterations | ( | ) | const [pure virtual] |
gets internal driveIterations.
virtual PxU32 PxArticulation::getLinks | ( | PxArticulationLink ** | userBuffer, | |
PxU32 | bufferSize, | |||
PxU32 | startIndex = 0 | |||
) | const [pure virtual] |
returns the set of links in the articulation
[in] | userBuffer | buffer into which to write an array of articulation link pointers |
[in] | bufferSize | the size of the buffer. If this is not large enough to contain all the pointers to links, only as many as will fit are written. |
[in] | startIndex | Index of first link pointer to be retrieved |
virtual PxU32 PxArticulation::getMaxProjectionIterations | ( | ) | const [pure virtual] |
gets maxProjectionIterations.
virtual const char* PxArticulation::getName | ( | ) | const [pure virtual] |
virtual PxU32 PxArticulation::getNbLinks | ( | ) | const [pure virtual] |
returns the number of links in the articulation
virtual PxScene* PxArticulation::getScene | ( | ) | const [pure virtual] |
Retrieves the scene which this articulation belongs to.
virtual PxReal PxArticulation::getSeparationTolerance | ( | ) | const [pure virtual] |
virtual PxReal PxArticulation::getSleepThreshold | ( | ) | const [pure virtual] |
Returns the mass-normalized energy below which an articulation may go to sleep.
virtual PxReal PxArticulation::getStabilizationThreshold | ( | ) | const [pure virtual] |
Returns the mass-normalized kinetic energy below which an articulation may participate in stabilization.
Articulations whose kinetic energy divided by their mass is above this threshold will not participate in stabilization.
virtual PxReal PxArticulation::getWakeCounter | ( | ) | const [pure virtual] |
Returns the wake counter of the articulation.
virtual PxBounds3 PxArticulation::getWorldBounds | ( | float | inflation = 1.01f |
) | const [pure virtual] |
Retrieves the axis aligned bounding box enclosing the articulation.
[in] | inflation | Scale factor for computed world bounds. Box extents are multiplied by this value. |
virtual bool PxArticulation::isKindOf | ( | const char * | superClass | ) | const [inline, protected, virtual] |
Returns whether a given type name matches with the type of this instance.
Reimplemented from PxBase.
References PxBase::isKindOf().
virtual bool PxArticulation::isSleeping | ( | ) | const [pure virtual] |
Returns true if this articulation is sleeping.
When an actor does not move for a period of time, it is no longer simulated in order to save time. This state is called sleeping. However, because the object automatically wakes up when it is either touched by an awake object, or a sleep-affecting property is changed by the user, the entire sleep mechanism should be transparent to the user.
An articulation can only go to sleep if all links are ready for sleeping. An articulation is guaranteed to be awake if at least one of the following holds:
If an articulation is asleep after the call to PxScene::fetchResults() returns, it is guaranteed that the poses of the links were not changed. You can use this information to avoid updating the transforms of associated of dependent objects.
virtual void PxArticulation::putToSleep | ( | ) | [pure virtual] |
Forces the articulation to sleep.
The articulation will stay asleep during the next simulation step if not touched by another non-sleeping actor.
It is invalid to use this method if the articulation has not been added to a scene already.
virtual void PxArticulation::release | ( | ) | [pure virtual] |
Deletes the articulation.
Do not keep a reference to the deleted instance.
Implements PxBase.
virtual void PxArticulation::releaseDriveCache | ( | PxArticulationDriveCache & | driveCache | ) | const [pure virtual] |
release a drive cache
[in] | driveCache | the drive cache to release |
virtual void PxArticulation::setExternalDriveIterations | ( | PxU32 | iterations | ) | [pure virtual] |
sets the number of iterations for drive response to external forces.
The drive model uses an iterative algorithm to determine the load on each joint of the articulation. This is the number of iterations to use when computing response of the drive to external forces.
[in] | iterations | the number of iterations used to compute the drive response to external forces. |
virtual void PxArticulation::setInternalDriveIterations | ( | PxU32 | iterations | ) | [pure virtual] |
sets the number of iterations used to compute the drive response to internal forces
The drive model uses an iterative algorithm to determine the load on each joint of the articulation. This is the number of iterations to use when computing response of the drive to internal forces.
[in] | iterations | the number of iterations used to compute the drive response to internal forces. |
virtual void PxArticulation::setMaxProjectionIterations | ( | PxU32 | iterations | ) | [pure virtual] |
sets maxProjectionIterations.
This is the maximum number of iterations to run projection on the articulation to bring the links back together if the separation tolerance is exceeded.
[in] | iterations | the maximum number of projection iterations Default: 4 |
virtual void PxArticulation::setName | ( | const char * | name | ) | [pure virtual] |
virtual void PxArticulation::setSeparationTolerance | ( | PxReal | tolerance | ) | [pure virtual] |
sets separationTolerance.
This is the maximum allowed separation of any joint in the articulation before projection is used
Default: 0.1f, scaled by the tolerance scale
[in] | tolerance | the separation tolerance for the articulation |
virtual void PxArticulation::setSleepThreshold | ( | PxReal | threshold | ) | [pure virtual] |
Sets the mass-normalized energy threshold below which an articulation may go to sleep.
The articulation will sleep if the energy of each body is below this threshold.
[in] | threshold | Energy below which an actor may go to sleep. Range: [0, PX_MAX_F32) |
virtual void PxArticulation::setSolverIterationCounts | ( | PxU32 | minPositionIters, | |
PxU32 | minVelocityIters = 1 | |||
) | [pure virtual] |
Sets the solver iteration counts for the articulation.
The solver iteration count determines how accurately joints and contacts are resolved. If you are having trouble with jointed bodies oscillating and behaving erratically, then setting a higher position iteration count may improve their stability.
If intersecting bodies are being depenetrated too violently, increase the number of velocity iterations. More velocity iterations will drive the relative exit velocity of the intersecting objects closer to the correct value given the restitution.
[in] | minPositionIters | Number of position iterations the solver should perform for this articulation. Range: [1,255] |
[in] | minVelocityIters | Number of velocity iterations the solver should perform for this articulation. Range: [1,255] |
virtual void PxArticulation::setStabilizationThreshold | ( | PxReal | threshold | ) | [pure virtual] |
Sets the mass-normalized kinetic energy threshold below which an articulation may participate in stabilization.
Articulation whose kinetic energy divided by their mass is above this threshold will not participate in stabilization.
This value has no effect if PxSceneFlag::eENABLE_STABILIZATION was not enabled on the PxSceneDesc.
Default: 0.01 * PxTolerancesScale::speed * PxTolerancesScale::speed
[in] | threshold | Energy below which an actor may participate in stabilization. Range: [0,inf) |
virtual void PxArticulation::setWakeCounter | ( | PxReal | wakeCounterValue | ) | [pure virtual] |
Sets the wake counter for the articulation.
The wake counter value determines the minimum amount of time until the articulation can be put to sleep. Please note that an articulation will not be put to sleep if the energy is above the specified threshold (see setSleepThreshold()) or if other awake objects are touching it.
[in] | wakeCounterValue | Wake counter value. Range: [0, PX_MAX_F32) |
virtual void PxArticulation::updateDriveCache | ( | PxArticulationDriveCache & | driveCache, | |
PxReal | compliance, | |||
PxU32 | driveIterations | |||
) | const [pure virtual] |
update a drive cache
[in] | driveCache | the drive cache to update |
[in] | compliance | the compliance value to use at all joints of the articulation. |
[in] | driveIterations | the number of iterations to use to evaluate the drive strengths |
virtual void PxArticulation::wakeUp | ( | ) | [pure virtual] |
Wakes up the articulation if it is sleeping.
The articulation will get woken up and might cause other touching objects to wake up as well during the next simulation step.
It is invalid to use this method if the articulation has not been added to a scene already.
void* PxArticulation::userData |
user can assign this to whatever, usually to create a 1:1 relationship with a user object.