Package com.jme3.input.controls

Examples of com.jme3.input.controls.KeyTrigger


    private void setColor(Node node, ColorRGBA color){
  for(int i = 0; i < node.getQuantity(); i++){
      Spatial spatial = node.getChild(i);
      if(spatial instanceof Geometry){
                //Material material = new Material();
                AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
                Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
                material.setColor("m_Color",color);
                //Material geomMaterial = ((Geometry)spatial).getMaterial();
                spatial.setMaterial(material);
                System.out.println("Spatial: "+spatial.getName());
View Full Code Here


     * Sets the color of the geometries of the children and home.
     * Note, this is a recursive method.
     * @param node the node that contains children
     **/
    private void setColor(Geometry geometry, ColorRGBA color){
        AssetManager assetManager = JmeSystem.newAssetManager(Thread.currentThread().getContextClassLoader().getResource("com/jme3/asset/Desktop.cfg"));
        Material material = new Material(assetManager, "Common/MatDefs/Misc/SolidColor.j3md");
        material.setColor("m_Color",color);
        geometry.setMaterial(material);
        System.out.println("Spatial: "+geometry.getName());
    }
View Full Code Here

            Spatial spatial = assetManager.loadModel(obj);
            //Material mat = new Material(assetManager, "Common/MatDefs/Misc/ShowNormals.j3md");
            //spatial.setMaterial(mat);
            node.attachChild(spatial);

      node.setModelBound(new BoundingSphere());
      node.updateModelBound();
  } catch (Exception e) {
            e.printStackTrace();
      //logger.logp(Level.SEVERE, this.getClass().toString(),"loadNode()", "Exception", e);
      node = null;
View Full Code Here

    guiNode.detachChildNamed("Statistics View");

    camNode = new Node("Cam Node");

    flyCam.setEnabled(false);
    ChaseCamera chaseCam = new ChaseCamera(cam, camNode, inputManager);
    chaseCam.setSmoothMotion(true);
    chaseCam.setMaxDistance(100000);
    chaseCam.setMinVerticalRotation(-FastMath.PI / 2);

    rootNode.attachChild(camNode);

  }
View Full Code Here

            //flyCam = new FlyByCamera(cam);
            //flyCam.setMoveSpeed(1f);
            //flyCam.registerWithInput(inputManager);

            if (context.getType() == Type.Display) {
                inputManager.addMapping("SIMPLEAPP_Exit", new KeyTrigger(KeyInput.KEY_ESCAPE));
            }
          
            inputManager.addMapping("SIMPLEAPP_CameraPos", new KeyTrigger(KeyInput.KEY_C));
            inputManager.addMapping("SIMPLEAPP_Memory", new KeyTrigger(KeyInput.KEY_M));
            inputManager.addListener(actionListener, "SIMPLEAPP_Exit",
                    "SIMPLEAPP_CameraPos", "SIMPLEAPP_Memory");
        }
   
        //create the Core
View Full Code Here

        Material mat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md");
        mat.setTexture("ColorMap", offTex);
        g.setMaterial(mat);
        rootNode.attachChild(g);
        inputManager.addMapping(TOGGLE_UPDATE, new KeyTrigger(KeyInput.KEY_SPACE));
        inputManager.addListener(this, TOGGLE_UPDATE);
    }
View Full Code Here

        if (inputManager.hasMapping("SIMPLEAPP_Exit")) {
            inputManager.deleteMapping("SIMPLEAPP_Exit");
        }

        inputManager.addMapping(PAUSE, new KeyTrigger(KeyInput.KEY_ESCAPE),
                new KeyTrigger(KeyboardInputEvent.KEY_PAUSE),
                new KeyTrigger(KeyboardInputEvent.KEY_P));
        inputManager.addMapping(NEXT_LEVEL, new KeyTrigger(KeyInput.KEY_F2));
        inputManager.addMapping(PREVIOUS_LEVEL, new KeyTrigger(KeyInput.KEY_F1));

        inputManager.addListener(actionListener, PAUSE, NEXT_LEVEL, PREVIOUS_LEVEL);

    }
View Full Code Here

    this.inputManager = inputManager;
    inputManager.addMapping("MouseToTuio_Active", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
    inputManager.addListener(this, "MouseToTuio_Active");
    inputManager.addMapping("MouseToTuio_Right_Active", new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
    inputManager.addListener(this, "MouseToTuio_Right_Active");
    inputManager.addMapping("SIMPLEAPP_Zoom", new KeyTrigger(KeyInput.KEY_UP));
    inputManager.addListener(this, "SIMPLEAPP_Zoom");
        inputManager.addMapping("SIMPLEAPP_ZoomMin", new KeyTrigger(KeyInput.KEY_DOWN));
        inputManager.addListener(this, "SIMPLEAPP_ZoomMin");
  }
View Full Code Here

        boolean isMoving = left || right || up || down;
        GameState.setMoving(isMoving);
    }

    private void addDesktopInputs() {
        inputManager.addMapping(LEFT_MOVE, new KeyTrigger(KeyInput.KEY_A));
        inputManager.addMapping(RIGHT_MOVE, new KeyTrigger(KeyInput.KEY_D));
        inputManager.addMapping(FORWARD_MOVE, new KeyTrigger(KeyInput.KEY_W));
        inputManager.addMapping(BACKWARD_MOVE, new KeyTrigger(KeyInput.KEY_S));
        inputManager.addMapping(JUMP, new KeyTrigger(KeyInput.KEY_SPACE));
        inputManager.addListener(this, LEFT_MOVE, RIGHT_MOVE, FORWARD_MOVE, BACKWARD_MOVE, JUMP);
    }
View Full Code Here

      }
     
      System.out.println("EntityNavManager finished");
     
        inputManager.addListener(this, "print_scenegraph", "print_cam_location", "print_bboxes", "toggle_navmesh", "drop_a_box", "toggle_navbodermesh");
        inputManager.addMapping("print_scenegraph", new KeyTrigger(KeyInput.KEY_F6));
        inputManager.addMapping("print_cam_location", new KeyTrigger(KeyInput.KEY_F1));
        inputManager.addMapping("print_bboxes", new KeyTrigger(KeyInput.KEY_F7));
        inputManager.addMapping("toggle_navmesh", new KeyTrigger(KeyInput.KEY_F8));
        inputManager.addMapping("drop_a_box", new KeyTrigger(KeyInput.KEY_F9));
        inputManager.addMapping("toggle_navbodermesh", new KeyTrigger(KeyInput.KEY_F10));
       
        rootNode.attachChild(bboxes);
        rootNode.attachChild(navs);
    }
View Full Code Here

TOP

Related Classes of com.jme3.input.controls.KeyTrigger

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.