CrystalSpace

Public API Reference

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

csCamera::Camera Struct Reference

iCamera implementation. More...

#include <camera.h>

Inheritance diagram for csCamera::Camera:

iCamera iBase List of all members.

Public Methods

virtual iCameraClone () const
 Create a clone of this camera. More...

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

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

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

virtual void SetFOV (int a, int width)
 Set the FOV in pixels. More...

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

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

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

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

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

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

virtual void SetTransform (const csOrthoTransform &tr)
 Set the transform corresponding to this camera. 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...

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

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

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

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

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

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

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

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

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

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

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

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

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


Detailed Description

iCamera implementation.

Definition at line 339 of file csengine/camera.h.


Member Function Documentation

virtual iCamera* csCamera::Camera::Clone   const [inline, virtual]
 

Create a clone of this camera.

Implements iCamera.

Definition at line 343 of file csengine/camera.h.

References csCamera::csCamera.

virtual void csCamera::Camera::Correct int    n [inline, virtual]
 

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

Implements iCamera.

Definition at line 392 of file csengine/camera.h.

virtual long csCamera::Camera::GetCameraNumber   const [inline, 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.

Implements iCamera.

Definition at line 412 of file csengine/camera.h.

virtual csPlane3* csCamera::Camera::GetFarPlane   const [inline, 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.

Implements iCamera.

Definition at line 404 of file csengine/camera.h.

virtual int csCamera::Camera::GetFOV   const [inline, virtual]
 

Return the FOV (field of view) in pixels.

Implements iCamera.

Definition at line 346 of file csengine/camera.h.

virtual float csCamera::Camera::GetFOVAngle   const [inline, virtual]
 

Return the FOV (field of view) in degrees.

Implements iCamera.

Definition at line 350 of file csengine/camera.h.

virtual iPolygon3D* csCamera::Camera::GetHit csVector3   v [inline, 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.

Implements iCamera.

Definition at line 388 of file csengine/camera.h.

virtual float csCamera::Camera::GetInvFOV   const [inline, virtual]
 

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

Implements iCamera.

Definition at line 348 of file csengine/camera.h.

virtual bool csCamera::Camera::GetOnlyPortals   [inline, virtual]
 

Get the hit-only-portals flag.

Implements iCamera.

Definition at line 429 of file csengine/camera.h.

virtual iSector* csCamera::Camera::GetSector   const [inline, virtual]
 

Get the current sector.

Implements iCamera.

Definition at line 382 of file csengine/camera.h.

References csSector::scfiSector.

virtual float csCamera::Camera::GetShiftX   const [inline, virtual]
 

Set the X shift amount.

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

Implements iCamera.

Definition at line 357 of file csengine/camera.h.

virtual float csCamera::Camera::GetShiftY   const [inline, virtual]
 

Set the Y shift amount.

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

Implements iCamera.

Definition at line 359 of file csengine/camera.h.

virtual const csOrthoTransform& csCamera::Camera::GetTransform   const [inline, virtual]
 

'const' version of GetTransform ().

Implements iCamera.

Definition at line 366 of file csengine/camera.h.

virtual csOrthoTransform& csCamera::Camera::GetTransform   [inline, 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.

Implements iCamera.

Definition at line 364 of file csengine/camera.h.

virtual void csCamera::Camera::InvPerspective const csVector2   p,
float    z,
csVector3   v
const [inline, virtual]
 

Calculate inverse perspective corrected point for this camera.

Implements iCamera.

Definition at line 420 of file csengine/camera.h.

virtual bool csCamera::Camera::IsMirrored   const [inline, virtual]
 

Return true if space is mirrored.

Implements iCamera.

Definition at line 396 of file csengine/camera.h.

virtual void csCamera::Camera::Move const csVector3   v,
bool    cd = true
[inline, virtual]
 

Moves the camera a relative amount in camera coordinates.

Implements iCamera.

Definition at line 375 of file csengine/camera.h.

virtual void csCamera::Camera::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.

Implements iCamera.

Definition at line 379 of file csengine/camera.h.

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

Implements iCamera.

Definition at line 373 of file csengine/camera.h.

virtual void csCamera::Camera::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.

Implements iCamera.

Definition at line 377 of file csengine/camera.h.

virtual void csCamera::Camera::OnlyPortals bool    hop [inline, 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.

Implements iCamera.

Definition at line 425 of file csengine/camera.h.

virtual void csCamera::Camera::Perspective const csVector3   v,
csVector2   p
const [inline, virtual]
 

Calculate perspective corrected point for this camera.

Implements iCamera.

Definition at line 416 of file csengine/camera.h.

virtual void csCamera::Camera::SetFarPlane csPlane3   fp [inline, 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).

Implements iCamera.

Definition at line 408 of file csengine/camera.h.

virtual void csCamera::Camera::SetFOV int    a,
int    width
[inline, virtual]
 

Set the FOV in pixels.

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

Implements iCamera.

Definition at line 352 of file csengine/camera.h.

virtual void csCamera::Camera::SetFOVAngle float    a,
int    width
[inline, virtual]
 

Set the FOV in radians.

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

Implements iCamera.

Definition at line 354 of file csengine/camera.h.

virtual void csCamera::Camera::SetMirrored bool    m [inline, virtual]
 

Set mirrored state.

Implements iCamera.

Definition at line 400 of file csengine/camera.h.

virtual void csCamera::Camera::SetPerspectiveCenter float    x,
float    y
[inline, virtual]
 

Set the shift amount.

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

Implements iCamera.

Definition at line 361 of file csengine/camera.h.

virtual void csCamera::Camera::SetSector iSector   s [inline, virtual]
 

Move to another sector.

Implements iCamera.

Definition at line 385 of file csengine/camera.h.

References iSector::GetPrivateObject.

virtual void csCamera::Camera::SetTransform const csOrthoTransform   tr [inline, virtual]
 

Set the transform corresponding to this camera.

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

Implements iCamera.

Definition at line 368 of file csengine/camera.h.


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