Class PhysicsMaterialRef

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

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

    • PhysicsMaterialRef

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

    • getPtrAsSimple

      public PhysicsMaterialSimple getPtrAsSimple()
      Access the target material, assuming it is a PhysicsMaterialSimple.
      Returns:
      the pre-existing object, or null if the reference is empty
    • getPtr

      public PhysicsMaterial getPtr()
      Access the targeted material, 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 PhysicsMaterial. 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

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