Java Code Examples for com.badlogic.gdx.graphics.OrthographicCamera#rotate()

The following examples show how to use com.badlogic.gdx.graphics.OrthographicCamera#rotate() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Box2DDebugger.java    From riiablo with Apache License 2.0 5 votes vote down vote up
@Override
protected void initialize() {
  setEnabled(false);
  renderer = new Box2DDebugRenderer();
  camera = new OrthographicCamera();
  camera.setToOrtho(true);
  camera.near = -1024;
  camera.far  =  1024;
  camera.rotate(Vector3.X, -60);
  camera.rotate(Vector3.Z, -45);
}
 
Example 2
Source File: Closeup.java    From ud405 with MIT License 3 votes vote down vote up
/**
 * Finally, let's zoom in on the satellite, and match its rotation. This could be very tricky,
 * given that rectangles are drawn by specifying their lower left corner, and also considering
 * that rectangles can specify the origin about which they will be rotated.
 *
 * Fortunately, we were smart when drawing the satellite, and made sure that it was _centered_
 * at SATELLITE_POSITION_X, SATELLITE_POSITION_Y, and also rotated about that point. That makes
 * our job super easy. We just move the camera to that position, and rotate the camera.
 */

private void trackSatellite(OrthographicCamera camera, float aspectRatio) {
    camera.viewportHeight = 2 * SATELLITE_SIZE;
    camera.viewportWidth = aspectRatio * camera.viewportHeight;
    camera.position.set(SATELLITE_POSITION_X, SATELLITE_POSITION_Y, 0);
    camera.rotate(SATELLITE_ROTATION);
}