I have a terrain engine that dynamically loads and detaches patches (class TerrainBlock) of terrain as a player walks along...
 
In managing these patches of terrain, every so often I do a .getAllChildren() on the parent of the group. 
 
If any blocks are out of the predefined visible range, I drop them with a detach() and setting the object to null.  Is this the correct way to _completely_ remove branchgroups from both the scenegraph and memory? 
 
Also...
While the reporting number of valid objects is returning exactly as I expect, there (49 in a case of a 7x7 group of patches), there are thousands (!) of  "terrainClickBehavior" objects returning.
 
This behavior is added to the terrain patch parent node, not each individual block that's added, so I don't understand why there are so many...  Perhaps J3D creates these behind the scenes to handle behaviors on each node added.  Anyone know the answer for this?
 
This makes me wonder, also, if getAllChildren is the best way to iterate through large lists of nodes... any suggestions?
 
Scott Smith
Virtopia 3D
 

Reply via email to