Sphere Class Reference

#include <Sphere.h>

Inherits Primitive.


Public Member Functions

 Sphere (Material *material, const Point &center, double radius)
virtual ~Sphere ()
virtual void getBounds (BoundingBox &bbox) const
virtual void intersect (HitRecord &hit, const RenderContext &context, const Ray &ray) const
 Intersect ray with primitive.
virtual void normal (Vector &normal, const RenderContext &context, const Point &hitpos, const Ray &ray, const HitRecord &hit) const
 Return normal for the hit location. Generally called after all ray-geometry intersection to get the normal for the hit point.

Protected Attributes

Point center
double radius
double inv_radius


Detailed Description

Definition at line 12 of file Sphere.h.


Constructor & Destructor Documentation

Sphere Material material,
const Point &  center,
double  radius
 

Definition at line 13 of file Sphere.cc.

References inv_radius.

~Sphere  )  [virtual]
 

Definition at line 19 of file Sphere.cc.


Member Function Documentation

void getBounds BoundingBox bbox  )  const [virtual]
 

Implements Object.

Definition at line 23 of file Sphere.cc.

References center, BoundingBox::extend(), and radius.

void intersect HitRecord hit,
const RenderContext context,
const Ray ray
const [virtual]
 

Intersect ray with primitive.

Implements Primitive.

Definition at line 30 of file Sphere.cc.

References center, Ray::direction(), Dot(), HitRecord::hit(), Primitive::matl, Ray::origin(), and radius.

void normal Vector normal,
const RenderContext context,
const Point &  hitpos,
const Ray ray,
const HitRecord hit
const [virtual]
 

Return normal for the hit location. Generally called after all ray-geometry intersection to get the normal for the hit point.

Implements Primitive.

Definition at line 47 of file Sphere.cc.

References center, and inv_radius.


Field Documentation

Point center [protected]
 

Definition at line 22 of file Sphere.h.

Referenced by getBounds(), intersect(), and normal().

double inv_radius [protected]
 

Definition at line 24 of file Sphere.h.

Referenced by normal(), and Sphere().

double radius [protected]
 

Definition at line 23 of file Sphere.h.

Referenced by getBounds(), and intersect().


The documentation for this class was generated from the following files:
Generated on Tue Jan 29 21:34:56 2008 for specter by  doxygen 1.4.6