Package javax.media.j3d

Examples of javax.media.j3d.Node


  /**
   * Sets whether this piece model is visible or not.
   */
  private void updatePieceOfFurnitureVisibility() {
    HomePieceOfFurniture piece = (HomePieceOfFurniture)getUserData();
    Node outlineModelNode = getOutlineModelNode();
    HomeEnvironment.DrawingMode drawingMode;
    if (outlineModelNode != null) {
      drawingMode = this.home.getEnvironment().getDrawingMode();
    } else {
      drawingMode = null;
View Full Code Here


  /**
   * Returns a clone of the given node with an outline appearance on its shapes.
   */
  private Node createOutlineModelNode(Node modelNode) {
    Node node = ModelManager.getInstance().cloneNode(modelNode);
    setOutlineAppearance(node);
    return node;
  }
View Full Code Here

        compile();
    }

    private EntityModel find(Entity entity) {
        for (Enumeration<?> e = getAllChildren(); e.hasMoreElements(); ) {
            Node n = (Node)e.nextElement();
            if (n instanceof EntityModel && entity.equals(n.getUserData())) {
                return (EntityModel)n;
            }
        }
        return null;
    }
View Full Code Here

            if (pickEntities == null || pickBoard == null) {
                return null;
            }

            PickInfo target;
            Node node;

            pickEntities.setShapeLocation(me);
            target = pickEntities.pickClosest();

            if (target == null) {
                pickBoard.setShapeLocation(me);
                target = pickBoard.pickClosest();
            }
            if (target == null) {
                return null;
            }

            node = target.getNode();
            while (node != null && node.getUserData() == null) {
                node = node.getParent();
            }
            if (node == null) {
                return null;
            }

            return node.getUserData();

        } catch (IllegalStateException ise) {
            // ignore early clicks
            return null;
        }
View Full Code Here

        addChild(tg);
    }
   
    void add(AttackAction aa, ViewTransform currentView) {
        for (Enumeration<?> e = getAllChildren(); e.hasMoreElements();) {
            Node tg = (Node)e.nextElement();
            if (aa.equals(tg.getUserData())) return;
        }
       
        String label = "?";
       
        if (aa instanceof WeaponAttackAction) {
View Full Code Here

        int width = sceneGraphIn.getWidth();

        for (int i = 0; i < width; i++) {
            SceneGraphToken objectToken = (SceneGraphToken) sceneGraphIn.get(i);
            Node node = objectToken.getSceneGraphNode();
            _addChild(node);
        }
    }
View Full Code Here

        for (int i = 0; i < width; i++) {
            SceneGraphToken objectToken = (SceneGraphToken) sceneGraphIn.get(i);

            // node = objectToken.getSceneGraphNode();
            Node node = objectToken.getSceneGraphNode();

            //((BranchGroup) node).detach();
            /* if (_debugging) {
             _debug("Node parent = " + node.getParent());

View Full Code Here

        for (int i = 0; i < width; i++) {
            if (sceneGraphIn.hasToken(i)) {
                SceneGraphToken nodeToken = (SceneGraphToken) sceneGraphIn
                        .get(i);
                Node node = nodeToken.getSceneGraphNode();
                _addChild(node);
            }
        }

        sceneGraphOut.send(0, new SceneGraphToken(_getNodeObject()));
View Full Code Here

        this.universe3D = universe3D;
    }

    public void fall(BranchGroup groupToFall) {
        TransformGroup tg = (TransformGroup) groupToFall.getChild(0);
        Node node = tg.getChild(0);
        // get the global transform before detaching to get all the transforms along the way
        // the group will not be attached locally anymore, but at the root,
        // so we need to get the global transform.
        Transform3D transform3D = getGlobalTransform3D(node);
        // we need to detach before changing the global transform, or it will move the group too far
View Full Code Here

          VertexGroup<V> vg = vertexMap.get(v);
          Appearance look = redLook;
          if(renderContext.getPickedVertexState().isPicked(v)) {
            look = yellowLook;
          }
          Node node = vg.getShape();
          if(node instanceof Primitive) {
            ((Primitive)node).setAppearance(look);
          }
        }
       
View Full Code Here

TOP

Related Classes of javax.media.j3d.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.