Google

Main Page   Class Hierarchy   Compound List   File List   Compound Members  

csCamera Class Reference

A camera positioned in the 3D world. More...

#include <camera.h>

Inheritance diagram for csCamera:

csOrthoTransform iBase csReversibleTransform csTransform List of all members.

Public Methods

 csCamera ()
 csCamera (csCamera *c)
 Copy constructor.

 csCamera (const csCamera &c)
 Copy constructor.

virtual ~csCamera ()
long GetCameraNumber () const
 Get the camera number. More...

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

void SetFOV (int a, int width)
 Set the FOV for this camera.

int GetFOV () const
 Get the FOV for this camera.

float GetInvFOV () const
 Get the inverse FOV for this camera.

void SetFOVAngle (float a, int width)
 Set the FOV in angles (degrees).

float GetFOVAngle () const
 Get the FOV in angles (degrees).

float GetShiftX () const
 Get the X shift value.

float GetShiftY () const
 Get the Y shift value.

void SetFarPlane (const csPlane3 *farplane)
 Set farplane, everything behind this will be cut.

csPlane3GetFarPlane () const
 Get the Farplane.

void SetSector (csSector *s)
 Set the sector that the camera resides in. More...

csSectorGetSector () const
 Get the current sector of the camera.

bool IsMirrored () const
 Returns true if we are in a mirrored world. More...

void SetMirrored (bool m)
 Set the mirrored state of this camera. More...

virtual void SetO2T (const csMatrix3 &m)
 Set 'other' to 'this' transformation matrix. More...

virtual void SetT2O (const csMatrix3 &m)
 Set 'this' to 'other' transformation matrix. More...

virtual void SetO2TTranslation (const csVector3 &v)
 Set 'world' to 'this' translation. More...

virtual void SetPosition (const csVector3 &v)
 Sets the absolute position of the camera inside the sector. More...

void SetW2C (const csMatrix3 &m)
 Set the world to camera transformation matrix. More...

void SetC2W (const csMatrix3 &m)
 Set the camera to world transformation matrix. More...

csMatrix3 GetW2C () const
 Return the world to camera transformation matrix.

csMatrix3 GetC2W () const
 Return the camera to world transformation matrix.

csVector3 GetW2CTranslation () const
 Return the world to camera translation.

csVector3 World2Camera (const csVector3 &v) const
 Transform a worldspace point to camera space.

csVector3 Camera2World (const csVector3 &v) const
 Transform a camera space point to world space.

csVector3 Camera2WorldRelative (const csVector3 &v) const
 Transform a camera space point to worldspace, relative to camera position.

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

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

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

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

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

void SetPerspectiveCenter (float x, float y)
 Change the shift for perspective correction.

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

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


Public Attributes

 SCF_DECLARE_IBASE
csCamera::Camera  scfiCamera

Static Public Methods

void SetDefaultFOV (int fov, int width)
 Set the default FOV for new cameras.

int GetDefaultFOV ()
 Get the default FOV for new cameras.

float GetDefaultInvFOV ()
 Get the default inverse FOV for new cameras.

float GetDefaultFOVAngle ()
 Get the default FOV in angles (degrees).


Friends

class  Camera

Detailed Description

A camera positioned in the 3D world.


Member Function Documentation

long csCamera::GetCameraNumber ( ) const [inline]
 

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.

csPolygon3D * csCamera::GetHit ( csVector3 & v )
 

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

Return the nearest polygon.

bool csCamera::IsMirrored ( ) const [inline]
 

Returns true if we are in a mirrored world.

Basicly this means that back-face culling will be reversed.

void csCamera::MoveUnrestricted ( const csVector3 & v ) [inline, 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.

void csCamera::MoveWorld ( const csVector3 & v,
bool cd = true ) [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).

void csCamera::MoveWorldUnrestricted ( const csVector3 & v ) [inline, 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.

void csCamera::SetC2W ( const csMatrix3 & m ) [inline]
 

Set the camera to world transformation matrix.

This basicly defines the direction that the camera looks.

void csCamera::SetMirrored ( bool m ) [inline]
 

Set the mirrored state of this camera.

The effect of this is mainly that back-face culling will be reversed. This is useful if you are stepping into a mirrored sector.

void csCamera::SetO2T ( const csMatrix3 & m ) [inline, virtual]
 

Set 'other' to 'this' transformation matrix.

csCamera overrides this in order to be able to update the camera number.

Reimplemented from csOrthoTransform.

void csCamera::SetO2TTranslation ( const csVector3 & v ) [inline, virtual]
 

Set 'world' to 'this' translation.

csCamera overrides this in order to be able to update the camera number.

Reimplemented from csTransform.

void csCamera::SetPosition ( const csVector3 & v ) [inline, virtual]
 

Sets the absolute position of the camera inside the sector.

Vector 'v' is in world space coordinates. This function does not check if the vector is really in the current sector. In fact it is legal to set the position outside the sector boundaries.

void csCamera::SetSector ( csSector * s ) [inline]
 

Set the sector that the camera resides in.

Note that this function does not check if the current camera location is really in that sector. In fact it is legal to have a camera which is viewing the current sector from outside.

void csCamera::SetT2O ( const csMatrix3 & m ) [inline, virtual]
 

Set 'this' to 'other' transformation matrix.

csCamera overrides this in order to be able to update the camera number.

Reimplemented from csOrthoTransform.

void csCamera::SetW2C ( const csMatrix3 & m ) [inline]
 

Set the world to camera transformation matrix.

This basicly defines the direction that the camera looks.


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.2.5 written by Dimitri van Heesch, ©1997-2000