Jolt Physics
A multi core friendly Game Physics Engine
|
Base class for character class. More...
#include <CharacterBase.h>
Public Types | |
enum class | EGroundState { OnGround , OnSteepGround , NotSupported , InAir } |
Public Member Functions | |
JPH_OVERRIDE_NEW_DELETE | CharacterBase (const CharacterBaseSettings *inSettings, PhysicsSystem *inSystem) |
Constructor. | |
virtual | ~CharacterBase ()=default |
Destructor. | |
void | SetMaxSlopeAngle (float inMaxSlopeAngle) |
Set the maximum angle of slope that character can still walk on (radians) | |
float | GetCosMaxSlopeAngle () const |
void | SetUp (Vec3Arg inUp) |
Set the up vector for the character. | |
Vec3 | GetUp () const |
bool | IsSlopeTooSteep (Vec3Arg inNormal) const |
Check if the normal of the ground surface is too steep to walk on. | |
const Shape * | GetShape () const |
Get the current shape that the character is using. | |
Public Member Functions inherited from RefTarget< CharacterBase > | |
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 Member Functions inherited from NonCopyable | |
NonCopyable ()=default | |
NonCopyable (const NonCopyable &)=delete | |
void | operator= (const NonCopyable &)=delete |
Static Public Member Functions | |
static const char * | sToString (EGroundState inState) |
Debug function to convert enum values to string. | |
Static Public Member Functions inherited from RefTarget< CharacterBase > | |
static int | sInternalGetRefCountOffset () |
INTERNAL HELPER FUNCTION USED BY SERIALIZATION. | |
Additional Inherited Members | |
Protected Attributes inherited from RefTarget< CharacterBase > | |
atomic< uint32 > | mRefCount |
Current reference count. | |
Static Protected Attributes inherited from RefTarget< CharacterBase > | |
static constexpr uint32 | cEmbedded |
A large value that gets added to the refcount to mark the object as embedded. | |
Base class for character class.
|
strong |
Enumerator | |
---|---|
OnGround | Character is on the ground and can move freely. |
OnSteepGround | Character is on a slope that is too steep and can't climb up any further. The caller should start applying downward velocity if sliding from the slope is desired. |
NotSupported | Character is touching an object, but is not supported by it and should fall. The GetGroundXXX functions will return information about the touched object. |
InAir | Character is in the air and is not touching anything. |
JPH_NAMESPACE_BEGIN CharacterBase::CharacterBase | ( | const CharacterBaseSettings * | inSettings, |
PhysicsSystem * | inSystem ) |
Constructor.
|
virtualdefault |
Destructor.
|
inline |
|
inline |
BodyID of the object the character is standing on. Note may have been removed!
|
inline |
Material that the character is standing on.
|
inline |
Get the contact normal with the ground.
|
inline |
Get the contact point with the ground.
|
inline |
Current ground state.
|
inline |
Sub part of the body that we're standing on.
|
inline |
User data value of the body that we're standing on.
|
inline |
Velocity in world space of ground.
Get the current shape that the character is using.
|
inline |
Check if the normal of the ground surface is too steep to walk on.
|
inline |
Returns true if the player is supported by normal or steep ground.
|
virtual |
Reimplemented in CharacterVirtual.
|
virtual |
Reimplemented in CharacterVirtual.
Set the maximum angle of slope that character can still walk on (radians)
|
static |
Debug function to convert enum values to string.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |