|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.java.joglutils.msg.nodes.Node
net.java.joglutils.msg.nodes.Camera
public abstract class Camera
Represents a camera which is used to view the scene. The camera should be added to the scene graph before the geometry it is intended to view.
The camera's default parameters are a position at (0, 0, 1), facing down the negative Z axis with the Y axis up, an aspect ratio of 1.0, a near distance of 1.0, a far distance of 100.0, and a focal distance of 10.0.
Field Summary | |
---|---|
protected boolean |
projDirty
|
protected Mat4f |
projMatrix
|
protected boolean |
viewDirty
|
protected Mat4f |
viewMatrix
|
Constructor Summary | |
---|---|
Camera()
|
Method Summary | |
---|---|
void |
doAction(Action action)
Performs the "typical" operation for this node when an action is applied to it. |
float |
getAspectRatio()
Returns the aspect ratio of the camera -- the width of the viewport divided by the height of the viewport. |
float |
getFarDistance()
Returns the distance from the eye point to the far clipping plane. |
float |
getFocalDistance()
Returns the distance from the eye point to the focal point of the scene. |
float |
getNearDistance()
Returns the distance from the eye point to the near clipping plane. |
Rotf |
getOrientation()
Returns the orientation of the camera. |
Vec3f |
getPosition()
Returns the position of the camera. |
abstract Mat4f |
getProjectionMatrix()
Returns the projection matrix associated with this camera's parameters. |
protected abstract 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. |
Mat4f |
getViewingMatrix()
Returns the viewing matrix associated with this camera's parameters. |
void |
rayPick(RayPickAction action)
Support for the built-in RayPickAction. |
void |
setAspectRatio(float aspectRatio)
Sets the aspect ratio of the camera -- the width of the viewport divided by the height of the viewport. |
void |
setFarDistance(float farDistance)
Sets the distance from the eye point to the far clipping plane. |
void |
setFocalDistance(float focalDistance)
Sets the distance from the eye point to the focal point of the scene. |
void |
setNearDistance(float nearDistance)
Sets the distance from the eye point to the near clipping plane. |
void |
setOrientation(Rotf orientation)
Sets the orientation of the camera. |
void |
setPosition(Vec3f position)
Sets the position of the camera. |
Line |
unproject(Vec2f point)
Un-projects the given on-screen point to a line in 3D space which can be used for picking or other operations. |
void |
unproject(Vec2f point,
Line line)
Un-projects the given on-screen point in to the given line in 3D space (in world coordinates) which can be used for picking or other operations. |
Methods inherited from class net.java.joglutils.msg.nodes.Node |
---|
render |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected boolean projDirty
protected boolean viewDirty
protected Mat4f projMatrix
protected Mat4f viewMatrix
Constructor Detail |
---|
public Camera()
Method Detail |
---|
public void setPosition(Vec3f position)
public Vec3f getPosition()
public void setOrientation(Rotf orientation)
public Rotf getOrientation()
public void setAspectRatio(float aspectRatio)
public float getAspectRatio()
public void setNearDistance(float nearDistance)
public float getNearDistance()
public void setFarDistance(float farDistance)
public float getFarDistance()
public void setFocalDistance(float focalDistance)
public float getFocalDistance()
public Mat4f getViewingMatrix()
public abstract Mat4f getProjectionMatrix()
public Line unproject(Vec2f point)
public void unproject(Vec2f point, Line line) throws SingularMatrixException
SingularMatrixException
protected abstract Vec3f getRayStartPoint(Vec2f point, Vec3f unprojectedPoint)
public void doAction(Action action)
Node
doAction
in class Node
public void rayPick(RayPickAction action)
Node
rayPick
in class Node
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |