Package com.jme3.input.controls

Examples of com.jme3.input.controls.MouseButtonTrigger


        //Uncomment this to look 3 world units above the target
    chaser.setLookAtOffset( targetOffset);//Vector3f.UNIT_Z.mult(targetOffset));

        //Uncomment this to enable rotation when the middle mouse button is pressed (like Blender)
        //WARNING : setting this trigger disable the rotation on right and left mouse button click
    chaser.setToggleRotationTrigger(new MouseButtonTrigger(MouseInput.BUTTON_RIGHT));
    chaser.setMaxDistance(20f);
    chaser.setMinDistance(5f);
    chaser.setDefaultDistance(12f);
    chaser.setZoomSensitivity(0.1f);
  }
View Full Code Here


    /** Configure cam to look at scene */
    cam.setLocation(new Vector3f(0, 4f, 6f));
    cam.lookAt(new Vector3f(2, 2, 0), Vector3f.UNIT_Y);
    /** Add InputManager action: Left click triggers shooting. */
    inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
    inputManager.addListener(actionListener, "shoot");
    /** Initialize the scene, materials, and physics space */
    initMaterials();
    initWall();
    initFloor();
View Full Code Here

  /** Declaring the "Shoot" action and mapping to its triggers. */
  private void initKeys() {

    inputManager.addMapping("Shoot", new KeyTrigger(KeyInput.KEY_SPACE), // trigger 1: spacebar
        new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); // trigger 2: left-button click
    inputManager.addListener(actionListener, "Shoot");
  }
View Full Code Here

    // You can map one or several inputs to one named action
    inputManager.addMapping("Pause", new KeyTrigger(KeyInput.KEY_P));
    inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_J));
    inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_K));
    inputManager.addMapping("Rotate", new KeyTrigger(KeyInput.KEY_SPACE), new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
    // Add the names to the action listener.
    inputManager.addListener(actionListener, new String[] { "Pause" });
    inputManager.addListener(analogListener, new String[] { "Left", "Right", "Rotate" });

  }
View Full Code Here

    initGameControlListener();
  }

  public void initGameControlListener() {
    inputManager.addMapping(InputStrings.FREE_MOUSE,
        new MouseButtonTrigger(inputBinding.getMouseBinding(InputStrings.FREE_MOUSE)));
    inputManager.addListener(new MouseInputListener(inputManager), InputStrings.FREE_MOUSE);
  }
View Full Code Here

          rootNode.attachChild(bulletg);
          space.add(bulletControl);
        }
      }
    };
    app.getInputManager().addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
    app.getInputManager().addListener(actionListener, "shoot");
  }
View Full Code Here

        inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_A));
        inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_D));
        inputManager.addMapping("Up", new KeyTrigger(KeyInput.KEY_W));
        inputManager.addMapping("Down", new KeyTrigger(KeyInput.KEY_S));
        inputManager.addMapping("Jump", new KeyTrigger(KeyInput.KEY_SPACE));
        inputManager.addMapping("Shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));

        inputManager.addListener(i, "Left");
        inputManager.addListener(i, "Right");
        inputManager.addListener(i, "Up");
        inputManager.addListener(i, "Down");
View Full Code Here

    input.addMapping("backward", new KeyTrigger(KeyInput.KEY_S));
    input.addMapping("jump", new KeyTrigger(KeyInput.KEY_SPACE));
    input.addMapping("center", new KeyTrigger(KeyInput.KEY_2));
    input.addMapping("crouch", new KeyTrigger(KeyInput.KEY_LSHIFT));
    input.addMapping("camera", new KeyTrigger(KeyInput.KEY_F));
    input.addMapping("shoot", new MouseButtonTrigger(0));
    input.addMapping("head_left", new MouseAxisTrigger(0, true));
    input.addMapping("head_right", new MouseAxisTrigger(0, false));
    input.addMapping("head_up", new MouseAxisTrigger(1, false));
    input.addMapping("head_down", new MouseAxisTrigger(1, true));
    input.setCursorVisible(false);
View Full Code Here

    });
  }
 
  public void setAmbientLight(final boolean on) {
    if (al == null) {
      al = new AmbientLight();
      al.setColor(new ColorRGBA(1.0f, 0.92f, 0.75f, 1f));
    }
    this.enqueue(new Callable<Integer>(){
      public Integer call() throws Exception {
        if (on) {
View Full Code Here

    //addEntity(ship);
   
   
   
    //addEntity(new RoidField("Roids", "Models/RoidField/Roid.mesh.xml"));
    AmbientLight al = new AmbientLight();
    al.setColor(ColorRGBA.White.mult(0.5f));
    mapNode.addLight(al);
   
   
    /*
    DirectionalLight sun = new DirectionalLight();
View Full Code Here

TOP

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

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.