|
@@ -598,4 +598,25 @@ TEST_SUITE("ShapeTests")
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
+ TEST_CASE("TestEmptyMutableCompound")
|
|
|
+ {
|
|
|
+ // Create empty shape
|
|
|
+ RefConst<Shape> mutable_compound = new MutableCompoundShape();
|
|
|
+
|
|
|
+ // A non-identity rotation
|
|
|
+ Quat rotation = Quat::sRotation(Vec3::sReplicate(1.0f / sqrt(3.0f)), 0.1f * JPH_PI);
|
|
|
+
|
|
|
+ // Check that local bounding box is invalid
|
|
|
+ AABox bounds1 = mutable_compound->GetLocalBounds();
|
|
|
+ CHECK(!bounds1.IsValid());
|
|
|
+
|
|
|
+ // Check that get world space bounds returns an invalid bounding box
|
|
|
+ AABox bounds2 = mutable_compound->GetWorldSpaceBounds(Mat44::sRotationTranslation(rotation, Vec3(100, 200, 300)), Vec3(1, 2, 3));
|
|
|
+ CHECK(!bounds2.IsValid());
|
|
|
+
|
|
|
+ // Check that get world space bounds returns an invalid bounding box for double precision parameters
|
|
|
+ AABox bounds3 = mutable_compound->GetWorldSpaceBounds(DMat44::sRotationTranslation(rotation, DVec3(100, 200, 300)), Vec3(1, 2, 3));
|
|
|
+ CHECK(!bounds3.IsValid());
|
|
|
+ }
|
|
|
}
|