lux::MotionPrimitive Class Reference

#include <primitive.h>

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

List of all members.

Public Member Functions

 MotionPrimitive (boost::shared_ptr< Primitive > i, const Transform &i2ws, const Transform &i2we, float s, float e)
virtual ~MotionPrimitive ()
virtual BBox WorldBound () const
virtual bool CanIntersect () const
virtual bool Intersect (const Ray &r, Intersection *in) const
virtual bool IntersectP (const Ray &r) const
virtual void GetShadingGeometry (const Transform &obj2world, const DifferentialGeometry &dg, DifferentialGeometry *dgShading) const
virtual bool CanSample () const
virtual float Area () const
virtual void Sample (float u1, float u2, float u3, DifferentialGeometry *dg) const
virtual float Pdf (const Point &p) const
virtual void Sample (const Point &P, float u1, float u2, float u3, DifferentialGeometry *dg) const
virtual float Pdf (const Point &p, const Vector &wi) const
virtual float Pdf (const Point &p, const Point &po) const

Private Attributes

boost::shared_ptr< Primitiveinstance
MotionSystemmotionSystem

Detailed Description

A decorator for instances of primitives with interpolated matrices for motion blur. This is achieved by changing the Object-to-World transformation in the result and other transforming all intersection info that was calculated, by interpolating between 2 matrices using the ray time.

Definition at line 326 of file primitive.h.


Constructor & Destructor Documentation

lux::MotionPrimitive::MotionPrimitive ( boost::shared_ptr< Primitive i,
const Transform i2ws,
const Transform i2we,
float  s,
float  e 
) [inline]

Creates a new instance from the given primitive.

Parameters:
i The primitive to instance.
i2ws The instance to world transformation at start time.
i2we The instance to world transformation at end time.
s The time at start.
e The time at end.

Definition at line 338 of file primitive.h.

References instance, and motionSystem.

virtual lux::MotionPrimitive::~MotionPrimitive (  )  [inline, virtual]

Definition at line 346 of file primitive.h.

References motionSystem.


Member Function Documentation

virtual float lux::MotionPrimitive::Area (  )  const [inline, virtual]

Returns the area of this primitive.

Reimplemented from lux::Primitive.

Definition at line 357 of file primitive.h.

References instance.

virtual bool lux::MotionPrimitive::CanIntersect (  )  const [inline, virtual]

Returns whether this primitive can be intersected.

Implements lux::Primitive.

Definition at line 350 of file primitive.h.

References instance.

virtual bool lux::MotionPrimitive::CanSample (  )  const [inline, virtual]

Returns whether this primitive can be sampled.

Implements lux::Primitive.

Definition at line 356 of file primitive.h.

References instance.

void MotionPrimitive::GetShadingGeometry ( const Transform obj2world,
const DifferentialGeometry dg,
DifferentialGeometry dgShading 
) const [virtual]
bool MotionPrimitive::Intersect ( const Ray r,
Intersection in 
) const [virtual]

Intersects this primitive with the given ray. If an intersection is found, the ray will (i.e. r.tmax) and all fields in the intersection info will be updated.

Parameters:
r The ray to intersect with this primitive.
in The destination of the intersection information.
Returns:
Whether an intersection was found.

Reimplemented from lux::Primitive.

Definition at line 184 of file primitive.cpp.

References lux::Intersection::dg, lux::DifferentialGeometry::dndu, lux::DifferentialGeometry::dndv, lux::DifferentialGeometry::dpdu, lux::DifferentialGeometry::dpdv, lux::Transform::GetInverse(), lux::DifferentialGeometry::handle, instance, lux::Ray::maxt, motionSystem, lux::DifferentialGeometry::nn, lux::Normalize(), lux::DifferentialGeometry::p, lux::Intersection::primitive, lux::MotionSystem::Sample(), lux::DifferentialGeometry::time, lux::Ray::time, and lux::Intersection::WorldToObject.

bool MotionPrimitive::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 208 of file primitive.cpp.

References lux::Transform::GetInverse(), instance, motionSystem, lux::MotionSystem::Sample(), and lux::Ray::time.

virtual float lux::MotionPrimitive::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 382 of file primitive.h.

References instance.

virtual float lux::MotionPrimitive::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 379 of file primitive.h.

References instance.

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

Returns the probablity density for sampling the given point (

See also:
Primitive::Sample(float,float,float,Normal*) const).
Parameters:
p 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 368 of file primitive.h.

References instance.

virtual void lux::MotionPrimitive::Sample ( const Point p,
float  u1,
float  u2,
float  u3,
DifferentialGeometry dg 
) const [inline, virtual]

Samples a point on this primitive that will be tested for visibility from a given point. Only the p, nn, dpdu, dpdv, u and v need to be calculated.

Parameters:
p The point that will be tested for visibility with the result.
u1 The point coordinate in the first dimension.
u2 The point coordinate in the second dimension.
u3 The subprimitive to sample.
dg The destination to store the sampled point in.

Reimplemented from lux::Primitive.

Definition at line 369 of file primitive.h.

References lux::DifferentialGeometry::dndu, lux::DifferentialGeometry::dndv, lux::DifferentialGeometry::dpdu, lux::DifferentialGeometry::dpdv, lux::Transform::GetInverse(), instance, motionSystem, lux::DifferentialGeometry::nn, lux::Normalize(), lux::DifferentialGeometry::p, lux::MotionSystem::Sample(), and lux::DifferentialGeometry::time.

virtual void lux::MotionPrimitive::Sample ( float  u1,
float  u2,
float  u3,
DifferentialGeometry dg 
) const [inline, virtual]

Samples a point on this primitive. Only the p, nn, dpdu, dpdv, u and v need to be calculated.

Parameters:
u1 The point coordinate in the first dimension.
u2 The point coordinate in the second dimension.
u3 The subprimitive to sample.
dg The destination to store the sampled point in.

Reimplemented from lux::Primitive.

Definition at line 358 of file primitive.h.

References lux::DifferentialGeometry::dndu, lux::DifferentialGeometry::dndv, lux::DifferentialGeometry::dpdu, lux::DifferentialGeometry::dpdv, instance, motionSystem, lux::DifferentialGeometry::nn, lux::Normalize(), lux::DifferentialGeometry::p, lux::MotionSystem::Sample(), and lux::DifferentialGeometry::time.

BBox MotionPrimitive::WorldBound (  )  const [virtual]

Returns the world bounds of this primitive.

Implements lux::Primitive.

Definition at line 238 of file primitive.cpp.

References lux::MotionSystem::Bound(), instance, and motionSystem.


Member Data Documentation

boost::shared_ptr<Primitive> lux::MotionPrimitive::instance [private]

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