CrystalSpace

Public API Reference

Main Page   Modules   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

iCamera Struct Reference
[Views & Cameras]

Camera class. More...

#include <camera.h>

Inheritance diagram for iCamera:

iBase csCamera::Camera List of all members.

Public Methods

virtual iCamera * Clone () const=0
 Create a clone of this camera. More...

virtual int GetFOV () const=0
 Return the FOV (field of view) in pixels. More...

virtual float GetInvFOV () const=0
 Return the inverse flield of view (1/FOV) in pixels. More...

virtual float GetFOVAngle () const=0
 Return the FOV (field of view) in degrees. More...

virtual void SetFOV (int fov, int width)=0
 Set the FOV in pixels. More...

virtual void SetFOVAngle (float fov, int width)=0
 Set the FOV in radians. More...

virtual float GetShiftX () const=0
 Set the X shift amount. More...

virtual float GetShiftY () const=0
 Set the Y shift amount. More...

virtual void SetPerspectiveCenter (float x, float y)=0
 Set the shift amount. More...

virtual csOrthoTransformGetTransform ()=0
 Get the transform corresponding to this camera. More...

virtual const csOrthoTransformGetTransform () const=0
 'const' version of GetTransform (). More...

virtual void SetTransform (const csOrthoTransform &tr)=0
 Set the transform corresponding to this camera. More...

virtual void MoveWorld (const csVector3 &v, bool cd=true)=0
 Moves the camera a relative amount in world coordinates. More...

virtual void Move (const csVector3 &v, bool cd=true)=0
 Moves the camera a relative amount in camera coordinates. More...

virtual void MoveWorldUnrestricted (const csVector3 &v)=0
 Moves the camera a relative amount in world coordinates, ignoring portals and walls. More...

virtual void MoveUnrestricted (const csVector3 &v)=0
 Moves the camera a relative amount in camera coordinates, ignoring portals and walls. More...

virtual iSectorGetSector () const=0
 Get the current sector. More...

virtual void SetSector (iSector *)=0
 Move to another sector. More...

virtual void Correct (int n)=0
 Eliminate roundoff error by snapping the camera orientation to a grid of density n. More...

virtual bool IsMirrored () const=0
 Return true if space is mirrored. More...

virtual void SetMirrored (bool m)=0
 Set mirrored state. More...

virtual iPolygon3DGetHit (csVector3 &v)=0
 Check if there is a polygon in front of us in the direction defined by 'v' (world space coordinates). More...

virtual csPlane3GetFarPlane () const=0
 Get the 3D far plane that should be used to clip all geometry. More...

virtual void SetFarPlane (csPlane3 *fp)=0
 Set the 3D far plane used to clip all geometry. More...

virtual long GetCameraNumber () const=0
 Get the camera number. More...

virtual void Perspective (const csVector3 &v, csVector2 &p) const=0
 Calculate perspective corrected point for this camera. More...

virtual void InvPerspective (const csVector2 &p, float z, csVector3 &v) const=0
 Calculate inverse perspective corrected point for this camera. More...

virtual void OnlyPortals (bool hop)=0
 If the hit-only-portals flag is true then only portals will be checked with the 'MoveWorld()' function. More...

virtual bool GetOnlyPortals ()=0
 Get the hit-only-portals flag. More...


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:

Definition at line 77 of file iengine/camera.h.


Member Function Documentation

virtual iCamera* iCamera::Clone   const [pure virtual]
 

Create a clone of this camera.

Implemented in csCamera::Camera.

virtual void iCamera::Correct int    n [pure virtual]
 

Eliminate roundoff error by snapping the camera orientation to a grid of density n.

Implemented in csCamera::Camera.

virtual long iCamera::GetCameraNumber   const [pure virtual]
 

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.

Implemented in csCamera::Camera.

virtual csPlane3* iCamera::GetFarPlane   const [pure virtual]
 

Get the 3D far plane that should be used to clip all geometry.

If this function returns NULL no far clipping is required. Otherwise it must be used to clip the object before drawing.

Implemented in csCamera::Camera.

virtual int iCamera::GetFOV   const [pure virtual]
 

Return the FOV (field of view) in pixels.

Implemented in csCamera::Camera.

