I'm working on a game in Java3D. I read all my level info from a file and it works fine. But now I want to re-initialize the scene from reading data from a different file.
How do I reset the scene?
开发者_如何学运维Should I just destroy the whole canvas3D and universe objects?
Thanks Mikeb, you put me on the right track.
I figured it out. You need to detach the branchgroup.
Like this:
if (sceneBG != null) {
sceneBG.detach();
}
sceneBG = new BranchGroup();
sceneBG.setCapability(BranchGroup.ALLOW_DETACH);
精彩评论