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. More... | |
MeshShapeSettings (const TriangleList &inTriangles, const PhysicsMaterialList &inMaterials=PhysicsMaterialList()) | |
Create a mesh shape. More... | |
MeshShapeSettings (const VertexList &inVertices, const IndexedTriangleList &inTriangles, const PhysicsMaterialList &inMaterials=PhysicsMaterialList()) | |
void | Sanitize () |
Sanitize the mesh data. Remove duplicate and degenerate triangles. More... | |
virtual ShapeResult | Create () const override |
Create a shape according to the settings specified by this object. More... | |
virtual ShapeResult | Create () const =0 |
Create a shape according to the settings specified by this object. More... | |
Public Member Functions inherited from SerializableObject | |
virtual | ~SerializableObject ()=default |
Constructor. More... | |
Public Member Functions inherited from RefTarget< ShapeSettings > | |
RefTarget ()=default | |
Constructor. More... | |
RefTarget (const RefTarget &) | |
~RefTarget () | |
assert no one is referencing us More... | |
void | SetEmbedded () const |
RefTarget & | operator= (const RefTarget &) |
Assignment operator. More... | |
uint32 | GetRefCount () const |
Get current refcount of this object. More... | |
void | AddRef () const |
Add or release a reference to this object. More... | |
void | Release () const |
Public Attributes | |
VertexList | mTriangleVertices |
Mesh data. More... | |
IndexedTriangleList | mIndexedTriangles |
Original list of indexed triangles. More... | |
PhysicsMaterialList | mMaterials |
Materials assigned to the triangles. Each triangle specifies which material it uses through its mMaterialIndex. More... | |
uint | mMaxTrianglesPerLeaf = 8 |
Public Attributes inherited from ShapeSettings | |
uint64 | mUserData = 0 |
User data (to be used freely by the application) More... | |
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. More... | |
Protected Attributes inherited from ShapeSettings | |
ShapeResult | mCachedResult |
Protected Attributes inherited from RefTarget< ShapeSettings > | |
atomic< uint32 > | mRefCount |
Current reference count. More... | |
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. More... | |
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