PxD6Joint Class Referenceabstract

A D6 joint is a general constraint between two actors. More...

#include <PxD6Joint.h>

Inheritance diagram for PxD6Joint:
Collaboration diagram for PxD6Joint:

Public Member Functions

virtual void setMotion (PxD6Axis::Enum axis, PxD6Motion::Enum type)=0
 Set the motion type around the specified axis. More...
 
virtual PxD6Motion::Enum getMotion (PxD6Axis::Enum axis) const =0
 Get the motion type around the specified axis. More...
 
virtual PxReal getTwistAngle () const =0
 get the twist angle of the joint, in the range (-2*Pi, 2*Pi] More...
 
PX_DEPRECATED PX_FORCE_INLINE PxReal getTwist () const
 get the twist angle of the joint More...
 
virtual PxReal getSwingYAngle () const =0
 get the swing angle of the joint from the Y axis More...
 
virtual PxReal getSwingZAngle () const =0
 get the swing angle of the joint from the Z axis More...
 
virtual void setDistanceLimit (const PxJointLinearLimit &limit)=0
 Set the distance limit for the joint. More...
 
virtual PxJointLinearLimit getDistanceLimit () const =0
 Get the distance limit for the joint. More...
 
PX_DEPRECATED PX_FORCE_INLINE void setLinearLimit (const PxJointLinearLimit &limit)
 
PX_DEPRECATED PX_FORCE_INLINE PxJointLinearLimit getLinearLimit () const
 
virtual void setLinearLimit (PxD6Axis::Enum axis, const PxJointLinearLimitPair &limit)=0
 Set the linear limit for a given linear axis. More...
 
virtual PxJointLinearLimitPair getLinearLimit (PxD6Axis::Enum axis) const =0
 Get the linear limit for a given linear axis. More...
 
virtual void setTwistLimit (const PxJointAngularLimitPair &limit)=0
 Set the twist limit for the joint. More...
 
virtual PxJointAngularLimitPair getTwistLimit () const =0
 Get the twist limit for the joint. More...
 
virtual void setSwingLimit (const PxJointLimitCone &limit)=0
 Set the swing cone limit for the joint. More...
 
virtual PxJointLimitCone getSwingLimit () const =0
 Get the cone limit for the joint. More...
 
virtual void setPyramidSwingLimit (const PxJointLimitPyramid &limit)=0
 Set a pyramidal swing limit for the joint. More...
 
virtual PxJointLimitPyramid getPyramidSwingLimit () const =0
 Get the pyramidal swing limit for the joint. More...
 
virtual void setDrive (PxD6Drive::Enum index, const PxD6JointDrive &drive)=0
 Set the drive parameters for the specified drive type. More...
 
virtual PxD6JointDrive getDrive (PxD6Drive::Enum index) const =0
 Get the drive parameters for the specified drive type. More...
 
virtual void setDrivePosition (const PxTransform &pose, bool autowake=true)=0
 Set the drive goal pose. More...
 
virtual PxTransform getDrivePosition () const =0
 Get the drive goal pose. More...
 
virtual void setDriveVelocity (const PxVec3 &linear, const PxVec3 &angular, bool autowake=true)=0
 Set the target goal velocity for drive. More...
 
virtual void getDriveVelocity (PxVec3 &linear, PxVec3 &angular) const =0
 Get the target goal velocity for joint drive. More...
 
virtual void setProjectionLinearTolerance (PxReal tolerance)=0
 Set the linear tolerance threshold for projection. Projection is enabled if PxConstraintFlag::ePROJECTION is set for the joint. More...
 
virtual PxReal getProjectionLinearTolerance () const =0
 Get the linear tolerance threshold for projection. More...
 
virtual void setProjectionAngularTolerance (PxReal tolerance)=0
 Set the angular tolerance threshold for projection. Projection is enabled if PxConstraintFlag::ePROJECTION is set for the joint. More...
 
virtual PxReal getProjectionAngularTolerance () const =0
 Get the angular tolerance threshold for projection. More...
 
virtual const char * getConcreteTypeName () const
 Returns string name of PxD6Joint, used for serialization. More...
 
