Go to the source code of this file.
Functions |
|
GEOMEXPORT Point3 | BaryCoords (Point3 p0, Point3 p1, Point3 p2, Point3 p) |
Calculates the barycentric coordinates of
the point p in 3-dimensional space according to a reference
triangle indicated by its three vertices p0, p1 and p2. |
|
GEOMEXPORT Point3 | BaryCoords (Point2 p0, Point2 p1, Point2 p2, Point2 p) |
Calculates the barycentric coordinates of
the point p in 2-dimensional space according to a reference
triangle indicated by its three vertices p0, p1 and p2. |
|
GEOMEXPORT BOOL | RayHitsBox (Ray &ray, Box3 &b) |
Checks if the given ray intersects a
three-dimensional box. |
|
GEOMEXPORT float | DistPtToLine (Point2 *p0, Point2 *p1, Point2 *q) |
Calculates the distance of a given point
from a line in two dimensions. |
|
GEOMEXPORT float | Dist3DPtToLine (Point3 *p0, Point3 *p1, Point3 *q) |
Calculates the distance of a given point
from a line in three dimensions. |
|
GEOMEXPORT void | ComputeBumpVectors (const Point3 tv[3], const Point3 v[3], Point3 bvec[3]) |
GEOMEXPORT void | ComputeBumpVec2D (int axis, const Point3 tv[3], const Point3 v[3], Point3 bvec[2]) |
Computes the 2 Bump basis vectors from the
UV, VW, or WU at a triangle. |
|
GEOMEXPORT void | ComputeTangentAndBinormal (const Point3 tv[3], const Point3 v[3], Point3 bvec[2]) |
Computes the bump basis vector for the U
texture channel (called the tangent), and the cross product of the
surface normal with the tangent (called the binormal). |
|
GEOMEXPORT ULONG | CompressNormal (Point3 p) |
Low precision compression of a vector from
12 bytes to 4 bytes. |
|
GEOMEXPORT Point3 | DeCompressNormal (ULONG n) |
Decompresses a vector that was compressed
using CompressNormal().
|
|
GEOMEXPORT void | ArbAxis (const Point3 &zAxis, Matrix3 &matrix) |
Creates an arbitrary axis system given an up
vector that conforms to the AutoCAD algorithm. |
Calculates the barycentric coordinates of the point p in 3-dimensional space according to a reference triangle indicated by its three vertices p0, p1 and p2.
p0,p1,p2 | The three vertices of the reference triangle in 3-dimensional space. |
p | The point for which the barycentric coordinates should be calculated. |
Calculates the barycentric coordinates of the point p in 2-dimensional space according to a reference triangle indicated by its three vertices p0, p1 and p2.
p0,p1,p2 | The three vertices of the reference triangle in 2-dimensional space. |
p | The point for which the barycentric coordinates should be calculated. |
Checks if the given ray intersects a three-dimensional box.
ray | The ray |
b | The box |
true
if the ray intersects the box,
false
otherwise.Calculates the distance of a given point from a line in two dimensions.
p0,p1 | Pointers to the two 2-dimensional points with which the line is defined. |
q | Pointer to the 2-dimensional point whose distance from the line should be calculated. |
Calculates the distance of a given point from a line in three dimensions.
p0,p1 | Pointers to the two 3-dimensional points with which the line is defined. |
q | Pointer to the 3-dimensional point whose distance from the line should be calculated. |
Use ComputeBumpVec2D() instead. This is here for compatibility only.
Computes the 3 bump basis vectors from the UVW coordinates of the triangle.
tv | Texture coordinates at 3 triangle vertices | |
v | Coordinates of triangle vertices (usually in camera space). | |
[out] | bvec | The 3 bump basis vectors (normalized) corresponding to the U,V,and W axes. |
GEOMEXPORT void ComputeBumpVec2D | ( | int | axis, |
const Point3 | tv[3], | ||
const Point3 | v[3], | ||
Point3 | bvec[2] | ||
) |
Computes the 2 Bump basis vectors from the UV, VW, or WU at a triangle.
axis | Either AXIS_UV, AXIS_VW, or AXIS_WU . | |
tv | Texture coordinates at 3 triangle vertices. | |
v | Coordinates of triangle vertices (usually in camera space) | |
[out] | bvec | The 2 normalized bump basis vectors corresponding to the specified axes. |
Computes the bump basis vector for the U texture channel (called the tangent), and the cross product of the surface normal with the tangent (called the binormal).
These along with the surface normal are used as the basis vectors for normal mapping.
tv | Texture coordinates at 3 triangle vertices. | |
v | Coordinates of triangle vertices (usually in camera space) | |
[out] | bvec | The 2 normalized bump basis vectors corresponding to the specified axes. |
GEOMEXPORT ULONG CompressNormal | ( | Point3 | p | ) |
Low precision compression of a vector from 12 bytes to 4 bytes.
Only accurate to 1 part in 512. This is commonly used to compress normals. The vector has to be <= 1.0 in length.
p | The decompressed vector. |
GEOMEXPORT Point3 DeCompressNormal | ( | ULONG | n | ) |
Decompresses a vector that was compressed using CompressNormal().
This function may also be used to decompress a surface normal from the G-Buffer using the BMM_CHAN_NORMAL channel. The decompressed vector has absolute error <.001 in each component.
n | A vector compressed using CompressNormal() |
Creates an arbitrary axis system given an up vector that conforms to the AutoCAD algorithm.
zAxis | The up vector. | |
[out] | matrix | The new axis system. |