Class Point2PointJoint

All Implemented Interfaces:
com.jme3.export.Savable, com.jme3.util.clone.JmeCloneable, Cloneable, 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

      protected Point2PointJoint()
      No-argument constructor needed by SavableClassUtil.
    • Point2PointJoint

      public Point2PointJoint(PhysicsRigidBody rigidBodyA, com.jme3.math.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, com.jme3.math.Vector3f pivotInA, com.jme3.math.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, com.jme3.math.Vector3f pivotInA, com.jme3.math.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
    • 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)
    • cloneFields

      public void cloneFields(com.jme3.util.clone.Cloner cloner, Object original)
      Callback from Cloner to convert this shallow-cloned joint into a deep-cloned one, using the specified Cloner and original to resolve copied fields.
      Specified by:
      cloneFields in interface com.jme3.util.clone.JmeCloneable
      Overrides:
      cloneFields in class Constraint
      Parameters:
      cloner - the Cloner that's cloning this joint (not null)
      original - the instance from which this joint was shallow-cloned (not null, unaffected)
    • read

      public void read(com.jme3.export.JmeImporter importer) throws IOException
      De-serialize this joint from the specified importer, for example when loading from a J3O file.
      Specified by:
      read in interface com.jme3.export.Savable
      Overrides:
      read in class Constraint
      Parameters:
      importer - (not null)
      Throws:
      IOException - from the importer
    • setPivotInA

      public void setPivotInA(com.jme3.math.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(com.jme3.math.Vector3f location)
      Alter the pivot location in B's scaled local coordinates.
      Overrides:
      setPivotInB in class Constraint
      Parameters:
      location - the desired location (not null, unaffected)
    • write

      public void write(com.jme3.export.JmeExporter exporter) throws IOException
      Serialize this joint to the specified exporter, for example when saving to a J3O file.
      Specified by:
      write in interface com.jme3.export.Savable
      Overrides:
      write in class Constraint
      Parameters:
      exporter - (not null)
      Throws:
      IOException - from the exporter