- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# FCDCamera Class Reference
[COLLADA Document Object Model.]

A COLLADA camera. More...

`#include <FCDCamera.h>`

Inheritance diagram for FCDCamera:

List of all members.

## Public Types
enum | ProjectionType { PERSPECTIVE, ORTHOGRAPHIC }
| The types of projection supported. More...
## Public Member Functions
| DeclareFlag (HasHorizontalView, 0)
| DeclareFlag (HasVerticalView, 1)
| DeclareFlagCount (2)
| 5 flags are locally declared.
| FCDCamera (FCDocument *document)
| Constructor: do not use directly.
virtual | ~FCDCamera ()
| Destructor.
virtual Type | GetType () const
| Retrieves the entity type for this class.
ProjectionType | GetProjectionType () const
| Retrieves the type of projection of this camera.
void | SetProjectionType (ProjectionType type)
| Sets the type of projections for this camera.
| DEPRECATED (3.05A, GetProjectionType()==FCDCamera::PERSPECTIVE) inline bool IsPerspective() const
| Retrieves whether this camera is a perspective camera.
| DEPRECATED (3.05A, SetProjectionType(FCDCamera::PERSPECTIVE)) inline void SetPerspective()
| Sets the type of this camera to perspective.
bool | HasHorizontalFov () const
| Retrieves whether the perspective camera defines an horizontal field of view.
bool | HasVerticalFov () const
| Retrieves whether the perspective camera defines a vertical field of view.
FCDParameterAnimatableFloat & | GetFovX ()
| Retrieves the horizontal field of view.
const FCDParameterAnimatableFloat & | GetFovX () const
| See above.
FCDParameterAnimatableFloat & | GetFovY ()
| Retrieves the vertical field of view.
const FCDParameterAnimatableFloat & | GetFovY () const
| See above.
void | SetFovX (float fovX)
| Sets the horizontal field of view value for this camera.
void | SetFovY (float fovY)
| Sets the vertical field of view value for this camera.
| DEPRECATED (3.05A, GetProjectionType()==FCDCamera::ORTHOGRAPHIC) inline bool IsOrthographic() const
| Retrieves whether this camera is an orthographic camera.
| DEPRECATED (3.05A, SetProjectionType(FCDCamera::ORTHOGRAPHIC)) inline void SetOrthographic()
| Sets the type of this camera to orthographic.
bool | HasHorizontalMag () const
| Retrieves whether the orthographic camera defines an horizontal magnification.
bool | HasVerticalMag () const
| Retrieves whether the perspective camera defines a vertical magnification.
FCDParameterAnimatableFloat & | GetMagX ()
| Retrieves the horizontal magnification.
const FCDParameterAnimatableFloat & | GetMagX () const
| See above.
FCDParameterAnimatableFloat & | GetMagY ()
| Retrieves the vertical magnification.
const FCDParameterAnimatableFloat & | GetMagY () const
| See above.
void | SetMagX (float magX)
| Sets the horizontal magnification for this camera.
void | SetMagY (float magY)
| Sets the vertical magnification value for this camera.
FCDParameterAnimatableFloat & | GetNearZ ()
| Retrieves the near-z value for this camera.
const FCDParameterAnimatableFloat & | GetNearZ () const
| See above.
FCDParameterAnimatableFloat & | GetFarZ ()
| Retrieves the far-z value for this camera.
const FCDParameterAnimatableFloat & | GetFarZ () const
| See above.
bool | HasAspectRatio () const
| Retrieves whether the camera defines an aspect ratio.
FCDParameterAnimatableFloat & | GetAspectRatio ()
| Retrieves the aspect ratio for the view of this camera.
const FCDParameterAnimatableFloat & | GetAspectRatio () const
| See above.
void | SetNearZ (float _nearZ)
| Sets the near-z value for this camera.
void | SetFarZ (float _farZ)
| Sets the far-z value for this camera.
void | SetAspectRatio (float aspectRatio)
| Sets the aspect ratio for the view of this camera.

