public class Camera extends GraphicsObject implements StreamInterface, Serializable
Modifier and Type | Class and Description |
---|---|
static class |
Camera.ViewFrustum
The view frustum has parameters [rmin,rmax], [umin,umax], and
[dmin,dmax].
|
Modifier and Type | Field and Description |
---|---|
protected float[] |
m_afFrustum
view frustum (near, far, bottom, top, left, right)
|
protected float |
m_fPortB
viewport
|
protected float |
m_fPortF
depth range
|
protected float |
m_fPortL
viewport
|
protected float |
m_fPortN
depth range
|
protected float |
m_fPortR
viewport
|
protected float |
m_fPortT
viewport
|
protected Vector3f |
m_kDVector
world coordinate frame
|
protected Vector3f |
m_kLocation
world coordinate frame
|
protected Vector3f |
m_kRVector
world coordinate frame
|
protected Vector3f |
m_kUVector
world coordinate frame
|
protected Renderer |
m_pkRenderer
The renderer to which this camera has been attached.
|
boolean |
Perspective
Allow for orthogonal cameras as well as perspective cameras.
|
private static long |
serialVersionUID |
Constructor and Description |
---|
Camera()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
Delete memory
|
int |
GetDiskUsed(StreamVersion rkVersion)
Returns the size of this object and it's children on disk for the
current StreamVersion parameter.
|
float |
GetDMax()
Get the far frustum value.
|
float |
GetDMin()
Get the near frustum value.
|
Vector3f |
GetDVector()
The camera frame is always in world coordinates.
|
float[] |
GetFrustum()
Get the view frustum.
|
Vector3f |
GetLocation()
The camera frame is always in world coordinates.
|
boolean |
GetPickRay(int iX,
int iY,
int iWidth,
int iHeight,
Vector3f rkOrigin,
Vector3f rkDirection)
Mouse picking support.
|
float |
GetPortB()
Get the viewport (contained in [0,1]^2)
|
float |
GetPortF()
Get depth range (contained in [0,1])
|
float |
GetPortL()
Get the viewport (contained in [0,1]^2)
|
float |
GetPortN()
Get depth range (contained in [0,1])
|
float |
GetPortR()
Get the viewport (contained in [0,1]^2)
|
float |
GetPortT()
Get the viewport (contained in [0,1]^2)
|
float |
GetRMax()
Get the right frustum value.
|
float |
GetRMin()
Get the left frustum value.
|
Vector3f |
GetRVector()
The camera frame is always in world coordinates.
|
float |
GetUMax()
Get the top frustum value.
|
float |
GetUMin()
Get the bottom frustum value.
|
Vector3f |
GetUVector()
The camera frame is always in world coordinates.
|
void |
Link(Stream rkStream,
Stream.Link pkLink)
Copies this objects children objects from the input Stream's HashTable,
based on the LinkID of the child stored in the pkLink parameter.
|
void |
Load(Stream rkStream,
Stream.Link pkLink)
Loads this object from the input parameter rkStream, using the input
Stream.Link to store the IDs of children objects of this object
for linking after all objects are loaded from the Stream.
|
boolean |
Register(Stream rkStream)
Registers this object with the input Stream parameter.
|
void |
Save(Stream rkStream)
Write this object and all it's children to the Stream.
|
StringTree |
SaveStrings(String acTitle)
Write this object into a StringTree for the scene-graph visualization.
|
void |
SetAxes(Vector3f rkDVector,
Vector3f rkUVector,
Vector3f rkRVector)
The camera frame is always in world coordinates.
|
void |
SetDepthRange(float fNear,
float fFar)
Set depth range (contained in [0,1])
|
void |
SetFrame(Vector3f rkLocation,
Vector3f rkDVector,
Vector3f rkUVector,
Vector3f rkRVector)
The camera frame is always in world coordinates.
|
void |
SetFrustum(float fUpFovDegrees,
float fAspectRatio,
float fDMin,
float fDMax)
Set a symmetric view frustum (umin = -umax, rmin = -rmax) using a field
of view in the "up" direction and an aspect ratio "width/height".
|
void |
SetFrustum(float fRMin,
float fRMax,
float fUMin,
float fUMax,
float fDMin,
float fDMax)
Set the view frustum.
|
void |
SetLocation(Vector3f rkLocation)
The camera frame is always in world coordinates.
|
void |
SetViewport(float fLeft,
float fRight,
float fTop,
float fBottom)
Set the viewport (contained in [0,1]^2)
|
GetAllObjectsByName, GetID, GetName, GetNextID, GetObjectByID, GetObjectByIDBase, GetObjectByName, GetObjectByNameBase, SetName
private static final long serialVersionUID
public boolean Perspective
protected Vector3f m_kLocation
protected Vector3f m_kDVector
protected Vector3f m_kUVector
protected Vector3f m_kRVector
protected float[] m_afFrustum
protected float m_fPortL
protected float m_fPortR
protected float m_fPortT
protected float m_fPortB
protected float m_fPortN
protected float m_fPortF
protected Renderer m_pkRenderer
public void dispose()
dispose
in class GraphicsObject
public int GetDiskUsed(StreamVersion rkVersion)
GetDiskUsed
in interface StreamInterface
GetDiskUsed
in class GraphicsObject
rkVersion
- the current version of the Stream file being created.public final float GetDMax()
public final float GetDMin()
public final Vector3f GetDVector()
public final float[] GetFrustum()
public final Vector3f GetLocation()
public boolean GetPickRay(int iX, int iY, int iWidth, int iHeight, Vector3f rkOrigin, Vector3f rkDirection)
iX
- x screen coordinate (left-handed)iY
- y screen coordinate (left-handed)iWidth
- screen widthiHeight
- screen heightrkOrigin
- origin of PickRay, return valuerkDirection
- direction of PickRay, return valuepublic final float GetPortB()
public final float GetPortF()
public final float GetPortL()
public final float GetPortN()
public final float GetPortR()
public final float GetPortT()
public final float GetRMax()
public final float GetRMin()
public final Vector3f GetRVector()
public final float GetUMax()
public final float GetUMin()
public final Vector3f GetUVector()
public void Link(Stream rkStream, Stream.Link pkLink)
Link
in interface StreamInterface
Link
in class GraphicsObject
rkStream
- the Stream where the child objects are stored.pkLink
- the Link class from which the child object IDs are read.public void Load(Stream rkStream, Stream.Link pkLink)
Load
in interface StreamInterface
Load
in class GraphicsObject
rkStream
- the Stream from which this object is being read.pkLink
- the Link class for storing the IDs of this object's
children objects.public boolean Register(Stream rkStream)
Register
in interface StreamInterface
Register
in class GraphicsObject
rkStream
- the Stream where the child objects are stored.public void Save(Stream rkStream)
Save
in interface StreamInterface
Save
in class GraphicsObject
rkStream
- the Stream where the child objects are stored.public StringTree SaveStrings(String acTitle)
SaveStrings
in interface StreamInterface
SaveStrings
in class GraphicsObject
acTitle
- the header for this object in the StringTree.public void SetAxes(Vector3f rkDVector, Vector3f rkUVector, Vector3f rkRVector)
rkDVector
- direction vector.rkUVector
- up vector.rkRVector
- right vector.public void SetDepthRange(float fNear, float fFar)
fNear
- nearfFar
- nearpublic void SetFrame(Vector3f rkLocation, Vector3f rkDVector, Vector3f rkUVector, Vector3f rkRVector)
rkLocation
- location vector.rkDVector
- direction vector.rkUVector
- up vector.rkRVector
- right vector.public void SetFrustum(float fUpFovDegrees, float fAspectRatio, float fDMin, float fDMax)
fUpFovDegrees
- field of view in the "up" direction.fAspectRatio
- aspect ratio "width/height"fDMin
- "near"fDMax
- "far"public void SetFrustum(float fRMin, float fRMax, float fUMin, float fUMax, float fDMin, float fDMax)
fRMin
- "left"fRMax
- "right"fUMin
- "bottom"fUMax
- "top"fDMin
- "near"fDMax
- "far"public void SetLocation(Vector3f rkLocation)
rkLocation
- location vector.public void SetViewport(float fLeft, float fRight, float fTop, float fBottom)
fLeft
- leftfRight
- rightfTop
- topfBottom
- bottom