Jolt Physics
A multi core friendly Game Physics Engine
|
Class that constructs a MeshShape. More...
#include <MeshShape.h>
Public Member Functions | |
MeshShapeSettings ()=default | |
Default constructor for deserialization. | |
MeshShapeSettings (const TriangleList &inTriangles, const PhysicsMaterialList &inMaterials=PhysicsMaterialList()) | |
Create a mesh shape. | |
MeshShapeSettings (const VertexList &inVertices, const IndexedTriangleList &inTriangles, const PhysicsMaterialList &inMaterials=PhysicsMaterialList()) | |
void | Sanitize () |
Sanitize the mesh data. Remove duplicate and degenerate triangles. | |
virtual ShapeResult | Create () const override |
Create a shape according to the settings specified by this object. | |
Public Member Functions inherited from SerializableObject | |
virtual | ~SerializableObject ()=default |
Constructor. | |
Public Member Functions inherited from RefTarget< ShapeSettings > | |
RefTarget ()=default | |
Constructor. | |
RefTarget (const RefTarget &) | |
~RefTarget () | |
assert no one is referencing us | |
void | SetEmbedded () const |
RefTarget & | operator= (const RefTarget &) |
Assignment operator. | |
uint32 | GetRefCount () const |
Get current refcount of this object. | |
void | AddRef () const |
Add or release a reference to this object. | |
void | Release () const |
Public Attributes | |
VertexList | mTriangleVertices |
Mesh data. | |
IndexedTriangleList | mIndexedTriangles |
Original list of indexed triangles. | |
PhysicsMaterialList | mMaterials |
Materials assigned to the triangles. Each triangle specifies which material it uses through its mMaterialIndex. | |
uint | mMaxTrianglesPerLeaf = 8 |
Public Attributes inherited from ShapeSettings | |
uint64 | mUserData = 0 |
User data (to be used freely by the application) | |
Additional Inherited Members | |
Public Types inherited from ShapeSettings | |
using | ShapeResult = Result<Ref<Shape>> |
Static Public Member Functions inherited from RefTarget< ShapeSettings > | |
static int | sInternalGetRefCountOffset () |
INTERNAL HELPER FUNCTION USED BY SERIALIZATION. | |
Protected Attributes inherited from ShapeSettings | |
ShapeResult | mCachedResult |
Protected Attributes inherited from RefTarget< ShapeSettings > | |
atomic< uint32 > | mRefCount |
Current reference count. | |
Static Protected Attributes inherited from RefTarget< ShapeSettings > | |
static constexpr uint32 | cEmbedded |
A large value that gets added to the refcount to mark the object as embedded. | |
Class that constructs a MeshShape.
|
default |
Default constructor for deserialization.
MeshShapeSettings::MeshShapeSettings | ( | const TriangleList & | inTriangles, |
const PhysicsMaterialList & | inMaterials = PhysicsMaterialList() ) |
Create a mesh shape.
MeshShapeSettings::MeshShapeSettings | ( | const VertexList & | inVertices, |
const IndexedTriangleList & | inTriangles, | ||
const PhysicsMaterialList & | inMaterials = PhysicsMaterialList() ) |
|
overridevirtual |
Create a shape according to the settings specified by this object.
Implements ShapeSettings.
void MeshShapeSettings::Sanitize | ( | ) |
Sanitize the mesh data. Remove duplicate and degenerate triangles.
IndexedTriangleList MeshShapeSettings::mIndexedTriangles |
Original list of indexed triangles.
PhysicsMaterialList MeshShapeSettings::mMaterials |
Materials assigned to the triangles. Each triangle specifies which material it uses through its mMaterialIndex.
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).
VertexList MeshShapeSettings::mTriangleVertices |
Mesh data.
Vertices belonging to mIndexedTriangles