RavEngine
Loading...
Searching...
No Matches
physx::PxConstraint Class Referenceabstract

A plugin class for implementing constraints. More...

#include <PxConstraint.h>

Inheritance diagram for physx::PxConstraint:
[legend]
Collaboration diagram for physx::PxConstraint:
[legend]

Public Member Functions

virtual void release ()=0
 Releases a PxConstraint instance.
 
virtual PxScene * getScene () const =0
 Retrieves the scene which this constraint belongs to.
 
virtual void getActors (PxRigidActor *&actor0, PxRigidActor *&actor1) const =0
 Retrieves the actors for this constraint.
 
virtual void setActors (PxRigidActor *actor0, PxRigidActor *actor1)=0
 Sets the actors for this constraint.
 
virtual void markDirty ()=0
 Notify the scene that the constraint shader data has been updated by the application.
 
virtual PxConstraintFlags getFlags () const =0
 Retrieve the flags for this constraint.
 
virtual void setFlags (PxConstraintFlags flags)=0
 Set the flags for this constraint.
 
virtual void setFlag (PxConstraintFlag::Enum flag, bool value)=0
 Set a flag for this constraint.
 
virtual void getForce (PxVec3 &linear, PxVec3 &angular) const =0
 Retrieve the constraint force most recently applied to maintain this constraint.
 
virtual bool isValid () const =0
 whether the constraint is valid.
 
virtual void setBreakForce (PxReal linear, PxReal angular)=0
 Set the break force and torque thresholds for this constraint.
 
virtual void getBreakForce (PxReal &linear, PxReal &angular) const =0
 Retrieve the constraint break force and torque thresholds.
 
virtual void setMinResponseThreshold (PxReal threshold)=0
 Set the minimum response threshold for a constraint row.
 
virtual PxReal getMinResponseThreshold () const =0
 Retrieve the constraint break force and torque thresholds.
 
virtual void * getExternalReference (PxU32 &typeID)=0
 Fetch external owner of the constraint.
 
virtual void setConstraintFunctions (PxConstraintConnector &connector, const PxConstraintShaderTable &shaders)=0
 Set the constraint functions for this constraint.
 
virtual const char * getConcreteTypeName () const PX_OVERRIDE
 Returns string name of dynamic type.
 
- Public Member Functions inherited from physx::PxBase
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_FORCE_INLINE PxType getConcreteType () const
 Returns concrete type of object.
 
PX_FORCE_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag

 
PX_FORCE_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags

 
PX_FORCE_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags.
 
virtual bool isReleasable () const
 Whether the object is subordinate.
 

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 PxConstraint (PxType concreteType, PxBaseFlags baseFlags)
 
PX_INLINE PxConstraint (PxBaseFlags baseFlags)
 
virtual bool isKindOf (const char *name) const PX_OVERRIDE
 Returns whether a given type name matches with the type of this instance.
 
- Protected Member Functions inherited from physx::PxBase
PX_INLINE PxBase (PxType concreteType, PxBaseFlags baseFlags)
 Constructor setting concrete type and base flags.
 
PX_INLINE PxBase (PxBaseFlags baseFlags)
 Deserialization constructor setting base flags.
 
virtual ~PxBase ()
 Destructor.
 
template<class T >
bool typeMatch () const
 

Additional Inherited Members

- Protected Attributes inherited from physx::PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 
PxU32 mBuiltInRefCount
 

Detailed Description

A plugin class for implementing constraints.

See also
PxPhysics.createConstraint

Member Function Documentation

◆ getActors()

virtual void physx::PxConstraint::getActors ( PxRigidActor *&  actor0,
PxRigidActor *&  actor1 
) const
pure virtual

Retrieves the actors for this constraint.

Parameters
[out]actor0a reference to the pointer for the first actor
[out]actor1a reference to the pointer for the second actor
See also
PxActor

Implemented in physx::NpConstraint.

◆ getBreakForce()

virtual void physx::PxConstraint::getBreakForce ( PxReal &  linear,
PxReal &  angular 
) const
pure virtual

Retrieve the constraint break force and torque thresholds.

Parameters
[out]linearthe linear break threshold
[out]angularthe angular break threshold

Implemented in physx::NpConstraint.

◆ getConcreteTypeName()

virtual const char * physx::PxConstraint::getConcreteTypeName ( ) const
inlinevirtual

Returns string name of dynamic type.

Returns
Class name of most derived type of this object.

Implements physx::PxBase.

◆ getExternalReference()

virtual void * physx::PxConstraint::getExternalReference ( PxU32 &  typeID)
pure virtual

Fetch external owner of the constraint.

Provides a reference to the external owner of a constraint and a unique owner type ID.

Parameters
[out]typeIDUnique type identifier of the external object.
Returns
Reference to the external object which owns the constraint.
See also
PxConstraintConnector.getExternalReference()

Implemented in physx::NpConstraint.

◆ getFlags()

virtual PxConstraintFlags physx::PxConstraint::getFlags ( ) const
pure virtual

Retrieve the flags for this constraint.

Returns
the constraint flags
See also
PxConstraintFlags

Implemented in physx::NpConstraint.

◆ getForce()

virtual void physx::PxConstraint::getForce ( PxVec3 &  linear,
PxVec3 &  angular 
) const
pure virtual

Retrieve the constraint force most recently applied to maintain this constraint.

Note
It is not allowed to use this method while the simulation is running (except during PxScene::collide(), in PxContactModifyCallback or in contact report callbacks).
Parameters
[out]linearthe constraint force
[out]angularthe constraint torque

Implemented in physx::NpConstraint.

◆ getMinResponseThreshold()

virtual PxReal physx::PxConstraint::getMinResponseThreshold ( ) const
pure virtual

Retrieve the constraint break force and torque thresholds.

Returns
the minimum response threshold for a constraint row

Implemented in physx::NpConstraint.

◆ getScene()

virtual PxScene * physx::PxConstraint::getScene ( ) const
pure virtual

Retrieves the scene which this constraint belongs to.

Returns
Owner Scene. NULL if not part of a scene.
See also
PxScene

Implemented in physx::NpConstraint.

◆ isKindOf()

virtual bool physx::PxConstraint::isKindOf ( const char *  superClass) const
inlineprotectedvirtual

Returns whether a given type name matches with the type of this instance.

Reimplemented from physx::PxBase.

◆ isValid()

virtual bool physx::PxConstraint::isValid ( ) const
pure virtual

whether the constraint is valid.

A constraint is valid if it has at least one dynamic rigid body or articulation link. A constraint that is not valid may not be inserted into a scene, and therefore a static actor to which an invalid constraint is attached may not be inserted into a scene.

Invalid constraints arise only when an actor to which the constraint is attached has been deleted.

Implemented in physx::NpConstraint.

◆ markDirty()

virtual void physx::PxConstraint::markDirty ( )
pure virtual

Notify the scene that the constraint shader data has been updated by the application.

Implemented in physx::NpConstraint.

◆ release()

virtual void physx::PxConstraint::release ( )
pure virtual

Releases a PxConstraint instance.

Note
This call does not wake up the connected rigid bodies.
See also
PxPhysics.createConstraint, PxBase.release()

Implements physx::PxBase.

Implemented in physx::NpConstraint.

◆ setActors()

virtual void physx::PxConstraint::setActors ( PxRigidActor *  actor0,
PxRigidActor *  actor1 
)
pure virtual

Sets the actors for this constraint.

Parameters
[in]actor0a reference to the pointer for the first actor
[in]actor1a reference to the pointer for the second actor
See also
PxActor

Implemented in physx::NpConstraint.

◆ setBreakForce()

virtual void physx::PxConstraint::setBreakForce ( PxReal  linear,
PxReal  angular 
)
pure virtual

Set the break force and torque thresholds for this constraint.

If either the force or torque measured at the constraint exceed these thresholds the constraint will break.

Parameters
[in]linearthe linear break threshold
[in]angularthe angular break threshold

Implemented in physx::NpConstraint.

◆ setConstraintFunctions()

virtual void physx::PxConstraint::setConstraintFunctions ( PxConstraintConnector &  connector,
const PxConstraintShaderTable &  shaders 
)
pure virtual

Set the constraint functions for this constraint.

Parameters
[in]connectorthe constraint connector object by which the SDK communicates with the constraint.
[in]shadersthe shader table for the constraint
See also
PxConstraintConnector PxConstraintSolverPrep PxConstraintProject PxConstraintVisualize

Implemented in physx::NpConstraint.

◆ setFlag()

virtual void physx::PxConstraint::setFlag ( PxConstraintFlag::Enum  flag,
bool  value 
)
pure virtual

Set a flag for this constraint.

Parameters
[in]flagthe constraint flag
[in]valuethe new value of the flag
See also
PxConstraintFlags

Implemented in physx::NpConstraint.

◆ setFlags()

virtual void physx::PxConstraint::setFlags ( PxConstraintFlags  flags)
pure virtual

Set the flags for this constraint.

Parameters
[in]flagsthe new constraint flags

default: PxConstraintFlag::eDRIVE_LIMITS_ARE_FORCES

See also
PxConstraintFlags

Implemented in physx::NpConstraint.

◆ setMinResponseThreshold()

virtual void physx::PxConstraint::setMinResponseThreshold ( PxReal  threshold)
pure virtual

Set the minimum response threshold for a constraint row.

When using mass modification for a joint or infinite inertia for a jointed body, very stiff solver constraints can be generated which can destabilize simulation. Setting this value to a small positive value (e.g. 1e-8) will cause constraint rows to be ignored if very large changes in impulses will generate only small changes in velocity. When setting this value, also set PxConstraintFlag::eDISABLE_PREPROCESSING. The solver accuracy for this joint may be reduced.

Parameters
[in]thresholdthe minimum response threshold
See also
PxConstraintFlag::eDISABLE_PREPROCESSING

Implemented in physx::NpConstraint.


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