Jolt Physics
A multi core friendly Game Physics Engine
|
#include <Shape.h>
Public Types | |
using | ShapeResult = Result< Ref< Shape > > |
Public Member Functions | |
virtual ShapeResult | Create () const =0 |
Create a shape according to the settings specified by this object. More... | |
void | ClearCachedResult () |
Public Member Functions inherited from SerializableObject | |
virtual | ~SerializableObject ()=default |
Constructor. More... | |
Public Member Functions inherited from NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
void | operator= (const NonCopyable &)=delete |
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 | |
uint64 | mUserData = 0 |
User data (to be used freely by the application) More... | |
Protected Attributes | |
ShapeResult | mCachedResult |
Protected Attributes inherited from RefTarget< ShapeSettings > | |
atomic< uint32 > | mRefCount |
Current reference count. More... | |
Additional Inherited Members | |
Static Public Member Functions inherited from RefTarget< ShapeSettings > | |
static int | sInternalGetRefCountOffset () |
INTERNAL HELPER FUNCTION USED BY SERIALIZATION. 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 can construct shapes and that is serializable using the ObjectStream system. Can be used to store shape data in 'uncooked' form (i.e. in a form that is still human readable and authorable). Once the shape has been created using the Create() function, the data will be moved into the Shape class in a form that is optimized for collision detection. After this, the ShapeSettings object is no longer needed and can be destroyed. Each shape class has a derived class of the ShapeSettings object to store shape specific data.
using ShapeSettings::ShapeResult = Result<Ref<Shape> > |
|
inline |
When creating a shape, the result is cached so that calling Create() again will return the same shape. If you make changes to the ShapeSettings you need to call this function to clear the cached result to allow Create() to build a new shape.
|
pure virtual |
Create a shape according to the settings specified by this object.
Implemented in BoxShapeSettings, CapsuleShapeSettings, ConvexHullShapeSettings, CylinderShapeSettings, EmptyShapeSettings, HeightFieldShapeSettings, MeshShapeSettings, MutableCompoundShapeSettings, OffsetCenterOfMassShapeSettings, PlaneShapeSettings, RotatedTranslatedShapeSettings, ScaledShapeSettings, SphereShapeSettings, StaticCompoundShapeSettings, TaperedCapsuleShapeSettings, TaperedCylinderShapeSettings, and TriangleShapeSettings.
|
mutableprotected |
uint64 ShapeSettings::mUserData = 0 |
User data (to be used freely by the application)