/** * Creates a blank BranchGroup with the proper capabilities. */ private static BranchGroup createBranchGroup () { BranchGroup bg = new BranchGroup(); bg.setCapability(BranchGroup.ALLOW_CHILDREN_READ); bg.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); bg.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); bg.setCapability(BranchGroup.ALLOW_DETACH); bg.setPickable(false); bg.setCollidable(false); return bg; }
/** * Creates a blank BranchGroup with the proper capabilities. */ private static BranchGroup createBranchGroup () { BranchGroup bg = new BranchGroup(); bg.setCapability(BranchGroup.ALLOW_CHILDREN_READ); bg.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); bg.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); bg.setCapability(BranchGroup.ALLOW_DETACH); bg.setPickable(false); bg.setCollidable(false); return bg; }
@Override public void setViewValue(Object o) { // value = o; if (!VGraphicsUtil.NO_3D) { if (shapeGroup != null) { shapeGroup.detach(); } Shape3D shape = (Shape3D) o; shapeGroup = new BranchGroup(); shapeGroup.setCapability(BranchGroup.ENABLE_PICK_REPORTING); shapeGroup.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); shapeGroup.setCapability(BranchGroup.ALLOW_CHILDREN_READ); shapeGroup.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); shapeGroup.setCapability(BranchGroup.ALLOW_DETACH); shapeGroup.addChild(shape); universeCreator.getRootGroup().addChild(shapeGroup); getCanvas().postRenderTask(); } }
private static Shape drawLWS (String filename) { Lw3dLoader loader = new Lw3dLoader(); try { BranchGroup bg = loader.load(filename).getSceneGroup(); bg.setCapability(BranchGroup.ALLOW_CHILDREN_READ); bg.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); bg.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); bg.setCapability(BranchGroup.ALLOW_DETACH); TransformGroup transGroup = new TransformGroup(); transGroup.addChild(bg); BranchGroup bg2 = createBranchGroup(); bg2.addChild(transGroup); offscreenGroup.addChild(bg2); return new Shape(bg2, transGroup); } catch (FileNotFoundException fnfe) { fnfe.printStackTrace(); } return null; }
private static Shape drawLWS (String filename) { Lw3dLoader loader = new Lw3dLoader(); try { BranchGroup bg = loader.load(filename).getSceneGroup(); bg.setCapability(BranchGroup.ALLOW_CHILDREN_READ); bg.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); bg.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); bg.setCapability(BranchGroup.ALLOW_DETACH); TransformGroup transGroup = new TransformGroup(); transGroup.addChild(bg); BranchGroup bg2 = createBranchGroup(); bg2.addChild(transGroup); offscreenGroup.addChild(bg2); return new Shape(bg2, transGroup); } catch (FileNotFoundException fnfe) { fnfe.printStackTrace(); } return null; }
shapeGroup.setCapability(BranchGroup.ENABLE_PICK_REPORTING); shapeGroup.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); shapeGroup.setCapability(BranchGroup.ALLOW_CHILDREN_READ); shapeGroup.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); shapeGroup.setCapability(BranchGroup.ALLOW_DETACH); BranchGroup g = new BranchGroup(); g.setCapability(BranchGroup.ENABLE_PICK_REPORTING); g.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); g.setCapability(BranchGroup.ALLOW_CHILDREN_READ); g.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); g.setCapability(BranchGroup.ALLOW_DETACH);
shapeParents[1].setCapability(BranchGroup.ENABLE_PICK_REPORTING); shapeParents[1].setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); shapeParents[1].setCapability(BranchGroup.ALLOW_CHILDREN_READ); shapeParents[1].setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); shapeParents[1].setCapability(BranchGroup.ALLOW_DETACH); } else { shapeParents[0] = new BranchGroup(); shapeParents[0].setCapability(BranchGroup.ENABLE_PICK_REPORTING); shapeParents[0].setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); shapeParents[0].setCapability(BranchGroup.ALLOW_CHILDREN_READ); shapeParents[0].setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); shapeParents[0].setCapability(BranchGroup.ALLOW_DETACH);
shapeGroups[i] = new BranchGroup(); shapeGroups[i].setCapability(BranchGroup.ENABLE_PICK_REPORTING); shapeGroups[i].setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); shapeGroups[i].setCapability(BranchGroup.ALLOW_CHILDREN_READ); shapeGroups[i].setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); shapeGroups[i].setCapability(BranchGroup.ALLOW_DETACH); switchParentGroup.setCapability(BranchGroup.ENABLE_PICK_REPORTING); switchParentGroup.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); switchParentGroup.setCapability(BranchGroup.ALLOW_CHILDREN_READ); switchParentGroup.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); switchParentGroup.setCapability(BranchGroup.ALLOW_DETACH);
try { BranchGroup bg = loader.load(filename).getSceneGroup(); bg.setCapability(BranchGroup.ALLOW_CHILDREN_READ); bg.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); bg.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); bg.setCapability(BranchGroup.ALLOW_DETACH);
try { BranchGroup bg = loader.load(filename).getSceneGroup(); bg.setCapability(BranchGroup.ALLOW_CHILDREN_READ); bg.setCapability(BranchGroup.ALLOW_CHILDREN_WRITE); bg.setCapability(BranchGroup.ALLOW_CHILDREN_EXTEND); bg.setCapability(BranchGroup.ALLOW_DETACH);
public void start() { trajectoire_ = new RotPosPathInterpolator(new Alpha(nbCycles_, temps_), univers_.getTransformGroup(), axe_, pourcentAtIndex_, directions_, positions_); trajectoire_.setSchedulingBounds(new BoundingSphere()); bg_ = new BranchGroup(); bg_.setCapability(BranchGroup.ALLOW_DETACH); bg_.addChild(trajectoire_); univers_.addBranchGraph(bg_); }
private void buildFond(Color3f _c) { if (background_ == null) { background_ = _c == null ? new Background(0F, 0F, 0F) : new Background(_c); background_.setCapability(Background.ALLOW_COLOR_WRITE); background_.setCapability(Background.ALLOW_COLOR_READ); background_.setCapability(Background.ALLOW_APPLICATION_BOUNDS_READ); background_.setCapability(Background.ALLOW_APPLICATION_BOUNDS_WRITE); // background_.setApplicationBounds(new BoundingSphere(new Point3d(0, 0, 0), 1E12)); background_.setBoundsAutoCompute(true); final BranchGroup fond = new BranchGroup(); fond.addChild(background_); fond.setCapability(BranchGroup.ALLOW_DETACH); addBranchGraph(fond); } }
emptyGroup.setCapability(BranchGroup.ALLOW_DETACH); locale_.addBranchGraph(emptyGroup); locale_.removeBranchGraph(emptyGroup);
public BUnivers(final BCanvas3D _canvas) { canvas_ = _canvas; locale_ = new Locale(this); final ViewPlatform camera = new ViewPlatform(); final BranchGroup viewGroup = new BranchGroup(); final TransformGroup viewTg = new TransformGroup(); viewTg.setCapability(TransformGroup.ALLOW_TRANSFORM_READ); viewTg.setCapability(TransformGroup.ALLOW_TRANSFORM_WRITE); viewTg.setCapability(Node.ALLOW_LOCAL_TO_VWORLD_READ); viewTg.addChild(camera); viewGroup.addChild(viewTg); final PhysicalBody body = new PhysicalBody(); final PhysicalEnvironment env = new PhysicalEnvironment(); final View view = new View(); view.setPhysicalBody(body); view.setPhysicalEnvironment(env); view.setBackClipDistance(100); view.setFrontClipDistance(.1); view.addCanvas3D(canvas_); view.attachViewPlatform(camera); transformU_ = viewTg; position_ = new Vector3d(); viewGroup.setCapability(BranchGroup.ALLOW_DETACH); locale_.addBranchGraph(viewGroup); }
public BranchGroup createSceneGraph(final Canvas3D canvas) { objRoot.setCapability(Group.ALLOW_CHILDREN_EXTEND); objRoot.setCapability(Group.ALLOW_CHILDREN_WRITE);