Class PxD6Joint


public class PxD6Joint extends PxJoint
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:

\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:
  • 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

      public static PxD6Joint wrapPointer(long address)
    • arrayGet

      public static PxD6Joint arrayGet(long baseAddress, int index)
    • destroy

      public void destroy()
    • setMotion

      public void setMotion(PxD6AxisEnum axis, PxD6MotionEnum type)
      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 specified
      type - the motion type around the specified axis

      Default: all degrees of freedom are locked

      See Also:
    • getMotion

      public PxD6MotionEnum getMotion(PxD6AxisEnum axis)
      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

      public void setDistanceLimit(PxJointLinearLimit limit)
      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

      public void setLinearLimit(PxD6AxisEnum axis, PxJointLinearLimitPair limit)
      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

      public void setTwistLimit(PxJointAngularLimitPair limit)
      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

      public void setSwingLimit(PxJointLimitCone limit)
      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

      public void setPyramidSwingLimit(PxJointLimitPyramid limit)
      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

      public void setDrive(PxD6DriveEnum index, PxD6JointDrive drive)
      Set the drive parameters for the specified drive type.
      Parameters:
      index - the type of drive being specified
      drive - the drive parameters
      See Also:
    • getDrive

      public PxD6JointDrive getDrive(PxD6DriveEnum index)
      Get the drive parameters for the specified drive type.
      Parameters:
      index - the specified drive type
      See Also:
    • setDrivePosition

      public void setDrivePosition(PxTransform pose)
      Set the drive goal pose

      The 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

      public void setDrivePosition(PxTransform pose, boolean autowake)
      Set the drive goal pose

      The 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

      public PxTransform getDrivePosition()
      Get the drive goal pose.
      See Also:
    • setDriveVelocity

      public void setDriveVelocity(PxVec3 linear, PxVec3 angular)
      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 drive
      angular - The goal velocity for angular drive wake counters to #PxSceneDesc::wakeCounterResetValue if the counter value is below the reset value.
      See Also:
    • getDriveVelocity

      public void getDriveVelocity(PxVec3 linear, PxVec3 angular)
      Get the target goal velocity for joint drive.
      Parameters:
      linear - The goal velocity for linear drive
      angular - The goal velocity for angular drive
      See Also: