Public Member Functions | Public Attributes | Protected Member Functions | List of all members
PxArticulation Class Referenceabstract

a tree structure of bodies connected by joints that is treated as a unit by the dynamics solver More...

#include <PxArticulation.h>

Inheritance diagram for PxArticulation:
Inheritance graph
[legend]
Collaboration diagram for PxArticulation:
Collaboration graph
[legend]

Public Member Functions

virtual void release ()=0
 Deletes the articulation. More...
 
virtual PxScenegetScene () const =0
 Retrieves the scene which this articulation belongs to. More...
 
virtual void setMaxProjectionIterations (PxU32 iterations)=0
 sets maxProjectionIterations. More...
 
virtual PxU32 getMaxProjectionIterations () const =0
 gets maxProjectionIterations. More...
 
virtual void setSeparationTolerance (PxReal tolerance)=0
 sets separationTolerance. More...
 
virtual PxReal getSeparationTolerance () const =0
 gets separationTolerance. More...
 
virtual void setInternalDriveIterations (PxU32 iterations)=0
 sets the number of iterations used to compute the drive response to internal forces More...
 
virtual PxU32 getInternalDriveIterations () const =0
 gets internal driveIterations. More...
 
virtual void setExternalDriveIterations (PxU32 iterations)=0
 sets the number of iterations for drive response to external forces. More...
 
virtual PxU32 getExternalDriveIterations () const =0
 gets externalDriveIterations. More...
 
virtual void setSolverIterationCounts (PxU32 minPositionIters, PxU32 minVelocityIters=1)=0
 Sets the solver iteration counts for the articulation. More...
 
virtual void getSolverIterationCounts (PxU32 &minPositionIters, PxU32 &minVelocityIters) const =0
 Retrieves the solver iteration counts. More...
 
virtual bool isSleeping () const =0
 Returns true if this articulation is sleeping. More...
 
virtual void setSleepThreshold (PxReal threshold)=0
 Sets the mass-normalized energy threshold below which an articulation may go to sleep. More...
 
virtual PxReal getSleepThreshold () const =0
 Returns the mass-normalized energy below which an articulation may go to sleep. More...
 
virtual void setStabilizationThreshold (PxReal threshold)=0
 Sets the mass-normalized kinetic energy threshold below which an articulation may participate in stabilization. More...
 
virtual PxReal getStabilizationThreshold () const =0
 Returns the mass-normalized kinetic energy below which an articulation may participate in stabilization. More...
 
virtual void setWakeCounter (PxReal wakeCounterValue)=0
 Sets the wake counter for the articulation. More...
 
virtual PxReal getWakeCounter () const =0
 Returns the wake counter of the articulation. More...
 
virtual void wakeUp ()=0
 Wakes up the articulation if it is sleeping. More...
 
virtual void putToSleep ()=0
 Forces the articulation to sleep. More...
 
virtual PxArticulationLinkcreateLink (PxArticulationLink *parent, const PxTransform &pose)=0
 adds a link to the articulation with default attribute values. More...
 
virtual PxU32 getNbLinks () const =0
 returns the number of links in the articulation More...
 
virtual PxU32 getLinks (PxArticulationLink **userBuffer, PxU32 bufferSize) const =0
 returns the set of links in the articulation More...
 
virtual void setName (const char *name)=0
 Sets a name string for the object that can be retrieved with getName(). More...
 
virtual const char * getName () const =0
 Retrieves the name string set with setName(). More...
 
virtual PxBounds3 getWorldBounds (float inflation=1.01f) const =0
 Retrieves the axis aligned bounding box enclosing the articulation. More...
 
virtual PxAggregategetAggregate () const =0
 Retrieves the aggregate the articulation might be a part of. More...
 
virtual PxArticulationDriveCachecreateDriveCache (PxReal compliance, PxU32 driveIterations) const =0
 create a drive cache for applying impulses which are propagated to the entire articulation More...
 
virtual void updateDriveCache (PxArticulationDriveCache &driveCache, PxReal compliance, PxU32 driveIterations) const =0
 update a drive cache More...
 
virtual void releaseDriveCache (PxArticulationDriveCache &driveCache) const =0
 release a drive cache More...
 
virtual void applyImpulse (PxArticulationLink *link, const PxArticulationDriveCache &driveCache, const PxVec3 &linearImpulse, const PxVec3 &angularImpulse)=0
 apply an impulse to an entire articulation More...
 
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 More...
 
virtual const char * getConcreteTypeName () const
 Returns string name of dynamic type. More...
 
- Public Member Functions inherited from PxBase
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_INLINE PxType getConcreteType () const
 Returns concrete type of object. More...
 
PX_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag. More...
 
PX_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags. More...
 
PX_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags. More...
 
virtual bool isReleasable () const
 Whether the object is subordinate. More...
 

Public Attributes

void * userData
 user can assign this to whatever, usually to create a 1:1 relationship with a user object. More...
 

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. More...
 
- 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
 

Additional Inherited Members

- Protected Attributes inherited from PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 

Detailed Description

a tree structure of bodies connected by joints that is treated as a unit by the dynamics solver

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.

See Also
PxArticulationJoint PxArticulationLink PxPhysics.createArticulation

Constructor & Destructor Documentation

PX_INLINE PxArticulation::PxArticulation ( PxType  concreteType,
PxBaseFlags  baseFlags 
)
inlineprotected
PX_INLINE PxArticulation::PxArticulation ( PxBaseFlags  baseFlags)
inlineprotected
virtual PxArticulation::~PxArticulation ( )
inlineprotectedvirtual

Member Function Documentation

virtual void PxArticulation::applyImpulse ( PxArticulationLink link,
const PxArticulationDriveCache driveCache,
const PxVec3 linearImpulse,
const PxVec3 angularImpulse 
)
pure virtual

apply an impulse to an entire articulation

Parameters
[in]linkthe link to which to apply the impulse
[in]driveCachethe drive cache
[in]linearImpulsethe linear impulse to apply
[in]angularImpulsethe angular impulse to apply
See Also
computeImpulseResponse
Note
this call may only be made on articulations that are in a scene, and may not be made during simulation
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

Parameters
[in]linkthe link to which to apply the impulse
[out]linearResponsethe change in linear velocity of the articulation link
[out]angularResponsethe change in angular velocity of the articulation link
[in]driveCachethe drive cache
[in]linearImpulsethe linear impulse to apply
[in]angularImpulsethe angular impulse to apply
See Also
applyImpulse

This call will wake up the articulation if it is asleep.

Note
this call may only be made on articulations that are in a scene, and may not be made during simulation
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

Parameters
[in]compliancethe 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]driveIterationsthe number of iterations to use to evaluate the drive strengths
Returns
a drive cache
See Also
PxArticulationDriveCache updateDriveCache releaseDriveCache applyImpulse computeImpulseResponse
Note
this call may only be made on articulations that are in a scene, and may not be made during simulation
virtual PxArticulationLink* PxArticulation::createLink ( PxArticulationLink parent,
const PxTransform pose 
)
pure virtual

adds a link to the articulation with default attribute values.

Parameters
[in]parentthe parent link of the articulation. Should be NULL if (and only if) this is the root link
[in]posethe pose of the new link
Returns
the new link, or NULL if the link cannot be created because the articulation has reached its maximum link count
See Also
PxArticulationLink
virtual PxAggregate* PxArticulation::getAggregate ( ) const
pure virtual

Retrieves the aggregate the articulation might be a part of.

Returns
The aggregate the articulation is a part of, or NULL if the articulation does not belong to an aggregate.
See Also
PxAggregate
virtual const char* PxArticulation::getConcreteTypeName ( ) const
inlinevirtual

Returns string name of dynamic type.

Returns
Class name of most derived type of this object.

Reimplemented from PxBase.

virtual PxU32 PxArticulation::getExternalDriveIterations ( ) const
pure virtual

gets externalDriveIterations.

Returns
the number of iterations used to compute the drive response to external forces
See Also
setExternalDriveIterations()
virtual PxU32 PxArticulation::getInternalDriveIterations ( ) const
pure virtual

gets internal driveIterations.

Returns
the number of iterations used to compute the drive response to internal forces
See Also
setInternalDriveIterations()
virtual PxU32 PxArticulation::getLinks ( PxArticulationLink **  userBuffer,
PxU32  bufferSize 
) const
pure virtual

returns the set of links in the articulation

Parameters
[in]userBufferbuffer into which to write an array of articulation link pointers
[in]bufferSizethe 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.
Returns
the number of links written into the buffer.
See Also
PxsArticulationLink
virtual PxU32 PxArticulation::getMaxProjectionIterations ( ) const
pure virtual

gets maxProjectionIterations.

Returns
the maximum number of projection iterations
See Also
setMaxProjectionIterations()
virtual const char* PxArticulation::getName ( ) const
pure virtual

Retrieves the name string set with setName().

Returns
Name string associated with object.
See Also
setName()
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.

Returns
Owner Scene. NULL if not part of a scene.
See Also
PxScene
virtual PxReal PxArticulation::getSeparationTolerance ( ) const
pure virtual

gets separationTolerance.

Returns
the separation tolerance
See Also
setSeparationTolerance()
virtual PxReal PxArticulation::getSleepThreshold ( ) const
pure virtual

Returns the mass-normalized energy below which an articulation may go to sleep.

Returns
The energy threshold for sleeping.
See Also
isSleeping() wakeUp() putToSleep() setSleepThreshold()
virtual void PxArticulation::getSolverIterationCounts ( PxU32 minPositionIters,
PxU32 minVelocityIters 
) const
pure virtual