- Public Member Functions inherited from PxJoint
virtual void setActors (PxRigidActor *actor0, PxRigidActor *actor1)=0
 Set the actors for this joint. More...
 
virtual void getActors (PxRigidActor *&actor0, PxRigidActor *&actor1) const =0
 Get the actors for this joint. More...
 
virtual void setLocalPose (PxJointActorIndex::Enum actor, const PxTransform &localPose)=0
 Set the joint local pose for an actor. More...
 
virtual PxTransform getLocalPose (PxJointActorIndex::Enum actor) const =0
 get the joint local pose for an actor. More...
 
virtual PxTransform getRelativeTransform () const =0
 get the relative pose for this joint More...
 
virtual PxVec3 getRelativeLinearVelocity () const =0
 get the relative linear velocity of the joint More...
 
virtual PxVec3 getRelativeAngularVelocity () const =0
 get the relative angular velocity of the joint More...
 
virtual void setBreakForce (PxReal force, PxReal torque)=0
 set the break force for this joint. More...
 
virtual void getBreakForce (PxReal &force, PxReal &torque) const =0
 get the break force for this joint. More...
 
virtual void setConstraintFlags (PxConstraintFlags flags)=0
 set the constraint flags for this joint. More...
 
virtual void setConstraintFlag (PxConstraintFlag::Enum flag, bool value)=0
 set a constraint flags for this joint to a specified value. More...
 
virtual PxConstraintFlags getConstraintFlags () const =0
 get the constraint flags for this joint. More...
 
virtual void setInvMassScale0 (PxReal invMassScale)=0
 set the inverse mass scale for actor0. More...
 
virtual PxReal getInvMassScale0 () const =0
 get the inverse mass scale for actor0. More...
 
virtual void setInvInertiaScale0 (PxReal invInertiaScale)=0
 set the inverse inertia scale for actor0. More...
 
virtual PxReal getInvInertiaScale0 () const =0
 get the inverse inertia scale for actor0. More...
 
virtual void setInvMassScale1 (PxReal invMassScale)=0
 set the inverse mass scale for actor1. More...
 
virtual PxReal getInvMassScale1 () const =0
 get the inverse mass scale for actor1. More...
 
virtual void setInvInertiaScale1 (PxReal invInertiaScale)=0
 set the inverse inertia scale for actor1. More...
 
virtual PxReal getInvInertiaScale1 () const =0
 get the inverse inertia scale for actor1. More...
 
virtual PxConstraintgetConstraint () const =0
 Retrieves the PxConstraint corresponding to this joint. 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 void release ()=0
 Deletes the joint. More...
 
virtual PxScenegetScene () const =0
 Retrieves the scene which this joint belongs to. More...
 
- Public Member Functions inherited from PxBase
template<class T >
T * is ()
 
template<class T >
const T * is () const
 
PX_FORCE_INLINE PxType getConcreteType () const
 Returns concrete type of object. More...
 
PX_FORCE_INLINE void setBaseFlag (PxBaseFlag::Enum flag, bool value)
 Set PxBaseFlag. More...
 
PX_FORCE_INLINE void setBaseFlags (PxBaseFlags inFlags)
 Set PxBaseFlags. More...
 
PX_FORCE_INLINE PxBaseFlags getBaseFlags () const
 Returns PxBaseFlags. More...
 
virtual bool isReleasable () const
 Whether the object is subordinate. More...
 

Protected Member Functions

PX_INLINE PxD6Joint (PxType concreteType, PxBaseFlags baseFlags)
 Constructor. More...
 
PX_INLINE PxD6Joint (PxBaseFlags baseFlags)
 Deserialization constructor. More...
 
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 PxJoint
virtual ~PxJoint ()
 
PX_INLINE PxJoint (PxType concreteType, PxBaseFlags baseFlags)
 Constructor. More...
 
PX_INLINE PxJoint (PxBaseFlags baseFlags)
 Deserialization constructor. 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

- Static Public Member Functions inherited from PxJoint
static void getBinaryMetaData (PxOutputStream &stream)
 Put class meta data in stream, used for serialization. More...
 
- Public Attributes inherited from PxJoint
void * userData
 user can assign this to whatever, usually to create a 1:1 relationship with a user object. More...
 
- Protected Attributes inherited from PxBase
PxType mConcreteType
 
PxBaseFlags mBaseFlags
 

Detailed Description

A D6 joint is a general constraint between two actors.

It allows the application to individually define the linear and rotational degrees of freedom, and also to configure a variety of limits and driven degrees of freedom.

By default all degrees of freedom are locked. So to create a prismatic joint with free motion along the x-axis:

...
joint->setMotion(PxD6Axis::eX, PxD6JointMotion::eFREE);
...

Or a Revolute joint with motion free allowed around the x-axis:

...
joint->setMotion(PxD6Axis::eTWIST, PxD6JointMotion::eFREE);
...

Degrees of freedom may also be set to limited instead of locked.

There are two different kinds of linear limits available. The first kind is a single limit value for all linear degrees of freedom, which may act as a linear, circular, or spherical limit depending on which degrees of freedom are limited. This is similar to a distance limit. Then, the second kind supports a pair of limit values for each linear axis, which can be used to implement a traditional prismatic joint for example.

If the twist degree of freedom is limited, is supports upper and lower limits. The two swing degrees of freedom are limited with a cone limit.

See also
PxD6JointCreate() PxJoint

Constructor & Destructor Documentation

◆ PxD6Joint() [1/2]

PX_INLINE PxD6Joint::PxD6Joint ( PxType  concreteType,
PxBaseFlags  baseFlags 
)
inlineprotected

Constructor.

◆ PxD6Joint() [2/2]

PX_INLINE PxD6Joint::PxD6Joint ( PxBaseFlags  baseFlags)
inlineprotected

Deserialization constructor.

Member Function Documentation

◆ getConcreteTypeName()

virtual const char* PxD6Joint::getConcreteTypeName ( ) const
inlinevirtual

Returns string name of PxD6Joint, used for serialization.

Implements PxBase.

◆ getDistanceLimit()

virtual PxJointLinearLimit PxD6Joint::getDistanceLimit ( ) const
pure virtual

Get the distance limit for the joint.

Returns
the distance limit structure
See also
setDistanceLimit() PxJointLinearLimit

◆ getDrive()

virtual PxD6JointDrive PxD6Joint::getDrive ( PxD6Drive::Enum  index) const
pure virtual

Get the drive parameters for the specified drive type.

Parameters
[in]indexthe specified drive type
See also
setDrive() PxD6JointDrive

◆ getDrivePosition()

virtual PxTransform PxD6Joint::getDrivePosition ( ) const
pure virtual

Get the drive goal pose.

See also
getDrivePosition()

◆ getDriveVelocity()

virtual void PxD6Joint::getDriveVelocity ( PxVec3 linear,
PxVec3 angular 
) const
pure virtual

Get the target goal velocity for joint drive.

Parameters
[in]linearThe goal velocity for linear drive
[in]angularThe goal velocity for angular drive
See also
setDriveVelocity()

◆ getLinearLimit() [1/2]

PX_DEPRECATED PX_FORCE_INLINE PxJointLinearLimit PxD6Joint::getLinearLimit ( ) const
inline
Deprecated:
Use getDistanceLimit instead. Deprecated since PhysX version 4.0

◆ getLinearLimit() [2/2]

virtual PxJointLinearLimitPair PxD6Joint::getLinearLimit ( PxD6Axis::Enum  axis) const
pure virtual

Get the linear limit for a given linear axis.

Parameters
[in]axisThe limited linear axis (must be PxD6Axis::eX, PxD6Axis::eY or PxD6Axis::eZ)
Returns
the linear limit pair structure from desired axis
See also
setLinearLimit() PxJointLinearLimit

◆ getMotion()

virtual PxD6Motion::Enum PxD6Joint::getMotion ( PxD6Axis::Enum  axis) const
pure virtual

Get the motion type around the specified axis.

See also
setMotion() PxD6Axis PxD6Motion
Parameters
[in]axisthe degree of freedom around which the motion type is specified
Returns
the motion type around the specified axis

◆ getProjectionAngularTolerance()

virtual PxReal PxD6Joint::getProjectionAngularTolerance ( ) const
pure virtual

Get the angular tolerance threshold for projection.

Returns
tolerance the angular tolerance threshold in radians
See also
setProjectionAngularTolerance()

