|
@@ -29,7 +29,7 @@ class BodyCreationSettings;
|
|
|
/// 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.
|
|
|
///
|
|
|
/// The linear velocity is also velocity of the center of mass, to correct for this: \f$VelocityCOM = Velocity - AngularVelocity \times ShapeCOM\f$.
|
|
|
-class Body : public NonCopyable
|
|
|
+class alignas(JPH_RVECTOR_ALIGNMENT) Body : public NonCopyable
|
|
|
{
|
|
|
public:
|
|
|
JPH_OVERRIDE_NEW_DELETE
|
|
@@ -319,7 +319,7 @@ private:
|
|
|
float mRestitution; ///< Restitution of body (dimensionless number, usually between 0 and 1, 0 = completely inelastic collision response, 1 = completely elastic collision response)
|
|
|
BodyID mID; ///< ID of the body (index in the bodies array)
|
|
|
|
|
|
- // 2 bytes aligned
|
|
|
+ // 2 or 4 bytes aligned
|
|
|
ObjectLayer mObjectLayer; ///< The collision layer this body belongs to (determines if two objects can collide)
|
|
|
|
|
|
// 1 byte aligned
|
|
@@ -327,15 +327,11 @@ private:
|
|
|
EMotionType mMotionType; ///< Type of motion (static, dynamic or kinematic)
|
|
|
atomic<uint8> mFlags = 0; ///< See EFlags for possible flags
|
|
|
|
|
|
- // 121 bytes up to here (64-bit mode, single precision)
|
|
|
+ // 121 bytes up to here (64-bit mode, single precision, 16-bit ObjectLayer)
|
|
|
|
|
|
#if JPH_CPU_ADDRESS_BITS == 32
|
|
|
- // Padding for 32 bit mode
|
|
|
- char mPadding[19];
|
|
|
-#endif
|
|
|
-#ifdef JPH_DOUBLE_PRECISION
|
|
|
- // Padding to align to 256 bit
|
|
|
- char mPadding2[16];
|
|
|
+ // Padding for mShape, mMotionProperties, mCollisionGroup.mGroupFilter being 4 instead of 8 bytes in 32 bit mode
|
|
|
+ uint8 mPadding[12];
|
|
|
#endif
|
|
|
};
|
|
|
|