Public Member Functions | |
Sphere (const Transform &o2w, bool ro, float rad, float zmin, float zmax, float phiMax) | |
BBox | ObjectBound () const |
bool | Intersect (const Ray &ray, float *tHit, DifferentialGeometry *dg) const |
bool | IntersectP (const Ray &ray) const |
float | Area () const |
Point | Sample (float u1, float u2, Normal *ns) const |
Point | Sample (const Point &p, float u1, float u2, Normal *ns) const |
float | Pdf (const Point &p, const Vector &wi) const |
Private Attributes | |
float | radius |
float | phiMax |
float | zmin |
float | zmax |
float | thetaMin |
float | thetaMax |
Definition at line 28 of file sphere.cpp.
Sphere::Sphere | ( | const Transform & | o2w, | |
bool | ro, | |||
float | rad, | |||
float | zmin, | |||
float | zmax, | |||
float | phiMax | |||
) |
BBox Sphere::ObjectBound | ( | ) | const [virtual] |
bool Sphere::Intersect | ( | const Ray & | ray, | |
float * | tHit, | |||
DifferentialGeometry * | dg | |||
) | const [virtual] |
Reimplemented from Shape.
Definition at line 104 of file sphere.cpp.
References Cross(), Ray::d, Dot(), M_PI, Ray::maxt, Ray::mint, N, Normalize(), Ray::o, Shape::ObjectToWorld, phiMax, Quadratic(), radius, thetaMax, thetaMin, Shape::WorldToObject, Point::x, Vector::x, Point::y, Vector::y, Point::z, Vector::z, zmax, and zmin.
Referenced by Sample().
bool Sphere::IntersectP | ( | const Ray & | ray | ) | const [virtual] |
float Sphere::Area | ( | ) | const [virtual] |
Reimplemented from Shape.
Definition at line 38 of file sphere.cpp.
References Normalize(), Shape::ObjectToWorld, radius, Shape::reverseOrientation, UniformSampleSphere(), Point::x, Point::y, and Point::z.
Referenced by Sample().
Reimplemented from Shape.
Definition at line 45 of file sphere.cpp.
References CoordinateSystem(), DistanceSquared(), Intersect(), Normalize(), Shape::ObjectToWorld, radius, Shape::reverseOrientation, Sample(), and UniformSampleCone().
Reimplemented from Shape.
Definition at line 72 of file sphere.cpp.
References DistanceSquared(), Shape::ObjectToWorld, Shape::Pdf(), radius, and UniformConePdf().
float Sphere::radius [private] |
Definition at line 84 of file sphere.cpp.
Referenced by Area(), CreateShape(), Intersect(), IntersectP(), ObjectBound(), Pdf(), Sample(), and Sphere().
float Sphere::phiMax [private] |
Definition at line 85 of file sphere.cpp.
Referenced by Area(), Intersect(), IntersectP(), and Sphere().
float Sphere::zmin [private] |
Definition at line 86 of file sphere.cpp.
Referenced by Area(), CreateShape(), Intersect(), IntersectP(), ObjectBound(), and Sphere().
float Sphere::zmax [private] |
Definition at line 86 of file sphere.cpp.
Referenced by Area(), CreateShape(), Intersect(), IntersectP(), ObjectBound(), and Sphere().
float Sphere::thetaMin [private] |
float Sphere::thetaMax [private] |