Marco Mamei wrote:
Do you have better alternatives?
If you want to detach BranchGroup, like in example below, use child.detach(), instead of parent.removeChild(...). If you want to remove arbitrary node, then it is a bit harder - in live scenegraph, you will first need to detach it's parent BranchGroup, then use removeChild, then attach it back. Please note, that you can use removeChild(Node) instead of removeChild(int). Or use indexOfChild(Node) first to retrieve number and check if node is indeed inside and remove afterwards. As for a piece of code you have posted, I'll not talk about it, because I could get carried away. Biggest mistake is using class cast exception as a control flow test - this is ugly and kills performance. Rest is left as exercise to reader :) Artur =========================================================================== 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".
