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:
\code ... joint->setMotion(PxD6Axis::eX, PxD6JointMotion::eFREE); ... \endcode
Or a Revolute joint with motion free allowed around the x-axis:
\code ... joint->setMotion(PxD6Axis::eTWIST, PxD6JointMotion::eFREE); ... \endcode
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:
-
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 PxD6JointarrayGet(long baseAddress, int index) voiddestroy()getDrive(PxD6DriveEnum index) Get the drive parameters for the specified drive type.Get the drive goal pose.voidgetDriveVelocity(PxVec3 linear, PxVec3 angular) Get the target goal velocity for joint drive.getMotion(PxD6AxisEnum axis) Get the motion type around the specified axis.floatget the swing angle of the joint from the Y axisfloatget the swing angle of the joint from the Z axisfloatget the twist angle of the joint, in the range (-2*Pi, 2*Pi]voidSet the distance limit for the joint.voidsetDrive(PxD6DriveEnum index, PxD6JointDrive drive) Set the drive parameters for the specified drive type.voidsetDrivePosition(PxTransform pose) Set the drive goal posevoidsetDrivePosition(PxTransform pose, boolean autowake) Set the drive goal posevoidsetDriveVelocity(PxVec3 linear, PxVec3 angular) Set the target goal velocity for drive.voidsetLinearLimit(PxD6AxisEnum axis, PxJointLinearLimitPair limit) Set the linear limit for a given linear axis.voidsetMotion(PxD6AxisEnum axis, PxD6MotionEnum type) Set the motion type around the specified axis.voidSet a pyramidal swing limit for the joint.voidsetSwingLimit(PxJointLimitCone limit) Set the swing cone limit for the joint.voidSet the twist limit for the joint.static PxD6JointwrapPointer(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
-
PxD6Joint
protected PxD6Joint() -
PxD6Joint
protected PxD6Joint(long address)
-
-
Method Details
-
wrapPointer
-
arrayGet
-
destroy
public void destroy() -
setMotion
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:
axis- the axis around which motion is specifiedtype- the motion type around the specified axisDefault: all degrees of freedom are locked
- See Also:
-
getMotion
Get the motion type around the specified axis.- Parameters:
axis- the degree of freedom around which the motion type is specified- Returns:
- the motion type around the specified axis
- See Also:
-
getTwistAngle
public float getTwistAngle()get the twist angle of the joint, in the range (-2*Pi, 2*Pi] -
getSwingYAngle
public float getSwingYAngle()get the swing angle of the joint from the Y axis -
getSwingZAngle
public float getSwingZAngle()get the swing angle of the joint from the Z axis -
setDistanceLimit
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:
limit- the distance limit structure- See Also:
-
setLinearLimit
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:
axis- The limited linear axis (must be PxD6Axis::eX, PxD6Axis::eY or PxD6Axis::eZ)limit- The linear limit pair structure
-
setTwistLimit
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:
limit- the twist limit structure- See Also:
-
setSwingLimit
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:
limit- the cone limit structure- See Also:
-
setPyramidSwingLimit
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:
limit- the cone limit structure- See Also:
-
setDrive
Set the drive parameters for the specified drive type.- Parameters:
index- the type of drive being specifieddrive- the drive parameters- See Also:
-
getDrive
Get the drive parameters for the specified drive type.- Parameters:
index- the specified drive type- See Also:
-
setDrivePosition
Set the drive goal poseThe goal is relative to the constraint frame of actor[0]
Default the identity transform
- Parameters:
pose- The goal drive pose if positional drive is in use. wake counters to #PxSceneDesc::wakeCounterResetValue if the counter value is below the reset value.- See Also:
-
setDrivePosition
Set the drive goal poseThe goal is relative to the constraint frame of actor[0]
Default the identity transform
- Parameters:
pose- The goal drive pose if positional drive is in use.autowake- If true and the attached actors are in a scene, this call wakes them up and increases their wake counters to #PxSceneDesc::wakeCounterResetValue if the counter value is below the reset value.- See Also:
-
getDrivePosition
Get the drive goal pose.- See Also:
-
setDriveVelocity
Set the target goal velocity for drive.The velocity is measured in the constraint frame of actor[0]
- Parameters:
linear- The goal velocity for linear driveangular- The goal velocity for angular drive wake counters to #PxSceneDesc::wakeCounterResetValue if the counter value is below the reset value.- See Also:
-
getDriveVelocity
Get the target goal velocity for joint drive.- Parameters:
linear- The goal velocity for linear driveangular- The goal velocity for angular drive- See Also:
-