VecUtil.h File Reference
#include "gcl/Geometry.h"
#include "gcl/Colour.h"
Include dependency graph for VecUtil.h:
Go to the source code of this file.
Functions
return max elt of v.
return min elt of v.
return index of max elt of v.
return index of min elt of v.
place max elts of a and b in c.
place min elts of a and b in c.
equivalents of Elts routines for Colours.
return volume of box defined by min/max.
return surface area of box defined by min/max.
update min/max according to pt.
Test if the point is inside the given triangle. More...
Find a vector that is orthogonal to v. More...
Return random vector with components in [0, 1].
Calculates the refraction vector for the given parameters. More...
Unit square to unit disk transform from Shirley & Chiu. More...
Unit disk to unit square transform from Shirley & Chiu. More...
Project p in direction r on to bounding box min/max. More...
Function Documentation
return surface area of box defined by min/max.
Definition at line 261 of file VecUtil.h.
return volume of box defined by min/max.
Definition at line 252 of file VecUtil.h.
Find triangle normal.
Sets n to the (unnormalised) normal of the triangle defined by
points a, b and c. Effectively returns the sum of the three possible
edge cross-products, for stability. The length of this vector is 2 x
the area of the triangle.
Definition at line 35 of file VecUtil.cc.
place max elts of a and b in c.
Definition at line 214 of file VecUtil.h.
place min elts of a and b in c.
Definition at line 221 of file VecUtil.h.
Find a vector that is orthogonal to v.
Warning: the vector this routine returns is *not*
normalised. (Though the length will be close to 1.)
Definition at line 98 of file VecUtil.h.
equivalents of Elts routines for Colours.
Definition at line 228 of file VecUtil.h.
Int MaxCmptIndex (const Colour & c) [inline]
return max elt of v.
Definition at line 148 of file VecUtil.h.
Int MaxEltIndex (const Vector & v) [inline]
return index of max elt of v.
Definition at line 172 of file VecUtil.h.
Int MinCmptIndex (const Colour & c) [inline]
return min elt of v.
Definition at line 153 of file VecUtil.h.
Int MinEltIndex (const Vector & v) [inline]
return index of min elt of v.
Definition at line 158 of file VecUtil.h.
Intersect plane with ray.
Returns true if given ray intersects the plane specified by d and
normal. (The plane equation is
.) If there is
an intersection, t is set, and the intersection point will be
.
Definition at line 66 of file VecUtil.h.
Test if the point is inside the given triangle.
Given a point lying in the plane of the triangle, we return false
if it lies outside the triangle, and its barycentric coordinates if it
lies inside.
Definition at line 84 of file VecUtil.cc.
Project p in direction r on to bounding box min/max.
Returns t such that this projected point = p + t * r.
Definition at line 291 of file VecUtil.cc.
Return random vector with components in [0, 1].
Definition at line 309 of file VecUtil.cc.
Calculates the refraction vector for the given parameters.
Returns true if total internal reflection occurs.
Definition at line 13 of file VecUtil.cc.
Unit disk to unit square transform from Shirley & Chiu.
-
Parameters:
-
in
a point on radius 1 disk
out
a point in [0,1]^2
Definition at line 248 of file VecUtil.cc.
Unit square to unit disk transform from Shirley & Chiu.
-
Parameters:
-
in
a point in [0,1]^2
out
a point on radius 1 disk
This transforms points on [0,1]^2 to points on unit disk centered at
origin. Each "pie-slice" quadrant of square is handled as a
seperate case. The bad floating point cases are all handled
appropriately. The regions for (a,b) are:
phi = pi/2
-----*-----
|\ /|
| \ 2 / |
| \ / |
phi=pi* 3 * 1 *phi = 0
| / \ |
| / 4 \ |
|/ \|
-----*-----
phi = 3pi/2
Definition at line 179 of file VecUtil.cc.
update min/max according to pt.
Definition at line 54 of file VecUtil.cc.
Generated at Sat Aug 5 00:17:04 2000 for Graphics Class Library by
doxygen 1.1.0 written by Dimitri van Heesch,
© 1997-2000