#include <plane.h>
Inheritance diagram for Plane:
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... |
Definition at line 17 of file plane.h.
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:
bool Plane::collides_with | ( | const Ray & | ray, | |
double & | t | |||
) | const [virtual] |
Does the ray passed in collide with this plane?
ray | The ray which is being traced. | |
t | This is z-depth at which 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:
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:
double Plane::m_d [protected] |
Plane::StaticInit Plane::m_init [static, protected] |
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] |