◆ getProjectionLinearTolerance()

virtual PxReal PxD6Joint::getProjectionLinearTolerance ( ) const
pure virtual

Get the linear tolerance threshold for projection.

Returns
the linear tolerance threshold
See also
setProjectionLinearTolerance()

◆ getPyramidSwingLimit()

virtual PxJointLimitPyramid PxD6Joint::getPyramidSwingLimit ( ) const
pure virtual

Get the pyramidal swing limit for the joint.

Returns
the swing limit structure
See also
setLimitCone() PxJointLimitPyramid

◆ getSwingLimit()

virtual PxJointLimitCone PxD6Joint::getSwingLimit ( ) const
pure virtual

Get the cone limit for the joint.

Returns
the swing limit structure
See also
setLimitCone() PxJointLimitCone

◆ getSwingYAngle()

virtual PxReal PxD6Joint::getSwingYAngle ( ) const
pure virtual

get the swing angle of the joint from the Y axis

◆ getSwingZAngle()

virtual PxReal PxD6Joint::getSwingZAngle ( ) const
pure virtual

get the swing angle of the joint from the Z axis

◆ getTwist()

PX_DEPRECATED PX_FORCE_INLINE PxReal PxD6Joint::getTwist ( ) const
inline

get the twist angle of the joint

Deprecated:
Use getTwistAngle instead. Deprecated since PhysX version 4.0

◆ getTwistAngle()

virtual PxReal PxD6Joint::getTwistAngle ( ) const
pure virtual

get the twist angle of the joint, in the range (-2*Pi, 2*Pi]

◆ getTwistLimit()

virtual PxJointAngularLimitPair PxD6Joint::getTwistLimit ( ) const
pure virtual

Get the twist limit for the joint.

Returns
the twist limit structure
See also
setTwistLimit() PxJointAngularLimitPair

◆ isKindOf()

virtual bool PxD6Joint::isKindOf ( const char *  name) const
inlineprotectedvirtual

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

Reimplemented from PxJoint.

References PxJoint::isKindOf().

◆ setDistanceLimit()

virtual void PxD6Joint::setDistanceLimit ( const PxJointLinearLimit limit)
pure virtual

Set the distance limit for the joint.

A single limit constraints all linear limited degrees of freedom, forming a linear, circular or spherical constraint on motion depending on the number of limited degrees. This is similar to a distance limit.

Parameters
[in]limitthe distance limit structure
See also
getDistanceLimit() PxJointLinearLimit

◆ setDrive()

virtual void PxD6Joint::setDrive ( PxD6Drive::Enum  index,
const PxD6JointDrive drive 
)
pure virtual

Set the drive parameters for the specified drive type.

Parameters
[in]indexthe type of drive being specified
[in]drivethe drive parameters
See also
getDrive() PxD6JointDrive

Default The default drive spring and damping values are zero, the force limit is zero, and no flags are set.

◆ setDrivePosition()

virtual void PxD6Joint::setDrivePosition ( const PxTransform pose,
bool  autowake = true 
)
pure virtual

Set the drive goal pose.

The goal is relative to the constraint frame of actor[0]

Default the identity transform

Parameters
[in]poseThe goal drive pose if positional drive is in use.
[in]autowakeWhether to wake the joint rigids up if it is asleep.
See also
setDrivePosition()

◆ setDriveVelocity()

virtual void PxD6Joint::setDriveVelocity ( const PxVec3 linear,
const PxVec3 angular,
bool  autowake = true 
)
pure virtual

Set the target goal velocity for drive.

The velocity is measured in the constraint frame of actor[0]

Parameters
[in]linearThe goal velocity for linear drive
[in]angularThe goal velocity for angular drive
[in]autowakeWhether to wake the joint rigids up if it is asleep.
See also
getDriveVelocity()

◆ setLinearLimit() [1/2]

PX_DEPRECATED PX_FORCE_INLINE void PxD6Joint::setLinearLimit ( const PxJointLinearLimit limit)
inline
Deprecated:
Use setDistanceLimit instead. Deprecated since PhysX version 4.0

◆ setLinearLimit() [2/2]

