Class Point2PointJoint

All Implemented Interfaces:
Comparable<NativePhysicsObject>

public class Point2PointJoint extends Constraint
A 3 degree-of-freedom joint based on Bullet's btPoint2PointConstraint.

From the Bullet manual:
Point to point constraint limits the translation so that the local pivot points of 2 rigid bodies match in worldspace. A chain of rigid bodies can be connected using this constraint.

  • Field Details

    • logger2

      public static final Logger logger2
      message logger for this class
  • Constructor Details

    • Point2PointJoint

      public Point2PointJoint(PhysicsRigidBody rigidBodyA, Vector3f pivotInA)
      Instantiate a single-ended Point2PointJoint where the constraint is already satisfied.

      To be effective, the joint must be added to the body's PhysicsSpace and the body must be dynamic.

      Parameters:
      rigidBodyA - the body to constrain (not null, alias created)
      pivotInA - the pivot location in the body's scaled local coordinates (not null, unaffected)
    • Point2PointJoint

      public Point2PointJoint(PhysicsRigidBody rigidBodyA, Vector3f pivotInA, Vector3f pivotInWorld)
      Instantiate a single-ended Point2PointJoint where the constraint might not be satisfied yet.

      To be effective, the joint must be added to the body's PhysicsSpace and the body must be dynamic.

      Parameters:
      rigidBodyA - the body to constrain (not null, alias created)
      pivotInA - the pivot location in A's scaled local coordinates (not null, unaffected)
      pivotInWorld - the pivot location in physics-space coordinates (not null, unaffected)
    • Point2PointJoint

      public Point2PointJoint(PhysicsRigidBody rigidBodyA, PhysicsRigidBody rigidBodyB, Vector3f pivotInA, Vector3f pivotInB)
      Instantiate a double-ended Point2PointJoint.

      To be effective, the joint must be added to the PhysicsSpace of both bodies. Also, the bodies must be distinct and at least one of them must be dynamic.

      Parameters:
      rigidBodyA - the body for the A end (not null, alias created)
      rigidBodyB - the body for the B end (not null, alias created)
      pivotInA - the pivot location in A's scaled local coordinates (not null, unaffected)
      pivotInB - the pivot location in B's scaled local coordinates (not null, unaffected)
  • Method Details

    • getDamping

      public float getDamping()
      Return the joint's damping ratio.
      Returns:
      the viscous damping ratio (0→no damping, 1→critically damped)
    • getImpulseClamp

      public float getImpulseClamp()
      Return the joint's impulse clamp.
      Returns:
      the clamp value
    • getPivotInA

      public Vector3f getPivotInA(Vector3f storeResult)
      Locate the pivot in A's scaled local coordinates.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the pivot location (either storeResult or a new vector, not null)
    • getPivotInB

      public Vector3f getPivotInB(Vector3f storeResult)
      Locate the pivot in B's scaled local coordinates.
      Parameters:
      storeResult - storage for the result (modified if not null)
      Returns:
      the pivot location (either storeResult or a new vector, not null)
    • getTau

      public float getTau()
      Return the joint's tau value.
      Returns:
      the tau value
    • setDamping

      public void setDamping(float value)
      Alter the joint's damping.
      Parameters:
      value - the desired viscous damping ratio (0→no damping, 1→critically damped, default=1)
    • setImpulseClamp

      public void setImpulseClamp(float value)
      Alter the joint's impulse clamp.
      Parameters:
      value - the desired impulse clamp value (default=0)
    • setTau

      public void setTau(float value)
      Alter the joint's tau value.
      Parameters:
      value - the desired tau value (default=0.3)
    • setPivotInA

      public void setPivotInA(Vector3f location)
      Alter the pivot location in A's scaled local coordinates.
      Overrides:
      setPivotInA in class Constraint
      Parameters:
      location - the desired location (not null, unaffected)
    • setPivotInB

      public void setPivotInB(Vector3f location)
      Alter the pivot location in B's scaled local coordinates. Unlike Minie, Libbulletjme implements this method for both single-ended and double-ended joints.
      Overrides:
      setPivotInB in class Constraint
      Parameters:
      location - the desired location (not null, unaffected)