FCDCamera Class Reference
[COLLADA Document Object Model.]

A COLLADA camera. More...

#include <FCDCamera.h>

Inheritance diagram for FCDCamera:

FCDTargetedEntity FCDEntity FCDObjectWithId FCDObject FUObject List of all members.

Public Member Functions

 FCDCamera (FCDocument *document)
 Constructor: do not use directly.
virtual ~FCDCamera ()
 Destructor: do not release directly.
virtual Type GetType () const
 Retrieves the entity type for this class.
bool IsPerspective () const
 Retrieves whether this camera is a perspective camera.
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.
float & GetFovX ()
 Retrieves the horizontal field of view.
const float & GetFovX () const
 See above.
float & GetFovY ()
 Retrieves the vertical field of view.
const float & 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.
bool IsOrthographic () const
 Retrieves whether this camera is an orthographic camera.
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.
float & GetMagX ()
 Retrieves the horizontal magnification.
const float & GetMagX () const
 See above.
float & GetMagY ()
 Retrieves the vertical magnification.
const float & 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.
float & GetNearZ ()
 Retrieves the near-z value for this camera.
const float & GetNearZ () const
 See above.
float & GetFarZ ()
 Retrieves the far-z value for this camera.
const float & GetFarZ () const
 See above.
float & GetAspectRatio ()
 Retrieves the aspect ratio for the view of this camera.
const float & 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.
bool HasAperture () const
 Retrieves whether the camera provides aperture information.
float & GetVerticalAperture ()
 Retrieves the vertical aperture of the camera.
const float & GetVerticalAperture () const
 See above.
float & GetHorizontalAperture ()
 Retrieves the horizontal aperture of the camera.
const float & GetHorizontalAperture () const
 See above.
float & GetLensSqueeze ()
 Retrieves the lens squeeze of the camera.
const float & GetLensSqueeze () const
 See above.
void SetVerticalAperture (float aperture)
 Sets the vertical aperture of the camera.
void SetHorizontalAperture (float aperture)
 Sets the horizontal aperture of the camera.
void SetLensSqueeze (float factor)
 Sets the lens squeeze of the camera.
FUStatus LoadFromXML (xmlNode *cameraNode)
 [INTERNAL] Reads in the <camera> element from a given COLLADA XML tree node.
virtual xmlNode * WriteToXML (xmlNode *parentNode) const
 [INTERNAL] Writes out the <camera> element to the given COLLADA XML tree node.

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.


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.

virtual FCDCamera::~FCDCamera  )  [virtual]
 

Destructor: do not release directly.

Release cameras using the FCDLibrary::ReleaseEntity function. All cameras are released with the document that they belong to.


Member Function Documentation

float& 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.

float& 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 frustrum is. For orthographic cameras, this value is solely used for depth-buffering.

Returns:
The far-z value for this camera.

float& 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.

float& 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.

float& FCDCamera::GetHorizontalAperture  )  [inline]
 

Retrieves the horizontal aperture of the camera.

This information is specific to COLLADA documents exported from ColladaMaya.

Returns:
The horizontal aperture of the camera.

float& FCDCamera::GetLensSqueeze  )  [inline]
 

Retrieves the lens squeeze of the camera.

This information is specific to COLLADA documents exported from ColladaMaya. The lens squeeze of the camera is a multiplier that acts directly on the horizontal aperture, following this formula: real horizontal aperture = given horizontal aperture * lens squeeze.

Returns:
The lens squeeze of the camera.

float& 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.

float& 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.

float& 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 frustrum is. For orthographic cameras, this value is solely used for depth-buffering.

Returns:
The near-z value for this camera.

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.

float& FCDCamera::GetVerticalAperture  )  [inline]
 

Retrieves the vertical aperture of the camera.

This information is specific to COLLADA documents exported from ColladaMaya.

Returns:
The vertical aperture of the camera.

bool FCDCamera::HasAperture  )  const [inline]
 

Retrieves whether the camera provides aperture information.

This information is specific to COLLADA documents exported from ColladaMaya.

Returns:
Whether the camera provides aperture information.

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.

bool FCDCamera::IsOrthographic  )  const [inline]
 

Retrieves whether this camera is an orthographic camera.

Returns:
Whether this camera is an orthographic camera.

bool FCDCamera::IsPerspective  )  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.

FUStatus FCDCamera::LoadFromXML xmlNode *  cameraNode  )  [virtual]
 

[INTERNAL] Reads in the <camera> element from a given COLLADA XML tree node.

Parameters:
cameraNode A COLLADA XML tree node.
Returns:
The status of the import. If the status is not successful, it may be dangerous to extract information from the camera.

Reimplemented from FCDEntity.

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 frustrum 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 greather 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::SetHorizontalAperture float  aperture  )  [inline]
 

Sets the horizontal aperture of the camera.

Parameters:
aperture The horizontal aperture of the camera.

void FCDCamera::SetLensSqueeze float  factor  )  [inline]
 

Sets the lens squeeze of the camera.

Parameters:
factor The lense squeeze of the camera.

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 frustrum 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 greather than the far-z value.

void FCDCamera::SetVerticalAperture float  aperture  )  [inline]
 

Sets the vertical aperture of the camera.

Parameters:
aperture The vertical aperture of the camera.

virtual xmlNode* FCDCamera::WriteToXML xmlNode *  parentNode  )  const [virtual]
 

[INTERNAL] Writes out the <camera> element to the given COLLADA XML tree node.

Parameters:
parentNode The COLLADA XML parent node in which to insert the geometry information.
Returns:
The created XML tree node.

Reimplemented from FCDEntity.


The documentation for this class was generated from the following file:
Generated on Fri May 12 16:44:41 2006 for FCollada by  doxygen 1.4.6-NO