Skip to Main Content

Java SE (Java Platform, Standard Edition)

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

RestrictedAccessException: Group: only a BranchGroup node may be added

843799Jun 19 2006 — edited Jun 19 2006
I was wondering if anyone else has ever got this error when trying to add a behavior to a BranchGroup during runtime. Here is the code:
TransformGroup transGunit = new TransformGroup();
BoundingSphere bs = new BoundingSphere(new Point3d(), 1000.0);
ObstacleFactory.setColor(new Color3f(0f,10f,0f));
ObstacleFactory.setStartingPos(1f,12f,0f);
models.add(ObstacleFactory.getInstance(odeWorld));
blockadd = models.size()-1;
transGunit.addChild(models.get(blockadd).getBranchGroup());
tg.add(transGunit);

behav.add(new KeyNavigatorBehavior(tg.get(tg.size() - 1)));
behav.get(blockadd).setSchedulingBounds(bs);
//behav.get(blockadd).setEnable(false);
// BranchGroup fooledYou = new BranchGroup();
// fooledYou.addChild(behav.get(behav.size() - 1));
// sceneRoot.addChild(fooledYou);

sceneRoot.addChild(behav.get(behav.size() - 1));

Thanks in adv ance.
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Jul 17 2006
Added on Jun 19 2006
3 comments
214 views