Main Page | Class Hierarchy | Compound List | File List | Compound Members | File Members | Related Pages

plane3 Struct Reference

List of all members.

Detailed Description

A three-dimensional plane.


Public Member Functions

void set (vec3 pa, vec3 pb, vec3 pc)
 Extrapolate plane from a triangle.

void set (vec3[] points)
 Extrapolate plane from a polygon.

void set (vec3 normal, float offset)
 Assign parameters; normal does not have to be a unit vector.

float signedDistance (vec3 vector)
 Return the signed distance from the vector to the plane.

float distance (vec3 vector)
 Return the distance from the vector to the plane.

bit inFront (vec3 vector)
 Return whether this point is in front of the plane.

char[] toString ()
 Return a string representation of the plane, in the form "plane3 ((normal), distance)".

float intersectLineSegment (vec3 a, vec3 b, out vec3 point)
 Get the intersection between a line segment and the plane.

float intersectLineSegment (vec3 a, vec3 b)
 Get the intersection point between a line segment and the plane.

int classify (sphere3 sphere)
 Get the relation between the plane and a sphere.

int classify (vec3 vector)
 Get the relation between the plane and a vector.

int classify (box3 box)
 Get the relation between the plane and an axis-aligned bounding box.


Public Attributes

vec3 normal
 Plane normal.

float offset
 Distance of the plane from origin along the normal.

int i1
 For collision with rays.

int i2
 For collision with rays.


Related Functions

(Note that these are not member functions.)

plane3 aplane3 (vec3 a, vec3 b, vec3 c)
 Create a plane from a triangle.

plane3 aplane3 (vec3 normal, float offset)
 Create a plane from specific parameters; normal does not have to be a unit vector.


Member Function Documentation

int plane3.classify box3  box  ) 
 

Get the relation between the plane and an axis-aligned bounding box.

Parameters:
box The axis-aligned bounding box to test.
Returns:
+1 if the box is fully in front of the plane, 0 if the box is crossing the plane, or -1 if the box is fully behind the plane.

int plane3.classify vec3  vector  ) 
 

Get the relation between the plane and a vector.

Parameters:
vector The vector to test.
Returns:
+1 if the vector is fully in front of the plane, 0 if the vector is on the plane, or -1 if the vector is fully behind the plane.

int plane3.classify sphere3  sphere  ) 
 

Get the relation between the plane and a sphere.

Parameters:
sphere The sphere to test. If it is NAN, the return value is undefined.
Returns:
+1 if the sphere is fully in front of the plane, 0 if the sphere is crossing the plane, or -1 if the sphere is fully behind the plane.

float plane3.intersectLineSegment vec3  a,
vec3  b
 

Get the intersection point between a line segment and the plane.

Parameters:
a The start of the line segment.
b The end of the line segment.
Returns:
Returns the intersection blend - from 0 (meaning a) to 1 (meaning b) - or float.nan if there is no intersection. It returns float.infinity if the line is on the plane.

float plane3.intersectLineSegment vec3  a,
vec3  b,
out vec3  point
 

Get the intersection between a line segment and the plane.

Parameters:
a The start of the line segment.
b The end of the line segment.
point The point of intersection is stored here if the plane intersects the line segment.
Returns:
Returns the intersection blend - from 0 (meaning a) to 1 (meaning b) - or float.nan if there is no intersection. It returns float.infinity if the line is on the plane.


The documentation for this struct was generated from the following file:
Generated on Thu Sep 4 13:12:53 2003 for dig by doxygen 1.3.2