How do I set the WorldBound on a Node?

So I'm ambling my way through the Flag Rush tutorial, customising it to work with the stuff I'm trying to achieve as I go along and I'm running into a problem with the bit where I need to call player.getWorldBound(), which is that the player's worldBound is null.



What do I need to call in order to make sure this is set?

Late answer, but:

You need to set the model bounds. World bounds are computed from those. You can call setModelBound and updateModelBound either for each mesh individually or on a Node.

Doing it on a Node that is parent to the mesh appear to do absolutely nothing, I have the following four lines:

scene.attachChild(player);
player.setModelBound(new BoundingBox());
player.updateWorldBound();
System.out.println("Player in world: "+player.getWorldBound());



Output for the last line is always "Player in world: null".

This is mostly copied parrot fashion from various places without really knowing how it works, so I'm probably doing something really simple wrong...

call updateGeometricState before you query the world bounding

… and the problem is solved!



Thanks Irrisor!