From 90301b106e7eb6dd6ba5f8854bf0024e7d5644d9 Mon Sep 17 00:00:00 2001 From: stephengold Date: Sun, 28 Apr 2024 17:48:56 -0700 Subject: [PATCH] test003b: verify the properties of a SphericalSegment --- src/test/java/TestLibbulletjme.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/test/java/TestLibbulletjme.java b/src/test/java/TestLibbulletjme.java index 529f5853..92de452c 100644 --- a/src/test/java/TestLibbulletjme.java +++ b/src/test/java/TestLibbulletjme.java @@ -63,6 +63,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE import com.jme3.bullet.collision.shapes.PlaneCollisionShape; import com.jme3.bullet.collision.shapes.SimplexCollisionShape; import com.jme3.bullet.collision.shapes.SphereCollisionShape; +import com.jme3.bullet.collision.shapes.SphericalSegment; import com.jme3.bullet.collision.shapes.infos.BoundingValueHierarchy; import com.jme3.bullet.collision.shapes.infos.IndexedMesh; import com.jme3.bullet.joints.New6Dof; @@ -657,6 +658,20 @@ public void test003b() { buf = DebugShapeFactory.getDebugTriangles( sphere, DebugShapeFactory.lowResolution); Assert.assertEquals(720, buf.capacity()); + + // SphericalSegment + SphericalSegment segment = new SphericalSegment(1f); + verifyCollisionShapeDefaults(segment); + Assert.assertEquals(0.04f, segment.getMargin(), 0f); + Assert.assertEquals(19, segment.getShapeType()); + Assert.assertFalse(segment.isConcave()); + Assert.assertTrue(segment.isConvex()); + Assert.assertFalse(segment.isInfinite()); + Assert.assertFalse(segment.isNonMoving()); + Assert.assertFalse(segment.isPolyhedral()); + buf = DebugShapeFactory.getDebugTriangles( + sphere, DebugShapeFactory.lowResolution); + Assert.assertEquals(720, buf.capacity()); } /**