lux::Sphere Class Reference

#include <sphere.h>

Inheritance diagram for lux::Sphere:
[legend]
Collaboration diagram for lux::Sphere:
[legend]

List of all members.

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 ShapeCreateShape (const Transform &o2w, bool reverseOrientation, const ParamSet &params)

Private Attributes

float radius
float phiMax
float zmin
float zmax
float thetaMin
float thetaMax

Detailed Description

Definition at line 31 of file sphere.h.


Constructor & Destructor Documentation

Sphere::Sphere ( const Transform o2w,
bool  ro,
float  rad,
float  zmin,
float  zmax,
float  phiMax 
)
virtual lux::Sphere::~Sphere (  )  [inline, virtual]

Definition at line 36 of file sphere.h.


Member Function Documentation

float Sphere::Area (  )  const [virtual]

Returns the area of this primitive.

Reimplemented from lux::Primitive.

Definition at line 192 of file sphere.cpp.

References phiMax, radius, zmax, and zmin.

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]
bool Sphere::IntersectP ( const Ray r  )  const [virtual]

Tests for intersection of this primitive with the given ray.

Parameters:
r The ray to intersect with this primitive.
Returns:
Whether an intersection was found.

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.

References radius, zmax, and zmin.

virtual float lux::Sphere::Pdf ( const Point p,
const Point po 
) const [inline, virtual]

Returns the probability density for sampling the given point. (

See also:
Primitive::Sample(Point&,float,float,float,Normal*) const). No visibility test is done here.
Parameters:
p The point that was to be tested for visibility with the result.
po The point that was sampled.
Returns:
The pdf value (w.r.t. surface area) for the given point.

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().

virtual float lux::Sphere::Pdf ( const Point p,
const Vector wi 
) const [inline, virtual]

Returns the probability density for sampling the given point. (

See also:
Primitive::Sample(Point&,float,float,float,Normal*) const).
Parameters:
p The point that was to be tested for visibility with the result.
wi The direction from the above point to the sampled point.
Returns:
The pdf value (w.r.t. solid angle) for the given 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]
virtual Point lux::Sphere::Sample ( float  u1,
float  u2,
float  u3,
Normal ns 
) const [inline, virtual]

Member Data Documentation

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().


The documentation for this class was generated from the following files:
Generated by  doxygen 1.6.2-20100208