Package com.github.stephengold.joltjni
Class MeshShapeSettings
java.lang.Object
com.github.stephengold.joltjni.JoltPhysicsObject
com.github.stephengold.joltjni.SerializableObject
com.github.stephengold.joltjni.ShapeSettings
com.github.stephengold.joltjni.MeshShapeSettings
- All Implemented Interfaces:
ConstJoltPhysicsObject,ConstSerializableObject,ConstShapeSettings,RefTarget,AutoCloseable,Comparable<JoltPhysicsObject>
Settings used to construct a
MeshShape.-
Constructor Summary
ConstructorsConstructorDescriptionInstantiate the default settings.MeshShapeSettings(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(MeshShapeSettings original) Instantiate a copy of the specified settings.MeshShapeSettings(ConstTriangle... triangleArray) Instantiate settings for the specified array of triangles.MeshShapeSettings(ConstTriangle[] triangleArray, PhysicsMaterialList materials) Instantiate settings for the specified parameters.MeshShapeSettings(ConstVertexList vertices, IndexedTriangleList indices) Instantiate settings for the specified vertices and indices.MeshShapeSettings(FloatBuffer positionBuffer) Instantiate settings for the specified vertices without indices.MeshShapeSettings(List<? extends ConstTriangle> triangleList) Instantiate settings for the specified list of triangles.MeshShapeSettings(List<? extends ConstTriangle> triangleList, PhysicsMaterialList materials) Instantiate settings for the specified parameters.MeshShapeSettings(List<Float3> vertices, IndexedTriangleList indices) Instantiate settings for the specified lists of vertices and triangles. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddIndexedTriangle(int vi0, int vi1, int vi2) Append the specified triangle to the internal array.voidaddTriangleVertex(Float3 vertex) Append the specified vertex to the internal array.intCount the triangles in the mesh.intCount the vertices in the mesh.floatReturn the cosine of the active-edge threshold angle.intReturn the maximum number of triangles per leaf.booleanTest whether each triangle will include user data.voidreserveIndexedTriangles(int numTriangles) Reserve storage for the specified number of triangles.voidreserveTriangleVertices(int numVertices) Reserve storage for the specified number of vertices.voidsetActiveEdgeCosThresholdAngle(float cosine) Alter the active-edge threshold angle.voidsetMaxTrianglesPerLeaf(int numTriangles) Alter the maximum number of triangles per leaf.voidsetPerTriangleUserData(boolean include) Alter whether each triangle will include user data.Methods inherited from class com.github.stephengold.joltjni.ShapeSettings
clearCachedResult, cloneShapeSettings, create, getRefCount, setEmbedded, setVirtualAddressAsCoOwner, toRef, toRefCMethods inherited from class com.github.stephengold.joltjni.SerializableObject
getRttiMethods 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, targetVaMethods inherited from interface com.github.stephengold.joltjni.readonly.ConstSerializableObject
getRtti
-
Constructor Details
-
MeshShapeSettings
public MeshShapeSettings()Instantiate the default settings. -
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 a copy of the specified settings.- Parameters:
original- the settings to copy (notnull, 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:
trueif 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-trueto include per-triangle data,falseto omit it (default=false)
-