java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.Triangle
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstTriangle,AutoCloseable,Comparable<JoltPhysicsObject>
A non-indexed triangle with a material index.
-
Constructor Summary
ConstructorsConstructorDescriptionTriangle()Instantiate a default triangle.Triangle(float v1x, float v1y, float v1z, float v2x, float v2y, float v2z, float v3x, float v3y, float v3z) Instantiate a triangle from component values.Triangle(float v1x, float v1y, float v1z, float v2x, float v2y, float v2z, float v3x, float v3y, float v3z, int materialIndex, int userData) Instantiate the specified triangle.Triangle(ConstFloat3 v1, ConstFloat3 v2, ConstFloat3 v3) Instantiate a triangle fromConstFloat3locations.Triangle(ConstFloat3 v1, ConstFloat3 v2, ConstFloat3 v3, int materialIndex) Instantiate the specified triangle.Triangle(ConstFloat3 v1, ConstFloat3 v2, ConstFloat3 v3, int materialIndex, int userData) Instantiate the specified triangle.Triangle(ConstTriangle original) Instantiate a copy of the specified triangle.Instantiate a triangle fromVec3Arglocations.Instantiate the specified triangle.Instantiate the specified triangle. -
Method Summary
Modifier and TypeMethodDescriptionintReturn the triangle's material index.intReturn the triangle's user data.voidputVertices(FloatBuffer storeBuffer) Write the vertex locations to the specified buffer and advance the buffer's position by 9.voidset(ConstTriangle source) Copy the argument to the current triangle.voidsetMaterialIndex(int materialIndex) Alter the triangle's material index.voidsetUserData(int value) Alter the triangle's user data.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, isCleanerStarted, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, targetVaOrZero, toString, vaMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.lang.Comparable
compareToMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa, targetVaOrZero
-
Constructor Details
-
Triangle
public Triangle()Instantiate a default triangle. -
Triangle
Instantiate a triangle fromConstFloat3locations.- Parameters:
v1- the desired location of the first vertex (notnull, unaffected)v2- the desired location of the 2nd vertex (notnull, unaffected)v3- the desired location of the 3rd vertex (notnull, unaffected)
-
Triangle
Instantiate the specified triangle.- Parameters:
v1- the desired location of the first vertex (notnull, unaffected)v2- the desired location of the 2nd vertex (notnull, unaffected)v3- the desired location of the 3rd vertex (notnull, unaffected)materialIndex- the desired material index
-
Triangle
Instantiate the specified triangle.- Parameters:
v1- the desired location of the first vertex (notnull, unaffected)v2- the desired location of the 2nd vertex (notnull, unaffected)v3- the desired location of the 3rd vertex (notnull, unaffected)materialIndex- the desired material indexuserData- the desired user data
-
Triangle
Instantiate a copy of the specified triangle.- Parameters:
original- the triangle to copy (notnull, unaffected)
-
Triangle
public Triangle(float v1x, float v1y, float v1z, float v2x, float v2y, float v2z, float v3x, float v3y, float v3z) Instantiate a triangle from component values.- Parameters:
v1x- the desired X coordinate of the first vertexv1y- the desired Y coordinate of the first vertexv1z- the desired Z coordinate of the first vertexv2x- the desired X coordinate of the 2nd vertexv2y- the desired Y coordinate of the 2nd vertexv2z- the desired Z coordinate of the 2nd vertexv3x- the desired X coordinate of the 3rd vertexv3y- the desired Y coordinate of the 3rd vertexv3z- the desired Z coordinate of the 3rd vertex
-
Triangle
public Triangle(float v1x, float v1y, float v1z, float v2x, float v2y, float v2z, float v3x, float v3y, float v3z, int materialIndex, int userData) Instantiate the specified triangle.- Parameters:
v1x- the desired X coordinate of the first vertexv1y- the desired Y coordinate of the first vertexv1z- the desired Z coordinate of the first vertexv2x- the desired X coordinate of the 2nd vertexv2y- the desired Y coordinate of the 2nd vertexv2z- the desired Z coordinate of the 2nd vertexv3x- the desired X coordinate of the 3rd vertexv3y- the desired Y coordinate of the 3rd vertexv3z- the desired Z coordinate of the 3rd vertexmaterialIndex- the desired material indexuserData- the desired user data
-
Triangle
Instantiate a triangle fromVec3Arglocations.- Parameters:
v1- the desired location of the first vertex (notnull, unaffected)v2- the desired location of the 2nd vertex (notnull, unaffected)v3- the desired location of the 3rd vertex (notnull, unaffected)
-
Triangle
Instantiate the specified triangle.- Parameters:
v1- the desired location of the first vertex (notnull, unaffected)v2- the desired location of the 2nd vertex (notnull, unaffected)v3- the desired location of the 3rd vertex (notnull, unaffected)materialIndex- the desired material index
-
Triangle
Instantiate the specified triangle.- Parameters:
v1- the desired location of the first vertex (notnull, unaffected)v2- the desired location of the 2nd vertex (notnull, unaffected)v3- the desired location of the 3rd vertex (notnull, unaffected)materialIndex- the desired material indexuserData- the desired user data
-
-
Method Details
-
set
Copy the argument to the current triangle.- Parameters:
source- the triangle to copy (notnull, unaffected)
-
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
-
getMaterialIndex
public int getMaterialIndex()Return the triangle's material index. The triangle is unaffected. (native attribute: mMaterialIndex)- Specified by:
getMaterialIndexin interfaceConstTriangle- Returns:
- the index
-
getUserData
public int getUserData()Return the triangle's user data. The triangle is unaffected. (native attribute: mUserData)- Specified by:
getUserDatain interfaceConstTriangle- Returns:
- the value
-
putVertices
Write the vertex locations to the specified buffer and advance the buffer's position by 9. The triangle is unaffected.- Specified by:
putVerticesin interfaceConstTriangle- Parameters:
storeBuffer- the destination buffer (notnull)
-