Examples of attachChild()


Examples of com.jme.scene.Node.attachChild()

        // The center teapot
        Node ret = new Node();
        Teapot teapot = new Teapot();
        teapot.resetData();
        teapot.setLocalScale(0.2f);
        ret.attachChild(teapot);

        matState = (MaterialState) ClientContextJME.getWorldManager().getRenderManager().createRendererState(RenderState.RS_MATERIAL);
        matState.setDiffuse(color);
        ret.setRenderState(matState);
View Full Code Here

Examples of com.jme.scene.Node.attachChild()

        tmpDir.mkdirs();

        // Create a fake entity, which will be used to calculate the model offset
        // from the cell
        Node cellRoot = new Node();
        cellRoot.attachChild(importedModel.getModelBG());
        cellRoot.updateGeometricState(0, true);
        Entity entity = new Entity("Fake");
        RenderComponent rc = ClientContextJME.getWorldManager().getRenderManager().createRenderComponent(cellRoot);
        entity.addComponent(RenderComponent.class, rc);
        importedModel.setEntity(entity);
View Full Code Here

Examples of com.jme.scene.Node.attachChild()

    }

    private Node createCameraGraph(WorldManager wm) {
        Node cameraSG = new Node("MyCamera SG");
        cameraNode = new CameraNode("MyCamera", null);
        cameraSG.attachChild(cameraNode);

        cameraNode.addGeometricUpdateListener(new GeometricUpdateListener() {

            public void geometricDataChanged(Spatial arg0) {
                notifyCameraMoved(new CellTransform(arg0.getWorldRotation(), arg0.getWorldTranslation()));
View Full Code Here

Examples of com.jme.scene.Node.attachChild()

            Node tmpParent = oldQuad.getParent();
            oldQuad.removeFromParent();
            TextureState texState = (TextureState) oldQuad.getRenderState(StateType.Texture);
            Texture tex = texState.getTexture();
            TextureManager.releaseTexture(tex);
            tmpParent.attachChild(updatedQuad);
        }
    }

    public void setShadowOffsetX(int offsetPixelX) {
        shadowOffsetX = offsetPixelX;
View Full Code Here

Examples of com.jme.scene.Node.attachChild()

        Vector3f labelPosition = new Vector3f(position.x, position.y + 3, position.z);
       
        Arrow arrow = new Arrow("Arrow", 3, 0.5f);
        Node rotatedOnX = new Node("Rotated For Arrow");
        rotatedOnX.setLocalRotation(new Quaternion().fromAngleAxis(90*FastMath.DEG_TO_RAD, new Vector3f(1, 0, 0)));
        rotatedOnX.attachChild(arrow);
        rotatedOnX.setLocalTranslation(position);
//        arrow.setLocalTranslation(position);
        label.setLocalTranslation(labelPosition);
        arrow.lookAt(direction, new Vector3f(0,1,0));
        rootNode.attachChild(label);
View Full Code Here

Examples of com.jme.scene.Node.attachChild()

        RenderManager rm = ClientContextJME.getWorldManager().getRenderManager();
        MaterialState matState3 = (MaterialState)
                rm.createRendererState(RenderState.StateType.Material);
        matState3.setDiffuse(color);
        n.setRenderState(matState3);
        n.attachChild(t);

        // Set the bound on the tube and update it
        t.setModelBound(new BoundingSphere());
        t.updateModelBound();
        return n;
View Full Code Here

Examples of com.jme.scene.Node.attachChild()

            for (int j = 10; j <= 50; j +=10) {
                Node jNode = new Node(String.valueOf(i+j));
                iNode.attachChild(jNode);
                for (int k = 1; k <= 5; k++) {
                    TriMesh kMesh = new TriMesh(String.valueOf(i+j+k));
                    jNode.attachChild(kMesh);
                }
            }
        }
        return rootNode;
    }
View Full Code Here

Examples of com.jme.scene.Node.attachChild()

        // Create a sub-node to hold the first arrow. We must translate it up,
        // so that the end is at (0, 0, 0) in the local coordinate space of
        // the node we return
        Node subNode1 = new Node();
        subNode1.setLocalTranslation(0, length / 2, 0);
        subNode1.attachChild(a1);

        // Create a sub-node to hold the second arrow. We must rotate it 180
        // degrees (about the +y axis since arrows by default point up). We
        // also must translate it down. Attach the second arrow to this node.
        Node subNode2 = new Node();
View Full Code Here

Examples of com.jme.scene.Node.attachChild()

        // also must translate it down. Attach the second arrow to this node.
        Node subNode2 = new Node();
        Quaternion q = new Quaternion().fromAngleAxis((float)Math.PI, new Vector3f(0, 0, 1));
        subNode2.setLocalRotation(q);
        subNode2.setLocalTranslation(0, -length / 2, 0);
        subNode2.attachChild(a2);

        // Attach the first arrow and the subnode to the main node
        n.attachChild(subNode1);
        n.attachChild(subNode2);
View Full Code Here

Examples of com.jme.scene.Node.attachChild()

          if (models.size()==1) {
                importedModel.setModelBG(load(zipFile, models.get(0), errorListener));
            } else {
                Node modelBG = new Node();
                for(KmlParser.KmlModel model : models) {
                    modelBG.attachChild(load(zipFile, model, errorListener));
                }
                importedModel.setModelBG(modelBG);
            }
            ResourceLocatorTool.removeThreadResourceLocator(ResourceLocatorTool.TYPE_TEXTURE, zipResource);
            WlzipManager.getWlzipManager().removeZip(zipHost, zipFile);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.