Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

Plane Class Reference

#include <plane.h>

List of all members.

Public Methods

 Plane ()
 Plane (VECTOR n, VECTOR p)
 ~Plane ()
float Distance (VECTOR x)
bool Intersection (VECTOR ray_point, VECTOR ray_dir, VECTOR *res)

Public Attributes

VECTOR normal
VECTOR point
float dist


Constructor & Destructor Documentation

Plane::Plane  
 

plane.cpp implementiert eine einfache ebenen Klasse inklusive einer Ebene-Strahl-schnitt Methode

Definition at line 6 of file plane.cpp.

References dist, normal, and point.

00006              {
00007         normal = VECTOR(0,0,0);
00008         point = VECTOR(0,0,0);
00009         dist = 0.0;
00010 }

Plane::Plane VECTOR    n,
VECTOR    p
 

Definition at line 12 of file plane.cpp.

References dist, VECTOR::dot(), normal, and point.

00012                                {
00013         normal = n;
00014         point = p;
00015         dist = -normal.dot(point);
00016 }

Plane::~Plane   [inline]
 

Definition at line 13 of file plane.h.

00013 {};


Member Function Documentation

float Plane::Distance VECTOR    x
 

Definition at line 19 of file plane.cpp.

References VECTOR::dot(), normal, and point.

00019                         {
00020         VECTOR help = x - point;
00021         return fabsf(normal.dot(point));
00022 }

bool Plane::Intersection VECTOR    ray_point,
VECTOR    ray_dir,
VECTOR   res
 

Definition at line 25 of file plane.cpp.

References dist, and VECTOR::dot().

00025                                                                  {
00026         float dir_norm = ray_dir.dot(normal);
00027         if (fabsf(dir_norm) < 0.001) return false; // parallel
00028         float t = -(ray_point.dot(normal)+dist)/(dir_norm);
00029         *res = ray_point + t*ray_dir;
00030         return true;
00031 }


Member Data Documentation

float Plane::dist
 

Definition at line 10 of file plane.h.

Referenced by Intersection(), and Plane().

VECTOR Plane::normal
 

Definition at line 8 of file plane.h.

Referenced by Distance(), Plane(), and Raycaster::Raycast().

VECTOR Plane::point
 

Definition at line 9 of file plane.h.

Referenced by Distance(), and Plane().


The documentation for this class was generated from the following files:
Generated on Thu Jan 30 21:35:44 2003 for 3DVis by doxygen1.3-rc2