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

public final class Triangle extends JoltPhysicsObject
A non-indexed triangle with a material index.
  • Constructor Details

    • Triangle

      public Triangle()
      Instantiate a default triangle.
    • Triangle

      public Triangle(Float3 v1, Float3 v2, Float3 v3)
      Instantiate a triangle from Float3 locations.
      Parameters:
      v1 - the desired location of the first vertex (not null, unaffected)
      v2 - the desired location of the 2nd vertex (not null, unaffected)
      v3 - the desired location of the 3rd vertex (not null, unaffected)
    • Triangle

      public Triangle(Float3 v1, Float3 v2, Float3 v3, int materialIndex)
      Instantiate the specified triangle
      Parameters:
      v1 - the desired location of the first vertex (not null, unaffected)
      v2 - the desired location of the 2nd vertex (not null, unaffected)
      v3 - the desired location of the 3rd vertex (not null, unaffected)
      materialIndex - the desired material index
    • Triangle

      public Triangle(Float3 v1, Float3 v2, Float3 v3, int materialIndex, int userData)
      Instantiate the specified triangle
      Parameters:
      v1 - the desired location of the first vertex (not null, unaffected)
      v2 - the desired location of the 2nd vertex (not null, unaffected)
      v3 - the desired location of the 3rd vertex (not null, unaffected)
      materialIndex - the desired material index
      userData - the desired user data
    • Triangle

      public Triangle(Vec3Arg v1, Vec3Arg v2, Vec3Arg v3)
      Instantiate a triangle from Float3 locations.
      Parameters:
      v1 - the desired location of the first vertex (not null, unaffected)
      v2 - the desired location of the 2nd vertex (not null, unaffected)
      v3 - the desired location of the 3rd vertex (not null, unaffected)
    • Triangle

      public Triangle(Vec3Arg v1, Vec3Arg v2, Vec3Arg v3, int materialIndex)
      Instantiate the specified triangle
      Parameters:
      v1 - the desired location of the first vertex (not null, unaffected)
      v2 - the desired location of the 2nd vertex (not null, unaffected)
      v3 - the desired location of the 3rd vertex (not null, unaffected)
      materialIndex - the desired material index
    • Triangle

      public Triangle(Vec3Arg v1, Vec3Arg v2, Vec3Arg v3, int materialIndex, int userData)
      Instantiate the specified triangle
      Parameters:
      v1 - the desired location of the first vertex (not null, unaffected)
      v2 - the desired location of the 2nd vertex (not null, unaffected)
      v3 - the desired location of the 3rd vertex (not null, unaffected)
      materialIndex - the desired material index
      userData - the desired user data
  • Method Details

    • getMaterialIndex

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

      public int getUserData()
      Return the triangle's user data. The triangle is unaffected. (native attribute: mUserData)
      Returns:
      the value
    • putVertices

      public void putVertices(FloatBuffer storeBuffer)
      Write the vertex locations to the specified buffer and advance the buffer's position by 9. The triangle is unaffected.
      Parameters:
      storeBuffer - the destination buffer (not null)
    • setMaterialIndex

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

      public void setUserData(int value)
      Alter the triangle's user data. (native attribute: mUserData)
      Parameters:
      value - the desired value