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

Class that constructs a CapsuleShape. More...

#include <CapsuleShape.h>

Inheritance diagram for CapsuleShapeSettings:
ConvexShapeSettings ShapeSettings SerializableObject RefTarget< ShapeSettings >

Public Member Functions

 CapsuleShapeSettings ()=default
 Default constructor for deserialization.
 CapsuleShapeSettings (float inHalfHeightOfCylinder, float inRadius, const PhysicsMaterial *inMaterial=nullptr)
 Create a capsule centered around the origin with one sphere cap at (0, -inHalfHeightOfCylinder, 0) and the other at (0, inHalfHeightOfCylinder, 0).
bool IsValid () const
 Check if this is a valid capsule shape.
bool IsSphere () const
 Checks if the settings of this capsule make this shape a sphere.
virtual ShapeResult Create () const override
 Create a shape according to the settings specified by this object.
Public Member Functions inherited from ConvexShapeSettings
 ConvexShapeSettings ()=default
 Constructor.
 ConvexShapeSettings (const PhysicsMaterial *inMaterial)
void SetDensity (float inDensity)
 Set the density of the object in kg / m^3.
Public Member Functions inherited from ShapeSettings
void ClearCachedResult ()
Public Member Functions inherited from SerializableObject
virtual ~SerializableObject ()=default
 Destructor.
Public Member Functions inherited from RefTarget< ShapeSettings >
 RefTarget ()=default
 Constructor.
 ~RefTarget ()
 assert no one is referencing us
void SetEmbedded () const
RefTargetoperator= (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

float mRadius = 0.0f
float mHalfHeightOfCylinder = 0.0f
Public Attributes inherited from ConvexShapeSettings
RefConst< PhysicsMaterialmMaterial
 Material assigned to this shape.
float mDensity = 1000.0f
 Uniform density of the interior of the convex object (kg / m^3).
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 Member Functions inherited from SerializableObject
 SerializableObject ()=default
 Don't allow (copy) constructing this base class, but allow derived classes to (copy) construct themselves.
 SerializableObject (const SerializableObject &)=default
SerializableObjectoperator= (const SerializableObject &)=default
Protected Attributes inherited from ShapeSettings
ShapeResult mCachedResult
Protected Attributes inherited from RefTarget< ShapeSettings >
atomic< uint32mRefCount
 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.

Detailed Description

Class that constructs a CapsuleShape.

Constructor & Destructor Documentation

◆ CapsuleShapeSettings() [1/2]

CapsuleShapeSettings::CapsuleShapeSettings ( )
default

Default constructor for deserialization.

◆ CapsuleShapeSettings() [2/2]

CapsuleShapeSettings::CapsuleShapeSettings ( float inHalfHeightOfCylinder,
float inRadius,
const PhysicsMaterial * inMaterial = nullptr )
inline

Create a capsule centered around the origin with one sphere cap at (0, -inHalfHeightOfCylinder, 0) and the other at (0, inHalfHeightOfCylinder, 0).

Member Function Documentation

◆ Create()

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

Create a shape according to the settings specified by this object.

Implements ShapeSettings.

◆ IsSphere()

bool CapsuleShapeSettings::IsSphere ( ) const
inline

Checks if the settings of this capsule make this shape a sphere.

◆ IsValid()

bool CapsuleShapeSettings::IsValid ( ) const
inline

Check if this is a valid capsule shape.

Member Data Documentation

◆ mHalfHeightOfCylinder

float CapsuleShapeSettings::mHalfHeightOfCylinder = 0.0f

◆ mRadius

float CapsuleShapeSettings::mRadius = 0.0f

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