virtual float iCamera::GetFOVAngle   const [pure virtual]
 

Return the FOV (field of view) in degrees.

Implemented in csCamera::Camera.

virtual iPolygon3D* iCamera::GetHit csVector3   v [pure virtual]
 

Check if there is a polygon in front of us in the direction defined by 'v' (world space coordinates).

Return the nearest polygon. Note that this function will not check beyond 'v'. So only the vector between the current position of the camera and 'v' is checked.

Implemented in csCamera::Camera.

virtual float iCamera::GetInvFOV   const [pure virtual]
 

Return the inverse flield of view (1/FOV) in pixels.

Implemented in csCamera::Camera.

virtual bool iCamera::GetOnlyPortals   [pure virtual]
 

Get the hit-only-portals flag.

Implemented in csCamera::Camera.

virtual iSector* iCamera::GetSector   const [pure virtual]
 

Get the current sector.

Implemented in csCamera::Camera.

virtual float iCamera::GetShiftX   const [pure virtual]
 

Set the X shift amount.

The parameter specified the desired X coordinate on screen of the projection center of the camera.

Implemented in csCamera::Camera.

virtual float iCamera::GetShiftY   const [pure virtual]
 

Set the Y shift amount.

The parameter specified the desired Y coordinate on screen of the projection center of the camera.

Implemented in csCamera::Camera.

virtual const csOrthoTransform& iCamera::GetTransform   const [pure virtual]
 

'const' version of GetTransform ().

Implemented in csCamera::Camera.

virtual csOrthoTransform& iCamera::GetTransform   [pure virtual]
 

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.

Implemented in csCamera::Camera.

virtual void iCamera::InvPerspective const csVector2   p,
float    z,
csVector3   v
const [pure virtual]
 

Calculate inverse perspective corrected point for this camera.

Implemented in csCamera::Camera.

virtual bool iCamera::IsMirrored   const [pure virtual]
 

Return true if space is mirrored.

Implemented in csCamera::Camera.

virtual void iCamera::Move const csVector3   v,
bool    cd = true
[pure virtual]
 

Moves the camera a relative amount in camera coordinates.

Implemented in csCamera::Camera.

virtual void iCamera::MoveUnrestricted const csVector3   v [pure virtual]
 

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.

Implemented in csCamera::Camera.

virtual void iCamera::MoveWorld const csVector3   v,
bool    cd = true
[pure virtual]
 

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).

Implemented in csCamera::Camera.

virtual void iCamera::MoveWorldUnrestricted const csVector3   v [pure virtual]
 

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.

Implemented in csCamera::Camera.

virtual void iCamera::OnlyPortals bool    hop [pure virtual]
 

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.

Implemented in csCamera::Camera.

virtual void iCamera::Perspective const csVector3   v,
csVector2   p
const [pure virtual]
 

Calculate perspective corrected point for this camera.

Implemented in csCamera::Camera.

virtual void iCamera::SetFarPlane csPlane3   fp [pure virtual]
 

Set the 3D far plane used to clip all geometry.

If the pointer is NULL 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).

Implemented in csCamera::Camera.

virtual void iCamera::SetFOV int    fov,
int    width
[pure virtual]
 

Set the FOV in pixels.

'fov' is the desired FOV in pixels. 'width' is the display width, also in pixels.

Implemented in csCamera::Camera.

virtual void iCamera::SetFOVAngle float    fov,
int    width
[pure virtual]
 

Set the FOV in radians.

'fov' is the desired FOV in degrees. 'width' is the display width in pixels.

Implemented in csCamera::Camera.

virtual void iCamera::SetMirrored bool    m [pure virtual]
 

Set mirrored state.

Implemented in csCamera::Camera.

virtual void iCamera::SetPerspectiveCenter float    x,
float    y
[pure virtual]
 

Set the shift amount.

The parameter specified the desired projection center of the camera on screen.

Implemented in csCamera::Camera.

virtual void iCamera::SetSector iSector   [pure virtual]
 

Move to another sector.

Implemented in csCamera::Camera.

virtual void iCamera::SetTransform const csOrthoTransform   tr [pure virtual]
 

Set the transform corresponding to this camera.

In this transform, 'other' is world space and 'this' is camera space.

Implemented in csCamera::Camera.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.2.14