net.java.joglutils.msg.nodes
Class PerspectiveCamera

java.lang.Object
  extended by net.java.joglutils.msg.nodes.Node
      extended by net.java.joglutils.msg.nodes.Camera
          extended by net.java.joglutils.msg.nodes.PerspectiveCamera

public class PerspectiveCamera
extends Camera

Represents a camera utilizing a perspective projection.

The default height angle is Math.PI / 4 radians (45 degrees), meaning that the camera has a total vertical field of view of 90 degrees.


Field Summary
 
Fields inherited from class net.java.joglutils.msg.nodes.Camera
projDirty, projMatrix, viewDirty, viewMatrix
 
Constructor Summary
PerspectiveCamera()
           
 
Method Summary
 float getHeightAngle()
          Returns the height angle, in radians, of this perspective camera.
 Mat4f getProjectionMatrix()
          Returns the projection matrix associated with this camera's parameters.
protected  Vec3f getRayStartPoint(Vec2f point, Vec3f unprojectedPoint)
          Computes the start point of a ray for picking, given a point in normalized screen coordinates ((0, 0) to (1, 1)) and a 3D point which that point unprojects to.
 float getWidthAngle()
          Returns the width angle, in radians, of this perspective camera, assuming the camera's currently-set aspect ratio.
 float getWidthAngle(float aspectRatio)
          Returns the width angle, in radians, of this perspective camera, assuming the passed-in aspect ratio.
 void render(GLRenderAction action)
          Support for the built-in GLRenderAction.
 void setHeightAngle(float heightAngle)
          Sets the height angle, in radians, of this perspective camera.
 
Methods inherited from class net.java.joglutils.msg.nodes.Camera
doAction, getAspectRatio, getFarDistance, getFocalDistance, getNearDistance, getOrientation, getPosition, getViewingMatrix, rayPick, setAspectRatio, setFarDistance, setFocalDistance, setNearDistance, setOrientation, setPosition, unproject, unproject
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PerspectiveCamera

public PerspectiveCamera()
Method Detail

getProjectionMatrix

public Mat4f getProjectionMatrix()
Description copied from class: Camera
Returns the projection matrix associated with this camera's parameters.

Specified by:
getProjectionMatrix in class Camera

setHeightAngle

public void setHeightAngle(float heightAngle)
Sets the height angle, in radians, of this perspective camera. The default height angle is Math.PI / 4 radians, or 45 degrees.


getHeightAngle

public float getHeightAngle()
Returns the height angle, in radians, of this perspective camera.


getWidthAngle

public float getWidthAngle(float aspectRatio)
Returns the width angle, in radians, of this perspective camera, assuming the passed-in aspect ratio.


getWidthAngle

public float getWidthAngle()
Returns the width angle, in radians, of this perspective camera, assuming the camera's currently-set aspect ratio.


getRayStartPoint

protected Vec3f getRayStartPoint(Vec2f point,
                                 Vec3f unprojectedPoint)
Description copied from class: Camera
Computes the start point of a ray for picking, given a point in normalized screen coordinates ((0, 0) to (1, 1)) and a 3D point which that point unprojects to.

Specified by:
getRayStartPoint in class Camera

render

public void render(GLRenderAction action)
Description copied from class: Node
Support for the built-in GLRenderAction. Note that supplying virtual methods in Node subclasses to support various actions is not required due to the framework supporting action methods, but for built-in actions it may make it simpler.

Overrides:
render in class Node