#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 | |
Material * | matl |
Definition at line 13 of file Primitive.h.
|
Constructor needs material.
Definition at line 11 of file Primitive.cc. |
|
Definition at line 16 of file Primitive.cc. |
|
Get UVW coordinates for hit location.
Definition at line 25 of file Primitive.cc. References Ray::direction(), HitRecord::minT(), and Ray::origin(). |
|
Intersect ray with primitive.
Implements Object. |
|
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(). |
|
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(). |
|
Definition at line 44 of file Primitive.h. Referenced by Triangle::intersect(), Sphere::intersect(), Ring::intersect(), Plane::intersect(), Cyl::intersect(), Box::intersect(), and preprocess(). |