Class IndexedTriangle

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

public final class IndexedTriangle extends IndexedTriangleNoMaterial
A triangle composed of three 32-bit mesh-vertex indices and a material index.
  • Constructor Details

    • IndexedTriangle

      public IndexedTriangle()
      Instantiate a triangle with all indices zero.
    • IndexedTriangle

      public IndexedTriangle(int vi0, int vi1, int vi2)
      Instantiate a triangle with the specified indices.
      Parameters:
      vi0 - the desired first mesh-vertex index
      vi1 - the desired 2nd mesh-vertex index
      vi2 - the desired 3rd mesh-vertex index
    • IndexedTriangle

      public IndexedTriangle(int vi0, int vi1, int vi2, int materialIndex)
      Instantiate a triangle with the specified indices.
      Parameters:
      vi0 - the desired first mesh-vertex index
      vi1 - the desired 2nd mesh-vertex index
      vi2 - the desired 3rd mesh-vertex index
      materialIndex - the desired material index
  • Method Details

    • getMaterialIndex

      public int getMaterialIndex()
      Return the triangle's material index. The triangle is unaffected. (native attribute: mMaterialIndex)
      Returns:
      the index
    • setMaterialIndex

      public void setMaterialIndex(int materialIndex)
      Alter the triangle's material index. (native attribute: mMaterialIndex)
      Parameters:
      materialIndex - the desired material index