cpe::sphere Class Reference

Object3d of type Sphere (center+radius). Analytically compute intersection with a ray. More...

+ Inheritance diagram for cpe::sphere:
+ Collaboration diagram for cpe::sphere:

List of all members.

Public Member Functions

 sphere ()
 empty constructor
 sphere (const v3 &x0, const double &r)
 direct constructor (center+radius)
virtual ~sphere ()
 desctructor
const double & radius () const
 get radius
const v3center () const
 get center
virtual std::vector
< intersection_data
intersect (const ray &seg) const
 Analytic intersection between a ray and the sphere.

Private Attributes

v3 x0
 internal center of the sphere
double r
 internal radius of the sphere

Detailed Description

Object3d of type Sphere (center+radius). Analytically compute intersection with a ray.


Constructor & Destructor Documentation

empty constructor

cpe::sphere::sphere ( const v3 x0,
const double &  r 
)

direct constructor (center+radius)

cpe::sphere::~sphere ( ) [virtual]

desctructor


Member Function Documentation

const v3 & cpe::sphere::center ( ) const

get center

References x0.

std::vector< intersection_data > cpe::sphere::intersect ( const ray seg) const [virtual]

Analytic intersection between a ray and the sphere.

Implements cpe::object3d.

References cpe::v3::dot(), cpe::ray::u(), cpe::ray::x0(), and x0.

+ Here is the call graph for this function:

const double & cpe::sphere::radius ( ) const

get radius

References r.


Member Data Documentation

double cpe::sphere::r [private]

internal radius of the sphere

Referenced by radius().

v3 cpe::sphere::x0 [private]

internal center of the sphere

Referenced by center(), and intersect().


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