PxRevoluteJoint
Defined in include/extensions/PxRevoluteJoint.h
-
class PxRevoluteJoint : public PxJoint
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.
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
Public Functions
-
virtual void setLimit(const PxJointAngularLimitPair &limits) = 0
set the joint limit parameters.
The limit is activated using the flag PxRevoluteJointFlag::eLIMIT_ENABLED
The limit angle range is (-2*Pi, 2*Pi).
See also
PxJointAngularLimitPair getLimit()
- Parameters
limits – [in] The joint limit parameters.
-
virtual PxJointAngularLimitPair getLimit() const = 0
get the joint limit parameters.
See also
PxJointAngularLimitPair setLimit()
- Returns
the joint limit parameters
-
virtual void setDriveVelocity(PxReal velocity, bool autowake = true) = 0
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.)
The sign of this variable determines the rotation direction, with positive values going the same way as positive joint angles. Setting a very large target velocity may cause undesirable results.
Range: (-PX_MAX_F32, PX_MAX_F32)Default: 0.0
See also
PxRevoluteFlags::eDRIVE_FREESPIN
- Parameters
velocity – [in] the drive target velocity
autowake – [in] Whether to wake up the joint rigids if they are asleep.
-
virtual PxReal getDriveVelocity() const = 0
gets the target velocity for the drive model.
See also
setDriveVelocity()
- Returns
the drive target velocity
-
virtual void setDriveForceLimit(PxReal limit) = 0
sets the maximum torque the drive can exert.
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()
-
virtual PxReal getDriveForceLimit() const = 0
gets the maximum torque the drive can exert.
See also
setDriveVelocity()
- Returns
the torque limit
-
virtual void setDriveGearRatio(PxReal ratio) = 0
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
See also
getDriveGearRatio()
- Parameters
ratio – [in] the drive gear ratio
-
virtual PxReal getDriveGearRatio() const = 0
gets the gear ratio.
See also
setDriveGearRatio()
- Returns
the drive gear ratio
-
virtual void setRevoluteJointFlags(PxRevoluteJointFlags flags) = 0
sets the flags specific to the Revolute Joint.
Default PxRevoluteJointFlags(0)
See also
PxRevoluteJointFlag setFlag() getFlags()
- Parameters
flags – [in] The joint flags.
-
virtual void setRevoluteJointFlag(PxRevoluteJointFlag::Enum flag, bool value) = 0
sets a single flag specific to a Revolute Joint.
See also
PxRevoluteJointFlag, getFlags() setFlags()
- Parameters
flag – [in] The flag to set or clear.
value – [in] the value to which to set the flag
-
virtual PxRevoluteJointFlags getRevoluteJointFlags() const = 0
gets the flags specific to the Revolute Joint.
See also
PxRevoluteJoint::flags, PxRevoluteJointFlag setFlag() setFlags()
- Returns
the joint flags
-
inline virtual const char *getConcreteTypeName() const override
Returns string name of PxRevoluteJoint, used for serialization.
-
virtual void setActors(PxRigidActor *actor0, PxRigidActor *actor1) = 0
Set the actors for this joint.
An actor may be NULL to indicate the world frame. At most one of the actors may be NULL.
See also
getActors()
- Parameters
actor0 – [in] the first actor.
actor1 – [in] the second actor
-
virtual void getActors(PxRigidActor *&actor0, PxRigidActor *&actor1) const = 0
Get the actors for this joint.
See also
setActors()
- Parameters
actor0 – [out] the first actor.
actor1 – [out] the second actor
-
virtual void setLocalPose(PxJointActorIndex::Enum actor, const PxTransform &localPose) = 0
Set the joint local pose for an actor.
This is the relative pose which locates the joint frame relative to the actor.
See also
getLocalPose()
- Parameters
actor – [in] 0 for the first actor, 1 for the second actor.
localPose – [in] the local pose for the actor this joint
-
virtual PxTransform getLocalPose(PxJointActorIndex::Enum actor) const = 0
get the joint local pose for an actor.
return the local pose for this joint
See also
setLocalPose()
- Parameters
actor – [in] 0 for the first actor, 1 for the second actor.
-
virtual PxTransform getRelativeTransform() const = 0
get the relative pose for this joint
This function returns the pose of the joint frame of actor1 relative to actor0
-
virtual PxVec3 getRelativeLinearVelocity() const = 0
get the relative linear velocity of the joint
This function returns the linear velocity of the origin of the constraint frame of actor1, relative to the origin of the constraint frame of actor0. The value is returned in the constraint frame of actor0
-
virtual PxVec3 getRelativeAngularVelocity() const = 0
get the relative angular velocity of the joint
This function returns the angular velocity of actor1 relative to actor0. The value is returned in the constraint frame of actor0
-
virtual void setBreakForce(PxReal force, PxReal torque) = 0
set the break force for this joint.
if the constraint force or torque on the joint exceeds the specified values, the joint will break, at which point it will not constrain the two actors and the flag PxConstraintFlag::eBROKEN will be set. The force and torque are measured in the joint frame of the first actor
- Parameters
force – [in] the maximum force the joint can apply before breaking
torque – [in] the maximum torque the joint can apply before breaking
-
virtual void getBreakForce(PxReal &force, PxReal &torque) const = 0
get the break force for this joint.
See also
setBreakForce()
- Parameters
force – [out] the maximum force the joint can apply before breaking
torque – [out] the maximum torque the joint can apply before breaking
-
virtual void setConstraintFlags(PxConstraintFlags flags) = 0
set the constraint flags for this joint.
See also
PxConstraintFlag
- Parameters
flags – [in] the constraint flags
-
virtual void setConstraintFlag(PxConstraintFlag::Enum flag, bool value) = 0
set a constraint flags for this joint to a specified value.
See also
PxConstraintFlag
- Parameters
flag – [in] the constraint flag
value – [in] the value to which to set the flag
-
virtual PxConstraintFlags getConstraintFlags() const = 0
get the constraint flags for this joint.
See also
PxConstraintFlag
- Returns
the constraint flags
-
virtual void setInvMassScale0(PxReal invMassScale) = 0
set the inverse mass scale for actor0.
See also
getInvMassScale0
- Parameters
invMassScale – [in] the scale to apply to the inverse mass of actor 0 for resolving this constraint
-
virtual PxReal getInvMassScale0() const = 0
get the inverse mass scale for actor0.
See also
setInvMassScale0
- Returns
inverse mass scale for actor0
-
virtual void setInvInertiaScale0(PxReal invInertiaScale) = 0
set the inverse inertia scale for actor0.
See also
getInvMassScale0
- Parameters
invInertiaScale – [in] the scale to apply to the inverse inertia of actor0 for resolving this constraint
-
virtual PxReal getInvInertiaScale0() const = 0
get the inverse inertia scale for actor0.
See also
setInvInertiaScale0
- Returns
inverse inertia scale for actor0
-
virtual void setInvMassScale1(PxReal invMassScale) = 0
set the inverse mass scale for actor1.
See also
getInvMassScale1
- Parameters
invMassScale – [in] the scale to apply to the inverse mass of actor 1 for resolving this constraint
-
virtual PxReal getInvMassScale1() const = 0
get the inverse mass scale for actor1.
See also
setInvMassScale1
- Returns
inverse mass scale for actor1
-
virtual void setInvInertiaScale1(PxReal invInertiaScale) = 0
set the inverse inertia scale for actor1.
See also
getInvInertiaScale1
- Parameters
invInertiaScale – [in] the scale to apply to the inverse inertia of actor1 for resolving this constraint
-
virtual PxReal getInvInertiaScale1() const = 0
get the inverse inertia scale for actor1.
See also
setInvInertiaScale1
- Returns
inverse inertia scale for actor1
-
virtual PxConstraint *getConstraint() const = 0
Retrieves the PxConstraint corresponding to this joint.
This can be used to determine, among other things, the force applied at the joint.
- Returns
the constraint
-
virtual void setName(const char *name) = 0
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.
See also
getName()
- Parameters
name – [in] String to set the objects name to.
-
virtual const char *getName() const = 0
Retrieves the name string set with setName().
See also
setName()
- Returns
Name string associated with object.
-
virtual void release() = 0
Deletes the joint.
Note
This call does not wake up the connected rigid bodies.
-
virtual PxScene *getScene() const = 0
Retrieves the scene which this joint belongs to.
See also
PxScene
- Returns
Owner Scene. NULL if not part of a scene.
-
inline PxType getConcreteType() const
Returns concrete type of object.
See also
PxConcreteType
- Returns
PxConcreteType::Enum of serialized object
-
inline void setBaseFlag(PxBaseFlag::Enum flag, bool value)
Set PxBaseFlag
- Parameters
flag – [in] The flag to be set
value – [in] The flags new value
-
inline void setBaseFlags(PxBaseFlags inFlags)
Set PxBaseFlags
See also
PxBaseFlags
- Parameters
inFlags – [in] The flags to be set
-
inline PxBaseFlags getBaseFlags() const
Returns PxBaseFlags.
See also
PxBaseFlags
- Returns
PxBaseFlags
-
inline virtual bool isReleasable() const
Whether the object is subordinate.
A class is subordinate, if it can only be instantiated in the context of another class.
See also
PxSerialization::isSerializable
- Returns
Whether the class is subordinate
Public Members
-
void *userData
user can assign this to whatever, usually to create a 1:1 relationship with a user object.
Public Static Functions
-
static void getBinaryMetaData(PxOutputStream &stream)
Put class meta data in stream, used for serialization.
Protected Functions
-
inline PxRevoluteJoint(PxType concreteType, PxBaseFlags baseFlags)
Constructor.
-
inline PxRevoluteJoint(PxBaseFlags baseFlags)
Deserialization constructor.
-
inline virtual bool isKindOf(const char *name) const
Returns whether a given type name matches with the type of this instance.
-
template<class T>
inline bool typeMatch() const
-
virtual void setLimit(const PxJointAngularLimitPair &limits) = 0