#include <Cyl.h>
Inherits Primitive.
Public Member Functions | |
Cyl (Material *material, const Point &base, const Point &top, const float rad) | |
virtual | ~Cyl () |
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 | base |
Point | top |
float | radius |
Vector | A |
Plane * | basePlane |
Plane * | topPlane |
Definition at line 13 of file Cyl.h.
|
Definition at line 16 of file Cyl.cc. References A, base, basePlane, Vector::normalize(), top, and topPlane. |
|
|
|
Implements Object. |
|
Intersect ray with primitive.
Implements Primitive. Definition at line 63 of file Cyl.cc. References A, base, basePlane, Cross(), Ray::direction(), Dot(), HitRecord::hit(), Plane::intersect(), Vector::length2(), Primitive::matl, HitRecord::minT(), Vector::normalize(), Ray::origin(), radius, HitRecord::scratchdata, and topPlane. |
|
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 38 of file Cyl.cc. References A, base, Dot(), radius, and HitRecord::scratchdata. |
|
Definition at line 30 of file Cyl.h. Referenced by Cyl(), intersect(), and normal(). |
|
Definition at line 27 of file Cyl.h. Referenced by Cyl(), intersect(), and normal(). |
|
Definition at line 31 of file Cyl.h. Referenced by Cyl(), intersect(), and ~Cyl(). |
|
Definition at line 29 of file Cyl.h. Referenced by intersect(), and normal(). |
|
Definition at line 28 of file Cyl.h. Referenced by Cyl(). |
|
Definition at line 32 of file Cyl.h. Referenced by Cyl(), intersect(), and ~Cyl(). |