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.
\image html 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:
-
Nested Class Summary
Nested classes/interfaces inherited from class physx.NativeObject
NativeObject.Allocator<T> -
Field Summary
FieldsFields inherited from class physx.NativeObject
address, isExternallyAllocated, SIZEOF_BYTE, SIZEOF_DOUBLE, SIZEOF_FLOAT, SIZEOF_INT, SIZEOF_LONG, SIZEOF_POINTER, SIZEOF_SHORT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PxRevoluteJointarrayGet(long baseAddress, int index) voiddestroy()floatgetAngle()return the angle of the joint, in the range (-2*Pi, 2*Pi]floatgets the maximum torque the drive can exert.floatgets the gear ratio.floatgets the target velocity for the drive model.gets the flags specific to the Revolute Joint.floatreturn the velocity of the jointvoidsetDriveForceLimit(float limit) sets the maximum torque the drive can exert.voidsetDriveGearRatio(float ratio) sets the gear ratio for the drive.voidsetDriveVelocity(float velocity) set the target velocity for the drive model.voidsetDriveVelocity(float velocity, boolean autowake) set the target velocity for the drive model.voidsetLimit(PxJointAngularLimitPair limits) set the joint limit parameters.voidsetRevoluteJointFlag(PxRevoluteJointFlagEnum flag, boolean value) sets a single flag specific to a Revolute Joint.voidsets the flags specific to the Revolute Joint.static PxRevoluteJointwrapPointer(long address) Methods inherited from class physx.extensions.PxJoint
getConstraint, getConstraintFlags, getInvMassScale0, getInvMassScale1, getLocalPose, getName, getRelativeAngularVelocity, getRelativeLinearVelocity, getRelativeTransform, getScene, getUserData, setActors, setBreakForce, setConstraintFlag, setConstraintFlags, setInvMassScale0, setInvMassScale1, setLocalPose, setName, setUserDataMethods inherited from class physx.common.PxBase
getBaseFlags, getConcreteType, getConcreteTypeName, isReleasable, release, setBaseFlag, setBaseFlagsMethods inherited from class physx.NativeObject
checkNotNull, equals, getAddress, hashCode
-
Field Details
-
SIZEOF
public static final int SIZEOF -
ALIGNOF
public static final int ALIGNOF- See Also:
-
-
Constructor Details
-
PxRevoluteJoint
protected PxRevoluteJoint() -
PxRevoluteJoint
protected PxRevoluteJoint(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
destroy
public void destroy() -
getAngle
public float getAngle()return the angle of the joint, in the range (-2*Pi, 2*Pi] -
getVelocity
public float getVelocity()return the velocity of the joint -
setLimit
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:
limits- The joint limit parameters.- See Also:
-
setDriveVelocity
public void setDriveVelocity(float velocity) 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.
- Parameters:
velocity- the drive target velocityRange: (-PX_MAX_F32, PX_MAX_F32)
Default: 0.0
-
setDriveVelocity
public void setDriveVelocity(float velocity, boolean autowake) 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.
- Parameters:
velocity- the drive target velocityautowake- Whether to wake up the joint rigids if they are asleep.Range: (-PX_MAX_F32, PX_MAX_F32)
Default: 0.0
-
getDriveVelocity
public float getDriveVelocity()gets the target velocity for the drive model.- Returns:
- the drive target velocity
- See Also:
-
setDriveForceLimit
public void setDriveForceLimit(float limit) 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:
-
getDriveForceLimit
public float getDriveForceLimit()gets the maximum torque the drive can exert.- Returns:
- the torque limit
- See Also:
-
setDriveGearRatio
public void setDriveGearRatio(float ratio) 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:
ratio- the drive gear ratio- See Also:
-
getDriveGearRatio
public float getDriveGearRatio()gets the gear ratio.- Returns:
- the drive gear ratio
- See Also:
-
setRevoluteJointFlags
sets the flags specific to the Revolute Joint.Default PxRevoluteJointFlags(0)
- Parameters:
flags- The joint flags.
-
setRevoluteJointFlag
sets a single flag specific to a Revolute Joint.- Parameters:
flag- The flag to set or clear.value- the value to which to set the flag
-
getRevoluteJointFlags
gets the flags specific to the Revolute Joint.- Returns:
- the joint flags
-