When I remove a node from the scenegraph, I first detach the scene at
the root to make it not live, then I remove the node, then I reattach
the scene like this:
universe.getLocale().removeBranchGraph( sceneRoot );
node.detach();
universe.addBranchGraph( sceneRoot );
But I get the following exception sometimes on the "removeBranchGraph()"
line:
Exception in thread "AppMainThread" java.lang.IndexOutOfBoundsException:
Index:
0, Size: 0
at java.util.ArrayList.RangeCheck(Unknown Source)
at java.util.ArrayList.remove(Unknown Source)
at
javax.media.j3d.OrderedPathList.removePath(OrderedPathList.java:40)
at
javax.media.j3d.GroupRetained.clearLive(GroupRetained.java:2256)
at
javax.media.j3d.TransformGroupRetained.clearLive(TransformGroupRetain
ed.java:721)
at
javax.media.j3d.GroupRetained.clearLive(GroupRetained.java:2210)
at javax.media.j3d.Locale.doRemoveBranchGraph(Locale.java:279)
at javax.media.j3d.Locale.removeBranchGraph(Locale.java:233)
at Tact3dRenderEngine.removeNode(Tact3dRenderEngine.java:122)
at PlatformTree.removePlatform(PlatformTree.java:179)
at PlatformTree.processPlatform(PlatformTree.java:37)
at PlatformManager.digestPlatforms(PlatformManager.java:46)
at InfoScene.enterMainLoop(InfoScene.java:93)
at InfoScene.<init>(InfoScene.java:31)
at InfoScene.main(InfoScene.java:153)
I couldn't find any documentation on a bug like this, so I thought I
would post it.
It doesn't happen all the time, and I have not yet found a pattern.
In case you were wondering why I detach the scene, it is for two
reasons:
1) It lets me remove nodes other than BranchGroups
2) If I don't detach it and make my removable nodes all BranchGroups,
then I see a serious performance slowdown after about 100 adds/removes
from the scenegraph.
It takes much longer to add/remove nodes after the slowdown occurs.
Detaching the scene before every "node.detach()" operation prevents the
slowdown.
This may also be a bug that should be addressed.
Thanks.
-Roy
[EMAIL PROTECTED]
===========================================================================
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".