java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.Triangle
- All Implemented Interfaces:
ConstJoltPhysicsObject
,AutoCloseable
,Comparable<JoltPhysicsObject>
A non-indexed triangle with a material index.
-
Constructor Summary
ConstructorsConstructorDescriptionTriangle()
Instantiate a default triangle.Instantiate a triangle fromFloat3
locations.Instantiate the specified triangleInstantiate the specified triangleInstantiate a triangle fromFloat3
locations.Instantiate the specified triangleInstantiate the specified triangle -
Method Summary
Modifier and TypeMethodDescriptionint
Return the triangle's material index.int
Return the triangle's user data.void
putVertices
(FloatBuffer storeBuffer) Write the vertex locations to the specified buffer and advance the buffer's position by 9.void
setMaterialIndex
(int materialIndex) Alter the triangle's material index.void
setUserData
(int value) Alter the triangle's user data.Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
-
Constructor Details
-
Triangle
public Triangle()Instantiate a default triangle. -
Triangle
Instantiate a triangle fromFloat3
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
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 triangle fromFloat3
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
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
-
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
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
-