CrystalSpace

Public API Reference

iPerspectiveCamera Struct Reference
[Views & Cameras]

An implementation of iCamera that renders a world with a classical perspective. More...

#include <iengine/camera.h>

Inheritance diagram for iPerspectiveCamera:

List of all members.

Public Member Functions

virtual float GetAspectRatio () const =0
 Get the aspect ratio between the horizontal and the vertical FOVs.
virtual iCameraGetCamera ()=0
 Get the iCamera interface for this camera.
virtual float GetFOV () const =0
 Return the vertical FOV (field of view) in normalized screen coordinates.
virtual float GetFOVAngle () const =0
 Return the vertical FOV (field of view) in degrees.
virtual float GetInvFOV () const =0
 Return the inverse of the normalized vertical field of view (1/FOV).
virtual float GetNearClipDistance () const =0
 Get the near clip distance of this camera.
virtual float GetShiftX () const =0
 Get the X shift amount.
virtual float GetShiftY () const =0
 Get the Y shift amount.
virtual float GetVerticalFOV () const =0
 Return the vertical FOV (field of view) in normalized screen coordinates.
virtual float GetVerticalFOVAngle () const =0
 Return the vertical FOV (field of view) in degrees.
virtual void SetAspectRatio (float aspect)=0
 Set the aspect ratio between the horizontal and the vertical FOVs.
virtual void SetFOV (float fov, float width)=0
 Set the FOV.
virtual void SetFOVAngle (float fov, float aspect)=0
 Set the FOV in degrees.
virtual void SetNearClipDistance (float dist)=0
 Set the near clip distance of this camera.
virtual void SetPerspectiveCenter (float x, float y)=0
 Set the X and Y shift amounts.
virtual void SetVerticalFOV (float fov)=0
 Set the vertical FOV (field of view) in normalized screen coordinates.
virtual void SetVerticalFOVAngle (float fov)=0
 Set the vertical FOV (field of view) as an angle in degrees.

Detailed Description

An implementation of iCamera that renders a world with a classical perspective.

A perspective camera has the following properties:

Main creators of instances implementing this interface:

Main ways to get pointers to this interface:

Definition at line 443 of file camera.h.


Member Function Documentation

virtual float iPerspectiveCamera::GetAspectRatio (  )  const [pure virtual]

Get the aspect ratio between the horizontal and the vertical FOVs.

virtual iCamera* iPerspectiveCamera::GetCamera (  )  [pure virtual]

Get the iCamera interface for this camera.

virtual float iPerspectiveCamera::GetFOV (  )  const [pure virtual]

Return the vertical FOV (field of view) in normalized screen coordinates.

Deprecated:
Deprecated in 2.2. Use GetVerticalFOV() and GetAspectRatio() instead
virtual float iPerspectiveCamera::GetFOVAngle (  )  const [pure virtual]

Return the vertical FOV (field of view) in degrees.

Deprecated:
Deprecated in 2.2. Use GetVerticalFOVAngle() and GetAspectRatio() instead
virtual float iPerspectiveCamera::GetInvFOV (  )  const [pure virtual]

Return the inverse of the normalized vertical field of view (1/FOV).

Deprecated:
Deprecated in 2.2. Use GetVerticalFOV() and GetAspectRatio() instead
virtual float iPerspectiveCamera::GetNearClipDistance (  )  const [pure virtual]

Get the near clip distance of this camera.

Higher clip distances increases the possibility that the camera may look "inside" some geometry, however, it also provides higher depth value precision - especially for large scenes this can prevent depth buffer issues (Z-fighting, wrong occlusion) at a distance.

If you have a collider (player etc.) coupled to camera movement a good initial value for the near clip distance is a value slightly above the collider radius.

virtual float iPerspectiveCamera::GetShiftX (  )  const [pure virtual]

Get the X shift amount.

The parameter specifies the X coordinate on the normalized screen of the projection center of the camera.

See also:
SetPerspectiveCenter()
virtual float iPerspectiveCamera::GetShiftY (  )  const [pure virtual]

Get the Y shift amount.

The parameter specifies the Y coordinate on the normalized screen of the projection center of the camera.

See also:
SetPerspectiveCenter()
virtual float iPerspectiveCamera::GetVerticalFOV (  )  const [pure virtual]

Return the vertical FOV (field of view) in normalized screen coordinates.

virtual float iPerspectiveCamera::GetVerticalFOVAngle (  )  const [pure virtual]

Return the vertical FOV (field of view) in degrees.

virtual void iPerspectiveCamera::SetAspectRatio ( float  aspect  )  [pure virtual]

Set the aspect ratio between the horizontal and the vertical FOVs.

If you use a different aspect ratio than the one of your window size (that is, its width divided by its height), then it will result in some stretching of the image. The default value is controlled by the engine and is set to the aspect ratio of the 2D canvas at initialization time (that is, usually 4:3).

virtual void iPerspectiveCamera::SetFOV ( float  fov,
float  width 
) [pure virtual]

Set the FOV.

fov is the desired FOV in normalized screen coordinates. width is the display width, also normalized.

Deprecated:
Deprecated in 2.2. Use SetVerticalFOV() and SetAspectRatio() instead
virtual void iPerspectiveCamera::SetFOVAngle ( float  fov,
float  aspect 
) [pure virtual]

Set the FOV in degrees.

fov is the desired FOV in degrees. width is the display width in normalized screen coordinates.

Deprecated:
Deprecated in 2.2. Use SetVerticalFOVAngle() and SetAspectRatio() instead
virtual void iPerspectiveCamera::SetNearClipDistance ( float  dist  )  [pure virtual]

Set the near clip distance of this camera.

The default near clipping distance is controlled by the engine.

virtual void iPerspectiveCamera::SetPerspectiveCenter ( float  x,
float  y 
) [pure virtual]

Set the X and Y shift amounts.

Those parameters specify the desired projection center of the camera on the normalized screen, that is, the position of the vanishing point of the perspective.

The default values for both x and y are 0.5, this corresponds to the vanishing point being at the center of the screen. A value of 0 sets the vanishing point respectively on the left and bottom of the screen, while a value of 1 sets it respectively at the right and top of the screen.

See also:
GetShiftX() GetShiftY()
virtual void iPerspectiveCamera::SetVerticalFOV ( float  fov  )  [pure virtual]

Set the vertical FOV (field of view) in normalized screen coordinates.

This corresponds to the global scale that the camera applies on its view. The horizontal FOV will be computed using the value set in SetAspectRatio().

Mathematically, the FOV is the tangent of the half of the FOV angle defined by SetVerticalFOVAngle().

The default value is 1.0. Bigger values result in wide angle views, while lower values result in zoom effects.

virtual void iPerspectiveCamera::SetVerticalFOVAngle ( float  fov  )  [pure virtual]

Set the vertical FOV (field of view) as an angle in degrees.

This is the angle seen by the camera between the top and the bottom edges of the screen. The horizontal FOV will be computed using the value set in SetAspectRatio().

The default value is 90. Bigger values result in wide angle views, while lower values result in zoom effects.


The documentation for this struct was generated from the following file:

Generated for Crystal Space 2.1 by doxygen 1.6.1