Package com.github.stephengold.joltjni
Class MeshShapeSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.NonCopyable
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ShapeSettings
com.github.stephengold.joltjni.MeshShapeSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject
,ConstShapeSettings
,RefTarget
,AutoCloseable
,Comparable<JoltPhysicsObject>
Settings used to construct a
MeshShape
.-
Constructor Summary
ConstructorsConstructorDescriptionMeshShapeSettings
(Float3[] vertexArray, IndexedTriangle... itArray) Instantiate settings for the specified vertices and triangles.MeshShapeSettings
(Float3[] vertices, IndexedTriangleList indices) Instantiate settings for the specified vertices and triangles.MeshShapeSettings
(Triangle... triangleArray) Instantiate settings for the specified array of triangles.MeshShapeSettings
(Triangle[] triangleArray, PhysicsMaterialList materials) Instantiate settings for the specified parameters.MeshShapeSettings
(VertexList vertices, IndexedTriangleList indices) Instantiate settings for the specified vertices and indices.MeshShapeSettings
(FloatBuffer positionBuffer) Instantiate settings for the specified vertices without indices.MeshShapeSettings
(List<Float3> vertices, IndexedTriangleList indices) Instantiate settings for the specified lists of vertices and triangles.MeshShapeSettings
(List<Triangle> triangleList) Instantiate settings for the specified list of triangles.MeshShapeSettings
(List<Triangle> triangleList, PhysicsMaterialList materials) Instantiate settings for the specified parameters. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addIndexedTriangle
(int vi0, int vi1, int vi2) Append the specified triangle to the internal array.void
addTriangleVertex
(Float3 vertex) Append the specified vertex to the internal array.int
Count the triangles in the mesh.int
Count the vertices in the mesh.float
Return the cosine of the active-edge threshold angle.int
Return the maximum number of triangles per leaf.boolean
Test whether each triangle will include user data.void
reserveIndexedTriangles
(int numTriangles) Reserve storage for the specified number of triangles.void
reserveTriangleVertices
(int numVertices) Reserve storage for the specified number of vertices.void
setActiveEdgeCosThresholdAngle
(float cosine) Alter the active-edge threshold angle.void
setMaxTrianglesPerLeaf
(int numTriangles) Alter the maximum number of triangles per leaf.void
setPerTriangleUserData
(boolean include) Alter whether each triangle will include user data.Methods inherited from class com.github.stephengold.joltjni.ShapeSettings
clearCachedResult, create, getRefCount, setEmbedded, toRef, toRefC
Methods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, getContainingObject, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, setVirtualAddress, startCleaner, targetVa, toString, va
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface java.lang.Comparable
compareTo
Methods inherited from interface com.github.stephengold.joltjni.readonly.ConstJoltPhysicsObject
close, hasAssignedNativeObject, ownsNativeObject, targetVa
-
Constructor Details
-
MeshShapeSettings
Instantiate settings for the specified vertices and triangles.- Parameters:
vertices
- the array of vertices (not null, unaffected)indices
- the list of triangles (not null, unaffected)
-
MeshShapeSettings
Instantiate settings for the specified vertices and triangles.- Parameters:
vertexArray
- the array of vertices (not null, unaffected)itArray
- the array of triangles (not null, unaffected)
-
MeshShapeSettings
Instantiate settings for the specified vertices without indices.- Parameters:
positionBuffer
- the vertex positions (not null, capacity a multiple of 9, unaffected)
-
MeshShapeSettings
Instantiate settings for the specified lists of vertices and triangles.- Parameters:
vertices
- the list of vertices (not null, unaffected)indices
- the list of triangles (not null, unaffected)
-
MeshShapeSettings
Instantiate settings for the specified list of triangles.- Parameters:
triangleList
- the list of triangles (not null, unaffected)
-
MeshShapeSettings
Instantiate settings for the specified parameters.- Parameters:
triangleList
- the list of triangles (not null, unaffected)materials
- the desired surface properties (not null, unaffected)
-
MeshShapeSettings
Instantiate settings for the specified vertices and indices.- Parameters:
vertices
- list of vertex locations (not null, unaffected)indices
- list of triangles that use those vertices (not null)
-
MeshShapeSettings
Instantiate settings for the specified array of triangles.- Parameters:
triangleArray
- the array of triangles (not null, unaffected)
-
MeshShapeSettings
Instantiate settings for the specified parameters.- Parameters:
triangleArray
- the array of triangles (not null, unaffected)materials
- the desired surface properties (not null, unaffected)
-
-
Method Details
-
addIndexedTriangle
public void addIndexedTriangle(int vi0, int vi1, int vi2) Append the specified triangle to the internal array.- Parameters:
vi0
- the desired first mesh-vertex indexvi1
- the desired 2nd mesh-vertex indexvi2
- the desired 3rd mesh-vertex index
-
addTriangleVertex
Append the specified vertex to the internal array.- Parameters:
vertex
- the location of the vertex to add (not null, unaffected)
-
countTriangles
public int countTriangles()Count the triangles in the mesh. The settings are unaffected.- Returns:
- the count (≥0)
-
countTriangleVertices
public int countTriangleVertices()Count the vertices in the mesh. The settings are unaffected.- Returns:
- the count (≥0)
-
getActiveEdgeCosThresholdAngle
public float getActiveEdgeCosThresholdAngle()Return the cosine of the active-edge threshold angle. The settings are unaffected. (native attribute: mActiveEdgeCosThresholdAngle)- Returns:
- the cosine
-
getMaxTrianglesPerLeaf
public int getMaxTrianglesPerLeaf()Return the maximum number of triangles per leaf. The settings are unaffected. (native attribute: mMaxTrianglesPerLeaf)- Returns:
- the maximum number
-
getPerTriangleUserData
public boolean getPerTriangleUserData()Test whether each triangle will include user data. The settings are unaffected. (native attribute: mPerTriangleUserData)- Returns:
true
if per-triangle data is included, otherwisefalse
-
reserveIndexedTriangles
public void reserveIndexedTriangles(int numTriangles) Reserve storage for the specified number of triangles.- Parameters:
numTriangles
- the desired capacity
-
reserveTriangleVertices
public void reserveTriangleVertices(int numVertices) Reserve storage for the specified number of vertices.- Parameters:
numVertices
- the desired capacity
-
setActiveEdgeCosThresholdAngle
public void setActiveEdgeCosThresholdAngle(float cosine) Alter the active-edge threshold angle. (native attribute: mActiveEdgeCosThresholdAngle)- Parameters:
cosine
- the cosine of the desired angle (default=0.996195)
-
setMaxTrianglesPerLeaf
public void setMaxTrianglesPerLeaf(int numTriangles) Alter the maximum number of triangles per leaf. (native attribute: mMaxTrianglesPerLeaf)- Parameters:
numTriangles
- the desired number (default=8)
-
setPerTriangleUserData
public void setPerTriangleUserData(boolean include) Alter whether each triangle will include user data. (native attribute: mPerTriangleUserData)- Parameters:
include
-true
to include per-triangle data,false
to omit it (default=false)
-