PxRevoluteJoint Class Referenceabstract

A joint which behaves in a similar way to a hinge or axle. More...

#include <PxRevoluteJoint.h>

Inheritance diagram for PxRevoluteJoint:
Collaboration diagram for PxRevoluteJoint:

Public Member Functions

virtual PxReal getAngle () const =0
 return the angle of the joint, in the range (-2*Pi, 2*Pi] More...
 
virtual PxReal getVelocity () const =0
 return the velocity of the joint More...
 
virtual void setLimit (const PxJointAngularLimitPair &limits)=0
 set the joint limit parameters. More...
 
virtual PxJointAngularLimitPair getLimit () const =0
 get the joint limit parameters. More...
 
virtual void setDriveVelocity (PxReal velocity, bool autowake=true)=0
 set the target velocity for the drive model. More...
 
virtual PxReal getDriveVelocity () const =0
 gets the target velocity for the drive model. More...
 
virtual void setDriveForceLimit (PxReal limit)=0
 sets the maximum torque the drive can exert. More...
 
virtual PxReal getDriveForceLimit () const =0
 gets the maximum torque the drive can exert. More...
 
virtual void setDriveGearRatio (PxReal ratio)=0
 sets the gear ratio for the drive. More...
 
virtual PxReal getDriveGearRatio () const =0
 gets the gear ratio. More...
 
virtual void setRevoluteJointFlags (PxRevoluteJointFlags flags)=0
 sets the flags specific to the Revolute Joint. More...
 
virtual void setRevoluteJointFlag (PxRevoluteJointFlag::Enum flag, bool value)=0
 sets a single flag specific to a Revolute Joint. More...
 
virtual PxRevoluteJointFlags getRevoluteJointFlags () const =0
 gets the flags specific to the Revolute Joint. 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
 gets the angular tolerance threshold for projection. More...
 
virtual const char * getConcreteTypeName () const
 Returns string name of PxRevoluteJoint, 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 PxRevoluteJoint (PxType concreteType, PxBaseFlags baseFlags)
 Constructor. More...
 
