Examples of MouseButtonTrigger


Examples of com.jme3.input.controls.MouseButtonTrigger

        super.setSpatial(spatial);

        if (spatial != null) {
            initialRotation = spatial.getLocalRotation().clone();

            inputManager.addMapping(LEFT_CLICK, new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
            inputManager.addListener(actionListener, LEFT_CLICK);

            weaponEntity = ((WeaponEntity) spatial.getUserData("entity"));
        }
    }
View Full Code Here

Examples of com.jme3.input.controls.MouseButtonTrigger

    private Camera cam = myApp.getCamera();
    private InputManager inputManager = myApp.getInputManager();
    private String LEFT_CLICK = "leftFood";

    public FoodThrowControl() {
        inputManager.addMapping(LEFT_CLICK, new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
        inputManager.addListener(this, LEFT_CLICK);
    }
View Full Code Here

Examples of com.jme3.input.controls.MouseButtonTrigger

   */
  private TuioInput() {}
 
  public void setInputManager(InputManager inputManager) {
    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

Examples of com.jme3.input.controls.MouseButtonTrigger

  }

  @Override
  public void addKeyMapping(InputManager man) {
    this.inputManager = man;
    man.addMapping("GotoClickedInputAction", new MouseButtonTrigger(
        MouseInput.BUTTON_LEFT));
    man.addListener(this, "GotoClickedInputAction");
  }
View Full Code Here

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

Examples of com.jme3.input.controls.MouseButtonTrigger

    /** 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

Examples of com.jme3.input.controls.MouseButtonTrigger

  /** 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

Examples of com.jme3.input.controls.MouseButtonTrigger

    // 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

Examples of com.jme3.input.controls.MouseButtonTrigger

    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

Examples of com.jme3.input.controls.MouseButtonTrigger

          rootNode.attachChild(bulletg);
          space.add(bulletControl);
        }
      }
    };
    app.getInputManager().addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
    app.getInputManager().addListener(actionListener, "shoot");
  }
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.