Skip to content

Commit

Permalink
test003b: verify the properties of a SphericalSegment
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed Apr 29, 2024
1 parent e990371 commit 90301b1
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/test/java/TestLibbulletjme.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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());
}

/**
Expand Down

0 comments on commit 90301b1

Please sign in to comment.