virtual void PxD6Joint::setLinearLimit ( PxD6Axis::Enum  axis,
const PxJointLinearLimitPair limit 
)
pure virtual

Set the linear limit for a given linear axis.

This function extends the previous setDistanceLimit call with the following features:

  • there can be a different limit for each linear axis
  • each limit is defined by two values, i.e. it can now be asymmetric

This can be used to create prismatic joints similar to PxPrismaticJoint, or point-in-quad joints, or point-in-box joints.

Parameters
[in]axisThe limited linear axis (must be PxD6Axis::eX, PxD6Axis::eY or PxD6Axis::eZ)
[in]limitThe linear limit pair structure
See also
getLinearLimit()

◆ setMotion()

virtual void PxD6Joint::setMotion ( PxD6Axis::Enum  axis,
PxD6Motion::Enum  type 
)
pure virtual

Set the motion type around the specified axis.

Each axis may independently specify that the degree of freedom is locked (blocking relative movement along or around this axis), limited by the corresponding limit, or free.

Parameters
[in]axisthe axis around which motion is specified
[in]typethe motion type around the specified axis

Default: all degrees of freedom are locked

See also
getMotion() PxD6Axis PxD6Motion

◆ setProjectionAngularTolerance()

virtual void PxD6Joint::setProjectionAngularTolerance ( PxReal  tolerance)
pure virtual

Set the angular tolerance threshold for projection. Projection is enabled if PxConstraintFlag::ePROJECTION is set for the joint.

If the joint deviates by more than this angle around its locked angular degrees of freedom, the solver will move the bodies to close the angle.

Setting a very small tolerance may result in simulation jitter or other artifacts.

Sometimes it is not possible to project (for example when the joints form a cycle).

Range: [0,Pi]
Default: Pi

Parameters
[in]tolerancethe angular tolerance threshold in radians
Note
Angular projection is implemented only for the case of two or three locked angular degrees of freedom.
See also
getProjectionAngularTolerance() PxJoint::setConstraintFlag() PxConstraintFlag::ePROJECTION

◆ setProjectionLinearTolerance()

virtual void PxD6Joint::setProjectionLinearTolerance ( PxReal  tolerance)
pure virtual

Set the linear tolerance threshold for projection. Projection is enabled if PxConstraintFlag::ePROJECTION is set for the joint.

If the joint separates by more than this distance along its locked degrees of freedom, the solver will move the bodies to close the distance.

Setting a very small tolerance may result in simulation jitter or other artifacts.

Sometimes it is not possible to project (for example when the joints form a cycle).

Range: [0, PX_MAX_F32)
Default: 1e10f

Parameters
[in]tolerancethe linear tolerance threshold
See also
getProjectionLinearTolerance() PxJoint::setConstraintFlags() PxConstraintFlag::ePROJECTION

◆ setPyramidSwingLimit()

virtual void PxD6Joint::setPyramidSwingLimit ( const PxJointLimitPyramid limit)
pure virtual

Set a pyramidal swing limit for the joint.

The pyramid limits will only be used in the following cases:

  • both swing Y and Z are limited. The limit shape is then a pyramid.
  • Y is limited and Z is locked, or vice versa. The limit shape is an asymmetric angular section, similar to what is supported for the twist axis. The remaining cases (Y limited and Z is free, or vice versa) are not supported.
Parameters
[in]limitthe cone limit structure
See also
getLimitCone() PxJointLimitPyramid

◆ setSwingLimit()

virtual void PxD6Joint::setSwingLimit ( const PxJointLimitCone limit)
pure virtual

Set the swing cone limit for the joint.

The cone limit is used if either or both swing axes are limited. The extents are symmetrical and measured in the frame of the parent. If only one swing degree of freedom is limited, the corresponding value from the cone limit defines the limit range.

Parameters
[in]limitthe cone limit structure
See also
getLimitCone() PxJointLimitCone

◆ setTwistLimit()

virtual void PxD6Joint::setTwistLimit ( const PxJointAngularLimitPair limit)
pure virtual

Set the twist limit for the joint.

The twist limit controls the range of motion around the twist axis.

The limit angle range is (-2*Pi, 2*Pi).

Parameters
[in]limitthe twist limit structure
See also
getTwistLimit() PxJointAngularLimitPair

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