Search in sources :

Example 96 with KeyTrigger

use of com.jme3.input.controls.KeyTrigger in project jmonkeyengine by jMonkeyEngine.

the class TerrainTestAndroid method setupKeys.

private void setupKeys() {
    flyCam.setMoveSpeed(50);
    inputManager.addMapping("wireframe", new KeyTrigger(KeyInput.KEY_T));
    inputManager.addListener(actionListener, "wireframe");
    inputManager.addMapping("triPlanar", new KeyTrigger(KeyInput.KEY_P));
    inputManager.addListener(actionListener, "triPlanar");
}
Also used : KeyTrigger(com.jme3.input.controls.KeyTrigger)

Example 97 with KeyTrigger

use of com.jme3.input.controls.KeyTrigger in project jmonkeyengine by jMonkeyEngine.

the class VRApplication method initialize.

@Override
public void initialize() {
    logger.config("Initialize VR application...");
    initialize_internal();
    cam.setFrustumFar(fFar);
    cam.setFrustumNear(fNear);
    dummyCam = cam.clone();
    if (isInVR()) {
        logger.config("VR mode enabled.");
        if (VRhardware != null) {
            VRhardware.initVRCompositor(compositorAllowed());
        } else {
            logger.warning("No VR system found.");
        }
        //FIXME: WARNING !!
        viewmanager = new VRViewManagerOpenVR(null);
        viewmanager.setResolutionMultiplier(resMult);
        inputManager.addMapping(RESET_HMD, new KeyTrigger(KeyInput.KEY_F9));
        setLostFocusBehavior(LostFocusBehavior.Disabled);
    } else {
        logger.config("VR mode disabled.");
        viewPort.attachScene(rootNode);
        guiViewPort.attachScene(guiNode);
    }
    if (viewmanager != null) {
        viewmanager.initialize();
    }
    simpleInitApp();
    // any filters created, move them now
    if (viewmanager != null) {
        viewmanager.moveScreenProcessingToEyes();
        // print out camera information
        if (isInVR()) {
            logger.info("VR Initialization Information");
            if (viewmanager.getLeftCamera() != null) {
                logger.info("camLeft: " + viewmanager.getLeftCamera().toString());
            }
            if (viewmanager.getRightCamera() != null) {
                logger.info("camRight: " + viewmanager.getRightCamera().toString());
            }
        }
    }
}
Also used : VRViewManagerOpenVR(com.jme3.util.VRViewManagerOpenVR) KeyTrigger(com.jme3.input.controls.KeyTrigger)

Aggregations

KeyTrigger (com.jme3.input.controls.KeyTrigger)93 ActionListener (com.jme3.input.controls.ActionListener)36 Vector3f (com.jme3.math.Vector3f)30 Geometry (com.jme3.scene.Geometry)23 Material (com.jme3.material.Material)22 DirectionalLight (com.jme3.light.DirectionalLight)21 Quaternion (com.jme3.math.Quaternion)18 Spatial (com.jme3.scene.Spatial)13 FilterPostProcessor (com.jme3.post.FilterPostProcessor)11 Box (com.jme3.scene.shape.Box)11 BitmapText (com.jme3.font.BitmapText)10 MouseButtonTrigger (com.jme3.input.controls.MouseButtonTrigger)10 Node (com.jme3.scene.Node)10 AnalogListener (com.jme3.input.controls.AnalogListener)9 ColorRGBA (com.jme3.math.ColorRGBA)9 Sphere (com.jme3.scene.shape.Sphere)8 AmbientLight (com.jme3.light.AmbientLight)7 Quad (com.jme3.scene.shape.Quad)6 ChaseCamera (com.jme3.input.ChaseCamera)4 BulletAppState (com.jme3.bullet.BulletAppState)3