GLUS
Functions
glus_plane.c File Reference
#include "GL/glus.h"

Functions

GLUSvoid GLUSAPIENTRY glusPlaneCopyf (GLUSfloat result[4], const GLUSfloat plane[4])
 Copies a plane. More...
 
GLUSvoid GLUSAPIENTRY glusPlaneCreatef (GLUSfloat result[4], const GLUSfloat point[4], const GLUSfloat normal[3])
 Creates a plane. More...
 
GLUSfloat GLUSAPIENTRY glusPlaneDistancePoint4f (const GLUSfloat plane[4], const GLUSfloat point[4])
 Calculates the signed distance from a plane to a point. More...
 
GLUSvoid GLUSAPIENTRY glusPlaneGetPoint4f (GLUSfloat point[4], const GLUSfloat plane[4])
 Calculates a point on the given plane, located around the origin. More...
 

Function Documentation

GLUSvoid GLUSAPIENTRY glusPlaneCopyf ( GLUSfloat  result[4],
const GLUSfloat  plane[4] 
)

Copies a plane.

Parameters
resultDestination plane.
planeSource plane.
GLUSvoid GLUSAPIENTRY glusPlaneCreatef ( GLUSfloat  result[4],
const GLUSfloat  point[4],
const GLUSfloat  normal[3] 
)

Creates a plane.

The formula is Ax + By + Cz + D = 0, where A,B,C and D are stored in the resulting array.

See also
Mathematics For 3D Game Programming & Computer Graphics, Second Edition, Page105
Parameters
resultThe calculated plane.
pointAny point on the plane.
normalThe normal vector of the plane. The vector will be normalized during calculation.
GLUSfloat GLUSAPIENTRY glusPlaneDistancePoint4f ( const GLUSfloat  plane[4],
const GLUSfloat  point[4] 
)

Calculates the signed distance from a plane to a point.

If the value is positive, the point is on the side the normal is directing to.

Parameters
planeThe used plane.
pointThe used point.
Returns
The signed distance.
GLUSvoid GLUSAPIENTRY glusPlaneGetPoint4f ( GLUSfloat  point[4],
const GLUSfloat  plane[4] 
)

Calculates a point on the given plane, located around the origin.

Parameters
pointThe resulting point.
planeThe used plane.