Hi guys,
I need to take a object off the scene and later rettach it to the scene, How do i handle that?
I’m still noob on scenegraph modifications, so i was looking for it on javadoc but couldn’t find it
Rafael
Hi guys,
I need to take a object off the scene and later rettach it to the scene, How do i handle that?
I’m still noob on scenegraph modifications, so i was looking for it on javadoc but couldn’t find it
Rafael
Just invoke the group.removeChild( Node ) method on the parent group of your object (Node). And don’t forget to keep a pointer to the removed Node stored somewhere. Then just invoke the addChild( Node ) method to reattach the Node.
Marvin
Thanks Marvin, i’ll try that
Rafael
What ?
What could be easier ?
In any data structures, you want to add/remove something, seek add/remove methods… you can find add/remove methods in GroupNode/NodeGroup/Group/BranchGroup/AnyGroup ^^ then javadoc just leads you to the real doc.
Only remember - do that thread safe way, sync with rendering loop by means of for example “synchronized (myVirtualUniverse)” as Marvin suggested, or any your way, otherways, if you don’t - you may get unpredictable or(and) unbelivable results ;D
Another way is to make use of ExtRenderLoop and ScheduledOperation.
I was killing myself for something easy
Thanks guys, it’s working fine by doing what Marvin told ;D
I bet it could get really funny.