## Detailed Description

A COLLADA camera.

Based on the FCDTargetedEntity class to support aimed cameras. COLLADA defines two types of cameras: perspective and orthographic. Both types are fully handled by this class.

A COLLADA perspective camera defines two of the three following parameters: horizontal field of view, vertical field of view and aspect ratio. The missing parameter can be calculated using the following formulae: aspect ratio = vertical field of view / horizontal field of view. The vertical and horizontal field of view are in degrees.

A COLLADA orthographic camera defines two of the three following parameters: horizontal magnification, vertical magnification and aspect ratio. The missing parameter can be calculated using the following formulae: aspect ratio = vertical magnification / horizontal magnification. You can calculate the viewport width and height using the following formulas: viewport width = horizontal magnification * 2, viewport height = vertical magnification * 2.

## Member Enumeration Documentation

enum FCDCamera::ProjectionType

  | The types of projection supported. Enumerator:
  PERSPECTIVE | A perspective projection. Uses a truncated rectangular pyramid frustrum.
  ORTHOGRAPHIC | An orthographic projection. Uses a rectangular prism frustrum.

## Constructor & Destructor Documentation

FCDCamera::FCDCamera | ( | FCDocument * | document | ) |

  | Constructor: do not use directly. Create new cameras using the FCDLibrary::AddEntity function. Parameters:
  | document | The COLLADA document that contains this camera entity.

## Member Function Documentation

FCDCamera::DEPRECATED | ( | 3. | 05A,
|  | GetProjectionType() | = `= FCDCamera::ORTHOGRAPHIC`
| ) | const`[inline]`

| Retrieves whether this camera is an orthographic camera. Returns: Whether this camera is an orthographic camera.

FCDCamera::DEPRECATED | ( | 3. | 05A,
|  | GetProjectionType() | = `= FCDCamera::PERSPECTIVE`
| ) | const`[inline]`

| Retrieves whether this camera is a perspective camera. This is the default type of camera. Returns: Whether this camera is a perspective camera.

FCDParameterAnimatableFloat& FCDCamera::GetAspectRatio | ( |  | ) | `[inline]`

| Retrieves the aspect ratio for the view of this camera. Before using this value, check if there are only one of the horizontal and vertical view ratios. If there are both of the view ratios provided for the camera, you will need to calculate the aspect ratio using the following formula: aspect ratio = vertical field of view / horizontal field of view. Returns: The view aspect ratio.

FCDParameterAnimatableFloat& FCDCamera::GetFarZ | ( |  | ) | `[inline]`

| Retrieves the far-z value for this camera. The far-z value represent how close the far-clip plane of the view frustum is. For orthographic cameras, this value is solely used for depth-buffering. Returns: The far-z value for this camera.

FCDParameterAnimatableFloat& FCDCamera::GetFovX | ( |  | ) | `[inline]`

| Retrieves the horizontal field of view. Before retrieving this value, check whether the camera defines the horizontal field of view using the HasHorizontalFov function. Returns: The horizontal field of view, in degrees.

FCDParameterAnimatableFloat& FCDCamera::GetFovY | ( |  | ) | `[inline]`

| Retrieves the vertical field of view. Before retrieving this value, check whether the camera defines the vertical field of view using the HasVerticalFov function. Returns: The horizontal field of view, in degrees.

FCDParameterAnimatableFloat& FCDCamera::GetMagX | ( |  | ) | `[inline]`

| Retrieves the horizontal magnification. Before retrieving this value, check whether the camera defines the horizontal magnification using the HasHorizontalMag function. Returns: The horizontal magnification.

FCDParameterAnimatableFloat& FCDCamera::GetMagY | ( |  | ) | `[inline]`

| Retrieves the vertical magnification. Before retrieving this value, check whether the camera defines the vertical magnification using the HasVerticalMag function. Returns: The vertical magnification.

FCDParameterAnimatableFloat& FCDCamera::GetNearZ | ( |  | ) | `[inline]`

