Skip to content

Commit

Permalink
test003b: verify ConicalFrustum defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
stephengold committed May 5, 2024
1 parent b85f6e7 commit 911fd18
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions src/test/java/TestLibbulletjme.java
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
import com.jme3.bullet.collision.shapes.CollisionShape;
import com.jme3.bullet.collision.shapes.CompoundCollisionShape;
import com.jme3.bullet.collision.shapes.ConeCollisionShape;
import com.jme3.bullet.collision.shapes.ConicalFrustum;
import com.jme3.bullet.collision.shapes.Convex2dShape;
import com.jme3.bullet.collision.shapes.ConvexShape;
import com.jme3.bullet.collision.shapes.CustomConvexShape;
Expand Down Expand Up @@ -362,6 +363,21 @@ public void test003a() {
cone, DebugShapeFactory.lowResolution);
Assert.assertEquals(702, buf.capacity());


// ConicalFrustum
ConicalFrustum frustum = new ConicalFrustum(1f, 0.5f, 1f);
verifyCollisionShapeDefaults(frustum);
Assert.assertEquals(0.04f, frustum.getMargin(), 0f);
Assert.assertEquals(19, frustum.getShapeType());
Assert.assertFalse(frustum.isConcave());
Assert.assertTrue(frustum.isConvex());
Assert.assertFalse(frustum.isInfinite());
Assert.assertFalse(frustum.isNonMoving());
Assert.assertFalse(frustum.isPolyhedral());
buf = DebugShapeFactory.getDebugTriangles(
frustum, DebugShapeFactory.lowResolution);
Assert.assertEquals(720, buf.capacity());

// Convex2d
ConeCollisionShape flatCone
= new ConeCollisionShape(10f, 0f, PhysicsSpace.AXIS_Z);
Expand Down

0 comments on commit 911fd18

Please sign in to comment.