Update functions in the scene graph

A Node has the following members to update internal states and structures.

  • updateCollisionTree()
  • updateGeometricState()
  • updateRenderState()
  • updateWorldBound()
  • updateModelBound()
  • updateWorldData()
  • updateWorldVector()

General rules

  1. If a node was translated, scaled or rotated call updateGeometricState().
  2. If a render state was changed call updateRenderState().
  3. If a model was added and you need triangle accuracy on picking and collision detecting call updateCollisionTree() once.
  4. Call updateGeometricState() every frame on your scene node to update controllers. This is done automatically by the BaseGame and derived classes.
  5. If any of the lock methods were called on the spatial, then certain parts of the spatial will not be updated. For example if lockBounds is called then bounding volumes will not be updated on a call to updateGeometricState().

What the functions do

updateCollisionTree

This function creates the OBBTree of the triangles in the model's geometry which is used for fast picking and collision detection on triangle accuracy.

updateGeometricState

This function calls updateWorldData() and updateWorldBound() of the node and optionally propagates the changes up to the root node.

updateRenderState

This function updates the stack of the RenderStates.

updateWorldBound

This function updates the bounding volume with the translation, rotation and scaling vectors. This is typically called by the system with updateGeometricState.

updateModelBound

This function updates the BoundingVolume attached to a Geometry node. This is required when building the model and after a call to setModelBound.

updateWorldData

This function calls the update() function of all attached controllers and then updateWorldVectors.

updateWorldVectors

This function updates the values for scale, translation and rotation vectors of this node relative to the world vectors.


/var/www/wiki/data/pages/updatefuncs.txt · Last modified: 2009/07/28 18:44 (external edit)  
Recent changes · Show pagesource · Login

Recent changes RSS feed Creative Commons License Donate Powered by PHP Valid XHTML 1.0 Valid CSS Driven by DokuWiki

subscribe to jME latest jme headlines


site design by bleedcrimson designs © 2008