I see the engine supports basic collision using bounding box/sphere of models. Is there a way to use a bounding sphere to test collision against a more complicated shape such a mesh ? I want to get an accurate collision of when the sphere touches the any area of the geometry not just the bounding box/sphere.
I looked through the tutorials on the sdk but it only shows box/sphere. The wiki has this topic but it’s down
Currently I have resorted to using a ray cast only collision detection system to simulate my physics. I’m just having to many issues with the bullet library. However this method sometimes fails when used on complicated shapes.
I’ve been using intersects instead of collide with. I’m working directly with the geometry instead of nodes.
Example code
public boolean intersects(Geometry geometry){
if (gameManager.getGeometry("Cube1").getModelBound().intersects(geometry.getModelBound())) {
return true;
} else {
return false;
}
}
Even if I create sphere and add it to the node then test it against the model bounds it by default creates a bounding box and uses that for detection. I’ll try playing with collideWith later and see what I come up with.
I was using the collidewith originally and it was always returning a false positive that’s when I realized I was using the it on the spatials world bounds and not the geometry bounds. I changed it the geometry and it worked.