Plane Class Reference

#include <plane.h>

Inheritance diagram for Plane:

Inheritance graph
[legend]
Collaboration diagram for Plane:

Collaboration graph
[legend]
List of all members.

Public Member Functions

virtual bool collides_with (const Ray &ray, double &t) const
virtual Ray get_normal (const Point3D &p) const
 Returns the surface normal at point p.
 Plane (Point3D p0, Point3D p1, Point3D p2, std::string color, std::string material, std::string bumpmap)
 Creates a new plane defined by three points in 3-space.
virtual ~Plane ()

Protected Attributes

double m_d
Ray m_normal
Point3D m_point

Static Protected Attributes

static StaticInit m_init
 Force static initialization.

Classes

class  StaticInit
 Fake a static initializer. More...

Detailed Description

Definition at line 17 of file plane.h.


Constructor & Destructor Documentation

Plane::Plane ( Point3D  p0,
Point3D  p1,
Point3D  p2,
std::string  color,
std::string  material,
std::string  bumpmap 
)

Creates a new plane defined by three points in 3-space.

Definition at line 13 of file plane.cpp.

References cross_product(), Ray::direction(), dot_product(), Scene::get_instance(), Renderable::m_bumpmap, m_d, Renderable::m_material, m_normal, and m_point.

Here is the call graph for this function:

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

Definition at line 44 of file plane.h.


Member Function Documentation

bool Plane::collides_with ( const Ray ray,
double &  t 
) const [virtual]

Does the ray passed in collide with this plane?

Parameters:
ray The ray which is being traced.
t This is z-depth at which the ray collides with the plane.
Returns:
True if the ray collides with the plane.

Implements Renderable.

Definition at line 26 of file plane.cpp.

References Ray::direction(), dot_product(), m_d, m_normal, and Ray::origin().

Here is the call graph for this function:

Ray Plane::get_normal ( const Point3D p  )  const [virtual]

Returns the surface normal at point p.

Implements Renderable.

Definition at line 51 of file plane.cpp.

References Ray::direction(), and m_normal.

Here is the call graph for this function:


Member Data Documentation

double Plane::m_d [protected]

Definition at line 35 of file plane.h.

Referenced by collides_with(), and Plane().

Plane::StaticInit Plane::m_init [static, protected]

Force static initialization.

Definition at line 29 of file plane.h.

Ray Plane::m_normal [protected]

The normal of a plane is always the same so this stores it so we only have to calculate it once.

Definition at line 33 of file plane.h.

Referenced by collides_with(), get_normal(), and Plane().

Point3D Plane::m_point [protected]

Definition at line 34 of file plane.h.

Referenced by Plane().


The documentation for this class was generated from the following files:
Generated on Tue Oct 30 22:12:22 2007 for mbrt by  doxygen 1.5.2