69 void Activate(
bool inLockBodies =
true);
74 void PostSimulation(
float inMaxSeparationDistance,
bool inLockBodies =
true);
95 void GetPositionAndRotation(
RVec3 &outPosition,
Quat &outRotation,
bool inLockBodies =
true)
const;
101 RVec3 GetPosition(
bool inLockBodies =
true)
const;
107 Quat GetRotation(
bool inLockBodies =
true)
const;
113 RVec3 GetCenterOfMassPosition(
bool inLockBodies =
true)
const;
116 RMat44 GetWorldTransform(
bool inLockBodies =
true)
const;
122 void SetLayer(
ObjectLayer inLayer,
bool inLockBodies =
true);
126 bool SetShape(
const Shape *inShape,
float inMaxPenetrationDepth,
bool inLockBodies =
true);
EAllowedDOFs
Enum used in BodyCreationSettings and MotionProperties to indicate which degrees of freedom a body ha...
Definition AllowedDOFs.h:11
@ TranslationY
Body can move in world space Y axis.
Definition AllowedDOFs.h:15
@ TranslationZ
Body can move in world space Z axis.
Definition AllowedDOFs.h:16
@ TranslationX
Body can move in world space X axis.
Definition AllowedDOFs.h:14
#define JPH_EXPORT
Definition Core.h:275
std::uint64_t uint64
Definition Core.h:504
#define JPH_NAMESPACE_END
Definition Core.h:425
#define JPH_NAMESPACE_BEGIN
Definition Core.h:419
EActivation
Enum used by AddBody to determine if the body needs to be initially active.
Definition EActivation.h:11
@ Activate
Activate the body, making it part of the simulation.
Definition EActivation.h:12
const Quat QuatArg
Definition MathTypes.h:28
const Vec3 Vec3Arg
Definition MathTypes.h:19
#define JPH_OVERRIDE_NEW_DELETE
Macro to override the new and delete functions.
Definition Memory.h:50
uint16 ObjectLayer
Definition ObjectLayer.h:16
Vec3Arg RVec3Arg
Definition Real.h:30
Mat44Arg RMat44Arg
Definition Real.h:32
Mat44 RMat44
Definition Real.h:31
Vec3 RVec3
Definition Real.h:29
CollisionCollector< CollideShapeResult, CollisionCollectorTraitsCollideShape > CollideShapeCollector
Definition Shape.h:47
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition BodyID.h:13
JPH_OVERRIDE_NEW_DELETE CharacterBase(const CharacterBaseSettings *inSettings, PhysicsSystem *inSystem)
Constructor.
Definition CharacterBase.cpp:12
CharacterBaseSettings & operator=(const CharacterBaseSettings &)=default
JPH_OVERRIDE_NEW_DELETE CharacterBaseSettings()=default
Constructor.
void SetLinearVelocity(Vec3Arg inLinearVelocity, bool inLockBodies=true)
Set the linear velocity of the character (m / s).
Definition Character.cpp:227
Vec3 GetLinearVelocity(bool inLockBodies=true) const
Get the linear velocity of the character (m / s).
Definition Character.cpp:222
BodyID GetBodyID() const
Get the body associated with this character.
Definition Character.h:92
ObjectLayer GetLayer() const
Get the layer of the character.
Definition Character.h:119
void RemoveFromPhysicsSystem(bool inLockBodies=true)
Remove bodies and constraints from the system.
Definition Character.cpp:60
void PostSimulation(float inMaxSeparationDistance, bool inLockBodies=true)
Definition Character.cpp:129
JPH_OVERRIDE_NEW_DELETE Character(const CharacterSettings *inSettings, RVec3Arg inPosition, QuatArg inRotation, uint64 inUserData, PhysicsSystem *inSystem)
Definition Character.cpp:31
void SetLinearAndAngularVelocity(Vec3Arg inLinearVelocity, Vec3Arg inAngularVelocity, bool inLockBodies=true)
Control the velocity of the character.
Definition Character.cpp:217
void AddImpulse(Vec3Arg inImpulse, bool inLockBodies=true)
Add impulse to the center of mass of the character.
Definition Character.cpp:237
void AddToPhysicsSystem(EActivation inActivationMode=EActivation::Activate, bool inLockBodies=true)
Add bodies and constraints to the system and optionally activate the bodies.
Definition Character.cpp:55
void AddLinearVelocity(Vec3Arg inLinearVelocity, bool inLockBodies=true)
Add world space linear velocity to current velocity (m / s).
Definition Character.cpp:232
Contains the configuration of a character.
Definition Character.h:17
CharacterSettings(const CharacterSettings &)=default
float mGravityFactor
Value to multiply gravity with for this character.
Definition Character.h:36
JPH_OVERRIDE_NEW_DELETE CharacterSettings()=default
Constructor.
float mMass
Mass of the character.
Definition Character.h:30
ObjectLayer mLayer
Layer that this character will be added to.
Definition Character.h:27
EAllowedDOFs mAllowedDOFs
Allowed degrees of freedom for this character.
Definition Character.h:39
float mFriction
Friction for the character.
Definition Character.h:33
Definition PhysicsSystem.h:30
Base class for all shapes (collision volume of a body). Defines a virtual interface for collision det...
Definition Shape.h:186