Package de.venjinx.jme3

Examples of de.venjinx.jme3.VoxelState


    public void onAnalog(String name, float value, float tpf) {
    }

    @Override
    public void onEvent(String id, MenuItemActivatedEvent<String> event) {
        VoxelObjectNode vObject;
        Node parent;
        DebugNode debug = debugNodes.get(activeGeometry);
        if (debug == null) {
            debug = new DebugNode(activeGeometry);
            debugNodes.put(activeGeometry, debug);
        }

        gui.showContextMenu(false, activeGeometry);

        debug.setLocalTranslation(activeGeometry.getWorldTranslation());
        debugNode.attachChild(debug);
        switch (event.getItem()) {
            case DebugGUI.MENU_SHOW_BOUND:
                debug.showBound();
                break;
            case DebugGUI.MENU_SHOW_CHUNK_BOUNDS:
                parent = activeGeometry.getParent();
                while (!(parent instanceof VoxelObjectNode))
                    parent = parent.getParent();
                vObject = (VoxelObjectNode) parent;
                vObject.showChunkBounds();
                break;
            case DebugGUI.MENU_SHOW_CHUNK_LODS:
                parent = activeGeometry.getParent();
                while (!(parent instanceof VoxelObjectNode))
                    parent = parent.getParent();
                vObject = (VoxelObjectNode) parent;
                vObject.showChunkLODs();
                break;
            case DebugGUI.MENU_SHOW_NORMALS:
                debug.showNormals();
                break;
            case DebugGUI.MENU_SHOW_WIREFRAME:
View Full Code Here


                       assetManager.loadTexture("textures/terrain/ground/grass512x512_01_normal.gif"));

        // mat.setBoolean("UseMaterialColors", true);
        // mat.setColor("Diffuse", ColorRGBA.White);

        VoxelObjectNode terrain = new VoxelObjectNode(data);
        terrain.setName("VoxelTerrain");
        terrain.setMaterial(mat);
        worldState.addObject(terrain);
    }
View Full Code Here

                wire.setLocalTranslation(refGeom.getLocalTranslation());
                node.attachChild(wire);
            }

            if (refGeom.getName().contains("Voxel")) {
                VoxelObjectNode vo;
                Node parent = refGeom.getParent();
                while (!(parent instanceof VoxelObjectNode))
                    parent = parent.getParent();
                vo = (VoxelObjectNode) parent;
                voxelGrid = buildVoxelGrid(vo);
                voxelGrid.setLocalTranslation(vo.getLocalTranslation());
                node.attachChild(voxelGrid);

                vo.showChunkLODs();
                vo.showChunkBounds();
            }
        }
        return node;
    }
View Full Code Here

    protected DebugMouse mouse;
    protected DebugState debugState;
    protected VoxelState worldState;

    public VenJinXEditor() {
        super(new VoxelState(), new DebugState());
    }
View Full Code Here

    @Override
    public int attachChild(Spatial child) {
        if (child instanceof ScenegraphNode)
            ((ScenegraphNode) child).setScenegraph(scenegraph);
        if (child.getParent() != this)
            notifyListeners(new NodeChangedEvent(this, child, EventType.ATTACHED));
        super.attachChild(child);
        return children.size();
    }
View Full Code Here

    @Override
    public int attachChildAt(Spatial child, int index) {
        if (child instanceof ScenegraphNode)
            ((ScenegraphNode) child).setScenegraph(scenegraph);
        if (child.getParent() != this)
            notifyListeners(new NodeChangedEvent(this, child, EventType.ATTACHED));
        super.attachChildAt(child, index);
        return children.size();
    }
View Full Code Here

    }

    @Override
    public int detachChild(Spatial child) {
        if (hasChild(child))
            notifyListeners(new NodeChangedEvent(this, child, EventType.DETACHED));
        super.detachChild(child);
        if (child instanceof ScenegraphNode)
            ((ScenegraphNode) child).setScenegraph(null);
        return children.size();
    }
View Full Code Here

    @Override
    public int detachChildNamed(String childName) {
        for (int x = 0, max = children.size(); x < max; x++) {
            Spatial child = children.get(x);
            if (childName.equals(child.getName())) {
                notifyListeners(new NodeChangedEvent(this, child, EventType.DETACHED));
                detachChildAt(x);
                if (child instanceof ScenegraphNode)
                    ((ScenegraphNode) child).setScenegraph(null);
                return x;
            }
View Full Code Here

    @Override
    public Spatial detachChildAt(int index) {
        Spatial child = children.get(index);
        if (hasChild(child))
            notifyListeners(new NodeChangedEvent(this, child, EventType.DETACHED));
        super.detachChildAt(index);
        if (child instanceof ScenegraphNode)
            ((ScenegraphNode) child).setScenegraph(null);
        return child;
    }
View Full Code Here

                            + e.getParent() + " - " + trace);
                break;
        }

        for (ScenegraphListener sl : listeners)
            sl.onGraphChanged(new GraphChangedEvent(this, e));
    }
View Full Code Here

TOP

Related Classes of de.venjinx.jme3.VoxelState

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.