Class TwoBodyConstraint

All Implemented Interfaces:
ConstConstraint, ConstJoltPhysicsObject, RefTarget, AutoCloseable, Comparable<ConstJoltPhysicsObject>
Direct Known Subclasses:
ConeConstraint, DistanceConstraint, FixedConstraint, GearConstraint, HingeConstraint, PointConstraint, SixDofConstraint, SliderConstraint

public abstract class TwoBodyConstraint extends Constraint
A type of Constraint that joins 2 bodies.
  • Method Details

    • getBody1

      public Body getBody1()
      Access the first body in the constraint. The constraint is unaffected.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getBody2

      public Body getBody2()
      Access the 2nd body in the constraint. The constraint is unaffected.
      Returns:
      a new JVM object with the pre-existing native object assigned
    • getConstraintToBody1Matrix

      public Mat44 getConstraintToBody1Matrix()
      Calculate the coordinate transform from constraint space to body 1. The constraint is unaffected.
      Returns:
      a new transform matrix
    • getConstraintToBody2Matrix

      public Mat44 getConstraintToBody2Matrix()
      Calculate the coordinate transform from constraint space to body 2. The constraint is unaffected.
      Returns:
      a new transform matrix