www.jpct.net

jPCT - a 3d engine for Java => Support => Topic started by: jon81 on June 14, 2011, 08:02:14 am

Title: JBullet Mesh Collision Shapes
Post by: jon81 on June 14, 2011, 08:02:14 am
I would like to use a more detailed collision shape for the ground in my jpct app.

Instead of a flat plane I would like to use a mesh to represent the terrain.

From the Bullet documentation:

"For static world environment, a very efficient way to represent static triangle meshes is to use a btBvhTriangleMeshShape. This collision shape builds an internal acceleration structure from a btTriangleMesh or btStridingMeshInterface."

Can some one please post some example code showing how to take an Object3D (the ground mesh) and convert it to either a "btTriangleMesh" or a "btStridingMeshInterface" so that it can be used to create the btBvhTriangleMeshShape?

Title: Re: JBullet Mesh Collision Shapes
Post by: EgonOlsen on June 14, 2011, 07:42:59 pm
No idea about JBullet, but you can get polygon information from an Object3D by using the PolygonManager. Maybe that helps to recreate the structures needed for JBullet.