Bounding Volumes and Billboard Nodes

billboard nodes don’t update their children in updateWorldData.

this causes a problem if you move a billboard node because the objects it is looking after (usually quads) don’t get to update their worldPosition and therefore do not get to update their bounding volumes correctly.

needless to say this has been causing me quite a lot of confusion! My work around is:


    * <code>updateWorldData</code> defers the updating of the billboards
    * orientation until rendering. This keeps the billboard from being
    * needlessly oriented if the player can not actually see it.
    * @param time
    *            the time between frames.
    * @see com.jme.scene.Spatial#updateWorldData(float)
   public void updateWorldData(float time) {
       // [hack]
      lastTime = time;

Have you found this works well and does it cause any issue with the billboard test in jmetest?

Without it my code to display the sun on the horizon fails. With it the test billboard node in jme test still works and all my code works. When reading through the code it is necessary, but there may be a reason in jME that I don’t understand for it not to be there.

So in other words, I am totally convinced this is a bug fix.

billboards should not update the node in that way, updating is deferred until rendering to get the current camera position. All children are then rotated, translated, scaled based on the billboard see: rotateBillboard()

How are you trying to move the sun? You need to move the billboard node rather than the sun node. Moving the sun node will cause the sun to rotated RELATIVE to the billboard node, throwing it off course.