|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.camera.CameraHandler
public abstract class CameraHandler
Controls the camera parameters.
| Nested Class Summary | |
|---|---|
static interface |
CameraHandler.Offset
Provides a means of temporarily offsetting the camera transform. |
| Field Summary | |
|---|---|
protected Camera |
_camera
The camera that we're handling. |
protected GlContext |
_ctx
The renderer context. |
protected float |
_far
The distance to the far clip plane. |
protected float |
_fovy
The vertical field of view (in radians). |
protected boolean |
_matchRenderSurface
Whether or not we're to match the size of the render surface. |
protected float |
_near
The distance to the near clip plane. |
protected List<CameraHandler.Offset> |
_offsets
The list of registered offsets. |
| Constructor Summary | |
|---|---|
CameraHandler(GlContext ctx)
Creates a new camera handler for the compositor camera. |
|
CameraHandler(GlContext ctx,
Camera camera,
boolean matchRenderSurface)
Creates a new camera handler for the specified camera. |
|
| Method Summary | |
|---|---|
void |
addOffset(CameraHandler.Offset offset)
Adds an element to the list of offsets to apply. |
float |
getFar()
Returns the distance to the far clip plane. |
float |
getFieldOfView()
Returns the camera's field of view in radians. |
float |
getNear()
Returns the distance to the near clip plane. |
protected abstract void |
getTransform(Transform3D transform)
Computes the base (pre-offset) camera transform. |
Quaternion |
getViewerRotation()
Returns a reference to the rotation to use for the viewer. |
Vector3f |
getViewerTranslation()
Returns a reference to the translation to use for the notional "viewer." |
boolean |
isAdded()
Determines whether the camera handler is currently active. |
void |
setPerspective(float fovy,
float near,
float far)
Sets the camera's perspective parameters. |
void |
sizeChanged(int width,
int height)
Notes that the size of the renderer's drawable surface has changed. |
void |
updatePerspective()
Updates the camera perspective parameters. |
void |
updatePosition()
Updates the camera position. |
void |
wasAdded()
Notifies the handler that it has been added. |
void |
wasRemoved()
Notifies the handler that it has been removed. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected GlContext _ctx
protected Camera _camera
protected boolean _matchRenderSurface
protected float _fovy
protected float _near
protected float _far
protected List<CameraHandler.Offset> _offsets
| Constructor Detail |
|---|
public CameraHandler(GlContext ctx)
public CameraHandler(GlContext ctx,
Camera camera,
boolean matchRenderSurface)
matchRenderSurface - if true, automatically adjust the camera viewport to match the
dimensions of the renderer surface.| Method Detail |
|---|
public void setPerspective(float fovy,
float near,
float far)
public float getFieldOfView()
public float getNear()
public float getFar()
public void addOffset(CameraHandler.Offset offset)
public Vector3f getViewerTranslation()
public Quaternion getViewerRotation()
public boolean isAdded()
public void wasAdded()
public void wasRemoved()
public void updatePerspective()
public void updatePosition()
public void sizeChanged(int width,
int height)
Renderer.Observer
sizeChanged in interface Renderer.Observerprotected abstract void getTransform(Transform3D transform)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||