Class PxGearJoint


public class PxGearJoint extends PxJoint
A joint that connects two existing revolute joints and constrains their relative angular velocity and position with respect to each other.
See Also:
  • Field Details

    • SIZEOF

      public static final int SIZEOF
    • ALIGNOF

      public static final int ALIGNOF
      See Also:
  • Constructor Details

    • PxGearJoint

      protected PxGearJoint()
    • PxGearJoint

      protected PxGearJoint(long address)
  • Method Details

    • wrapPointer

      public static PxGearJoint wrapPointer(long address)
    • arrayGet

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

      public void destroy()
    • setHinges

      public boolean setHinges(PxBase hinge0, PxBase hinge1)
      Set the hinge/revolute joints connected by the gear joint.

      The passed joints can be either PxRevoluteJoint, PxD6Joint or PxArticulationJointReducedCoordinate. The joints must define degrees of freedom around the twist axis.

      Note that these joints are only used to compute the positional error correction term, used to adjust potential drift between jointed actors. The gear joint can run without calling this function, but in that case some visible overlap may develop over time between the teeth of the gear meshes.

      Note: Calling this function resets the internal positional error correction term.

      Parameters:
      hinge0 - The first hinge joint
      hinge1 - The second hinge joint
      Returns:
      true if success
    • setGearRatio

      public void setGearRatio(float ratio)
      Set the desired gear ratio.

      For two gears with n0 and n1 teeth respectively, the gear ratio is n0/n1.

      Note: You may need to use a negative gear ratio if the joint frames of involved actors are not oriented in the same direction.

      Note: Calling this function resets the internal positional error correction term.

      Parameters:
      ratio - Desired ratio between the two hinges.
    • getGearRatio

      public float getGearRatio()
      Get the gear ratio.
      Returns:
      Current ratio