Class PhysicsSceneRef

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

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

    • PhysicsSceneRef

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

    • fixInvalidScales

      public boolean fixInvalidScales()
      Correct any incorrectly scaled shapes in the scene.
      Returns:
      true if successful, otherwise false
    • getBodies

      public BodyCreationSettings[] getBodies()
      Access the body-creation settings as a Java array.
      Returns:
      a new array of new JVM objects with the pre-existing native objects assigned
    • createBodies

      public boolean createBodies(PhysicsSystem system)
      Instantiate the bodies in the scene.
      Parameters:
      system - where to add the bodies (not null, modified)
      Returns:
      true if successful, otherwise false
    • getPtr

      public PhysicsScene getPtr()
      Temporarily access the referenced PhysicsScene.
      Specified by:
      getPtr in class Ref
      Returns:
      a new JVM object that refers to the pre-existing native object
    • toRef

      public PhysicsSceneRef toRef()
      Create a counted reference to the native PhysicsSceneRef.
      Specified by:
      toRef in class Ref
      Returns:
      a new JVM object with a new native object assigned