![]() |
Public API Reference |
#include <camera.h>
Inheritance diagram for csCamera:
Public Methods | |
csCamera (csCamera *c) | |
Copy constructor. More... | |
csCamera (const csCamera &c) | |
Copy constructor. More... | |
long | GetCameraNumber () const |
Get the camera number. More... | |
iPolygon3D * | 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. More... | |
int | GetFOV () const |
Get the FOV for this camera. More... | |
float | GetInvFOV () const |
Get the inverse FOV for this camera. More... | |
void | SetFOVAngle (float a, int width) |
Set the FOV in angles (degrees). More... | |
float | GetFOVAngle () const |
Get the FOV in angles (degrees). More... | |
float | GetShiftX () const |
Get the X shift value. More... | |
float | GetShiftY () const |
Get the Y shift value. More... | |
void | SetFarPlane (const csPlane3 *farplane) |
Set farplane, everything behind this will be cut. More... | |
csPlane3 * | GetFarPlane () const |
Get the Farplane. More... | |
void | SetSector (csSector *s) |
Set the sector that the camera resides in. More... | |
csSector * | GetSector () const |
Get the current sector of the camera. More... | |
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. More... | |
csMatrix3 | GetC2W () const |
Return the camera to world transformation matrix. More... | |
csVector3 | GetW2CTranslation () const |
Return the world to camera translation. More... | |
csVector3 | World2Camera (const csVector3 &v) const |
Transform a worldspace point to camera space. More... | |
csVector3 | Camera2World (const csVector3 &v) const |
Transform a camera space point to world space. More... | |
csVector3 | Camera2WorldRelative (const csVector3 &v) const |
Transform a camera space point to worldspace, relative to camera position. More... | |
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. More... | |
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. More... | |
void | SetPerspectiveCenter (float x, float y) |
Change the shift for perspective correction. More... | |
void | Perspective (const csVector3 &v, csVector2 &p) const |
Calculate perspective corrected point for this camera. More... | |
void | InvPerspective (const csVector2 &p, float z, csVector3 &v) const |
Calculate inverse perspective corrected point for this camera. More... | |
Static Public Methods | |
void | SetDefaultFOV (int fov, int width) |
Set the default FOV for new cameras. More... | |
int | GetDefaultFOV () |
Get the default FOV for new cameras. More... | |
float | GetDefaultInvFOV () |
Get the default inverse FOV for new cameras. More... | |
float | GetDefaultFOVAngle () |
Get the default FOV in angles (degrees). More... | |
Public Attributes | |
csCamera::Camera | scfiCamera |
iCamera implementation. More... |
Definition at line 35 of file csengine/camera.h.
|
Copy constructor.
Referenced by csCamera::Camera::Clone. |
|
Copy constructor.
|
|
Transform a camera space point to world space.
Definition at line 269 of file csengine/camera.h. References csReversibleTransform::This2Other. |
|
Transform a camera space point to worldspace, relative to camera position.
Definition at line 275 of file csengine/camera.h. References csReversibleTransform::This2OtherRelative. |
|
Eliminate roundoff error by snapping the camera orientation to a grid of density n.
|
|
Return the camera to world transformation matrix.
Definition at line 253 of file csengine/camera.h. References csReversibleTransform::GetT2O. |
|
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. Definition at line 98 of file csengine/camera.h. |
|
Get the default FOV for new cameras.
Definition at line 118 of file csengine/camera.h. |
|
Get the default FOV in angles (degrees).
Definition at line 122 of file csengine/camera.h. |
|
Get the default inverse FOV for new cameras.
Definition at line 120 of file csengine/camera.h. |
|
Get the Farplane.
Definition at line 152 of file csengine/camera.h. |
|
Get the FOV for this camera.
Definition at line 132 of file csengine/camera.h. |
|
Get the FOV in angles (degrees).
Definition at line 139 of file csengine/camera.h. |
|
Check if there is a polygon in front of us in the direction defined by 'v' (world space coordinates). Return the nearest polygon. |
|
Get the inverse FOV for this camera.
Definition at line 134 of file csengine/camera.h. |
|
Get the current sector of the camera.
Definition at line 170 of file csengine/camera.h. |
|
Get the X shift value.
Definition at line 145 of file csengine/camera.h. |
|
Get the Y shift value.
Definition at line 147 of file csengine/camera.h. |
|
Return the world to camera transformation matrix.
Definition at line 248 of file csengine/camera.h. References csTransform::GetO2T. |
|
Return the world to camera translation.
Definition at line 258 of file csengine/camera.h. References csTransform::GetO2TTranslation. |
|
Calculate inverse perspective corrected point for this camera.
Definition at line 328 of file csengine/camera.h. References csVector2::x, csVector3::x, csVector2::y, csVector3::y, and csVector3::z. |
|
Returns true if we are in a mirrored world. Basicly this means that back-face culling will be reversed. Definition at line 177 of file csengine/camera.h. |
|
Moves the camera a relative amount in camera coordinates.
Definition at line 289 of file csengine/camera.h. References csReversibleTransform::m_t2o, and MoveWorld. |
|
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. Definition at line 308 of file csengine/camera.h. References csReversibleTransform::m_t2o, and csTransform::Translate. |
|
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). Referenced by Move. |
|
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. Definition at line 299 of file csengine/camera.h. References csTransform::Translate. |
|
Calculate perspective corrected point for this camera.
Definition at line 320 of file csengine/camera.h. References csVector3::x, csVector2::x, csVector3::y, csVector2::y, and csVector3::z. |
|
Set the camera to world transformation matrix. This basicly defines the direction that the camera looks. Definition at line 243 of file csengine/camera.h. References SetT2O. |
|
Set the default FOV for new cameras.
Definition at line 110 of file csengine/camera.h. |
|
Set farplane, everything behind this will be cut.
|
|
Set the FOV for this camera.
Definition at line 125 of file csengine/camera.h. |
|
Set the FOV in angles (degrees).
|
|
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. Definition at line 185 of file csengine/camera.h. |
|
Set 'other' to 'this' transformation matrix. csCamera overrides this in order to be able to update the camera number. Reimplemented from csOrthoTransform. Definition at line 196 of file csengine/camera.h. References csOrthoTransform::SetO2T. Referenced by SetW2C. |
|
Set 'world' to 'this' translation. csCamera overrides this in order to be able to update the camera number. Reimplemented from csTransform. Definition at line 218 of file csengine/camera.h. References csTransform::SetO2TTranslation. |
|
Change the shift for perspective correction.
Definition at line 317 of file csengine/camera.h. |
|
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. Definition at line 231 of file csengine/camera.h. References csTransform::SetOrigin. |
|
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. Definition at line 161 of file csengine/camera.h. |
|
Set 'this' to 'other' transformation matrix. csCamera overrides this in order to be able to update the camera number. Reimplemented from csOrthoTransform. Definition at line 207 of file csengine/camera.h. References csOrthoTransform::SetT2O. Referenced by SetC2W. |
|
Set the world to camera transformation matrix. This basicly defines the direction that the camera looks. Definition at line 237 of file csengine/camera.h. References SetO2T. |
|
Transform a worldspace point to camera space.
Definition at line 263 of file csengine/camera.h. References csTransform::Other2This. |
|
iCamera implementation.
|