PX_INLINE PxRevoluteJoint (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 joint which behaves in a similar way to a hinge or axle.

A hinge joint removes all but a single rotational degree of freedom from two objects. The axis along which the two bodies may rotate is specified with a point and a direction vector.

The position of the hinge on each body is specified by the origin of the body's joint frame. The axis of the hinge is specified as the direction of the x-axis in the body's joint frame.

revoluteJoint.png

A revolute joint can be given a motor, so that it can apply a force to rotate the attached actors. It may also be given a limit, to restrict the revolute motion to within a certain range. In addition, the bodies may be projected together if the distance or angle between them exceeds a given threshold.

Projection, drive and limits are activated by setting the appropriate flags on the joint.

See also
PxRevoluteJointCreate() PxJoint

Constructor & Destructor Documentation

◆ PxRevoluteJoint() [1/2]

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

Constructor.

◆ PxRevoluteJoint() [2/2]

PX_INLINE PxRevoluteJoint::PxRevoluteJoint ( PxBaseFlags  baseFlags)
inlineprotected

Deserialization constructor.

Member Function Documentation

◆ getAngle()

virtual PxReal PxRevoluteJoint::getAngle ( ) const
pure virtual

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

◆ getConcreteTypeName()

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

Returns string name of PxRevoluteJoint, used for serialization.

Implements PxBase.

◆ getDriveForceLimit()

virtual PxReal PxRevoluteJoint::getDriveForceLimit ( ) const
pure virtual

gets the maximum torque the drive can exert.

Returns
the torque limit
See also
setDriveVelocity()

◆ getDriveGearRatio()

virtual PxReal PxRevoluteJoint::getDriveGearRatio ( ) const
pure virtual

gets the gear ratio.

Returns
the drive gear ratio
See also
setDriveGearRatio()

◆ getDriveVelocity()

virtual PxReal PxRevoluteJoint::getDriveVelocity ( ) const
pure virtual

gets the target velocity for the drive model.

Returns
the drive target velocity
See also
setDriveVelocity()

◆ getLimit()

virtual PxJointAngularLimitPair PxRevoluteJoint::getLimit ( ) const
pure virtual

get the joint limit parameters.

Returns
the joint limit parameters
See also
PxJointAngularLimitPair setLimit()

◆ getProjectionAngularTolerance()

virtual PxReal PxRevoluteJoint::getProjectionAngularTolerance ( ) const
pure virtual

gets the angular tolerance threshold for projection.

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

◆ getProjectionLinearTolerance()

virtual PxReal PxRevoluteJoint::getProjectionLinearTolerance ( ) const
pure virtual

Get the linear tolerance threshold for projection.

Returns
the linear tolerance threshold
See also
setProjectionLinearTolerance()

◆ getRevoluteJointFlags()

virtual PxRevoluteJointFlags PxRevoluteJoint::getRevoluteJointFlags ( ) const
pure virtual

gets the flags specific to the Revolute Joint.

Returns
the joint flags
See also
PxRevoluteJoint::flags, PxRevoluteJointFlag setFlag() setFlags()

◆ getVelocity()

virtual PxReal PxRevoluteJoint::getVelocity ( ) const
pure virtual

return the velocity of the joint

◆ isKindOf()

virtual bool PxRevoluteJoint::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().

◆ setDriveForceLimit()

virtual void PxRevoluteJoint::setDriveForceLimit ( PxReal  limit)
pure virtual

sets the maximum torque the drive can exert.

Setting this to a very large value if velTarget is also very large may cause unexpected results.

The value set here may be used either as an impulse limit or a force limit, depending on the flag PxConstraintFlag::eDRIVE_LIMITS_ARE_FORCES

Range: [0, PX_MAX_F32)
Default: PX_MAX_F32

See also
setDriveVelocity()

◆ setDriveGearRatio()

virtual void PxRevoluteJoint::setDriveGearRatio ( PxReal  ratio)
pure virtual

sets the gear ratio for the drive.

When setting up the drive constraint, the velocity of the first actor is scaled by this value, and its response to drive torque is scaled down. So if the drive target velocity is zero, the second actor will be driven to the velocity of the first scaled by the gear ratio

Range: [0, PX_MAX_F32)
Default: 1.0

Parameters
[in]ratiothe drive gear ratio
See also
getDriveGearRatio()

◆ setDriveVelocity()

virtual void PxRevoluteJoint::setDriveVelocity ( PxReal  velocity,
bool  autowake = true 
)
pure virtual

set the target velocity for the drive model.

The motor will only be able to reach this velocity if the maxForce is sufficiently large. If the joint is spinning faster than this velocity, the motor will actually try to brake (see PxRevoluteJointFlag::eDRIVE_FREESPIN.)

If you set this to infinity then the motor will keep speeding up, unless there is some sort of resistance on the attached bodies. The sign of this variable determines the rotation direction, with positive values going the same way as positive joint angles.

Parameters
[in]velocitythe drive target velocity
[in]autowakeWhether to wake the joint rigids up if it is asleep.

Range: [0, PX_MAX_F32)
Default: 0.0

See also
PxRevoluteFlags::eDRIVE_FREESPIN

◆ setLimit()

virtual void PxRevoluteJoint::setLimit ( const PxJointAngularLimitPair limits)
pure virtual

set the joint limit parameters.

The limit is activated using the flag PxRevoluteJointFlag::eLIMIT_ENABLED

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

Parameters
[in]limitsThe joint limit parameters.
See also
PxJointAngularLimitPair getLimit()

◆ setProjectionAngularTolerance()

virtual void PxRevoluteJoint::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
See also
getProjectionAngularTolerance() PxJoint::setConstraintFlag() PxConstraintFlag::ePROJECTION

◆ setProjectionLinearTolerance()

virtual void PxRevoluteJoint::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

◆ setRevoluteJointFlag()

virtual void PxRevoluteJoint::setRevoluteJointFlag ( PxRevoluteJointFlag::Enum  flag,
bool  value 
)
pure virtual

sets a single flag specific to a Revolute Joint.

Parameters
[in]flagThe flag to set or clear.
[in]valuethe value to which to set the flag
See also
PxRevoluteJointFlag, getFlags() setFlags()

◆ setRevoluteJointFlags()

virtual void PxRevoluteJoint::setRevoluteJointFlags ( PxRevoluteJointFlags  flags)
pure virtual

sets the flags specific to the Revolute Joint.

Default PxRevoluteJointFlags(0)

Parameters
[in]flagsThe joint flags.
See also
PxRevoluteJointFlag setFlag() getFlags()

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