| Retrieves the near-z value for this camera. The near-z value represent how close the near-clip plane of the view frustum is. For orthographic cameras, this value is solely used for depth-buffering. Returns: The near-z value for this camera.

ProjectionType FCDCamera::GetProjectionType | ( |  | ) | const`[inline]`

| Retrieves the type of projection of this camera. Returns: The projection type.

virtual Type FCDCamera::GetType | ( |  | ) | const`[inline, virtual]`

| Retrieves the entity type for this class. This function is part of the FCDEntity interface. Returns: The entity type: CAMERA. Reimplemented from FCDEntity.

bool FCDCamera::HasAspectRatio | ( |  | ) | const`[inline]`

| Retrieves whether the camera defines an aspect ratio. Returns: Whether the camera defines an aspect ratio.

bool FCDCamera::HasHorizontalFov | ( |  | ) | const`[inline]`

| Retrieves whether the perspective camera defines an horizontal field of view. If the camera does not define the horizontal field of view, you can calculate it using the following formula: horizontal field of view = vertical field of view / aspect ratio. Returns: Whether the perspective camera defines an horizontal field of view.

bool FCDCamera::HasHorizontalMag | ( |  | ) | const`[inline]`

| Retrieves whether the orthographic camera defines an horizontal magnification. If the camera does not define the horizontal magnification, you can calculate it using the following formula: horizontal magnification = vertical magnification / aspect ratio. Returns: Whether the orthographic camera defines an horizontal magnification.

bool FCDCamera::HasVerticalFov | ( |  | ) | const`[inline]`

| Retrieves whether the perspective camera defines a vertical field of view. If the camera does not define the vertical field of view, you can calculate it using the following formula: vertical field of view = aspect ratio * horizontal field of view. Returns: Whether the perspective camera defines a vertical field of view.

bool FCDCamera::HasVerticalMag | ( |  | ) | const`[inline]`

| Retrieves whether the perspective camera defines a vertical magnification. If the camera does not define the vertical magnification, you can calculate it using the following formula: vertical magnification = aspect ratio * horizontal magnification. Returns: Whether the perspective camera defines a vertical magnification.

void FCDCamera::SetAspectRatio | ( | float | aspectRatio | ) |

  | Sets the aspect ratio for the view of this camera. Parameters:
  | aspectRatio | The new view aspect ratio.

void FCDCamera::SetFarZ | ( | float | _farZ | ) | `[inline]`

  | Sets the far-z value for this camera. The far-z value represent how close the far-clip plane of the view frustum is. For orthographic cameras, this value is solely used for depth-buffering. Parameters:
  | _farZ | A valid far-z value. No check is made to verify that the far-z value is greater than the near-z value.

void FCDCamera::SetFovX | ( | float | fovX | ) |

  | Sets the horizontal field of view value for this camera. Parameters:
  | fovX | The new horizontal field of view, in degrees.

void FCDCamera::SetFovY | ( | float | fovY | ) |

  | Sets the vertical field of view value for this camera. Parameters:
  | fovY | The new vertical field of view, in degrees.

void FCDCamera::SetMagX | ( | float | magX | ) | `[inline]`

  | Sets the horizontal magnification for this camera. Parameters:
  | magX | The new horizontal magnification, in degrees.

void FCDCamera::SetMagY | ( | float | magY | ) | `[inline]`

  | Sets the vertical magnification value for this camera. Parameters:
  | magY | The new vertical magnification, in degrees.

void FCDCamera::SetNearZ | ( | float | _nearZ | ) | `[inline]`

  | Sets the near-z value for this camera. The near-z value represent how close the near-clip plane of the view frustum is. For orthographic cameras, this value is solely used for depth-buffering. Parameters:
  | _nearZ | A valid near-z value. No check is made to verify that the near-z value is greater than the far-z value.

void FCDCamera::SetProjectionType | ( | ProjectionType | type | ) | `[inline]`

  | Sets the type of projections for this camera. Parameters:
  | type | The projection type for this camera.

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

- FCDocument/FCDCamera.h