de.javagl.swogl.scene
Class DefaultCamera

java.lang.Object
  extended by de.javagl.swogl.scene.DefaultCamera
All Implemented Interfaces:
Camera, MutableCamera

public class DefaultCamera
extends java.lang.Object
implements MutableCamera

Default implementation of a MutableCamera.


Constructor Summary
DefaultCamera()
          Creates a new DefaultCamera with an eyePoint at (0,0,1), a viewPoint of (0,0,0), an upVector of (0,1,0) and a fov of 60 degrees.
 
Method Summary
 void addCameraListener(CameraListener cameraListener)
          Add the given listener which will be notified when a property of this camera changes
 javax.vecmath.Point3f getEyePoint()
          Return the eye point of the camera
 float getFovY()
          Return the angle of the field-of-view (FOV) of the camera (in y-direction), in degrees
 javax.vecmath.Vector3f getUpVector()
          Return the up vector of the camera
 javax.vecmath.Point3f getViewPoint()
          Return the view point of the camera
protected  void notifyCameraChanged()
          Notify all listeners about a camera change
 void removeCameraListener(CameraListener cameraListener)
          Remove the given listener from this camera
 void setEyePoint(javax.vecmath.Tuple3f point)
          Set the eye point of the camera
 void setFovY(float degrees)
          Set the field-of-view (FOV) of the camera (in y-direction) to the given angle (in degrees)
 void setUpVector(javax.vecmath.Tuple3f vector)
          Set the up vector of the camera
 void setViewPoint(javax.vecmath.Tuple3f point)
          Set the view point of the camera
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DefaultCamera

public DefaultCamera()
Creates a new DefaultCamera with an eyePoint at (0,0,1), a viewPoint of (0,0,0), an upVector of (0,1,0) and a fov of 60 degrees.

Method Detail

getEyePoint

public javax.vecmath.Point3f getEyePoint()
Description copied from interface: Camera
Return the eye point of the camera

Specified by:
getEyePoint in interface Camera
Returns:
The eye point of the camera

getViewPoint

public javax.vecmath.Point3f getViewPoint()
Description copied from interface: Camera
Return the view point of the camera

Specified by:
getViewPoint in interface Camera
Returns:
The view point of the camera

getUpVector

public javax.vecmath.Vector3f getUpVector()
Description copied from interface: Camera
Return the up vector of the camera

Specified by:
getUpVector in interface Camera
Returns:
The up vector of the camera

getFovY

public float getFovY()
Description copied from interface: Camera
Return the angle of the field-of-view (FOV) of the camera (in y-direction), in degrees

Specified by:
getFovY in interface Camera
Returns:
The FOV, in degrees

setEyePoint

public void setEyePoint(javax.vecmath.Tuple3f point)
Description copied from interface: MutableCamera
Set the eye point of the camera

Specified by:
setEyePoint in interface MutableCamera
Parameters:
point - The eye point of the camera

setViewPoint

public void setViewPoint(javax.vecmath.Tuple3f point)
Description copied from interface: MutableCamera
Set the view point of the camera

Specified by:
setViewPoint in interface MutableCamera
Parameters:
point - The view point of the camera

setUpVector

public void setUpVector(javax.vecmath.Tuple3f vector)
Description copied from interface: MutableCamera
Set the up vector of the camera

Specified by:
setUpVector in interface MutableCamera
Parameters:
vector - The up vector of the camera

setFovY

public void setFovY(float degrees)
Description copied from interface: MutableCamera
Set the field-of-view (FOV) of the camera (in y-direction) to the given angle (in degrees)

Specified by:
setFovY in interface MutableCamera
Parameters:
degrees - The FOV

notifyCameraChanged

protected void notifyCameraChanged()
Notify all listeners about a camera change


addCameraListener

public void addCameraListener(CameraListener cameraListener)
Description copied from interface: Camera
Add the given listener which will be notified when a property of this camera changes

Specified by:
addCameraListener in interface Camera
Parameters:
cameraListener - The listener to add

removeCameraListener

public void removeCameraListener(CameraListener cameraListener)
Description copied from interface: Camera
Remove the given listener from this camera

Specified by:
removeCameraListener in interface Camera
Parameters:
cameraListener - The listener to remove

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object