Package com.jme3.scene

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


    @Override
    public void setSpatial(Spatial spatial) {
        if (spatial != null && spatial instanceof Node) {
            Node node = (Node) spatial;
            node.attachChild(suspensionNode);
        } else if (spatial == null && this.spatial != null) {
            Node node = (Node) this.spatial;
            node.detachChild(suspensionNode);
        }
        super.setSpatial(spatial);
View Full Code Here


    @Override
    public void setSpatial(Spatial spatial) {
        if (spatial != null && spatial instanceof Node) {
            Node node = (Node) spatial;
            node.attachChild(geom);
        } else if (spatial == null && this.spatial != null) {
            Node node = (Node) this.spatial;
            node.detachChild(geom);
        }
        super.setSpatial(spatial);
View Full Code Here

    protected void controlUpdate(float tpf) {
        if(myShape != body.getCollisionShape()){
            Node node = (Node) this.spatial;
            node.detachChild(geom);
            geom = DebugShapeFactory.getDebugShape(body.getCollisionShape());
            node.attachChild(geom);
        }
        if(body.isActive()){
            geom.setMaterial(debugAppState.DEBUG_MAGENTA);
        }else{
            geom.setMaterial(debugAppState.DEBUG_BLUE);
View Full Code Here

            Node modelRoot = new Node(blenderKey.getName());
            for (Node node : rootObjects) {
                if (node instanceof LightNode) {
                    modelRoot.addLight(((LightNode) node).getLight());
                }
                modelRoot.attachChild(node);
            }

            return modelRoot;
        } catch (BlenderFileException e) {
            throw new IOException(e.getLocalizedMessage(), e);
View Full Code Here

                    Pointer pMesh = (Pointer) objectStructure.getFieldValue("data");
                    List<Structure> meshesArray = pMesh.fetchData();
                    List<Geometry> geometries = meshHelper.toMesh(meshesArray.get(0), blenderContext);
                    if (geometries != null) {
                        for (Geometry geometry : geometries) {
                            result.attachChild(geometry);
                        }
                    }
                    break;
                case SURF:
                case CURVE:
View Full Code Here

                    if (pCurve.isNotNull()) {
                        CurvesHelper curvesHelper = blenderContext.getHelper(CurvesHelper.class);
                        Structure curveData = pCurve.fetchData().get(0);
                        List<Geometry> curves = curvesHelper.toCurve(curveData, blenderContext);
                        for (Geometry curve : curves) {
                            result.attachChild(curve);
                        }
                    }
                    break;
                case LAMP:
                    Pointer pLamp = (Pointer) objectStructure.getFieldValue("data");
View Full Code Here

                    Structure objectStructure = pObject.fetchData().get(0);

                    Object object = objectHelper.toObject(objectStructure, blenderContext);
                    if (object instanceof LightNode) {
                        result.addLight(((LightNode) object).getLight());
                        result.attachChild((LightNode) object);
                    } else if (object instanceof Node) {
                        if (LOGGER.isLoggable(Level.FINE)) {
                            LOGGER.log(Level.FINE, "{0}: {1}--> {2}", new Object[] { ((Node) object).getName(), ((Node) object).getLocalTranslation().toString(), ((Node) object).getParent() == null ? "null" : ((Node) object).getParent().getName() });
                        }
                        if (((Node) object).getParent() == null) {
View Full Code Here

                    } else if (object instanceof Node) {
                        if (LOGGER.isLoggable(Level.FINE)) {
                            LOGGER.log(Level.FINE, "{0}: {1}--> {2}", new Object[] { ((Node) object).getName(), ((Node) object).getLocalTranslation().toString(), ((Node) object).getParent() == null ? "null" : ((Node) object).getParent().getName() });
                        }
                        if (((Node) object).getParent() == null) {
                            result.attachChild((Spatial) object);
                        }
                    }
                }
            }
        } catch (BlenderFileException e) {
View Full Code Here

        Geometry gDirection =  new Geometry("Direction-Line", new Line(new Vector3f(0,0,0), new Vector3f(0,0,2)));
       
        gSphere.setMaterial(main);
        gDirection.setMaterial(scnd);

        fighter.attachChild(gSphere);
        fighter.attachChild(gDirection);
       
       
        SimpleBoundingVolumeFactory.createBestBoundingVolume(fighter);
        fighter.setLocalTranslation(pos);
View Full Code Here

       
        gSphere.setMaterial(main);
        gDirection.setMaterial(scnd);

        fighter.attachChild(gSphere);
        fighter.attachChild(gDirection);
       
       
        SimpleBoundingVolumeFactory.createBestBoundingVolume(fighter);
        fighter.setLocalTranslation(pos);
       
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.