I’m trying to store the bounding volumes of certain models to do ray casting and collisions on the server.
I loop through all of the loaded models when the server is initiated, store the bounding volumes, and delete the reference to the model to prevent an out of memory error.
//init collidable item on server
BoundingVolume bv = item.getWorldBound();
collidableItems.add(bv);
assetManager.deleteFromCache(item.getKey());
But when I try to test for a collision using the following code, it appears as though the shape of the model is ignored, and the bounding volume instead takes the shape of the blue box that appears around the Spatial when opened in the scene composer.
//this code returns a huge bounding box rather than the model's shape
BoundingVolume bounds = (BoundingVolume) collidableItems.get(i);
bounds.collideWith(collidable, results);
I have no problem with single player or client side collision when I can test collisions using the original spatial as opposed to extracting its bounding volume
//this code returns proper collisions
Spatial item = (Spatial) collidableItems.get(i);
item.collideWith(collidable, results);
Any ideas how I can get this working or achieve the same thing in any other ways? Thanks.