> Date: Mon, 18 Mar 2002 13:43:43 -0600
> From: Scott Mobile <[EMAIL PROTECTED]>
> Subject: [JAVA3D] Destroying branchgroups, garbage collecdtion
> To: [EMAIL PROTECTED]
> MIME-version: 1.0
> X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2600.0000
> X-Priority: 3
> X-MSMail-priority: Normal
> Delivered-to: [EMAIL PROTECTED]
>
> 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?

Java 3D will release all references to that sub-graph (the removed
BranchGroup), if non of the Node or NodeComponent is being used by
part of the existing live scene graph.

>
> 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?

Java 3D doesn't do that, you might want to check your code.


- Chien Yang
  Java 3D Team.

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff JAVA3D-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to