/** Rotates the camera by the given angle around the direction vector. The direction and up vector will not be orthogonalized. * @param angle */ public void rotate (float angle) { rotate(direction, angle); }
/** Rotates the camera by the given angle around the direction vector. The direction and up vector will not be orthogonalized. * @param angle */ public void rotate (float angle) { rotate(direction, angle); }
/** Rotates the camera by the given angle around the direction vector. The direction and up vector will not be orthogonalized. * @param angle */ public void rotate (float angle) { rotate(direction, angle); }
/** * 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); } }