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.Instantiate a triangle fromFloat3locations.Instantiate the specified triangleInstantiate the specified triangleTriangle(ConstTriangle original) Instantiate a copy of the specified triangle.Instantiate a triangle fromFloat3locations.Instantiate the specified triangleInstantiate 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.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, 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 
- 
Constructor Details
- 
Triangle
public Triangle()Instantiate a default triangle. - 
Triangle
Instantiate a triangle fromFloat3locations.- 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
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
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 indexuserData- the desired user data
 - 
Triangle
Instantiate a copy of the specified triangle.- Parameters:
 original- the triangle to copy (notnull, unaffected)
 - 
Triangle
Instantiate a triangle fromFloat3locations.- 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
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
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 indexuserData- the desired user data
 
 - 
 - 
Method Details
- 
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 (not null)
 
 -