newspeoplefor developersdocumentationdownloads

plane Class Reference
[Math Data Types]

#include <plane.h>

List of all members.


Detailed Description

A plane in 3d space.

(C) 2004 RadonLabs GmbH

Definition at line 16 of file plane.h.


Public Member Functions

 plane ()
 default constructor
 plane (float A, float B, float C, float D)
 constructor 1
 plane (const plane &p)
 constructor 2
 plane (const vector3 &v0, const vector3 &v1, const vector3 &v2)
 constructor 3
void set (float A, float B, float C, float D)
 set contents
void set (const vector3 &v0, const vector3 &v1, const vector3 &v2)
 construct plane from 3 vectors
float distance (const vector3 &v) const
 compute distance of point to plane
vector3 normal () const
 get plane normal
bool intersect (const line3 &l, float &t) const
 get intersecting t of line with one sided plane
bool intersect (const plane &p, line3 &l) const
 get plane/plane intersection

Public Attributes

float a
float b
float c
float d

Constructor & Destructor Documentation

plane::plane  )  [inline]
 

default constructor

Definition at line 47 of file plane.h.

plane::plane float  A,
float  B,
float  C,
float  D
[inline]
 

constructor 1

Definition at line 60 of file plane.h.

plane::plane const plane p  )  [inline]
 

constructor 2

Definition at line 73 of file plane.h.

plane::plane const vector3 v0,
const vector3 v1,
const vector3 v2
[inline]
 

constructor 3

Definition at line 115 of file plane.h.


Member Function Documentation

void plane::set float  A,
float  B,
float  C,
float  D
[inline]
 

set contents

Definition at line 87 of file plane.h.

void plane::set const vector3 v0,
const vector3 v1,
const vector3 v2
[inline]
 

construct plane from 3 vectors

Constructs a plane from 3 position vectors.

Definition at line 101 of file plane.h.

float plane::distance const vector3 v  )  const [inline]
 

compute distance of point to plane

Computes the distance of a point to the plane. Return 0.0 if the point is on the plane.

Definition at line 127 of file plane.h.

vector3 plane::normal  )  const [inline]
 

get plane normal

Returns the plane normal.

Definition at line 138 of file plane.h.

bool plane::intersect const line3 l,
float &  t
const [inline]
 

get intersecting t of line with one sided plane

Get intersecting t of line with one-sided plane. Returns false if the line is parallel to the plane.

If the given line intersects with the plane, plugging the value t into the line equation produces the point of intersection.

The following code snippet shows the way to get the intersection point between a line and a plane:

    if (p.intersect(l, t))
    {
        vector3 intersection = l.b + t*l.m;
    }

Definition at line 162 of file plane.h.

bool plane::intersect const plane p,
line3 l
const [inline]
 

get plane/plane intersection

Get plane/plane intersection. Return false if planes are parallel.

Definition at line 183 of file plane.h.


Member Data Documentation

float plane::a
 

Definition at line 40 of file plane.h.

float plane::b
 

Definition at line 40 of file plane.h.

float plane::c
 

Definition at line 40 of file plane.h.

float plane::d
 

Definition at line 40 of file plane.h.


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

Copyright © 1999-2005 by the contributing authors. Ideas, requests, problems: Send feedback.