#include <Sphere.h>
Inherits Primitive.
Public Member Functions | |
Sphere (Material *material, const Point ¢er, 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 |
Definition at line 12 of file Sphere.h.
|
Definition at line 13 of file Sphere.cc. References inv_radius. |
|
|
|
Implements Object. Definition at line 23 of file Sphere.cc. References center, BoundingBox::extend(), and radius. |
|
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. |
|
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. |
|
Definition at line 22 of file Sphere.h. Referenced by getBounds(), intersect(), and normal(). |
|
|
|
Definition at line 23 of file Sphere.h. Referenced by getBounds(), and intersect(). |