Intersectable Class Reference

Interface for an intersectable object in 3-space, with some extra functionality specific to accelerating spatial intersection queries. More...

#include <Intersectable.h>

Inheritance diagram for Intersectable:

MeshTriangle Shape MeshTriangleFast Camera Transformable ThinLensCamera Blob Implicit InstancedShape Mesh PointShape ShapeSet Triangle

List of all members.

Public Member Functions

Constructors
 Intersectable ()
virtual ~Intersectable ()
Initialization
virtual void init ()
 Initializes this Intersectable for fast intersection testing.
Main usage interface
virtual real_t getIntersection (const Ray &ray, SurfacePoint &pt)=0
 Tests the given ray with this object for intersection. If a valid intersection exists, its "t" value will be returned and the given SurfacePoint will be initialized with enough data for this object to later fill in all relevant information lazily (world space normal at intersection point, uv coordinates, etc.).
virtual bool intersects (const Ray &ray, real_t tMax=INFINITY)
 Used for occlusion/visibility testing where you don't necessarily care about anything other than whether or not an intersection exists. (generally faster than getIntersection).
Accessors
virtual AABB getAABB () const =0
real_t getMin (unsigned dim) const
real_t getMax (unsigned dim) const

Public Attributes

Fast-access public data
unsigned int rayID


Detailed Description

Interface for an intersectable object in 3-space, with some extra functionality specific to accelerating spatial intersection queries.

Author:
Travis Fischer (fisch0920@gmail.com)

Matthew Jacobs (jacobs.mh@gmail.com)

Date:
Fall 2008

Definition at line 23 of file Intersectable.h.


Constructor & Destructor Documentation

Intersectable::Intersectable (  )  [inline]

Definition at line 39 of file Intersectable.h.

virtual Intersectable::~Intersectable (  )  [inline, virtual]

Definition at line 43 of file Intersectable.h.


Member Function Documentation

void Intersectable::init (  )  [virtual]

Initializes this Intersectable for fast intersection testing.

Note:
default implementation is empty

must be called before getIntersection or intersects

Reimplemented in Blob, Implicit, InstancedShape, Mesh, MeshTriangleFast, Plane, PointShape, Shape, ShapeSet, Transformable, and Triangle.

Definition at line 15 of file Intersectable.cpp.

virtual real_t Intersectable::getIntersection ( const Ray ray,
SurfacePoint pt 
) [pure virtual]

Tests the given ray with this object for intersection. If a valid intersection exists, its "t" value will be returned and the given SurfacePoint will be initialized with enough data for this object to later fill in all relevant information lazily (world space normal at intersection point, uv coordinates, etc.).

Note:
if you only care about whether or not an intersection exists and don't actually need to know the exact intersection point, see the intersects method instead.
Returns:
the smallest positive "t" value of any intersections found, or INFINITY if no valid intersection exists

Implemented in ThinLensCamera, Blob, Cone, Cube, Cylinder, InstancedShape, Mesh, MeshTriangle, MeshTriangleFast, Plane, PointShape, ShapeSet, Sphere, and Triangle.

bool Intersectable::intersects ( const Ray ray,
real_t  tMax = INFINITY 
) [virtual]

Used for occlusion/visibility testing where you don't necessarily care about anything other than whether or not an intersection exists. (generally faster than getIntersection).

Note:
default implementation defers to getIntersection
Returns:
whether or not the given ray intersects this object with a positive "t" value greater than EPSILON and less than the given tMax

Reimplemented in Blob, Cone, Cube, Cylinder, InstancedShape, Mesh, Plane, PointShape, ShapeSet, and Sphere.

Definition at line 19 of file Intersectable.cpp.

virtual AABB Intersectable::getAABB (  )  const [pure virtual]

Implemented in Blob, MeshTriangle, and Shape.

real_t Intersectable::getMin ( unsigned  dim  )  const [inline]

Definition at line 101 of file Intersectable.h.

real_t Intersectable::getMax ( unsigned  dim  )  const [inline]

Definition at line 105 of file Intersectable.h.


Member Data Documentation

unsigned int Intersectable::rayID

for 'mailboxing' intersection tests to speed up traversal of kdTreeAccel by ensuring that large primitives which may lie in more than one voxel are only tested for intersection once-per-ray for more info, search the raytracing literature for mailboxing

Definition at line 32 of file Intersectable.h.


The documentation for this class was generated from the following files:

Generated on 28 Feb 2009 for Milton by doxygen 1.5.6