CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

csDPlane Class Reference
[Geometry utilities]

A plane in 3D space. More...

#include <csgeom/math3d_d.h>

List of all members.

Public Member Functions

 csDPlane ()
 Initialize to the xy plane.
 csDPlane (const csDVector3 &plane_norm, double d=0)
 Initialize the plane.
 csDPlane (double a, double b, double c, double d=0)
 Initialize the plane.
csDVector3Normal ()
 Return the normal vector of this plane.
const csDVector3Normal () const
 Return the normal vector of this plane.
double A () const
 Return the A component of this plane.
double B () const
 Return the B component of this plane.
double C () const
 Return the C component of this plane.
double D () const
 Return the D component of this plane.
double & A ()
 Return the A component of this plane.
double & B ()
 Return the B component of this plane.
double & C ()
 Return the C component of this plane.
double & D ()
 Return the D component of this plane.
void Set (double a, double b, double c, double d)
 Set the value of the four plane components.
double Classify (const csDVector3 &pt) const
 Classify the given vector with regards to this plane.
double Distance (const csDVector3 &pt) const
 Compute the distance from the given vector to this plane.
void Invert ()
 Reverses the direction of the plane while maintianing the plane itself.
void Normalize ()
 Normalizes the plane equation so that 'norm' is a unit vector.

Static Public Member Functions

double Classify (double A, double B, double C, double D, const csDVector3 &pt)
 Classify a vector with regards to four plane components.

Public Attributes

csDVector3 norm
 The normal vector (or the (A,B,C) components).
double DD
 The D component of the plane.


Detailed Description

A plane in 3D space.

The plane is given by the equation AAx + BBy + CCz + DD = 0, Where (AA,BB,CC) is given by the vector 'norm'.

Definition at line 357 of file math3d_d.h.


Constructor & Destructor Documentation

csDPlane::csDPlane  )  [inline]
 

Initialize to the xy plane.

Definition at line 367 of file math3d_d.h.

References DD, and norm.

csDPlane::csDPlane const csDVector3 plane_norm,
double  d = 0
[inline]
 

Initialize the plane.

Definition at line 370 of file math3d_d.h.

References DD, and norm.

csDPlane::csDPlane double  a,
double  b,
double  c,
double  d = 0
[inline]
 

Initialize the plane.

Definition at line 374 of file math3d_d.h.

References DD, and norm.


Member Function Documentation

double& csDPlane::A  )  [inline]
 

Return the A component of this plane.

Definition at line 391 of file math3d_d.h.

References norm, and csDVector3::x.

double csDPlane::A  )  const [inline]
 

Return the A component of this plane.

Definition at line 382 of file math3d_d.h.

References norm, and csDVector3::x.

double& csDPlane::B  )  [inline]
 

Return the B component of this plane.

Definition at line 393 of file math3d_d.h.

References norm, and csDVector3::y.

double csDPlane::B  )  const [inline]
 

Return the B component of this plane.

Definition at line 384 of file math3d_d.h.

References norm, and csDVector3::y.

double& csDPlane::C  )  [inline]
 

Return the C component of this plane.

Definition at line 395 of file math3d_d.h.

References norm, and csDVector3::z.

double csDPlane::C  )  const [inline]
 

Return the C component of this plane.

Definition at line 386 of file math3d_d.h.

References norm, and csDVector3::z.

double csDPlane::Classify double  A,
double  B,
double  C,
double  D,
const csDVector3 pt
[inline, static]
 

Classify a vector with regards to four plane components.

Definition at line 407 of file math3d_d.h.

References csDVector3::x, csDVector3::y, and csDVector3::z.

double csDPlane::Classify const csDVector3 pt  )  const [inline]
 

Classify the given vector with regards to this plane.

Definition at line 404 of file math3d_d.h.

References norm.

Referenced by Distance(), csDSquaredDist::PointPlane(), and csDMath3::Visible().

double& csDPlane::D  )  [inline]
 

Return the D component of this plane.

Definition at line 397 of file math3d_d.h.

double csDPlane::D  )  const [inline]
 

Return the D component of this plane.

Definition at line 388 of file math3d_d.h.

double csDPlane::Distance const csDVector3 pt  )  const [inline]
 

Compute the distance from the given vector to this plane.

This function assumes that 'norm' is a unit vector. If not, the function returns distance times the magnitude of 'norm'.

Definition at line 416 of file math3d_d.h.

References Classify().

void csDPlane::Invert  )  [inline]
 

Reverses the direction of the plane while maintianing the plane itself.

Definition at line 420 of file math3d_d.h.

References DD, and norm.

const csDVector3& csDPlane::Normal  )  const [inline]
 

Return the normal vector of this plane.

Definition at line 379 of file math3d_d.h.

csDVector3& csDPlane::Normal  )  [inline]
 

Return the normal vector of this plane.

Definition at line 377 of file math3d_d.h.

void csDPlane::Normalize  )  [inline]
 

Normalizes the plane equation so that 'norm' is a unit vector.

Definition at line 423 of file math3d_d.h.

References DD, csDVector3::Norm(), and norm.

void csDPlane::Set double  a,
double  b,
double  c,
double  d
[inline]
 

Set the value of the four plane components.

Definition at line 400 of file math3d_d.h.

References DD, norm, csDVector3::x, csDVector3::y, and csDVector3::z.


Member Data Documentation

double csDPlane::DD
 

The D component of the plane.

Definition at line 364 of file math3d_d.h.

Referenced by csDPlane(), Invert(), Normalize(), csDMath3::PlanesEqual(), and Set().

csDVector3 csDPlane::norm
 

The normal vector (or the (A,B,C) components).

Definition at line 361 of file math3d_d.h.

Referenced by A(), B(), C(), Classify(), csDPlane(), Invert(), Normalize(), csDMath3::PlanesEqual(), and Set().


The documentation for this class was generated from the following file:
Generated for Crystal Space by doxygen 1.3.9.1