Example usage for com.badlogic.gdx.graphics.g3d.utils FirstPersonCameraController FirstPersonCameraController

List of usage examples for com.badlogic.gdx.graphics.g3d.utils FirstPersonCameraController FirstPersonCameraController

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics.g3d.utils FirstPersonCameraController FirstPersonCameraController.

Prototype

public FirstPersonCameraController(Camera camera) 

Source Link

Usage

From source file:com.mbrlabs.demo.MundusDemo.java

License:Apache License

@Override
public void create() {
    batch = new ModelBatch();
    fpsLogger = new FPSLogger();

    // setup mundus & load our scene
    mundus = new Mundus(Gdx.files.internal("mundus"));
    mundus.init();/*from w ww  . j  a  v a  2 s. c  o m*/
    scene = mundus.loadScene("Main Scene.mundus");
    scene.sceneGraph.batch = batch;

    // position cam
    scene.cam.position.set(230, 150, 190);
    scene.cam.direction.rotate(Vector3.Y, 70);
    scene.cam.direction.rotate(Vector3.Z, -20);

    // setup input
    controller = new FirstPersonCameraController(scene.cam);
    controller.setVelocity(200f);
    Gdx.input.setInputProcessor(controller);
}