11 JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read));
18 JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read));
25 JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read));
39 if (!
inBody1.GetCollideKinematicVsNonDynamic()
40 && !
inBody2.GetCollideKinematicVsNonDynamic()
72 JPH_ASSERT(
inBody1.GetID() !=
inBody2.GetID(),
"Read the comment above, A and B are the same body which should not be possible!");
75 if (!
inBody1.GetCollisionGroup().CanCollide(
inBody2.GetCollisionGroup()))
84 JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::ReadWrite));
103 JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::ReadWrite));
158 JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read));
193 GetSleepTestPoints(
points);
#define JPH_NAMESPACE_END
Definition Core.h:367
std::uint32_t uint32
Definition Core.h:442
#define JPH_NAMESPACE_BEGIN
Definition Core.h:361
#define JPH_ASSERT(...)
Definition IssueReporting.h:33
AllocateFunction Allocate
Definition Memory.cpp:59
Vec3 GetExtent() const
Get extent of bounding box (half of the size)
Definition AABox.h:111
const MotionProperties * GetMotionProperties() const
Access to the motion properties.
Definition Body.h:255
Vec3 GetWorldSpaceSurfaceNormal(const SubShapeID &inSubShapeID, RVec3Arg inPosition) const
Get surface normal of a particular sub shape and its world space surface position on this body.
Definition Body.inl:114
bool IsDynamic() const
Check if this body is dynamic, which means that it moves and forces can act on it.
Definition Body.h:67
void AddRotationStep(Vec3Arg inAngularVelocityTimesDeltaTime)
Update rotation using an Euler step (using during position integrate & constraint solving)
Definition Body.inl:81
RMat44 GetWorldTransform() const
Calculates the transform of this body.
Definition Body.inl:9
void SetLinearVelocityClamped(Vec3Arg inLinearVelocity)
Set world space linear velocity of the center of mass, will make sure the value is clamped against th...
Definition Body.h:156
static constexpr uint32 cInactiveIndex
Constant indicating that body is not active.
Definition Body.h:335
static bool sFindCollidingPairsCanCollide(const Body &inBody1, const Body &inBody2)
Definition Body.inl:30
Mat44 GetInverseInertia() const
Get inverse inertia tensor in world space.
Definition Body.inl:120
bool IsRigidBody() const
Check if this body is a rigid body.
Definition Body.h:52
void SetAngularVelocityClamped(Vec3Arg inAngularVelocity)
Set world space angular velocity of the center of mass, will make sure the value is clamped against t...
Definition Body.h:165
RMat44 GetCenterOfMassTransform() const
Calculates the transform for this body's center of mass.
Definition Body.inl:16
void ResetSleepTimer()
Resets the sleep timer. This does not wake up the body if it is sleeping, but allows resetting the sy...
Definition Body.inl:190
RMat44 GetInverseCenterOfMassTransform() const
Calculates the inverse of the transform for this body's center of mass.
Definition Body.inl:23
void AddAngularImpulse(Vec3Arg inAngularImpulse)
Add angular impulse in world space (unit: N m s)
Definition Body.inl:149
void SubRotationStep(Vec3Arg inAngularVelocityTimesDeltaTime)
Definition Body.inl:100
void AddForce(Vec3Arg inForce)
Add force (unit: N) at center of mass for the next time step, will be reset after the next call to Ph...
Definition Body.h:174
void AddTorque(Vec3Arg inTorque)
Add torque (unit: N m) for the next time step, will be reset after the next call to PhysicsSystem::Up...
Definition Body.h:180
void AddImpulse(Vec3Arg inImpulse)
Add impulse to center of mass (unit: kg m/s)
Definition Body.inl:133
Holds a 4x4 matrix of floats, but supports also operations on the 3x3 upper left part of the matrix.
Definition Mat44.h:13
JPH_INLINE Mat44 PreTranslated(Vec3Arg inTranslation) const
Pre multiply by translation matrix: result = this * Mat44::sTranslation(inTranslation)
Definition Mat44.inl:898
static JPH_INLINE Mat44 sRotationTranslation(QuatArg inR, Vec3Arg inT)
Get matrix that rotates and translates.
Definition Mat44.inl:149
static JPH_INLINE Mat44 sRotation(Vec3Arg inAxis, float inAngle)
Rotate around arbitrary axis.
Definition Mat44.inl:139
static JPH_INLINE Mat44 sInverseRotationTranslation(QuatArg inR, Vec3Arg inT)
Get inverse matrix of sRotationTranslation.
Definition Mat44.inl:156
Vec3 GetLinearVelocity() const
Get world space linear velocity of the center of mass.
Definition MotionProperties.h:43
Vec3 GetAngularVelocity() const
Get world space angular velocity of the center of mass.
Definition MotionProperties.h:52
float GetInverseMass() const
Get inverse mass (1 / mass). Should only be called on a dynamic object (static or kinematic bodies ha...
Definition MotionProperties.h:95
JPH_INLINE Vec3 MultiplyWorldSpaceInverseInertiaByVector(QuatArg inBodyRotation, Vec3Arg inV) const
Multiply a vector with the inverse world space inertia tensor ( ). Zero if object is static or kinema...
Definition MotionProperties.inl:76
void ResetSleepTestSpheres(const RVec3 *inPoints)
Reset spheres to center around inPoints with radius 0.
Definition MotionProperties.inl:144
Mat44 GetInverseInertiaForRotation(Mat44Arg inRotation) const
Get inverse inertia matrix ( ) for a given object rotation (translation will be ignored)....
Definition MotionProperties.inl:59
static JPH_INLINE Quat sRotation(Vec3Arg inAxis, float inAngle)
Rotation from axis and angle.
Definition Quat.inl:74
bool IsNaN() const
If any component of this quaternion is a NaN (not a number)
Definition Quat.h:62
virtual AABox GetLocalBounds() const =0
Get local bounding box including convex radius, this box is centered around the center of mass rather...
virtual Vec3 GetCenterOfMass() const
All shapes are centered around their center of mass. This function returns the center of mass positio...
Definition Shape.h:203
virtual Vec3 GetSurfaceNormal(const SubShapeID &inSubShapeID, Vec3Arg inLocalSurfacePosition) const =0
A sub shape id contains a path to an element (usually a triangle or other primitive type) of a compou...
Definition SubShapeID.h:23
JPH_INLINE float GetX() const
Get individual components.
Definition Vec3.h:123
JPH_INLINE int GetLowestComponentIndex() const
Get index of component with lowest value.
Definition Vec3.inl:554
JPH_INLINE float GetY() const
Definition Vec3.h:124
JPH_INLINE float GetZ() const
Definition Vec3.h:125