Class PxJoint

Direct Known Subclasses:
PxD6Joint, PxDistanceJoint, PxFixedJoint, PxGearJoint, PxPrismaticJoint, PxRackAndPinionJoint, PxRevoluteJoint, PxSphericalJoint

public class PxJoint extends PxBase
a base interface providing common functionality for PhysX joints
  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxJoint

      protected PxJoint()
    • PxJoint

      protected PxJoint(long address)
  • Method Details

    • wrapPointer

      public static PxJoint wrapPointer(long address)
    • arrayGet

      public static PxJoint arrayGet(long baseAddress, int index)
    • getUserData

      public NativeObject getUserData()
      user can assign this to whatever, usually to create a 1:1 relationship with a user object.
    • setUserData

      public void setUserData(NativeObject value)
      user can assign this to whatever, usually to create a 1:1 relationship with a user object.
    • setActors

      public void setActors(PxRigidActor actor0, PxRigidActor actor1)
      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.

      Parameters:
      actor0 - the first actor.
      actor1 - the second actor
    • setLocalPose

      public void setLocalPose(PxJointActorIndexEnum actor, PxTransform localPose)
      Set the joint local pose for an actor.

      This is the relative pose which locates the joint frame relative to the actor.

      Parameters:
      actor - 0 for the first actor, 1 for the second actor.
      localPose - the local pose for the actor this joint
      See Also:
    • getLocalPose

      public PxTransform getLocalPose(PxJointActorIndexEnum actor)
      get the joint local pose for an actor.
      Parameters:
      actor - 0 for the first actor, 1 for the second actor.

      return the local pose for this joint

      See Also:
    • getRelativeTransform

      public PxTransform getRelativeTransform()
      get the relative pose for this joint

      This function returns the pose of the joint frame of actor1 relative to actor0

    • getRelativeLinearVelocity

      public PxVec3 getRelativeLinearVelocity()
      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

    • getRelativeAngularVelocity

      public PxVec3 getRelativeAngularVelocity()
      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

    • setBreakForce

      public void setBreakForce(float force, float torque)
      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 - the maximum force the joint can apply before breaking
      torque - the maximum torque the joint can apply before breaking
    • setConstraintFlags

      public void setConstraintFlags(PxConstraintFlags flags)
      set the constraint flags for this joint.
      Parameters:
      flags - the constraint flags
    • setConstraintFlag

      public void setConstraintFlag(PxConstraintFlagEnum flag, boolean value)
      set a constraint flags for this joint to a specified value.
      Parameters:
      flag - the constraint flag
      value - the value to which to set the flag
    • getConstraintFlags

      public PxConstraintFlags getConstraintFlags()
      get the constraint flags for this joint.
      Returns:
      the constraint flags
    • setInvMassScale0

      public void setInvMassScale0(float invMassScale)
      set the inverse mass scale for actor0.
      Parameters:
      invMassScale - the scale to apply to the inverse mass of actor 0 for resolving this constraint
      See Also:
    • getInvMassScale0

      public float getInvMassScale0()
      get the inverse mass scale for actor0.
      Returns:
      inverse mass scale for actor0
      See Also:
    • setInvMassScale1

      public void setInvMassScale1(float invMassScale)
      set the inverse mass scale for actor1.
      Parameters:
      invMassScale - the scale to apply to the inverse mass of actor 1 for resolving this constraint
      See Also:
    • getInvMassScale1

      public float getInvMassScale1()
      get the inverse mass scale for actor1.
      Returns:
      inverse mass scale for actor1
      See Also:
    • getConstraint

      public PxConstraint getConstraint()
      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
    • setName

      public void setName(String name)
      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.

      Parameters:
      name - String to set the objects name to.
      See Also:
    • getName

      public String getName()
      Retrieves the name string set with setName().
      Returns:
      Name string associated with object.
      See Also:
    • getScene

      public PxScene getScene()
      Retrieves the scene which this joint belongs to.
      Returns:
      Owner Scene. NULL if not part of a scene.
      See Also: