Example usage for com.badlogic.gdx.graphics Camera lookAt

List of usage examples for com.badlogic.gdx.graphics Camera lookAt

Introduction

In this page you can find the example usage for com.badlogic.gdx.graphics Camera lookAt.

Prototype

public void lookAt(float x, float y, float z) 

Source Link

Document

Recalculates the direction of the camera to look at the point (x, y, z).

Usage

From source file:com.ridiculousRPG.camera.CameraTrackMovableService.java

License:Apache License

/**
 * Centers the camera to the tracked object (event)
 *///from  w  ww . j  ava2s .c  o m
public void centerTrackObj() {
    if (trackObj == null)
        return;
    Camera cam = GameBase.$().getCamera();
    cam.lookAt(trackObj.getCenterX(), trackObj.getCenterY(), 0f);
    cam.update();
    oldX = trackObj.getX();
    oldY = trackObj.getY();
}