Collision detection on models

Hello :slight_smile:



We are programming a little simulation with jME as a school project. We are happy with the most implementation but we have a serious problem with collision detection.



Our problem: We need collision detection on models (buildings, hurdle, …). We are not happy with the existings BoundingVolumne and its derived classes. We also tried using the builtin collision detection on triangles, but this is too CPU expensive. We had a look at the Octree implementation posted in this forum but it didn't work really on our models. We tried also jME Physics 2 but it seems, that it uses also BoundingVolumnes?!



We create models using Blender and export them as .obj. We use jME 1.0.



Please can you give us some advice or solution on this problem?



Greetings, Marcel

Collision detection with JMEPhysics (via ODE) works on ODE primitives: capsules, boxes, triangle meshes…



With JMEPhysics you can choose to use bounding collisions (this works for small things like bullets!) or you can use triangle meshes. If you do this and your scene has tons of triangles then it will be CPU expensive.



A common approach is to use a simplified model for collisions. For example, having an airplane with thousands of triangles will be expensive, but you can show the detailed airplane and still use a 20 triangles version for collision purposes. Same applies to every model or piece of map.



You should also remove from collision data every piece of the scene that is not collidable.



Note that ODE creates an internal representation of data using an Octree, so if you are using JMEPhysics you are already partitioning space (in terms of collition detection and physics simulation).



Regards!

jjmontes said:

A common approach is to use a simplified model for collisions. For example, having an airplane with thousands of triangles will be expensive, but you can show the detailed airplane and still use a 20 triangles version for collision purposes. Same applies to every model or piece of map.


First: Thank you for answering.

A question about the below mentioned aproach. That means that I create an airplane.obj which is detailed and an ariplane_bounding.obj wich is really basic? How can the first obj be displayed and the other used for collision detection?

Edit: Our model is already very basic... it is a square with a roof on it and an additional garage on the left side....