Package com.jme.scene.state

Examples of com.jme.scene.state.CullState


                ClientContextJME.getWorldManager().addRenderUpdater(new RenderUpdater() {

                    public void update(Object arg0) {
                        TreeScan.findNode(rc.getSceneRoot(), new ProcessNodeInterface() {
                            public boolean processNode(Spatial node) {
                                CullState cs = (CullState) node.getRenderState(RenderState.RS_CULL);
                                if (cs==null) {
                                    cs = (CullState) ClientContextJME.getWorldManager().getRenderManager().createRendererState(RenderState.RS_CULL);
                                    node.setRenderState(cs);
                                }
                                cs.setCullFace(face);

                                return true;
                            }
                        });
                        ClientContextJME.getWorldManager().addToUpdateList(rc.getSceneRoot());
View Full Code Here


        ThreadSafeColladaImporter importer = new ThreadSafeColladaImporter(name);
        importer.setErrorListener(listener);
        importer.load(in);
        modelNode = importer.getModel();

        CullState culls = DisplaySystem.getDisplaySystem().getRenderer().createCullState();
        culls.setCullFace(CullState.Face.Back);
        modelNode.setRenderState(culls);

        if (applyColladaAxisAndScale) {
            // Adjust the scene transform to match the scale and axis specified in
            // the collada file
View Full Code Here

        alphaState.setTestFunction(BlendState.TestFunction.GreaterThan);
        alphaState.setEnabled(true);
        sphere.setRenderState(alphaState);

        // Remove the back faces of the object so transparency works properly
        CullState cullState = (CullState)rm.createRendererState(StateType.Cull);
        cullState.setCullFace(CullState.Face.Back);
        sphereNode.setRenderState(cullState);

        // Set the bound so this node can be pickable
        sphere.setModelBound(new BoundingSphere());
        sphere.updateModelBound();
View Full Code Here

        bs.setBlendEnabled(true);
        bs.setSourceFunction(BlendState.SourceFunction.SourceAlpha);
        bs.setDestinationFunction(BlendState.DestinationFunction.OneMinusSourceAlpha);
        outerOrb.setRenderState(bs);

        CullState cs = (CullState) ClientContextJME.getWorldManager().getRenderManager().createRendererState(StateType.Cull);
        cs.setEnabled(true);
        cs.setCullFace(CullState.Face.Back);
        outerOrb.setRenderState(cs);

         orbNode.attachChild(outerOrb);
    }
View Full Code Here

    skybox.setTexture( Skybox.EAST, east );
    skybox.setTexture( Skybox.UP, up );
    skybox.setTexture( Skybox.DOWN, down );
    skybox.preloadTextures();

    CullState cullState = display.getRenderer().createCullState();
    cullState.setCullMode( CullState.CS_NONE );
    cullState.setEnabled( true );
    skybox.setRenderState( cullState );

    ZBufferState zState = display.getRenderer().createZBufferState();
    zState.setEnabled( false );
    skybox.setRenderState( zState );
View Full Code Here

    skybox.setTexture( Skybox.EAST, east );
    skybox.setTexture( Skybox.UP, up );
    skybox.setTexture( Skybox.DOWN, down );
    skybox.preloadTextures();

    CullState cullState = display.getRenderer().createCullState();
    cullState.setCullMode( CullState.CS_NONE );
    cullState.setEnabled( true );
    skybox.setRenderState( cullState );

    ZBufferState zState = display.getRenderer().createZBufferState();
    zState.setEnabled( false );
    skybox.setRenderState( zState );
View Full Code Here

    wireState = display.getRenderer().createWireframeState();
    wireState.setEnabled(false);
    root.setRenderState(wireState);

    // set culling on nonfacing triangles
    CullState cs = display.getRenderer().createCullState();
    cs.setCullMode(CullState.CS_BACK);
    root.setRenderState(cs);

    // enable the depth buffer
    ZBufferState buf = display.getRenderer().createZBufferState();
    buf.setEnabled(true);
View Full Code Here

    public static Node makeRandomEnviromentObjects(Vector3f center, int boxSize, int count, boolean useTransparency) {
        Node node = new Node("random_objects");

        Renderer renderer = DisplaySystem.getDisplaySystem().getRenderer();
        CullState cs = renderer.createCullState();
        cs.setCullFace(Face.Back);
        node.setRenderState(cs);
        if (useTransparency) {
            ZBufferState zs = renderer.createZBufferState();
            zs.setEnabled(false);
            node.setRenderState(zs);
View Full Code Here

        // prirazeni boxu
        box.setRenderState(ts);
        box.updateRenderState();

        // cullstate rika jestli vykreslovat i trjuhelniky s normalou smerem od kamery
        CullState cs = display.getRenderer().createCullState();
        cs.setEnabled(false);
        cs.setCullFace(com.jme.scene.state.CullState.Face.Back);
        box.setRenderState(cs);
        box.updateRenderState();

        // pruhlednosti. Naprosto magicka vec s milionem moznych kombinaci, pricemz pouzitelnych je asi tak deset. :-(
        BlendState bs = display.getRenderer().createBlendState();
View Full Code Here

        // prirazeni boxu
        box.setRenderState(ts);
        box.updateRenderState();

        // cullstate rika jestli vykreslovat i trjuhelniky s normalou smerem od kamery
        CullState cs = display.getRenderer().createCullState();
        cs.setEnabled(false);
        cs.setCullFace(com.jme.scene.state.CullState.Face.Back);
        box.setRenderState(cs);
        box.updateRenderState();

        // pruhlednosti. Naprosto magicka vec s milionem moznych kombinaci, pricemz pouzitelnych je asi tak deset. :-(
        BlendState bs = display.getRenderer().createBlendState();
View Full Code Here

TOP

Related Classes of com.jme.scene.state.CullState

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.