#include <torus.h>
Public Member Functions | |
| Torus (const Transform &o2w, bool ro, float marad, float mirad, float zmin, float zmax, float phiMax) | |
| virtual | ~Torus () |
| virtual BBox | ObjectBound () const |
| virtual bool | Intersect (const Ray &ray, float *tHit, DifferentialGeometry *dg) const |
| virtual bool | IntersectP (const Ray &ray) const |
| virtual float | Area () const |
| virtual Point | Sample (float u1, float u2, float u3, Normal *ns) const |
Static Public Member Functions | |
| static Shape * | CreateShape (const Transform &o2w, bool reverseOrientation, const ParamSet ¶ms) |
Private Member Functions | |
| bool | FindIntersection (const Ray &ray, float *tHit, Point *pHit, float *phiHit, float *thetaHit) const |
Private Attributes | |
| float | majorRadius |
| float | minorRadius |
| float | phiMax |
| float | thetaMin |
| float | thetaMax |
| float | zmin |
| float | zmax |
Definition at line 31 of file torus.h.
| Torus::Torus | ( | const Transform & | o2w, | |
| bool | ro, | |||
| float | marad, | |||
| float | mirad, | |||
| float | zmin, | |||
| float | zmax, | |||
| float | phiMax | |||
| ) |
Definition at line 333 of file torus.cpp.
References Clamp(), M_PI, majorRadius, cimg_library::cimg::max(), cimg_library::cimg::min(), minorRadius, phiMax, Radians(), thetaMax, thetaMin, zmax, and zmin.
Referenced by CreateShape().
| float Torus::Area | ( | ) | const [virtual] |
Returns the area of this primitive.
Reimplemented from lux::Primitive.
Definition at line 450 of file torus.cpp.
References majorRadius, minorRadius, phiMax, thetaMax, and thetaMin.
| Shape * Torus::CreateShape | ( | const Transform & | o2w, | |
| bool | reverseOrientation, | |||
| const ParamSet & | params | |||
| ) | [static] |
Definition at line 454 of file torus.cpp.
References lux::ParamSet::FindOneFloat(), majorRadius, minorRadius, and Torus().
| bool Torus::FindIntersection | ( | const Ray & | ray, | |
| float * | tHit, | |||
| Point * | pHit, | |||
| float * | phiHit, | |||
| float * | thetaHit | |||
| ) | const [private] |
Definition at line 242 of file torus.cpp.
References Clamp(), lux::Ray::d, lux::Dot(), lux::Vector::Length(), M_PI, majorRadius, lux::Ray::maxt, minorRadius, lux::Ray::mint, lux::Ray::o, phiMax, quartic(), r2, thetaMax, lux::Point::x, lux::Point::y, lux::Point::z, and lux::Vector::z.
Referenced by Intersect(), and IntersectP().
| bool Torus::Intersect | ( | const Ray & | ray, | |
| float * | tHit, | |||
| DifferentialGeometry * | dg | |||
| ) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 354 of file torus.cpp.
References lux::Cross(), lux::Dot(), FindIntersection(), blender::g, G(), minorRadius, lux::Normalize(), lux::Shape::ObjectToWorld, phiMax, thetaMax, thetaMin, lux::Shape::WorldToObject, lux::Point::x, lux::Point::y, and lux::Point::z.
| bool Torus::IntersectP | ( | const Ray & | r | ) | const [virtual] |
Tests for intersection of this primitive with the given ray.
| r | The ray to intersect with this primitive. |
Reimplemented from lux::Primitive.
Definition at line 438 of file torus.cpp.
References FindIntersection(), and lux::Shape::WorldToObject.
| BBox Torus::ObjectBound | ( | ) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 349 of file torus.cpp.
References majorRadius, and minorRadius.
| virtual Point lux::Torus::Sample | ( | float | u1, | |
| float | u2, | |||
| float | u3, | |||
| Normal * | ns | |||
| ) | const [inline, virtual] |
Reimplemented from lux::Shape.
Definition at line 42 of file torus.h.
References majorRadius, minorRadius, lux::Normalize(), lux::Shape::ObjectToWorld, p, lux::Shape::reverseOrientation, thetaMax, and thetaMin.
float lux::Torus::majorRadius [private] |
Definition at line 68 of file torus.h.
Referenced by Area(), CreateShape(), FindIntersection(), ObjectBound(), Sample(), and Torus().
float lux::Torus::minorRadius [private] |
Definition at line 68 of file torus.h.
Referenced by Area(), CreateShape(), FindIntersection(), Intersect(), ObjectBound(), Sample(), and Torus().
float lux::Torus::phiMax [private] |
Definition at line 69 of file torus.h.
Referenced by Area(), FindIntersection(), Intersect(), and Torus().
float lux::Torus::thetaMax [private] |
Definition at line 70 of file torus.h.
Referenced by Area(), FindIntersection(), Intersect(), Sample(), and Torus().
float lux::Torus::thetaMin [private] |
float lux::Torus::zmax [private] |
float lux::Torus::zmin [private] |
1.6.2-20100208