#include <camera.h>
Inheritance diagram for csCamera:
Public Methods | |
csCamera () | |
csCamera (csCamera *c) | |
Copy constructor. | |
csCamera (const csCamera &c) | |
Copy constructor. | |
virtual | ~csCamera () |
long | GetCameraNumber () const |
Get the camera number. More... | |
csPolygon3D* | GetHit (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 (csPlaneClip *farplane) |
Set farplane, everything behind this will be cut. | |
csPlaneClip* | GetFarPlane () const |
Get the Farplane. | |
bool | UseFarPlane () const |
do we actually use the farplane ? | |
void | UseFarPlane (bool useit) |
Set whether we use farplane or not. Farplane must been set before. | |
void | SetSector (csSector *s) |
Set the sector that the camera resides in. More... | |
csSector* | GetSector () 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 |
|
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. |
|
Check if there is a polygon in front of us in the direction defined by 'v' (world space coordinates). Return the nearest polygon. |
|
Returns true if we are in a mirrored world. Basicly this means that back-face culling will be reversed. |
|
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. |
|
Set the camera to world transformation matrix. This basicly defines the direction that the camera looks. |
|
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. |
|
Set 'other' to 'this' transformation matrix. csCamera overrides this in order to be able to update the camera number. Reimplemented from csOrthoTransform. |
|
Set 'world' to 'this' translation. csCamera overrides this in order to be able to update the camera number. Reimplemented from csTransform. |
|
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. |
|
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. |
|
Set 'this' to 'other' transformation matrix. csCamera overrides this in order to be able to update the camera number. Reimplemented from csOrthoTransform. |
|
Set the world to camera transformation matrix. This basicly defines the direction that the camera looks. |