Class TwoBodyConstraintSettingsRef

All Implemented Interfaces:
ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>

public final class TwoBodyConstraintSettingsRef extends Ref
A counted reference to a TwoBodyConstraintSettings object. (native type: Ref<TwoBodyConstraintSettings>)
  • Constructor Details

    • TwoBodyConstraintSettingsRef

      public TwoBodyConstraintSettingsRef()
      Instantiate an empty reference.
  • Method Details

    • create

      public TwoBodyConstraint create(Body rigidBody1, Body rigidBody2)
      Create a constraint using the settings. The settings are unaffected.
      Parameters:
      rigidBody1 - the desired first body (not null, not soft)
      rigidBody2 - the desired 2nd body (not null, not soft)
      Returns:
      the new constraint, ready to be added to a PhysicsSystem
    • getPtr

      public TwoBodyConstraintSettings getPtr()
      Access the targeted settings, if any.
      Specified by:
      getPtr in class Ref
      Returns:
      the pre-existing object, or null if the reference is empty
    • targetVa

      public long targetVa()
      Return the address of the native TwoBodyConstraintSettings. No objects are affected.
      Specified by:
      targetVa in interface ConstJoltPhysicsObject
      Overrides:
      targetVa in class JoltPhysicsObject
      Returns:
      the virtual address, or zero if the reference is empty
    • toRef

      Create an additional counted reference to the targeted settings.
      Specified by:
      toRef in class Ref
      Returns:
      a new JVM object with a new native object assigned