Class that constructs a MeshShape.
More...
#include <MeshShape.h>
Class that constructs a MeshShape.
◆ EBuildQuality
Enumerator |
---|
FavorRuntimePerformance | Favor runtime performance, takes more time to build the MeshShape but performs better.
|
FavorBuildSpeed | Favor build speed, build the tree faster but the MeshShape will be slower.
|
◆ MeshShapeSettings() [1/3]
MeshShapeSettings::MeshShapeSettings |
( |
| ) |
|
|
default |
Default constructor for deserialization.
◆ MeshShapeSettings() [2/3]
◆ MeshShapeSettings() [3/3]
◆ Create()
Create a shape according to the settings specified by this object.
Implements ShapeSettings.
◆ Sanitize()
void MeshShapeSettings::Sanitize |
( |
| ) |
|
Sanitize the mesh data. Remove duplicate and degenerate triangles. This is called automatically when constructing the MeshShapeSettings with a list of (indexed-) triangles.
◆ mActiveEdgeCosThresholdAngle
float MeshShapeSettings::mActiveEdgeCosThresholdAngle = 0.996195f |
Cosine of the threshold angle (if the angle between the two triangles is bigger than this, the edge is active, note that a concave edge is always inactive). Setting this value too small can cause ghost collisions with edges, setting it too big can cause depenetration artifacts (objects not depenetrating quickly). Valid ranges are between cos(0 degrees) and cos(90 degrees). The default value is cos(5 degrees). Negative values will make all edges active and causes EActiveEdgeMode::CollideOnlyWithActive to behave as EActiveEdgeMode::CollideWithAll. This speeds up the build process but will require all bodies that can interact with the mesh to use BodyCreationSettings::mEnhancedInternalEdgeRemoval = true.
◆ mBuildQuality
Determines the quality of the tree building process.
◆ mIndexedTriangles
Original list of indexed triangles (triangles will be reordered internally in the mesh shape). Triangles must be provided in counter clockwise order. Degenerate triangles will automatically be removed during mesh creation but no other mesh simplifications are performed, use an external library if this is desired. For simulation, the triangles are considered to be single sided. For ray casts you can choose to make triangles double sided by setting RayCastSettings::mBackFaceMode to EBackFaceMode::CollideWithBackFaces. For collide shape tests you can use CollideShapeSettings::mBackFaceMode and for shape casts you can use ShapeCastSettings::mBackFaceModeTriangles.
◆ mMaterials
Materials assigned to the triangles. Each triangle specifies which material it uses through its mMaterialIndex.
◆ mMaxTrianglesPerLeaf
uint MeshShapeSettings::mMaxTrianglesPerLeaf = 8 |
Maximum number of triangles in each leaf of the axis aligned box tree. This is a balance between memory and performance. Can be in the range [1, MeshShape::MaxTrianglesPerLeaf]. Sensible values are between 4 (for better performance) and 8 (for less memory usage).
◆ mPerTriangleUserData
bool MeshShapeSettings::mPerTriangleUserData = false |
◆ mTriangleVertices
Vertices belonging to mIndexedTriangles.
The documentation for this class was generated from the following files: