Primitive Class Reference

#include <Primitive.h>

Inherits Object.

Inherited by Box, Cyl, Plane, Ring, Sphere, and Triangle.


Public Member Functions

 Primitive (Material *matl)
 Constructor needs material.
virtual ~Primitive ()
virtual void preprocess ()
 This is called before rendering to allow the primitive to pre-compute terms.
virtual void intersect (HitRecord &hit, const RenderContext &context, const Ray &ray) const =0
 Intersect ray with primitive.
virtual void normal (Vector &normal, const RenderContext &context, const Point &hitpos, const Ray &ray, const HitRecord &hit) const =0
 Return normal for the hit location. Generally called after all ray-geometry intersection to get the normal for the hit point.
virtual void computeUVW (Vector &uvw, const RenderContext &context, const Ray &ray, const HitRecord &hit) const
 Get UVW coordinates for hit location.

Protected Attributes

Materialmatl


Detailed Description

Definition at line 13 of file Primitive.h.


Constructor & Destructor Documentation

Primitive Material matl  ) 
 

Constructor needs material.

Definition at line 11 of file Primitive.cc.

~Primitive  )  [virtual]
 

Definition at line 16 of file Primitive.cc.


Member Function Documentation

void computeUVW Vector uvw,
const RenderContext context,
const Ray ray,
const HitRecord hit
const [virtual]
 

Get UVW coordinates for hit location.

Definition at line 25 of file Primitive.cc.

References Ray::direction(), HitRecord::minT(), and Ray::origin().

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

Intersect ray with primitive.

Implements Object.

Implemented in Box, Cyl, Plane, Ring, Sphere, and Triangle.

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

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

Implemented in Box, Cyl, Plane, Ring, Sphere, and Triangle.

Referenced by LambertianMaterial::shade().

void preprocess  )  [virtual]
 

This is called before rendering to allow the primitive to pre-compute terms.

Reimplemented from Object.

Definition at line 20 of file Primitive.cc.

References matl, and Material::preprocess().


Field Documentation

Material* matl [protected]
 

Definition at line 44 of file Primitive.h.

Referenced by Triangle::intersect(), Sphere::intersect(), Ring::intersect(), Plane::intersect(), Cyl::intersect(), Box::intersect(), and preprocess().


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