World::Camera Class Reference

#include <Camera.hh>

Collaboration diagram for World::Camera:

Collaboration graph
[legend]

List of all members.


Detailed Description

Camera data, algorithms and functions used for creating camera rays.

Used for creating rays shooting from camera. Describes camera using Top, Direction, Position vectors and Field of View.

Definition at line 32 of file Camera.hh.


Public Member Functions

 Camera (const Math::Vector &Pos=Math::Vector(0.0, 1.0,-1.0), const Math::Vector &Dir=Math::Vector(0.0, 0.0, 1.0), Double FOV=DegreeToFOV(45.0), Bool AutoTop=true, const Math::Vector &Top=Math::Vector(0.0, 1.0, 0.0))
View CreateView (Int XRes, Int YRes) const

Static Public Member Functions

static Double DegreeToFOV (Double Degree)

Protected Attributes

Double FOV
Math::Vector Pos
Math::Vector Dir
Math::Vector Top

Friends

std::ostream & operator<< (std::ostream &os, const Camera &C)

Classes

class  View
 Generates rays shooting from camera. More...

Constructor & Destructor Documentation

World::Camera::Camera ( const Math::Vector Pos = Math::Vector(0.0, 1.0, -1.0),
const Math::Vector Dir = Math::Vector(0.0, 0.0, 1.0),
Double  FOV = DegreeToFOV(45.0),
Bool  AutoTop = true,
const Math::Vector Top = Math::Vector(0.0, 1.0, 0.0) 
)

Initializes camera with default values

Function can calculate the Top vector so that camera "horizon line" is parallel to scene horizon.

Parameters:
Pos Camera position vector
Dir Direction of the camera view
FOV Camera "Field of View" in radians
AutoTop should top vector be automatically calculated?
Top if AutoTop = false, we use this vector

Definition at line 22 of file Camera.cc.

References Math::Abs(), Math::Tuple< T, DoCropping, Count >::Normalize(), and Math::Vector::Set().

Here is the call graph for this function:


Member Function Documentation

static Double World::Camera::DegreeToFOV ( Double  Degree  )  [inline, static]

Utility function to convert degrees into radians

Definition at line 87 of file Camera.hh.

Referenced by World::Scene::ParseCamera().

Here is the caller graph for this function:

Camera::View World::Camera::CreateView ( Int  XRes,
Int  YRes 
) const

Performs few vector calculations and returns object which is then used to create rays

Definition at line 51 of file Camera.cc.

References Math::Vector::Cross(), Dir, FOV, Pos, and Top.

Here is the call graph for this function:


Friends And Related Function Documentation

std::ostream& operator<< ( std::ostream &  os,
const Camera C 
) [friend]

Pretty-printer

Definition at line 91 of file Camera.cc.


Member Data Documentation

Double World::Camera::FOV [protected]

Camera Field of View in radians

Definition at line 35 of file Camera.hh.

Referenced by CreateView(), and World::operator<<().

Position at which camera is located

Definition at line 38 of file Camera.hh.

Referenced by CreateView(), and World::operator<<().

Direction the camera is pointing.

Definition at line 41 of file Camera.hh.

Referenced by CreateView(), and World::operator<<().

Vector defining 'top' direction of camera; can be calculated automatically.

Definition at line 46 of file Camera.hh.

Referenced by CreateView(), and World::operator<<().


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

Generated on Wed Mar 12 00:36:16 2008 for blaRAY by  doxygen 1.5.5