com.threerings.opengl.camera
Class OrbitCameraHandler

java.lang.Object
  extended by com.threerings.opengl.camera.CameraHandler
      extended by com.threerings.opengl.camera.OrbitCameraHandler
All Implemented Interfaces:
Renderer.Observer

public class OrbitCameraHandler
extends CameraHandler

Swings the camera around a target position.


Nested Class Summary
 
Nested classes/interfaces inherited from class com.threerings.opengl.camera.CameraHandler
CameraHandler.Offset
 
Constructor Summary
OrbitCameraHandler(GlContext ctx)
          Creates a new orbit camera handler for the compositor camera.
OrbitCameraHandler(GlContext ctx, Camera camera, boolean matchRenderSurface)
          Creates a new orbit camera handler for the specified camera.
 
Method Summary
 SphereCoords getCoords()
          Returns a reference to the camera's coordinates relative to the target.
 Vector3f getTarget()
          Returns a reference to the location of the camera's target.
 Vector3f getViewerTranslation()
          Returns a reference to the translation to use for the notional "viewer."
 void orbit(float azimuth, float elevation)
          Adjusts the azimuth and elevation of the camera by the specified amounts.
 void pan(float x, float y)
          Pans the target by the specified amounts relative to the camera's current orientation.
 void panXY(float x, float y)
          Pans the target on the XY plane by the specified amounts relative to the camera's current orientation.
 void setCoordLimits(float minElevation, float maxElevation, float minDistance, float maxDistance)
          Sets the limits on the camera's relative coordinates.
 void zoom(float distance)
          "Zooms" in (if negative) or out (if positive) by the specified amount.
 
Methods inherited from class com.threerings.opengl.camera.CameraHandler
addOffset, getFar, getFieldOfView, getNear, getViewerRotation, isAdded, setPerspective, sizeChanged, updatePerspective, updatePosition, wasAdded, wasRemoved
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OrbitCameraHandler

public OrbitCameraHandler(GlContext ctx)
Creates a new orbit camera handler for the compositor camera.


OrbitCameraHandler

public OrbitCameraHandler(GlContext ctx,
                          Camera camera,
                          boolean matchRenderSurface)
Creates a new orbit camera handler for the specified camera.

Method Detail

getTarget

public Vector3f getTarget()
Returns a reference to the location of the camera's target.


getCoords

public SphereCoords getCoords()
Returns a reference to the camera's coordinates relative to the target.


orbit

public void orbit(float azimuth,
                  float elevation)
Adjusts the azimuth and elevation of the camera by the specified amounts.


zoom

public void zoom(float distance)
"Zooms" in (if negative) or out (if positive) by the specified amount.


pan

public void pan(float x,
                float y)
Pans the target by the specified amounts relative to the camera's current orientation.


panXY

public void panXY(float x,
                  float y)
Pans the target on the XY plane by the specified amounts relative to the camera's current orientation.


setCoordLimits

public void setCoordLimits(float minElevation,
                           float maxElevation,
                           float minDistance,
                           float maxDistance)
Sets the limits on the camera's relative coordinates.


getViewerTranslation

public Vector3f getViewerTranslation()
Description copied from class: CameraHandler
Returns a reference to the translation to use for the notional "viewer."

Overrides:
getViewerTranslation in class CameraHandler


Copyright © 2011. All Rights Reserved.