iCamera Struct Reference
[Views & Cameras]
Camera class.
More...
#include <camera.h>
Inheritance diagram for iCamera:

Public Methods | |
virtual iCamera * | Clone () const=0 |
Create a clone of this camera. | |
virtual int | GetFOV () const=0 |
Return the FOV (field of view) in pixels. | |
virtual float | GetInvFOV () const=0 |
Return the inverse flield of view (1/FOV) in pixels. | |
virtual float | GetFOVAngle () const=0 |
Return the FOV (field of view) in degrees. | |
virtual void | SetFOV (int fov, int width)=0 |
Set the FOV in pixels. | |
virtual void | SetFOVAngle (float fov, int width)=0 |
Set the FOV in degrees. | |
virtual float | GetShiftX () const=0 |
Set the X shift amount. | |
virtual float | GetShiftY () const=0 |
Set the Y shift amount. | |
virtual void | SetPerspectiveCenter (float x, float y)=0 |
Set the shift amount. | |
virtual csOrthoTransform & | GetTransform ()=0 |
Get the transform corresponding to this camera. | |
virtual const csOrthoTransform & | GetTransform () const=0 |
'const' version of GetTransform () | |
virtual void | SetTransform (const csOrthoTransform &tr)=0 |
Set the transform corresponding to this camera. | |
virtual void | MoveWorld (const csVector3 &v, bool cd=true)=0 |
Moves the camera a relative amount in world coordinates. | |
virtual void | Move (const csVector3 &v, bool cd=true)=0 |
Moves the camera a relative amount in camera coordinates. | |
virtual void | MoveWorldUnrestricted (const csVector3 &v)=0 |
Moves the camera a relative amount in world coordinates, ignoring portals and walls. | |
virtual void | MoveUnrestricted (const csVector3 &v)=0 |
Moves the camera a relative amount in camera coordinates, ignoring portals and walls. | |
virtual iSector * | GetSector () const=0 |
Get the current sector. | |
virtual void | SetSector (iSector *)=0 |
Move to another sector. | |
virtual void | Correct (int n)=0 |
Eliminate roundoff error by snapping the camera orientation to a grid of density n. | |
virtual bool | IsMirrored () const=0 |
Return true if space is mirrored. | |
virtual void | SetMirrored (bool m)=0 |
Set mirrored state. | |
virtual csPlane3 * | GetFarPlane () const=0 |
Get the 3D far plane that should be used to clip all geometry. | |
virtual void | SetFarPlane (csPlane3 *fp)=0 |
Set the 3D far plane used to clip all geometry. | |
virtual long | GetCameraNumber () const=0 |
Get the camera number. | |
virtual void | Perspective (const csVector3 &v, csVector2 &p) const=0 |
Calculate perspective corrected point for this camera. | |
virtual void | InvPerspective (const csVector2 &p, float z, csVector3 &v) const=0 |
Calculate inverse perspective corrected point for this camera. | |
virtual void | OnlyPortals (bool hop)=0 |
If the hit-only-portals flag is true then only portals will be checked with the 'MoveWorld()' function. | |
virtual bool | GetOnlyPortals ()=0 |
Get the hit-only-portals flag. |
Detailed Description
Camera class.This class represents camera objects which can be used to render a world in the engine. A camera has the following properties:
- Home sector: The sector in which rendering starts.
- Transformation: This is an orthonormal transformation which is applied to all rendered objects to move them from world space to camera space. It is the mathematical representation of position and direction of the camera. The position should be inside the home sector.
- Field of View: Controls the size on screen of the rendered objects and can be used for zooming effects. The FOV can be given either in pixels or as an angle in degrees.
- Shift amount: The projection center in screen coordinates.
- Mirrored Flag: Should be set to true if the transformation is mirrored.
- Far Plane: A distant plane that is orthogonal to the view direction. It is used to clip away all objects that are farther away than a certain distance, usually to improve rendering speed.
- Camera number: An identifier for a camera transformation, used internally in the engine to detect outdated vertex buffers.
- Only Portals Flag: If this is true then no collisions are detected for camera movement except for portals.
Main creators of instances implementing this interface:
Main ways to get pointers to this interface: Main users of this interface:
Definition at line 90 of file camera.h.
Member Function Documentation
|
Create a clone of this camera.
|
|
Eliminate roundoff error by snapping the camera orientation to a grid of density n.
|
|
Get the camera number. This number is changed for every new camera instance and it is also updated whenever the camera transformation changes. This number can be used to cache camera vertex arrays, for example. |
|
Get the 3D far plane that should be used to clip all geometry. If this function returns 0 no far clipping is required. Otherwise it must be used to clip the object before drawing. |
|
Return the FOV (field of view) in pixels.
|
|
Return the FOV (field of view) in degrees.
|
|
Return the inverse flield of view (1/FOV) in pixels.
|
|
Get the hit-only-portals flag.
|
|
Get the current sector.
|
|
Set the X shift amount. The parameter specified the desired X coordinate on screen of the projection center of the camera. |
|
Set the Y shift amount. The parameter specified the desired Y coordinate on screen of the projection center of the camera. |
|
'const' version of GetTransform ()
|
|
Get the transform corresponding to this camera. In this transform, 'other' is world space and 'this' is camera space. WARNING! It is illegal to directly assign to the given transform in order to modify it. To change the entire transform you have to use SetTransform(). Note that it is legal to modify the returned transform otherwise. Just do not assign to it. |
|
Calculate inverse perspective corrected point for this camera.
|
|
Return true if space is mirrored.
|
|
Moves the camera a relative amount in camera coordinates.
|
|
Moves the camera a relative amount in camera coordinates, ignoring portals and walls. This is used by the wireframe class. In general this is useful by any camera model that doesn't want to restrict its movement by portals and sector boundaries. |
|
Moves the camera a relative amount in world coordinates. If 'cd' is true then collision detection with objects and things inside the sector is active. Otherwise you can walk through objects (but portals will still be correctly checked). |
|
Moves the camera a relative amount in world coordinates, ignoring portals and walls. This is used by the wireframe class. In general this is useful by any camera model that doesn't want to restrict its movement by portals and sector boundaries. |
|
If the hit-only-portals flag is true then only portals will be checked with the 'MoveWorld()' function. This is a lot faster but it does mean that you will have to do collision detection with non-portal polygons using another technique. The default for this flag is true. |
|
Calculate perspective corrected point for this camera.
|
|
Set the 3D far plane used to clip all geometry. If the pointer is 0 then far plane clipping will be disabled. Otherwise it will be enabled and the plane will be copied (so you can free or reuse the pointer you give here). Note that the far-plane will cull away geometry which is on the negative side of the plane (with csPlane3::Classify() function). |
|
Set the FOV in pixels. 'fov' is the desired FOV in pixels. 'width' is the display width, also in pixels. |
|
Set the FOV in degrees. 'fov' is the desired FOV in degrees. 'width' is the display width in pixels. |
|
Set mirrored state.
|
|
Set the shift amount. The parameter specified the desired projection center of the camera on screen. |
|
Move to another sector.
|
|
Set the transform corresponding to this camera. In this transform, 'other' is world space and 'this' is camera space. |
The documentation for this struct was generated from the following file:
- iengine/camera.h
Generated for Crystal Space by doxygen 1.2.18