Class PhysicsMaterial

All Implemented Interfaces:
ConstJoltPhysicsObject, ConstPhysicsMaterial, ConstSerializableObject, RefTarget, AutoCloseable, Comparable<JoltPhysicsObject>
Direct Known Subclasses:
PhysicsMaterialSimple

public class PhysicsMaterial extends SerializableObject implements ConstPhysicsMaterial, RefTarget
Surface properties of (part of) a Shape.
  • Method Details

    • sDefault

      public static ConstPhysicsMaterial sDefault()
      Return the default material, used when a shape has no material defined.
      Returns:
      a new immutable JVM object with the pre-existing native object assigned
    • sRestoreFromBinaryState

      public static PhysicsMaterialResult sRestoreFromBinaryState(StreamIn stream)
      Read a material from the specified binary stream.
      Parameters:
      stream - where to read objects (not null)
      Returns:
      a new object
    • getDebugColor

      public Color getDebugColor()
      Copy the debug color. The material is unaffected.
      Specified by:
      getDebugColor in interface ConstPhysicsMaterial
      Returns:
      a new object
    • getDebugName

      public String getDebugName()
      Return the debug name. The material is unaffected.
      Specified by:
      getDebugName in interface ConstPhysicsMaterial
      Returns:
      a string of text or null
    • saveBinaryState

      public void saveBinaryState(StreamOut stream)
      Save the material to the specified binary stream. The material is unaffected.
      Specified by:
      saveBinaryState in interface ConstPhysicsMaterial
      Parameters:
      stream - the stream to write to (not null)
    • toRefC

      public PhysicsMaterialRefC toRefC()
      Create a counted reference to the native PhysicsMaterial.
      Specified by:
      toRefC in interface ConstPhysicsMaterial
      Returns:
      a new JVM object with a new native object assigned
    • getRefCount

      public int getRefCount()
      Count the active references to the native PhysicsMaterial. The material is unaffected.
      Specified by:
      getRefCount in interface RefTarget
      Returns:
      the count (≥0)
    • setEmbedded

      public void setEmbedded()
      Mark the native PhysicsMaterial as embedded.
      Specified by:
      setEmbedded in interface RefTarget
    • toRef

      public PhysicsMaterialRef toRef()
      Create a counted reference to the native PhysicsMaterial.
      Specified by:
      toRef in interface RefTarget
      Returns:
      a new JVM object with a new native object assigned