Jolt Physics
A multi core friendly Game Physics Engine
Loading...
Searching...
No Matches
MeshShapeSettings Class Referencefinal

Class that constructs a MeshShape. More...

#include <MeshShape.h>

Inheritance diagram for MeshShapeSettings:
ShapeSettings SerializableObject RefTarget< ShapeSettings >

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
 
RefTargetoperator= (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< uint32mRefCount
 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...
 

Detailed Description

Class that constructs a MeshShape.

Constructor & Destructor Documentation

◆ MeshShapeSettings() [1/3]

MeshShapeSettings::MeshShapeSettings ( )
default

Default constructor for deserialization.

◆ MeshShapeSettings() [2/3]

MeshShapeSettings::MeshShapeSettings ( const TriangleList inTriangles,
const PhysicsMaterialList inMaterials = PhysicsMaterialList() 
)

Create a mesh shape.

◆ MeshShapeSettings() [3/3]

MeshShapeSettings::MeshShapeSettings ( const VertexList inVertices,
const IndexedTriangleList inTriangles,
const PhysicsMaterialList inMaterials = PhysicsMaterialList() 
)

Member Function Documentation

◆ Create()

ShapeSettings::ShapeResult MeshShapeSettings::Create ( ) const
overridevirtual

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.

Member Data Documentation

◆ mIndexedTriangles

IndexedTriangleList MeshShapeSettings::mIndexedTriangles

Original list of indexed triangles.

◆ mMaterials

PhysicsMaterialList MeshShapeSettings::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).

◆ mTriangleVertices

VertexList MeshShapeSettings::mTriangleVertices

Mesh data.

Vertices belonging to mIndexedTriangles


The documentation for this class was generated from the following files: