Collision & Intersection (Without JBullet)

Code Sample

Assume you have two collidables a and b and want to detect collisions between them. The collision parties can be Geometries, Nodes with Geometries attached (including the rootNode), Planes, Quads, Lines, or Rays.

The following code snippet can be triggered by listeners (e.g. after an input action such as a click), or timed in the update loop.

// Calculate detection results
CollisionResults results = new CollisionResults();
a.collideWith(b, results);


However, if you use anything other than a Ray or... um... been a while since I did this... CollisionShape?? It will error out.

Is the documentation here wrong? Or? Does the use of this require JBullet?

if they are both spatials then at least 1 needs to use spatial.getWorldBound()

Yeah you can only collide ray or box bounding volumes with geometry/meshes. Geometry vs geometry doesn’t work and depending on your needs bullet might be the better solution.