Retrieves the solver iteration counts.

See Also
setSolverIterationCounts()
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.

Returns
The energy threshold for participating in stabilization.
See Also
setStabilizationThreshold() PxSceneFlag::eENABLE_STABILIZATION
virtual PxReal PxArticulation::getWakeCounter ( ) const
pure virtual

Returns the wake counter of the articulation.

Returns
The wake counter of the articulation.
See Also
isSleeping() setWakeCounter()
virtual PxBounds3 PxArticulation::getWorldBounds ( float  inflation = 1.01f) const
pure virtual

Retrieves the axis aligned bounding box enclosing the articulation.

Parameters
[in]inflationScale factor for computed world bounds. Box extents are multiplied by this value.
Returns
The articulation's bounding box.
See Also
PxBounds3
virtual bool PxArticulation::isKindOf ( const char *  superClass) const
inlineprotectedvirtual

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:

  • The wake counter is positive (see setWakeCounter()).
  • The linear or angular velocity of any link is non-zero.
  • A non-zero force or torque has been applied to the articulation or any of its links.

If an articulation is sleeping, the following state is guaranteed:

  • The wake counter is zero.
  • The linear and angular velocity of all links is zero.
  • There is no force update pending.

When an articulation gets inserted into a scene, it will be considered asleep if all the points above hold, else it will be treated as awake.

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.

Note
It is invalid to use this method if the articulation has not been added to a scene already.
Returns
True if the articulation is sleeping.
See Also
isSleeping() wakeUp() putToSleep() getSleepThreshold()
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.

Note
This will set any applied force, the velocity and the wake counter of all bodies in the articulation to zero.
It is invalid to use this method if the articulation has not been added to a scene already.
See Also
isSleeping() wakeUp()
virtual void PxArticulation::release ( )
pure virtual

Deletes the articulation.

Do not keep a reference to the deleted instance.

See Also
PxPhysics.createArticulation()

Implements PxBase.

virtual void PxArticulation::releaseDriveCache ( PxArticulationDriveCache driveCache) const
pure virtual

release a drive cache

Parameters
[in]driveCachethe drive cache to release
See Also
createDriveCache updateDriveCache
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.

Parameters
[in]iterationsthe number of iterations used to compute the drive response to external forces.

Default: 4

See Also
getExternalDriveIterations()
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.

Parameters
[in]iterationsthe number of iterations used to compute the drive response to internal forces.

Default: 4

See Also
getInternalDriveIterations()
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.

Parameters
[in]iterationsthe maximum number of projection iterations Default: 4
See Also
getMaxProjectionIterations()
virtual void PxArticulation::setName ( const char *  name)
pure virtual

Sets a name string for the object that can be retrieved with getName().

This is for debugging and is not used by the SDK. The string is not copied by the SDK, only the pointer is stored.

Parameters
[in]nameString to set the objects name to.
See Also
getName()
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

Parameters
[in]tolerancethe separation tolerance for the articulation
See Also
getSeparationTolerance()
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.

Parameters
[in]thresholdEnergy below which an actor may go to sleep. Range: [0, PX_MAX_F32)
See Also
isSleeping() getSleepThreshold() wakeUp() putToSleep()
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.

Parameters
[in]minPositionItersNumber of position iterations the solver should perform for this articulation. Range: [1,255]
[in]minVelocityItersNumber of velocity iterations the solver should perform for this articulation. Range: [1,255]
See Also
getSolverIterationCounts()
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

Parameters
[in]thresholdEnergy below which an actor may participate in stabilization. Range: (0,inf]
See Also
getStabilizationThreshold() PxSceneFlag::eENABLE_STABILIZATION
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.

Note
Passing in a positive value will wake the articulation up automatically.

Default: 0.4 (which corresponds to 20 frames for a time step of 0.02)

Parameters
[in]wakeCounterValueWake counter value. Range: [0, PX_MAX_F32)
See Also
isSleeping() getWakeCounter()
virtual void PxArticulation::updateDriveCache ( PxArticulationDriveCache driveCache,
PxReal  compliance,
PxU32  driveIterations 
) const
pure virtual

update a drive cache

Parameters
[in]driveCachethe drive cache to update
[in]compliancethe compliance value to use at all joints of the articulation.
[in]driveIterationsthe number of iterations to use to evaluate the drive strengths
Returns
a drive cache
See Also
releaseDriveCache createDriveCache applyImpulse computeImpulseResponse
Note
this call may only be made on articulations that are in a scene, and may not be made during simulation
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.

Note
This will set the wake counter of the articulation to the value specified in PxSceneDesc::wakeCounterResetValue.
It is invalid to use this method if the articulation has not been added to a scene already.
See Also
isSleeping() putToSleep()

Member Data Documentation

void* PxArticulation::userData

user can assign this to whatever, usually to create a 1:1 relationship with a user object.


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


Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com