#include <cugl.h>
Public Member Functions  
Plane (GLfloat a=0, GLfloat b=1, GLfloat c=0, GLfloat d=0)  
Plane (Point &p, Point &q, Point &r)  
Plane (Line &s, Point &p)  
Plane (Vector &v, Point &p)  
void  normalize () 
Plane  unit () const 
Vector  normal () const 
void  clipPlane (GLenum index) const 
Private Attributes  
GLfloat  a 
GLfloat  b 
GLfloat  c 
GLfloat  d 
Friends  
class  Matrix 
Point  meet (Line &k, Plane &p) 
bool  operator== (const Plane &x, const Plane &y) 
bool  operator!= (const Plane &x, const Plane &y) 
std::ostream &  operator<< (std::ostream &os, Plane &p) 
GLfloat  dist (const Point &p, const Plane &s) 
GLfloat  dist (const Plane &s, const Point &p) 
Planes are used for clipping, shadows, and reflections (see class Matrix).
Homogeneous points (x,y,z,w) lie on the plane if Ax+By+Cz+Dw=0. The notation for a plane is <A,B,C,D>. The plane <0,0,0,D> is undefined. An attempt to construct such a plane sets the error flag to BAD_PLANE and the plane is set to <0,1,0,0> (in the conventional OpenGL frame, this often corresponds to the ground, y=0).
A Plane is in normal form if the Vector (A,B,C) is a unit vector. A Plane can be normalized by scaling A,B,C,D.
Definition at line 432 of file cugl.h.
cugl::Plane::Plane  (  GLfloat  a = 0 , 

GLfloat  b = 1 , 

GLfloat  c = 0 , 

GLfloat  d = 0  
) 
Construct a plane given the coefficients of its equation Ax+By+Cx+D=0. If no arguments are provided, construct the plane y = 0.
Construct a plane containing the three given points.
Construct the plane orthogonal to v
and passing through p
.
void cugl::Plane::normalize  (  ) 
Plane cugl::Plane::unit  (  )  const 
Vector cugl::Plane::normal  (  )  const [inline] 
void cugl::Plane::clipPlane  (  GLenum  index  )  const 
Use this plane as a clipping plane. This function calls glClipPlane
to suppress rendering of objects on one side of the plane.
index  must be one of GL_CLIP_PLANE0, GL_CLIP_PLANE1, ... A An implementation of OpenGL is supposed to provide at least six clipping planes, numbered 0,1,...,5. 
std::ostream& operator<<  (  std::ostream &  os,  
Plane &  p  
)  [friend] 
Write a description of the plane to the output stream as <a,b,c,d>. Inserts the components of the plane into the output stream os
in the format <a,b,c,d>. The current settings of the stream formatting parameters are used. If a width is specified with setw()
, it is applied to each component rather than to the plane as a whole.
Return the distance between a Point and a Plane. The result has the correct magnitude only if the Point and the Plane are both in normal form. In particular, the result is incorrect if the Point is at infinity. However, the sign of the result is correct in all cases, and so it is not necessary to provide normalized arguments if only the sign is important.
Return the distance between a Point and a Plane. The result has the correct magnitude only if the Point and the Plane are both in normal form. In particular, the result is incorrect if the Point is at infinity. However, the sign of the result is correct in all cases, and so it is not necessary to provide normalized arguments if only the sign is important.
GLfloat cugl::Plane::a [private] 
Coefficient of x in the plane equation.
Definition at line 542 of file cugl.h.
Referenced by cugl::dist(), normal(), and cugl::operator==().
GLfloat cugl::Plane::b [private] 
Coefficient of y in the plane equation.
Definition at line 545 of file cugl.h.
Referenced by cugl::dist(), normal(), and cugl::operator==().
GLfloat cugl::Plane::c [private] 
Coefficient of z in the plane equation.
Definition at line 548 of file cugl.h.
Referenced by cugl::dist(), normal(), and cugl::operator==().
GLfloat cugl::Plane::d [private] 
Coefficient of w in the plane equation.
Definition at line 551 of file cugl.h.
Referenced by cugl::dist(), and cugl::operator==().