#include <sphere.h>
Public Member Functions | |
Sphere (const Transform &o2w, bool ro, float rad, float zmin, float zmax, float phiMax) | |
virtual | ~Sphere () |
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 |
virtual Point | Sample (const Point &p, float u1, float u2, float u3, Normal *ns) const |
virtual float | Pdf (const Point &p, const Vector &wi) const |
virtual float | Pdf (const Point &p, const Point &po) const |
Static Public Member Functions | |
static Shape * | CreateShape (const Transform &o2w, bool reverseOrientation, const ParamSet ¶ms) |
Private Attributes | |
float | radius |
float | phiMax |
float | zmin |
float | zmax |
float | thetaMin |
float | thetaMax |
Definition at line 31 of file sphere.h.
Sphere::Sphere | ( | const Transform & | o2w, | |
bool | ro, | |||
float | rad, | |||
float | zmin, | |||
float | zmax, | |||
float | phiMax | |||
) |
Definition at line 31 of file sphere.cpp.
References Clamp(), cimg_library::cimg::max(), cimg_library::cimg::min(), phiMax, Radians(), radius, thetaMax, thetaMin, zmax, and zmin.
Referenced by CreateShape().
float Sphere::Area | ( | ) | const [virtual] |
Returns the area of this primitive.
Reimplemented from lux::Primitive.
Definition at line 192 of file sphere.cpp.
Shape * Sphere::CreateShape | ( | const Transform & | o2w, | |
bool | reverseOrientation, | |||
const ParamSet & | params | |||
) | [static] |
Definition at line 195 of file sphere.cpp.
References lux::ParamSet::FindOneFloat(), radius, Sphere(), zmax, and zmin.
bool Sphere::Intersect | ( | const Ray & | ray, | |
float * | tHit, | |||
DifferentialGeometry * | dg | |||
) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 45 of file sphere.cpp.
References lux::Cross(), lux::Ray::d, lux::Dot(), blender::g, G(), M_PI, lux::Ray::maxt, lux::Ray::mint, lux::Normalize(), lux::Ray::o, lux::Shape::ObjectToWorld, phiMax, Quadratic(), radius, thetaMax, thetaMin, lux::Shape::WorldToObject, lux::Point::x, lux::Vector::x, lux::Point::y, lux::Vector::y, lux::Point::z, lux::Vector::z, zmax, and zmin.
Referenced by Sample().
bool Sphere::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 149 of file sphere.cpp.
References lux::Ray::d, M_PI, lux::Ray::maxt, lux::Ray::mint, lux::Ray::o, phiMax, Quadratic(), radius, lux::Shape::WorldToObject, lux::Point::x, lux::Vector::x, lux::Point::y, lux::Vector::y, lux::Point::z, lux::Vector::z, zmax, and zmin.
BBox Sphere::ObjectBound | ( | ) | const [virtual] |
Reimplemented from lux::Shape.
Definition at line 41 of file sphere.cpp.
Returns the probability density for sampling the given point. (
p | The point that was to be tested for visibility with the result. | |
po | The point that was sampled. |
Reimplemented from lux::Primitive.
Definition at line 86 of file sphere.h.
References lux::AbsDot(), lux::DistanceSquared(), lux::Vector::LengthSquared(), cimg_library::cimg::max(), lux::Shape::ObjectToWorld, Pdf(), radius, and lux::UniformConePdf().
Returns the probability density for sampling the given point. (
p | The point that was to be tested for visibility with the result. | |
wi | The direction from the above point to the sampled point. |
Reimplemented from lux::Primitive.
Definition at line 76 of file sphere.h.
References lux::DistanceSquared(), cimg_library::cimg::max(), lux::Shape::ObjectToWorld, radius, and lux::UniformConePdf().
Referenced by Pdf().
virtual Point lux::Sphere::Sample | ( | const Point & | p, | |
float | u1, | |||
float | u2, | |||
float | u3, | |||
Normal * | ns | |||
) | const [inline, virtual] |
Reimplemented from lux::Shape.
Definition at line 49 of file sphere.h.
References lux::CoordinateSystem(), lux::DistanceSquared(), Intersect(), cimg_library::cimg::max(), lux::Normalize(), lux::Shape::ObjectToWorld, lux::r, radius, lux::Shape::reverseOrientation, Sample(), and lux::UniformSampleCone().
virtual Point lux::Sphere::Sample | ( | float | u1, | |
float | u2, | |||
float | u3, | |||
Normal * | ns | |||
) | const [inline, virtual] |
Reimplemented from lux::Shape.
Definition at line 42 of file sphere.h.
References lux::Normalize(), lux::Shape::ObjectToWorld, p, radius, lux::Shape::reverseOrientation, lux::UniformSampleSphere(), lux::Point::x, lux::Point::y, and lux::Point::z.
Referenced by Sample().
float lux::Sphere::phiMax [private] |
Definition at line 104 of file sphere.h.
Referenced by Area(), Intersect(), IntersectP(), and Sphere().
float lux::Sphere::radius [private] |
Definition at line 103 of file sphere.h.
Referenced by Area(), CreateShape(), Intersect(), IntersectP(), ObjectBound(), Pdf(), Sample(), and Sphere().
float lux::Sphere::thetaMax [private] |
Definition at line 106 of file sphere.h.
Referenced by Intersect(), and Sphere().
float lux::Sphere::thetaMin [private] |
Definition at line 106 of file sphere.h.
Referenced by Intersect(), and Sphere().
float lux::Sphere::zmax [private] |
Definition at line 105 of file sphere.h.
Referenced by Area(), CreateShape(), Intersect(), IntersectP(), ObjectBound(), and Sphere().
float lux::Sphere::zmin [private] |
Definition at line 105 of file sphere.h.
Referenced by Area(), CreateShape(), Intersect(), IntersectP(), ObjectBound(), and Sphere().