vtdata library
Public Types | Public Member Functions | Public Attributes | List of all members
FPlane Class Reference
Inheritance diagram for FPlane:
Inheritance graph
[legend]

Public Types

enum  IntersectionType {
  COLINEAR, COPLANAR, PARALLEL, FACING_AWAY,
  INTERSECTING
}
 

Public Member Functions

 FPlane (float a, float b, float c, float d)
 Construct from parametric coefficients.
 
 FPlane (const FPoint3 &p, const FPoint3 &q, const FPoint3 &r)
 Construct from three points.
 
 FPlane (const FPoint3 &Point, const FPoint3 &Normal)
 Construct from point and normal vector.
 
const FPlaneoperator= (const FPlane &rhs)
 
void Set (const FPoint3 &p, const FPoint3 &n)
 
void Set (float a, float b, float c, float d)
 
float Distance (const FPoint3 &v) const
 
const IntersectionType Intersection (const FPlane &Plane, FPoint3 &Origin, FPoint3 &Direction, float fEpsilon=0.0) const
 Intersection of two planes. More...
 
const IntersectionType RayIntersection (const FPoint3 &Origin, const FPoint3 &Direction, float &fDistance, FPoint3 &Intersection, float fEpsilon=0.0) const
 Intersection of ray with plane. More...
 
const IntersectionType LineIntersection (const FPoint3 &Origin, const FPoint3 &Direction, FPoint3 &Intersection, float fEpsilon=0.0) const
 Intersection of line with plane.
 
const IntersectionType ThreePlanesIntersection (const FPlane &Plane1, const FPlane &Plane2, FPoint3 &Intersection, float fEpsilon=0.0) const
 Intersection of three planes.
 
- Public Member Functions inherited from FPoint3
 FPoint3 (float fx, float fy, float fz)
 
 FPoint3 (const DPoint3 &p)
 
float Length () const
 
float LengthSquared () const
 
FPoint3Normalize ()
 
FPoint3SetLength (float len)
 
void Set (float fx, float fy, float fz)
 
float Dot (const FPoint3 &rhs) const
 
float Dot (const float *fp) const
 
FPoint3 Cross (const FPoint3 &v) const
 
void UnitNormal (const FPoint3 &p0, const FPoint3 &p1, const FPoint3 &p2)
 
FPoint3operator= (const FPoint3 &v)
 
FPoint3operator= (const DPoint3 &v)
 
FPoint3 operator+ (const FPoint3 &v) const
 
FPoint3 operator- (const FPoint3 &v) const
 
FPoint3 operator* (float s) const
 
FPoint3 operator* (double s) const
 
FPoint3 operator/ (float s) const
 
FPoint3 operator- () const
 
bool operator== (const FPoint3 &v2) const
 
bool operator!= (const FPoint3 &v2) const
 
void operator+= (const FPoint3 &v)
 
void operator-= (const FPoint3 &v)
 
void operator*= (float s)
 
void operator/= (float s)
 
float & operator[] (int nIndex)
 
const float & operator[] (int nIndex) const
 

Public Attributes

float w
 
- Public Attributes inherited from FPoint3
float x
 
float y
 
float z
 

Detailed Description

A class representing an infinite plane, interface single-precision (float).

Member Function Documentation

const FPlane::IntersectionType FPlane::Intersection ( const FPlane Plane,
FPoint3 Origin,
FPoint3 Direction,
float  fEpsilon = 0.0 
) const

Find the intersection of two planes. which in the general case is a line. The line is provided as a ray (origin and direction).

Returns
status, which is either INTERSECTING, COPLANAR, or PARALLEL. In the case of INTERSECTING, then the Origin and Direction parameters describe the line of intersection.
const FPlane::IntersectionType FPlane::RayIntersection ( const FPoint3 Origin,
const FPoint3 Direction,
float &  fDistance,
FPoint3 Intersection,
float  fEpsilon = 0.0 
) const

Compute Ray-Plane intersection.

Parameters
Origin,DirectionThe position and direction that define the ray.
fDistanceThe distance along the ray to the intersection point.
IntersectionThe intersection point.
fEpsilonSmall value to test for numeric equivalenccy.
Returns
The intersection result (PARALLEL, FACING_AWAY, or INTERSECTING)