How do I define a custom mesh in JBullet?

I am creating a game and I wanted to use the JBullet physics engine. I have searched the Javadocs but I have not found anything. How do I define a custom shape to use with JBullet? I was looking for something that I pass the vertices and indices array into, or are there other solutions? Thank you :D


Use ConvexHullShape if your mesh is convex. It takes the vertices as parameter, but doesn't need the indices or other connection information.

For concave mesh you can use BvhTriangleMeshShape. It takes e.g. TriangleIndexVertexArray as a parameter, which is created from lists of triangle indices and vertices.

JBullet is not up-to-date with the latest Bullet versions, but it is still a good physics library for Java.

JBullet does not seem like complete port, so I moved onto C++ and I am hoping to use Bullet.

Need Your Help

How do you get an embedded Jetty webserver to dump its interim Java code for JSPs

java jsp jetty

I keep running into this problem when debugging JSP pages in OpenNMS. The Jetty wiki talks about keepGenerated ( in webdefault.xml but it seems

colorbox breaks on rel attribute when bxslider is loaded

javascript jquery colorbox bxslider

After much debugging I came to the conclusion these two libraries are colliding. I tested them both separate and they work but when used together (and there is a rel attribute things break)