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,RefTarget,AutoCloseable,Comparable<ConstJoltPhysicsObject>
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(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 TypeMethodDescriptionintCount 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.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, create, getRefCount, setEmbedded, toRefMethods inherited from class com.github.stephengold.joltjni.JoltPhysicsObject
close, compareTo, equals, hasAssignedNativeObject, hashCode, ownsNativeObject, setVirtualAddress, startCleaner, toString, va
-
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 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
-
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, otherwise false
-
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)
-