Class IndexedTriangleNoMaterial

java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.IndexedTriangleNoMaterial
All Implemented Interfaces:
ConstIndexedTriangleNoMaterial, ConstJoltPhysicsObject, AutoCloseable, Comparable<JoltPhysicsObject>
Direct Known Subclasses:
IndexedTriangle

public class IndexedTriangleNoMaterial extends JoltPhysicsObject implements ConstIndexedTriangleNoMaterial
A triangle composed of three 32-bit mesh-vertex indices.
  • Constructor Details

    • IndexedTriangleNoMaterial

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

      public IndexedTriangleNoMaterial(ConstIndexedTriangleNoMaterial original)
      Instantiate a copy of the specified triangle.
      Parameters:
      original - the triangle to copy (not null, unaffected)
    • IndexedTriangleNoMaterial

      public IndexedTriangleNoMaterial(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
  • Method Details

    • set

      public void set(ConstIndexedTriangleNoMaterial source)
      Copy the argument to the current triangle.
      Parameters:
      source - the triangle to copy (not null, unaffected)
    • setIdx

      public void setIdx(int cornerIndex, int meshVertexIndex)
      Alter the mesh-vertex index of the specified corner.
      Parameters:
      cornerIndex - which corner to modify (0, 1, or 2)
      meshVertexIndex - the index of the desired mesh vertex
    • getIdx

      public int getIdx(int cornerIndex)
      Return the mesh-vertex index of the specified corner. The triangle is unaffected.
      Specified by:
      getIdx in interface ConstIndexedTriangleNoMaterial
      Parameters:
      cornerIndex - which corner to access (0, 1, or 2)
      Returns:
      the index of the vertex in the mesh
    • isEqual

      public boolean isEqual(ConstIndexedTriangleNoMaterial other)
      Test whether the current triangle is equivalent to the argument. Both triangles are unaffected. (native operator: binary ==)
      Specified by:
      isEqual in interface ConstIndexedTriangleNoMaterial
      Parameters:
      other - the triangle to compare with (not null, unaffected)
      Returns:
      true if equal, false if unequal
    • put

      public void put(IntBuffer storeBuffer)
      Write all 3 indices to the specified buffer and advance the buffer's position by 3. The triangle is unaffected.
      Specified by:
      put in interface ConstIndexedTriangleNoMaterial
      Parameters:
      storeBuffer - the destination buffer (not null)