cpe::camera Class Reference

Storage of a camera and screen parameters. More...

+ Collaboration diagram for cpe::camera:

List of all members.

Public Member Functions

 camera (const v3 &center=v3(0, 0,-2), const v3 &direction=v3(0, 0, 1), const v3 &up=v3(0, 1, 0), const double &dist_screen=2.0, const double &length_screen=4.0)
 direct constructor
const v3get_center () const
 get the center of the camera
const v3get_direction () const
 get the direction value
const v3get_up () const
 get the up direction value
const double & get_dist_screen () const
 get the dist_screen value
const double & get_length_screen () const
 get the length_of the screen value
v3 get_screen_coordinate (const double &u, const double &v) const
 get the screen coordinate given the parametric (u,v) data. (u,v) belongs to [0,1]

Private Attributes

v3 p
 internal camera center
v3 dir
 direction of pointing camera
v3 up
 up direction of the camera
double dist_screen
 internal screen distance to the center
double length_screen
 length of the screen

Detailed Description

Storage of a camera and screen parameters.


Constructor & Destructor Documentation

cpe::camera::camera ( const v3 center = v3(0,0,-2),
const v3 direction = v3(0,0,1),
const v3 up = v3(0,1,0),
const double &  dist_screen = 2.0,
const double &  length_screen = 4.0 
)

direct constructor


Member Function Documentation

const v3 & cpe::camera::get_center ( ) const

get the center of the camera

References p.

Referenced by cpe::ray::generate_ray_from_camera().

const v3 & cpe::camera::get_direction ( ) const

get the direction value

References dir.

const double & cpe::camera::get_dist_screen ( ) const

get the dist_screen value

References dist_screen.

const double & cpe::camera::get_length_screen ( ) const

get the length_of the screen value

References length_screen.

v3 cpe::camera::get_screen_coordinate ( const double &  u,
const double &  v 
) const

get the screen coordinate given the parametric (u,v) data. (u,v) belongs to [0,1]

References cpe::v3::cross(), dir, dist_screen, length_screen, cpe::v3::normalized(), p, and up.

Referenced by cpe::ray::generate_ray_from_camera().

+ Here is the call graph for this function:

const v3 & cpe::camera::get_up ( ) const

get the up direction value

References up.


Member Data Documentation

v3 cpe::camera::dir [private]

direction of pointing camera

Referenced by get_direction(), and get_screen_coordinate().

double cpe::camera::dist_screen [private]

internal screen distance to the center

Referenced by get_dist_screen(), and get_screen_coordinate().

double cpe::camera::length_screen [private]

length of the screen

Referenced by get_length_screen(), and get_screen_coordinate().

v3 cpe::camera::p [private]

internal camera center

Referenced by get_center(), and get_screen_coordinate().

v3 cpe::camera::up [private]

up direction of the camera

Referenced by get_screen_coordinate(), and get_up().


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