lux::SampleableSphericalFunction Class Reference

#include <sphericalfunction.h>

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

List of all members.

Public Member Functions

 SampleableSphericalFunction (boost::shared_ptr< const SphericalFunction > aFunc, int xRes=512, int yRes=256)
 ~SampleableSphericalFunction ()
RGBColor f (float phi, float theta) const
RGBColor Sample_f (float u1, float u2, Vector *w, float *pdf) const
float Pdf (const Vector &w) const
float Average_f () const

Private Attributes

int nVDistribs
Distribution1DuDistrib
Distribution1D ** vDistribs
boost::shared_ptr< const
SphericalFunction
func

Detailed Description

A spherical functions that allows efficient sampling.

Definition at line 113 of file sphericalfunction.h.


Constructor & Destructor Documentation

lux::SampleableSphericalFunction::SampleableSphericalFunction ( boost::shared_ptr< const SphericalFunction aFunc,
int  xRes = 512,
int  yRes = 256 
)

Definition at line 42 of file sphericalfunction.cpp.

lux::SampleableSphericalFunction::~SampleableSphericalFunction (  ) 

Definition at line 76 of file sphericalfunction.cpp.


Member Function Documentation

float lux::SampleableSphericalFunction::Average_f (  )  const

Returns the average function value over the entire sphere.

Returns:
The average function value.

Definition at line 117 of file sphericalfunction.cpp.

Referenced by lux::PointLight::Power(), and lux::AreaLight::Power().

RGBColor lux::SampleableSphericalFunction::f ( float  phi,
float  theta 
) const [virtual]

Evaluates this function for the given direction.

Parameters:
phi The angle in the xy plane.
theta The angle from the z axis.
Returns:
The function value for the given direction.

Implements lux::SphericalFunction.

Definition at line 84 of file sphericalfunction.cpp.

Referenced by GonioBxDF::f(), GonioAreaBxDF::f(), lux::PointLight::L(), lux::AreaLight::L(), and lux::AreaLight::Power().

float lux::SampleableSphericalFunction::Pdf ( const Vector w  )  const

Computes the pdf for sampling the given direction.

Parameters:
w The direction.
Returns:
The pdf (w.r.t. solid angle) for the direction.

Definition at line 106 of file sphericalfunction.cpp.

Referenced by lux::PointLight::Sample_L().

RGBColor lux::SampleableSphericalFunction::Sample_f ( float  u1,
float  u2,
Vector w,
float *  pdf 
) const

Samples this spherical function.

Parameters:
u1 The first random value.
u2 The second random value.
w The address to store the sampled direction in.
pdf The address to store the pdf (w.r.t. solid angle) of the sample direction in.
Returns:
The function value of the sampled direction.

Definition at line 88 of file sphericalfunction.cpp.

Referenced by lux::PointLight::Sample_L().


Member Data Documentation

boost::shared_ptr<const SphericalFunction> lux::SampleableSphericalFunction::func [private]

Definition at line 154 of file sphericalfunction.h.

Definition at line 151 of file sphericalfunction.h.

Definition at line 152 of file sphericalfunction.h.

Definition at line 153 of file sphericalfunction.h.


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