66 void DestroyBodyWithoutID(
Body *inBody)
const;
70 bool AssignBodyID(
Body *ioBody);
74 bool AssignBodyID(
Body *ioBody,
const BodyID &inBodyID);
84 void UnassignBodyIDs(
const BodyID *inBodyIDs,
int inNumber,
Body **outBodies);
87 void DestroyBody(
const BodyID &inBodyID);
90 void DestroyBodies(
const BodyID *inBodyIDs,
int inNumber);
99 void RemoveBody(
const BodyID &inBodyID);
102 bool IsAdded(
const BodyID &inBodyID)
const;
120 void AddBodiesAbort(
BodyID *ioBodies,
int inNumber,
AddState inAddState);
121 void RemoveBodies(
BodyID *ioBodies,
int inNumber);
126 void ActivateBody(
const BodyID &inBodyID);
127 void ActivateBodies(
const BodyID *inBodyIDs,
int inNumber);
129 void DeactivateBody(
const BodyID &inBodyID);
130 void DeactivateBodies(
const BodyID *inBodyIDs,
int inNumber);
131 bool IsActive(
const BodyID &inBodyID)
const;
151 void SetShape(
const BodyID &inBodyID,
const Shape *inShape,
bool inUpdateMassProperties,
EActivation inActivationMode)
const;
158 void NotifyShapeChanged(
const BodyID &inBodyID,
Vec3Arg inPreviousCenterOfMass,
bool inUpdateMassProperties,
EActivation inActivationMode)
const;
171 void GetPositionAndRotation(
const BodyID &inBodyID,
RVec3 &outPosition,
Quat &outRotation)
const;
174 RVec3 GetCenterOfMassPosition(
const BodyID &inBodyID)
const;
176 Quat GetRotation(
const BodyID &inBodyID)
const;
178 RMat44 GetCenterOfMassTransform(
const BodyID &inBodyID)
const;
182 void MoveKinematic(
const BodyID &inBodyID,
RVec3Arg inTargetPosition,
QuatArg inTargetRotation,
float inDeltaTime);
186 void SetLinearAndAngularVelocity(
const BodyID &inBodyID,
Vec3Arg inLinearVelocity,
Vec3Arg inAngularVelocity);
187 void GetLinearAndAngularVelocity(
const BodyID &inBodyID,
Vec3 &outLinearVelocity,
Vec3 &outAngularVelocity)
const;
188 void SetLinearVelocity(
const BodyID &inBodyID,
Vec3Arg inLinearVelocity);
189 Vec3 GetLinearVelocity(
const BodyID &inBodyID)
const;
190 void AddLinearVelocity(
const BodyID &inBodyID,
Vec3Arg inLinearVelocity);
191 void AddLinearAndAngularVelocity(
const BodyID &inBodyID,
Vec3Arg inLinearVelocity,
Vec3Arg inAngularVelocity);
192 void SetAngularVelocity(
const BodyID &inBodyID,
Vec3Arg inAngularVelocity);
193 Vec3 GetAngularVelocity(
const BodyID &inBodyID)
const;
212 void AddAngularImpulse(
const BodyID &inBodyID,
Vec3Arg inAngularImpulse);
233 Mat44 GetInverseInertia(
const BodyID &inBodyID)
const;
237 void SetRestitution(
const BodyID &inBodyID,
float inRestitution);
238 float GetRestitution(
const BodyID &inBodyID)
const;
243 void SetFriction(
const BodyID &inBodyID,
float inFriction);
244 float GetFriction(
const BodyID &inBodyID)
const;
249 void SetGravityFactor(
const BodyID &inBodyID,
float inGravityFactor);
250 float GetGravityFactor(
const BodyID &inBodyID)
const;
258 void SetUserData(
const BodyID &inBodyID,
uint64 inUserData)
const;
264 void InvalidateContactCache(
const BodyID &inBodyID);
EBodyType
Type of body.
Definition BodyType.h:11
#define JPH_EXPORT
Definition Core.h:214
std::uint64_t uint64
Definition Core.h:430
#define JPH_NAMESPACE_END
Definition Core.h:354
#define JPH_NAMESPACE_BEGIN
Definition Core.h:348
EActivation
Enum used by AddBody to determine if the body needs to be initially active.
Definition EActivation.h:11
EMotionQuality
Motion quality, or how well it detects collisions when it has a high velocity.
Definition MotionQuality.h:11
EMotionType
Motion type of a physics body.
Definition MotionType.h:11
uint16 ObjectLayer
Definition ObjectLayer.h:16
Axis aligned box.
Definition AABox.h:16
Settings for constructing a rigid body.
Definition BodyCreationSettings.h:31
ID of a body. This is a way of reasoning about bodies in a multithreaded simulation while avoiding ra...
Definition BodyID.h:13
Definition BodyInterface.h:35
void Init(BodyLockInterface &inBodyLockInterface, BodyManager &inBodyManager, BroadPhase &inBroadPhase)
Initialize the interface (should only be called by PhysicsSystem)
Definition BodyInterface.h:38
void * AddState
Broadphase add state handle, used to keep track of a batch while ading to the broadphase.
Definition BodyInterface.h:113
Base class interface for locking a body. Usually you will use BodyLockRead / BodyLockWrite / BodyLock...
Definition BodyLockInterface.h:17
Class that contains all bodies.
Definition BodyManager.h:32
Used to do coarse collision detection operations to quickly prune out bodies that will not collide.
Definition BroadPhase.h:26
Filter class for broadphase layers.
Definition BroadPhaseLayer.h:89
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
Class that makes another class non-copyable. Usage: Inherit from NonCopyable.
Definition NonCopyable.h:11
Filter class for object layers.
Definition ObjectLayer.h:28
Definition PhysicsMaterial.h:23
Definition Reference.h:151
Base class for all shapes (collision volume of a body). Defines a virtual interface for collision det...
Definition Shape.h:174
Definition SoftBodyCreationSettings.h:18
A sub shape id contains a path to an element (usually a triangle or other primitive type) of a compou...
Definition SubShapeID.h:23
Base class for all constraints that involve 2 bodies. Body1 is usually considered the parent,...
Definition TwoBodyConstraint.h:27
Base class for settings for all constraints that involve 2 bodies.
Definition TwoBodyConstraint.h:16