ソースを参照

Only checking size of TransformedShape and Body in 64-bit builds (#926)

Fixes #924
Jorrit Rouwe 1 年間 前
コミット
958b6558c8
2 ファイル変更2 行追加7 行削除
  1. 1 6
      Jolt/Physics/Body/Body.h
  2. 1 1
      Jolt/Physics/Collision/TransformedShape.h

+ 1 - 6
Jolt/Physics/Body/Body.h

@@ -375,14 +375,9 @@ private:
 	atomic<uint8>			mFlags = 0;														///< See EFlags for possible flags
 
 	// 122 bytes up to here (64-bit mode, single precision, 16-bit ObjectLayer)
-
-#if JPH_CPU_ADDRESS_BITS == 32
-	// Padding for mShape, mMotionProperties, mCollisionGroup.mGroupFilter being 4 instead of 8 bytes in 32 bit mode
-	uint8					mPadding[12];
-#endif
 };
 
-static_assert(sizeof(Body) == JPH_IF_SINGLE_PRECISION_ELSE(128, 160), "Body size is incorrect");
+static_assert(JPH_CPU_ADDRESS_BITS != 64 || sizeof(Body) == JPH_IF_SINGLE_PRECISION_ELSE(128, 160), "Body size is incorrect");
 static_assert(alignof(Body) == JPH_RVECTOR_ALIGNMENT, "Body should properly align");
 
 JPH_NAMESPACE_END

+ 1 - 1
Jolt/Physics/Collision/TransformedShape.h

@@ -188,7 +188,7 @@ public:
 	SubShapeIDCreator			mSubShapeIDCreator;							///< Optional sub shape ID creator for the shape (can be used when expanding compound shapes into multiple transformed shapes)
 };
 
-static_assert(sizeof(TransformedShape) == JPH_IF_SINGLE_PRECISION_ELSE(64, 96), "Not properly packed");
+static_assert(JPH_CPU_ADDRESS_BITS != 64 || sizeof(TransformedShape) == JPH_IF_SINGLE_PRECISION_ELSE(64, 96), "Not properly packed");
 static_assert(alignof(TransformedShape) == JPH_RVECTOR_ALIGNMENT, "Not properly aligned");
 
 JPH_NAMESPACE_END