Contents User Forum Source Index APIs by Task APIs by Level Data


G3D::Plane Class Reference

An infinite 2D plane in 3D space. More...

#include <Plane.h>

List of all members.

Public Member Functions

Vector3 center () const
Vector3 closestPoint (const Vector3 &x) const
void deserialize (class BinaryInput &b)
float distance (const Vector3 &x) const
void flip ()
bool fuzzyContains (const Vector3 &point) const
void getEquation (float &a, float &b, float &c, float &d) const
void getEquation (double &a, double &b, double &c, double &d) const
void getEquation (Vector3 &normal, float &d) const
void getEquation (Vector3 &normal, double &d) const
bool halfSpaceContains (const Vector4 &point) const
bool halfSpaceContains (Vector3 point) const
bool halfSpaceContainsFinite (const Vector3 &point) const
const Vector3normal () const
 Plane (class BinaryInput &b)
 Plane (const Vector3 &__normal, const Vector3 &point)
 Plane (Vector4 point0, Vector4 point1, Vector4 point2)
 Plane (const Vector3 &point0, const Vector3 &point1, const Vector3 &point2)
 Plane ()
void serialize (class BinaryOutput &b) const
std::string toString () const
virtual ~Plane ()

Static Public Member Functions

static Plane fromEquation (float a, float b, float c, float d)


Detailed Description

An infinite 2D plane in 3D space.


Constructor & Destructor Documentation

G3D::Plane::Plane (  )  [inline]

G3D::Plane::Plane ( const Vector3 point0,
const Vector3 point1,
const Vector3 point2 
)

Constructs a plane from three points.

G3D::Plane::Plane ( Vector4  point0,
Vector4  point1,
Vector4  point2 
)

Constructs a plane from three points, where at most two are at infinity (w = 0, not xyz = inf).

G3D::Plane::Plane ( const Vector3 __normal,
const Vector3 point 
)

The normal will be unitized.

G3D::Plane::Plane ( class BinaryInput b  ) 

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


Member Function Documentation

Vector3 G3D::Plane::center (  )  const [inline]

Returns normal * distance from origin.

Vector3 G3D::Plane::closestPoint ( const Vector3 x  )  const [inline]

void G3D::Plane::deserialize ( class BinaryInput b  ) 

float G3D::Plane::distance ( const Vector3 x  )  const [inline]

Returns distance from point to plane.

Distance is negative if point is behind (not in plane in direction opposite normal) the plane.

void G3D::Plane::flip (  ) 

Inverts the facing direction of the plane so the new normal is the inverse of the old normal.

static Plane G3D::Plane::fromEquation ( float  a,
float  b,
float  c,
float  d 
) [static]

bool G3D::Plane::fuzzyContains ( const Vector3 point  )  const [inline]

Returns true if the point is nearly in the plane.

void G3D::Plane::getEquation ( float &  a,
float &  b,
float &  c,
float &  d 
) const

void G3D::Plane::getEquation ( double &  a,
double &  b,
double &  c,
double &  d 
) const

ax + by + cz + d = 0

void G3D::Plane::getEquation ( Vector3 normal,
float &  d 
) const

void G3D::Plane::getEquation ( Vector3 normal,
double &  d 
) const

Returns the equation in the form:.

normal.Dot(Vector3(x, y, z)) + d = 0

bool G3D::Plane::halfSpaceContains ( const Vector4 point  )  const [inline]

Returns true if point is on the side the normal points to or is in the plane.

bool G3D::Plane::halfSpaceContains ( Vector3  point  )  const [inline]

Returns true if point is on the side the normal points to or is in the plane.

bool G3D::Plane::halfSpaceContainsFinite ( const Vector3 point  )  const [inline]

Returns true if point is on the side the normal points to or is in the plane.

Only call on finite points. Faster than halfSpaceContains.

const Vector3& G3D::Plane::normal (  )  const [inline]

void G3D::Plane::serialize ( class BinaryOutput b  )  const

std::string G3D::Plane::toString (  )  const


The documentation for this class was generated from the following file:
Generated on Thu Aug 2 11:40:47 2007 for G3D by doxygen 1.5.2
Hosted by SourceForge.net Logo