#define JPH_NAMESPACE_END
Definition Core.h:240
uint64_t uint64
Definition Core.h:313
#define JPH_NAMESPACE_BEGIN
Definition Core.h:234
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
Settings for constructing a rigid body.
Definition BodyCreationSettings.h:29
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:31
void SetShape(const BodyID &inBodyID, const Shape *inShape, bool inUpdateMassProperties, EActivation inActivationMode) const
Definition BodyInterface.cpp:239
Vec3 GetPointVelocity(const BodyID &inBodyID, RVec3Arg inPoint) const
Velocity of point inPoint (in world space, e.g. on the surface of the body) of the body.
Definition BodyInterface.cpp:627
float GetFriction(const BodyID &inBodyID) const
Definition BodyInterface.cpp:858
void DeactivateBodies(const BodyID *inBodyIDs, int inNumber)
Definition BodyInterface.cpp:197
Vec3 GetAngularVelocity(const BodyID &inBodyID) const
Definition BodyInterface.cpp:614
void SetPositionAndRotationWhenChanged(const BodyID &inBodyID, RVec3Arg inPosition, QuatArg inRotation, EActivation inActivationMode)
Will only update the position/rotation and activate the body when the difference is larger than a ver...
Definition BodyInterface.cpp:353
BodyID CreateAndAddBody(const BodyCreationSettings &inSettings, EActivation inActivationMode)
Definition BodyInterface.cpp:124
void SetMotionType(const BodyID &inBodyID, EMotionType inMotionType, EActivation inActivationMode)
Definition BodyInterface.cpp:782
void SetPosition(const BodyID &inBodyID, RVec3Arg inPosition, EActivation inActivationMode)
Definition BodyInterface.cpp:397
void SetRotation(const BodyID &inBodyID, QuatArg inRotation, EActivation inActivationMode)
Definition BodyInterface.cpp:438
bool IsAdded(const BodyID &inBodyID) const
Check if a body has been added to the physics system.
Definition BodyInterface.cpp:118
Quat GetRotation(const BodyID &inBodyID) const
Definition BodyInterface.cpp:461
void AddTorque(const BodyID &inBodyID, Vec3Arg inTorque)
See Body::AddTorque.
Definition BodyInterface.cpp:672
void SetGravityFactor(const BodyID &inBodyID, float inGravityFactor)
Definition BodyInterface.cpp:867
void AddForceAndTorque(const BodyID &inBodyID, Vec3Arg inForce, Vec3Arg inTorque)
A combination of Body::AddForce and Body::AddTorque.
Definition BodyInterface.cpp:688
EMotionType GetMotionType(const BodyID &inBodyID) const
Definition BodyInterface.cpp:801
void SetObjectLayer(const BodyID &inBodyID, ObjectLayer inLayer)
Definition BodyInterface.cpp:298
RVec3 GetCenterOfMassPosition(const BodyID &inBodyID) const
Definition BodyInterface.cpp:429
float GetGravityFactor(const BodyID &inBodyID) const
Definition BodyInterface.cpp:874
uint64 GetUserData(const BodyID &inBodyID) const
Get the user data for a body.
Definition BodyInterface.cpp:892
void SetPositionAndRotation(const BodyID &inBodyID, RVec3Arg inPosition, QuatArg inRotation, EActivation inActivationMode)
Definition BodyInterface.cpp:330
void SetMotionQuality(const BodyID &inBodyID, EMotionQuality inMotionQuality)
Definition BodyInterface.cpp:810
EMotionQuality GetMotionQuality(const BodyID &inBodyID) const
Definition BodyInterface.cpp:817
Vec3 GetLinearVelocity(const BodyID &inBodyID) const
Definition BodyInterface.cpp:552
bool AssignBodyID(Body *ioBody)
Definition BodyInterface.cpp:51
void DestroyBody(const BodyID &inBodyID)
Destroy a body.
Definition BodyInterface.cpp:73
void GetPositionAndRotation(const BodyID &inBodyID, RVec3 &outPosition, Quat &outRotation) const
Definition BodyInterface.cpp:381
void SetLinearVelocity(const BodyID &inBodyID, Vec3Arg inLinearVelocity)
Definition BodyInterface.cpp:536
RMat44 GetCenterOfMassTransform(const BodyID &inBodyID) const
Definition BodyInterface.cpp:479
float GetRestitution(const BodyID &inBodyID) const
Definition BodyInterface.cpp:842
const PhysicsMaterial * GetMaterial(const BodyID &inBodyID, const SubShapeID &inSubShapeID) const
Get the material for a particular sub shape.
Definition BodyInterface.cpp:901
ObjectLayer GetObjectLayer(const BodyID &inBodyID) const
Definition BodyInterface.cpp:321
void AddBody(const BodyID &inBodyID, EActivation inActivationMode)
Definition BodyInterface.cpp:83
void SetAngularVelocity(const BodyID &inBodyID, Vec3Arg inAngularVelocity)
Definition BodyInterface.cpp:598
void RemoveBodies(BodyID *ioBodies, int inNumber)
Definition BodyInterface.cpp:155
void MoveKinematic(const BodyID &inBodyID, RVec3Arg inTargetPosition, QuatArg inTargetRotation, float inDeltaTime)
Set velocity of body such that it will be positioned at inTargetPosition/Rotation in inDeltaTime seco...
Definition BodyInterface.cpp:488
void RemoveBody(const BodyID &inBodyID)
Remove body from the physics system.
Definition BodyInterface.cpp:101
void Init(BodyLockInterface &inBodyLockInterface, BodyManager &inBodyManager, BroadPhase &inBroadPhase)
Initialize the interface (should only be called by PhysicsSystem)
Definition BodyInterface.h:34
void DeactivateBody(const BodyID &inBodyID)
Definition BodyInterface.cpp:185
void DestroyBodyWithoutID(Body *inBody) const
Definition BodyInterface.cpp:46
void AddBodiesFinalize(BodyID *ioBodies, int inNumber, AddState inAddState, EActivation inActivationMode)
Definition BodyInterface.cpp:138
Body * CreateBodyWithID(const BodyID &inBodyID, const BodyCreationSettings &inSettings)
Definition BodyInterface.cpp:30
void AddAngularImpulse(const BodyID &inBodyID, Vec3Arg inAngularImpulse)
Definition BodyInterface.cpp:737
bool IsActive(const BodyID &inBodyID) const
Definition BodyInterface.cpp:204
void SetLinearAndAngularVelocity(const BodyID &inBodyID, Vec3Arg inLinearVelocity, Vec3Arg inAngularVelocity)
Definition BodyInterface.cpp:502
void ActivateConstraint(const TwoBodyConstraint *inConstraint)
Activate non-static bodies attached to a constraint.
Definition BodyInterface.cpp:224
void AddLinearAndAngularVelocity(const BodyID &inBodyID, Vec3Arg inLinearVelocity, Vec3Arg inAngularVelocity)
Add linear and angular to current velocities.
Definition BodyInterface.cpp:581
void SetRestitution(const BodyID &inBodyID, float inRestitution)
Definition BodyInterface.cpp:835
RMat44 GetWorldTransform(const BodyID &inBodyID) const
Definition BodyInterface.cpp:470
void UnassignBodyIDs(const BodyID *inBodyIDs, int inNumber, Body **outBodies)
Definition BodyInterface.cpp:68
Body * UnassignBodyID(const BodyID &inBodyID)
Advanced use only. See UnassignBodyIDs. Unassigns the ID of a single body.
Definition BodyInterface.cpp:61
void DestroyBodies(const BodyID *inBodyIDs, int inNumber)
Destroy multiple bodies.
Definition BodyInterface.cpp:78
RVec3 GetPosition(const BodyID &inBodyID) const
Definition BodyInterface.cpp:420
void AddLinearVelocity(const BodyID &inBodyID, Vec3Arg inLinearVelocity)
Add velocity to current velocity.
Definition BodyInterface.cpp:565
Mat44 GetInverseInertia(const BodyID &inBodyID) const
Get inverse inertia tensor in world space.
Definition BodyInterface.cpp:826
void NotifyShapeChanged(const BodyID &inBodyID, Vec3Arg inPreviousCenterOfMass, bool inUpdateMassProperties, EActivation inActivationMode) const
Definition BodyInterface.cpp:269
void ActivateBodies(const BodyID *inBodyIDs, int inNumber)
Definition BodyInterface.cpp:178
AddState AddBodiesPrepare(BodyID *ioBodies, int inNumber)
Definition BodyInterface.cpp:133
void GetLinearAndAngularVelocity(const BodyID &inBodyID, Vec3 &outLinearVelocity, Vec3 &outAngularVelocity) const
Definition BodyInterface.cpp:519
void ActivateBody(const BodyID &inBodyID)
Definition BodyInterface.cpp:166
Body * CreateBodyWithoutID(const BodyCreationSettings &inSettings) const
Definition BodyInterface.cpp:41
void AddBodiesAbort(BodyID *ioBodies, int inNumber, AddState inAddState)
Definition BodyInterface.cpp:150
TwoBodyConstraint * CreateConstraint(const TwoBodyConstraintSettings *inSettings, const BodyID &inBodyID1, const BodyID &inBodyID2)
Create a two body constraint.
Definition BodyInterface.cpp:210
Body * CreateBody(const BodyCreationSettings &inSettings)
Definition BodyInterface.cpp:19
void SetPositionRotationAndVelocity(const BodyID &inBodyID, RVec3Arg inPosition, QuatArg inRotation, Vec3Arg inLinearVelocity, Vec3Arg inAngularVelocity)
Definition BodyInterface.cpp:753
void AddImpulse(const BodyID &inBodyID, Vec3Arg inImpulse)
Applied at center of mass.
Definition BodyInterface.cpp:705
void AddForce(const BodyID &inBodyID, Vec3Arg inForce)
See Body::AddForce.
Definition BodyInterface.cpp:640
TransformedShape GetTransformedShape(const BodyID &inBodyID) const
Get transform and shape for this body, used to perform collision detection.
Definition BodyInterface.cpp:883
void * AddState
Broadphase add state handle, used to keep track of a batch while ading to the broadphase.
Definition BodyInterface.h:95
void InvalidateContactCache(const BodyID &inBodyID)
Set the Body::EFlags::InvalidateContactCache flag for the specified body. This means that the collisi...
Definition BodyInterface.cpp:910
RefConst< Shape > GetShape(const BodyID &inBodyID) const
Get the current shape.
Definition BodyInterface.cpp:230
void SetFriction(const BodyID &inBodyID, float inFriction)
Definition BodyInterface.cpp:851
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:30
Used to do coarse collision detection operations to quickly prune out bodies that will not collide.
Definition BroadPhase.h:26
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
Definition PhysicsMaterial.h:23
Definition Reference.h:154
Base class for all shapes (collision volume of a body). Defines a virtual interface for collision det...
Definition Shape.h:170
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