I’m using JBullet for physics and collision, and I got meshes to work but I have a question. How would I decrease the amount of vertices that get put into the collision mesh, without deforming the shape, for performance reasons? I wouldn’t need 1000 vertices for a collision, maybe 100. For example I am using the blender monkey which has 1,980 vertices, and I want less than 100. How would I do it?
This is the code I use to put vertices into the collision mesh:
ObjectArrayList<Vector3f> vertices = new ObjectArrayList<Vector3f>();
float[] verts = Renderer.vaolist.get(vaoListId).vertices;
for(int i = 0; i < verts.length; i+=3) {
vertices.add(new Vector3f(verts[i],verts[i+1],verts[i+2]));
}
CollisionShape shape = new ConvexHullShape(vertices);