Body.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346
  1. // SPDX-FileCopyrightText: 2021 Jorrit Rouwe
  2. // SPDX-License-Identifier: MIT
  3. #pragma once
  4. #include <Jolt/Core/NonCopyable.h>
  5. #include <Jolt/Geometry/AABox.h>
  6. #include <Jolt/Physics/Collision/Shape/Shape.h>
  7. #include <Jolt/Physics/Collision/BroadPhase/BroadPhaseLayer.h>
  8. #include <Jolt/Physics/Collision/ObjectLayer.h>
  9. #include <Jolt/Physics/Collision/CollisionGroup.h>
  10. #include <Jolt/Physics/Collision/TransformedShape.h>
  11. #include <Jolt/Physics/Body/MotionProperties.h>
  12. #include <Jolt/Physics/Body/BodyID.h>
  13. #include <Jolt/Physics/Body/BodyAccess.h>
  14. #include <Jolt/Core/StringTools.h>
  15. JPH_NAMESPACE_BEGIN
  16. class StateRecorder;
  17. class BodyCreationSettings;
  18. /// A rigid body that can be simulated using the physics system
  19. ///
  20. /// Note that internally all properties (position, velocity etc.) are tracked relative to the center of mass of the object to simplify the simulation of the object.
  21. ///
  22. /// The offset between the position of the body and the center of mass position of the body is GetShape()->GetCenterOfMass().
  23. /// The functions that get/set the position of the body all indicate if they are relative to the center of mass or to the original position in which the shape was created.
  24. ///
  25. /// The linear velocity is also velocity of the center of mass, to correct for this: \f$VelocityCOM = Velocity - AngularVelocity \times ShapeCOM\f$.
  26. class Body : public NonCopyable
  27. {
  28. public:
  29. JPH_OVERRIDE_NEW_DELETE
  30. /// Default constructor
  31. Body() = default;
  32. /// Destructor
  33. ~Body() { JPH_ASSERT(mMotionProperties == nullptr); }
  34. /// Get the id of this body
  35. inline const BodyID & GetID() const { return mID; }
  36. /// If this body is currently actively simulating (true) or sleeping (false)
  37. inline bool IsActive() const { return mMotionProperties != nullptr && mMotionProperties->mIndexInActiveBodies != cInactiveIndex; }
  38. /// Check if this body is static (not movable)
  39. inline bool IsStatic() const { return mMotionType == EMotionType::Static; }
  40. /// Check if this body is kinematic (keyframed), which means that it will move according to its current velocity, but forces don't affect it
  41. inline bool IsKinematic() const { return mMotionType == EMotionType::Kinematic; }
  42. /// Check if this body is dynamic, which means that it moves and forces can act on it
  43. inline bool IsDynamic() const { return mMotionType == EMotionType::Dynamic; }
  44. /// Check if a body could be made kinematic or dynamic (if it was created dynamic or with mAllowDynamicOrKinematic set to true)
  45. inline bool CanBeKinematicOrDynamic() const { return mMotionProperties != nullptr; }
  46. /// Change the body to a sensor. A sensor will receive collision callbacks, but will not cause any collision responses and can be used as a trigger volume.
  47. /// The cheapest sensor (in terms of CPU usage) is a sensor with motion type Static (they can be moved around using BodyInterface::SetPosition/SetPositionAndRotation).
  48. /// These sensors will only detect collisions with active Dynamic or Kinematic bodies. As soon as a body go to sleep, the contact point with the sensor will be lost.
  49. /// If you make a sensor Dynamic or Kinematic and activate them, the sensor will be able to detect collisions with sleeping bodies too. An active sensor will never go to sleep automatically.
  50. /// When you make a Dynamic or Kinematic sensor, make sure it is in an ObjectLayer that does not collide with Static bodies or other sensors to avoid extra overhead in the broad phase.
  51. inline void SetIsSensor(bool inIsSensor) { if (inIsSensor) mFlags.fetch_or(uint8(EFlags::IsSensor), memory_order_relaxed); else mFlags.fetch_and(uint8(~uint8(EFlags::IsSensor)), memory_order_relaxed); }
  52. /// Check if this body is a sensor.
  53. inline bool IsSensor() const { return (mFlags.load(memory_order_relaxed) & uint8(EFlags::IsSensor)) != 0; }
  54. /// If PhysicsSettings::mUseManifoldReduction is true, this allows turning off manifold reduction for this specific body. Manifold reduction by default will combine contacts that come from different SubShapeIDs (e.g. different triangles or different compound shapes).
  55. /// If the application requires tracking exactly which SubShapeIDs are in contact, you can turn off manifold reduction. Note that this comes at a performance cost.
  56. inline void SetUseManifoldReduction(bool inUseReduction) { if (inUseReduction) mFlags.fetch_or(uint8(EFlags::UseManifoldReduction), memory_order_relaxed); else mFlags.fetch_and(uint8(~uint8(EFlags::UseManifoldReduction)), memory_order_relaxed); }
  57. /// Check if this body can use manifold reduction.
  58. inline bool GetUseManifoldReduction() const { return (mFlags.load(memory_order_relaxed) & uint8(EFlags::UseManifoldReduction)) != 0; }
  59. /// Checks if the combination of this body and inBody2 should use manifold reduction
  60. inline bool GetUseManifoldReductionWithBody(const Body &inBody2) const { return ((mFlags.load(memory_order_relaxed) & inBody2.mFlags.load(memory_order_relaxed)) & uint8(EFlags::UseManifoldReduction)) != 0; }
  61. /// Motion type of this body
  62. inline EMotionType GetMotionType() const { return mMotionType; }
  63. void SetMotionType(EMotionType inMotionType);
  64. /// Get broadphase layer, this determines in which broad phase sub-tree the object is placed
  65. inline BroadPhaseLayer GetBroadPhaseLayer() const { return mBroadPhaseLayer; }
  66. /// Get object layer, this determines which other objects it collides with
  67. inline ObjectLayer GetObjectLayer() const { return mObjectLayer; }
  68. /// Collision group and sub-group ID, determines which other objects it collides with
  69. const CollisionGroup & GetCollisionGroup() const { return mCollisionGroup; }
  70. CollisionGroup & GetCollisionGroup() { return mCollisionGroup; }
  71. void SetCollisionGroup(const CollisionGroup &inGroup) { mCollisionGroup = inGroup; }
  72. /// If this body can go to sleep. Note that disabling sleeping on a sleeping object wil not wake it up.
  73. bool GetAllowSleeping() const { return mMotionProperties->mAllowSleeping; }
  74. void SetAllowSleeping(bool inAllow);
  75. /// Friction (dimensionless number, usually between 0 and 1, 0 = no friction, 1 = friction force equals force that presses the two bodies together)
  76. inline float GetFriction() const { return mFriction; }
  77. void SetFriction(float inFriction) { JPH_ASSERT(inFriction >= 0.0f); mFriction = inFriction; }
  78. /// Restitution (dimensionless number, usually between 0 and 1, 0 = completely inelastic collision response, 1 = completely elastic collision response)
  79. inline float GetRestitution() const { return mRestitution; }
  80. void SetRestitution(float inRestitution) { JPH_ASSERT(inRestitution >= 0.0f && inRestitution <= 1.0f); mRestitution = inRestitution; }
  81. /// Get world space linear velocity of the center of mass (unit: m/s)
  82. inline Vec3 GetLinearVelocity() const { return !IsStatic()? mMotionProperties->GetLinearVelocity() : Vec3::sZero(); }
  83. /// Set world space linear velocity of the center of mass (unit: m/s)
  84. void SetLinearVelocity(Vec3Arg inLinearVelocity) { JPH_ASSERT(!IsStatic()); mMotionProperties->SetLinearVelocity(inLinearVelocity); }
  85. /// Set world space linear velocity of the center of mass, will make sure the value is clamped against the maximum linear velocity
  86. void SetLinearVelocityClamped(Vec3Arg inLinearVelocity) { JPH_ASSERT(!IsStatic()); mMotionProperties->SetLinearVelocityClamped(inLinearVelocity); }
  87. /// Get world space angular velocity of the center of mass (unit: rad/s)
  88. inline Vec3 GetAngularVelocity() const { return !IsStatic()? mMotionProperties->GetAngularVelocity() : Vec3::sZero(); }
  89. /// Set world space angular velocity of the center of mass (unit: rad/s)
  90. void SetAngularVelocity(Vec3Arg inAngularVelocity) { JPH_ASSERT(!IsStatic()); mMotionProperties->SetAngularVelocity(inAngularVelocity); }
  91. /// Set world space angular velocity of the center of mass, will make sure the value is clamped against the maximum angular velocity
  92. void SetAngularVelocityClamped(Vec3Arg inAngularVelocity) { JPH_ASSERT(!IsStatic()); mMotionProperties->SetAngularVelocityClamped(inAngularVelocity); }
  93. /// Velocity of point inPoint (in center of mass space, e.g. on the surface of the body) of the body (unit: m/s)
  94. inline Vec3 GetPointVelocityCOM(Vec3Arg inPointRelativeToCOM) const { return !IsStatic()? mMotionProperties->GetPointVelocityCOM(inPointRelativeToCOM) : Vec3::sZero(); }
  95. /// Velocity of point inPoint (in world space, e.g. on the surface of the body) of the body (unit: m/s)
  96. inline Vec3 GetPointVelocity(RVec3Arg inPoint) const { JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read)); return GetPointVelocityCOM(Vec3(inPoint - mPosition)); }
  97. /// Add force (unit: N) at center of mass for the next time step, will be reset after the next call to PhysicsSimulation::Update
  98. inline void AddForce(Vec3Arg inForce) { JPH_ASSERT(IsDynamic()); (Vec3::sLoadFloat3Unsafe(mMotionProperties->mForce) + inForce).StoreFloat3(&mMotionProperties->mForce); }
  99. /// Add force (unit: N) at inPosition for the next time step, will be reset after the next call to PhysicsSimulation::Update
  100. inline void AddForce(Vec3Arg inForce, RVec3Arg inPosition);
  101. /// Add torque (unit: N m) for the next time step, will be reset after the next call to PhysicsSimulation::Update
  102. inline void AddTorque(Vec3Arg inTorque) { JPH_ASSERT(IsDynamic()); (Vec3::sLoadFloat3Unsafe(mMotionProperties->mTorque) + inTorque).StoreFloat3(&mMotionProperties->mTorque); }
  103. // Get the total amount of force applied to the center of mass this time step (through AddForce calls). Note that it will reset to zero after PhysicsSimulation::Update.
  104. inline Vec3 GetAccumulatedForce() const { JPH_ASSERT(IsDynamic()); return mMotionProperties->GetAccumulatedForce(); }
  105. // Get the total amount of torque applied to the center of mass this time step (through AddForce/AddTorque calls). Note that it will reset to zero after PhysicsSimulation::Update.
  106. inline Vec3 GetAccumulatedTorque() const { JPH_ASSERT(IsDynamic()); return mMotionProperties->GetAccumulatedTorque(); }
  107. /// Get inverse inertia tensor in world space
  108. inline Mat44 GetInverseInertia() const;
  109. /// Add impulse to center of mass (unit: kg m/s)
  110. inline void AddImpulse(Vec3Arg inImpulse);
  111. /// Add impulse to point in world space (unit: kg m/s)
  112. inline void AddImpulse(Vec3Arg inImpulse, RVec3Arg inPosition);
  113. /// Add angular impulse in world space (unit: N m s)
  114. inline void AddAngularImpulse(Vec3Arg inAngularImpulse);
  115. /// Set velocity of body such that it will be positioned at inTargetPosition/Rotation in inDeltaTime seconds.
  116. void MoveKinematic(RVec3Arg inTargetPosition, QuatArg inTargetRotation, float inDeltaTime);
  117. /// Applies an impulse to the body that simulates fluid buoyancy and drag
  118. /// @param inSurfacePosition Position on the fluid surface in world space
  119. /// @param inSurfaceNormal Normal of the fluid surface (should point up)
  120. /// @param inBuoyancy The buoyancy factor for the body. 1 = neutral body, < 1 sinks, > 1 floats. Note that we don't use the fluid density since it is harder to configure than a simple number between [0, 2]
  121. /// @param inLinearDrag Linear drag factor that slows down the body when in the fluid (approx. 0.5)
  122. /// @param inAngularDrag Angular drag factor that slows down rotation when the body is in the fluid (approx. 0.01)
  123. /// @param inFluidVelocity The average velocity of the fluid (in m/s) in which the body resides
  124. /// @param inGravity The graviy vector (pointing down)
  125. /// @param inDeltaTime Delta time of the next simulation step (in s)
  126. /// @return true if an impulse was applied, false if the body was not in the fluid
  127. bool ApplyBuoyancyImpulse(RVec3Arg inSurfacePosition, Vec3Arg inSurfaceNormal, float inBuoyancy, float inLinearDrag, float inAngularDrag, Vec3Arg inFluidVelocity, Vec3Arg inGravity, float inDeltaTime);
  128. /// Check if this body has been added to the physics system
  129. inline bool IsInBroadPhase() const { return (mFlags.load(memory_order_relaxed) & uint8(EFlags::IsInBroadPhase)) != 0; }
  130. /// Check if this body has been changed in such a way that the collision cache should be considered invalid for any body interacting with this body
  131. inline bool IsCollisionCacheInvalid() const { return (mFlags.load(memory_order_relaxed) & uint8(EFlags::InvalidateContactCache)) != 0; }
  132. /// Get the shape of this body
  133. inline const Shape * GetShape() const { return mShape; }
  134. /// World space position of the body
  135. inline RVec3 GetPosition() const { JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read)); return mPosition - mRotation * mShape->GetCenterOfMass(); }
  136. /// World space rotation of the body
  137. inline Quat GetRotation() const { JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read)); return mRotation; }
  138. /// Calculates the transform of this body
  139. inline RMat44 GetWorldTransform() const;
  140. /// Gets the world space position of this body's center of mass
  141. inline RVec3 GetCenterOfMassPosition() const { JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read)); return mPosition; }
  142. /// Calculates the transform for this body's center of mass
  143. inline RMat44 GetCenterOfMassTransform() const;
  144. /// Calculates the inverse of the transform for this body's center of mass
  145. inline RMat44 GetInverseCenterOfMassTransform() const;
  146. /// Get world space bounding box
  147. inline const AABox & GetWorldSpaceBounds() const { return mBounds; }
  148. /// Access to the motion properties
  149. const MotionProperties *GetMotionProperties() const { JPH_ASSERT(!IsStatic()); return mMotionProperties; }
  150. MotionProperties * GetMotionProperties() { JPH_ASSERT(!IsStatic()); return mMotionProperties; }
  151. /// Access to the motion properties (version that does not check if the object is kinematic or dynamic)
  152. const MotionProperties *GetMotionPropertiesUnchecked() const { return mMotionProperties; }
  153. MotionProperties * GetMotionPropertiesUnchecked() { return mMotionProperties; }
  154. /// Access to the user data, can be used for anything by the application
  155. uint64 GetUserData() const { return mUserData; }
  156. void SetUserData(uint64 inUserData) { mUserData = inUserData; }
  157. /// Get surface normal of a particular sub shape and its world space surface position on this body
  158. inline Vec3 GetWorldSpaceSurfaceNormal(const SubShapeID &inSubShapeID, RVec3Arg inPosition) const;
  159. /// Get the transformed shape of this body, which can be used to do collision detection outside of a body lock
  160. inline TransformedShape GetTransformedShape() const { JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::Read)); return TransformedShape(mPosition, mRotation, mShape, mID); }
  161. /// Debug function to convert a body back to a body creation settings object to be able to save/recreate the body later
  162. BodyCreationSettings GetBodyCreationSettings() const;
  163. /// A dummy body that can be used by constraints to attach a constraint to the world instead of another body
  164. static Body sFixedToWorld;
  165. ///@name THESE FUNCTIONS ARE FOR INTERNAL USE ONLY AND SHOULD NOT BE CALLED BY THE APPLICATION
  166. ///@{
  167. /// Helper function for BroadPhase::FindCollidingPairs that returns true when two bodies can collide
  168. /// It assumes that body 1 is dynamic and active and guarantees that it body 1 collides with body 2 that body 2 will not collide with body 1 in order to avoid finding duplicate collision pairs
  169. static inline bool sFindCollidingPairsCanCollide(const Body &inBody1, const Body &inBody2);
  170. /// Update position using an Euler step (used during position integrate & constraint solving)
  171. inline void AddPositionStep(Vec3Arg inLinearVelocityTimesDeltaTime) { JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::ReadWrite)); mPosition += inLinearVelocityTimesDeltaTime; JPH_ASSERT(!mPosition.IsNaN()); }
  172. inline void SubPositionStep(Vec3Arg inLinearVelocityTimesDeltaTime) { JPH_ASSERT(BodyAccess::sCheckRights(BodyAccess::sPositionAccess, BodyAccess::EAccess::ReadWrite)); mPosition -= inLinearVelocityTimesDeltaTime; JPH_ASSERT(!mPosition.IsNaN()); }
  173. /// Update rotation using an Euler step (using during position integrate & constraint solving)
  174. inline void AddRotationStep(Vec3Arg inAngularVelocityTimesDeltaTime);
  175. inline void SubRotationStep(Vec3Arg inAngularVelocityTimesDeltaTime);
  176. /// Flag if body is in the broadphase (should only be called by the BroadPhase)
  177. inline void SetInBroadPhaseInternal(bool inInBroadPhase) { if (inInBroadPhase) mFlags.fetch_or(uint8(EFlags::IsInBroadPhase), memory_order_relaxed); else mFlags.fetch_and(uint8(~uint8(EFlags::IsInBroadPhase)), memory_order_relaxed); }
  178. /// Invalidate the contact cache (should only be called by the BodyManager), will be reset the next simulation step. Returns true if the contact cache was still valid.
  179. inline bool InvalidateContactCacheInternal() { return (mFlags.fetch_or(uint8(EFlags::InvalidateContactCache), memory_order_relaxed) & uint8(EFlags::InvalidateContactCache)) == 0; }
  180. /// Reset the collision cache invalid flag (should only be called by the BodyManager).
  181. inline void ValidateContactCacheInternal() { JPH_IF_ENABLE_ASSERTS(uint8 old_val = ) mFlags.fetch_and(uint8(~uint8(EFlags::InvalidateContactCache)), memory_order_relaxed); JPH_ASSERT((old_val & uint8(EFlags::InvalidateContactCache)) != 0); }
  182. /// Updates world space bounding box (should only be called by the PhysicsSystem)
  183. void CalculateWorldSpaceBoundsInternal();
  184. /// Function to update body's position (should only be called by the BodyInterface since it also requires updating the broadphase)
  185. void SetPositionAndRotationInternal(RVec3Arg inPosition, QuatArg inRotation);
  186. /// Updates the center of mass and optionally mass propertes after shifting the center of mass or changes to the shape (should only be called by the BodyInterface since it also requires updating the broadphase)
  187. /// @param inPreviousCenterOfMass Center of mass of the shape before the alterations
  188. /// @param inUpdateMassProperties When true, the mass and inertia tensor is recalculated
  189. void UpdateCenterOfMassInternal(Vec3Arg inPreviousCenterOfMass, bool inUpdateMassProperties);
  190. /// Function to update a body's shape (should only be called by the BodyInterface since it also requires updating the broadphase)
  191. /// @param inShape The new shape for this body
  192. /// @param inUpdateMassProperties When true, the mass and inertia tensor is recalculated
  193. void SetShapeInternal(const Shape *inShape, bool inUpdateMassProperties);
  194. /// Access to the index in the BodyManager::mActiveBodies list
  195. uint32 GetIndexInActiveBodiesInternal() const { return mMotionProperties != nullptr? mMotionProperties->mIndexInActiveBodies : cInactiveIndex; }
  196. enum class ECanSleep
  197. {
  198. CannotSleep = 0, ///< Object cannot go to sleep
  199. CanSleep = 1, ///< Object can go to sleep
  200. };
  201. /// Update eligibility for sleeping
  202. ECanSleep UpdateSleepStateInternal(float inDeltaTime, float inMaxMovement, float inTimeBeforeSleep);
  203. /// Saving state for replay
  204. void SaveState(StateRecorder &inStream) const;
  205. /// Restoring state for replay
  206. void RestoreState(StateRecorder &inStream);
  207. ///@}
  208. static constexpr uint32 cInactiveIndex = uint32(-1); ///< Constant indicating that body is not active
  209. private:
  210. friend class BodyManager;
  211. explicit Body(bool); ///< Alternative constructor that initializes all members
  212. inline void GetSleepTestPoints(RVec3 *outPoints) const; ///< Determine points to test for checking if body is sleeping: COM, COM + largest bounding box axis, COM + second largest bounding box axis
  213. inline void ResetSleepTestSpheres(); ///< Reset spheres to current position as returned by GetSleepTestPoints
  214. enum class EFlags : uint8
  215. {
  216. IsSensor = 1 << 0, ///< If this object is a sensor. A sensor will receive collision callbacks, but will not cause any collision responses and can be used as a trigger volume.
  217. IsInBroadPhase = 1 << 1, ///< Set this bit to indicate that the body is in the broadphase
  218. InvalidateContactCache = 1 << 2, ///< Set this bit to indicate that all collision caches for this body are invalid, will be reset the next simulation step.
  219. UseManifoldReduction = 1 << 3, ///< Set this bit to indicate that this body can use manifold reduction (if PhysicsSettings::mUseManifoldReduction is true)
  220. };
  221. // 16 byte aligned
  222. RVec3 mPosition; ///< World space position of center of mass
  223. Quat mRotation; ///< World space rotation of center of mass
  224. AABox mBounds; ///< World space bounding box of the body
  225. // 8 byte aligned
  226. RefConst<Shape> mShape; ///< Shape representing the volume of this body
  227. MotionProperties * mMotionProperties = nullptr; ///< If this is a keyframed or dynamic object, this object holds all information about the movement
  228. uint64 mUserData = 0; ///< User data, can be used for anything by the application
  229. CollisionGroup mCollisionGroup; ///< The collision group this body belongs to (determines if two objects can collide)
  230. // 4 byte aligned
  231. float mFriction; ///< Friction of the body (dimensionless number, usually between 0 and 1, 0 = no friction, 1 = friction force equals force that presses the two bodies together)
  232. float mRestitution; ///< Restitution of body (dimensionless number, usually between 0 and 1, 0 = completely inelastic collision response, 1 = completely elastic collision response)
  233. BodyID mID; ///< ID of the body (index in the bodies array)
  234. // 2 bytes aligned
  235. ObjectLayer mObjectLayer; ///< The collision layer this body belongs to (determines if two objects can collide)
  236. // 1 byte aligned
  237. BroadPhaseLayer mBroadPhaseLayer; ///< The broad phase layer this body belongs to
  238. EMotionType mMotionType; ///< Type of motion (static, dynamic or kinematic)
  239. atomic<uint8> mFlags = 0; ///< See EFlags for possible flags
  240. // 121 bytes up to here (64-bit mode, single precision)
  241. #if JPH_CPU_ADDRESS_BITS == 32
  242. // Padding for 32 bit mode
  243. char mPadding[19];
  244. #endif
  245. #ifdef JPH_DOUBLE_PRECISION
  246. // Padding to align to 256 bit
  247. char mPadding2[16];
  248. #endif
  249. };
  250. static_assert(sizeof(Body) == JPH_IF_SINGLE_PRECISION_ELSE(128, 160), "Body size is incorrect");
  251. static_assert(alignof(Body) == JPH_RVECTOR_ALIGNMENT, "Body should properly align");
  252. JPH_NAMESPACE_END
  253. #include "Body.inl"