UT/UT_Vector3.h File Reference

#include "UT_API.h"
#include <math.h>
#include <limits.h>
#include "UT_Assert.h"
#include "UT_Math.h"
#include <iostream.h>
#include <vector>
#include "UT_Matrix3.h"
#include "UT_Vector4.h"

Go to the source code of this file.

Classes

class  UT_Vector3
 3D Vector class. More...

Functions

UT_Vector3 operator* (const UT_Vector3 &v, const UT_Matrix3 &m)
UT_Vector3 operator* (const UT_Vector3 &v, const UT_DMatrix3 &m)
UT_Vector3 operator* (const UT_Vector3 &v, const UT_Matrix4 &m)
UT_Vector3 operator* (const UT_Vector3 &v, const UT_DMatrix4 &m)
UT_Vector3 operator+ (const UT_Vector3 &v1, const UT_Vector3 &v2)
UT_Vector3 operator- (const UT_Vector3 &v1, const UT_Vector3 &v2)
UT_Vector3 operator+ (const UT_Vector3 &v, fpreal scalar)
UT_Vector3 operator- (const UT_Vector3 &v, fpreal scalar)
UT_Vector3 operator* (const UT_Vector3 &v, fpreal scalar)
UT_Vector3 operator/ (const UT_Vector3 &v, fpreal scalar)
UT_Vector3 operator+ (fpreal scalar, const UT_Vector3 &v)
UT_Vector3 operator- (fpreal scalar, const UT_Vector3 &v)
UT_Vector3 operator* (fpreal scalar, const UT_Vector3 &v)
UT_Vector3 operator/ (fpreal scalar, const UT_Vector3 &v)
UT_Vector3 project (const UT_Vector3 &u, const UT_Vector3 &v)
 The orthogonal projection of a vector u onto a vector v.
fpreal distance3d (const UT_Vector3 &p1, const UT_Vector3 &p2)
 Compute the distance between two points.
fpreal distance2 (const UT_Vector3 &p1, const UT_Vector3 &p2)
 Compute the distance squared.
fpreal segmentPointDist2 (const UT_Vector3 &pos, const UT_Vector3 &pt1, const UT_Vector3 &pt2)
UT_API double intersectLines (const UT_Vector3 &p1, const UT_Vector3 &v1, const UT_Vector3 &p2, const UT_Vector3 &v2, float &t1, float &t2)
UT_API bool intersectSegments (const UT_Vector3 &p0, const UT_Vector3 &p1, const UT_Vector3 &a, const UT_Vector3 &b, float &t)
UT_API UT_Vector2 segmentClosestParallel (const UT_Vector3 &p0, const UT_Vector3 &p1, const UT_Vector3 &a, const UT_Vector3 &b)
UT_API UT_Vector2 segmentClosest (const UT_Vector3 &p0, const UT_Vector3 &p1, const UT_Vector3 &a, const UT_Vector3 &b)
UT_Vector3 operator* (const UT_Vector3 &v1, const UT_Vector3 &v2)
UT_Vector3 operator/ (const UT_Vector3 &v1, const UT_Vector3 &v2)
fpreal dot (const UT_Vector3 &v1, const UT_Vector3 &v2)
 The dot and cross products between two vectors (see operator*() too).
UT_Vector3 cross (const UT_Vector3 &v1, const UT_Vector3 &v2)
 The dot and cross products between two vectors (see operator*() too).
UT_Vector3 rowVecMult (const UT_Vector3 &v, const UT_Matrix3 &m)
UT_Vector3 colVecMult (const UT_Matrix3 &m, const UT_Vector3 &v)
UT_API UT_Vector3 rowVecMult (const UT_Vector3 &v, const UT_DMatrix3 &m)
UT_API UT_Vector3 rowVecMult (const UT_Vector3 &v, const UT_Matrix4 &m)
UT_API UT_Vector3 rowVecMult (const UT_Vector3 &v, const UT_DMatrix4 &m)
UT_API UT_Vector3 colVecMult (const UT_DMatrix3 &m, const UT_Vector3 &v)
UT_API UT_Vector3 colVecMult (const UT_Matrix4 &m, const UT_Vector3 &v)
UT_API UT_Vector3 colVecMult (const UT_DMatrix4 &m, const UT_Vector3 &v)
UT_API UT_Vector3 rowVecMult3 (const UT_Vector3 &v, const UT_Matrix4 &m)
UT_API UT_Vector3 rowVecMult3 (const UT_Vector3 &v, const UT_DMatrix4 &m)
UT_API UT_Vector3 colVecMult3 (const UT_Matrix4 &m, const UT_Vector3 &v)
UT_API UT_Vector3 colVecMult3 (const UT_DMatrix4 &m, const UT_Vector3 &v)


Function Documentation

UT_API UT_Vector3 colVecMult ( const UT_DMatrix4 m,
const UT_Vector3 v 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

UT_API UT_Vector3 colVecMult ( const UT_Matrix4 m,
const UT_Vector3 v 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

UT_API UT_Vector3 colVecMult ( const UT_DMatrix3 m,
const UT_Vector3 v 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

UT_Vector3 colVecMult ( const UT_Matrix3 m,
const UT_Vector3 v 
) [inline]

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

Definition at line 869 of file UT_Vector3.h.

UT_API UT_Vector3 colVecMult3 ( const UT_DMatrix4 m,
const UT_Vector3 v 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

UT_API UT_Vector3 colVecMult3 ( const UT_Matrix4 m,
const UT_Vector3 v 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

UT_Vector3 cross ( const UT_Vector3 v1,
const UT_Vector3 v2 
) [inline]

The dot and cross products between two vectors (see operator*() too).

Definition at line 842 of file UT_Vector3.h.

fpreal distance2 ( const UT_Vector3 p1,
const UT_Vector3 p2 
) [inline]

Compute the distance squared.

Definition at line 908 of file UT_Vector3.h.

fpreal distance3d ( const UT_Vector3 p1,
const UT_Vector3 p2 
) [inline]

Compute the distance between two points.

Examples:
GR/GR_SimpleNoise.C, and VRAY/VRAY_DemoMountain.C.

Definition at line 903 of file UT_Vector3.h.

fpreal dot ( const UT_Vector3 v1,
const UT_Vector3 v2 
) [inline]

The dot and cross products between two vectors (see operator*() too).

Definition at line 836 of file UT_Vector3.h.

UT_API double intersectLines ( const UT_Vector3 p1,
const UT_Vector3 v1,
const UT_Vector3 p2,
const UT_Vector3 v2,
float &  t1,
float &  t2 
)

Intersect the lines p1 + v1 * t1 and p2 + v2 * t2. t1 and t2 are set so that the lines intersect when projected to the plane defined by the two lines. This function returns a value which indicates how close to being parallel the lines are. Closer to zero means more parallel. This is done so that the user of this function can decide what epsilon they want to use.

UT_API bool intersectSegments ( const UT_Vector3 p0,
const UT_Vector3 p1,
const UT_Vector3 a,
const UT_Vector3 b,
float &  t 
)

Returns true if the segments from p0 to p1 and from a to b intersect, and t will contain the parametric value of the intersection on the segment a-b. Otherwise returns false. Parallel segments will return false. T is guaranteed to be between 0.0 and 1.0 if this function returns true.

UT_Vector3 operator* ( const UT_Vector3 v1,
const UT_Vector3 v2 
) [inline]

Definition at line 782 of file UT_Vector3.h.

UT_Vector3 operator* ( fpreal  scalar,
const UT_Vector3 v 
) [inline]

Definition at line 818 of file UT_Vector3.h.

UT_Vector3 operator* ( const UT_Vector3 v,
fpreal  scalar 
) [inline]

Definition at line 812 of file UT_Vector3.h.

UT_Vector3 operator* ( const UT_Vector3 v,
const UT_DMatrix4 m 
) [inline]

Definition at line 897 of file UT_Vector3.h.

UT_Vector3 operator* ( const UT_Vector3 v,
const UT_Matrix4 m 
) [inline]

Definition at line 891 of file UT_Vector3.h.

UT_Vector3 operator* ( const UT_Vector3 v,
const UT_DMatrix3 m 
) [inline]

Definition at line 885 of file UT_Vector3.h.

UT_Vector3 operator* ( const UT_Vector3 v,
const UT_Matrix3 m 
) [inline]

Definition at line 879 of file UT_Vector3.h.

UT_Vector3 operator+ ( fpreal  scalar,
const UT_Vector3 v 
) [inline]

Definition at line 794 of file UT_Vector3.h.

UT_Vector3 operator+ ( const UT_Vector3 v,
fpreal  scalar 
) [inline]

Definition at line 776 of file UT_Vector3.h.

UT_Vector3 operator+ ( const UT_Vector3 v1,
const UT_Vector3 v2 
) [inline]

Definition at line 764 of file UT_Vector3.h.

UT_Vector3 operator- ( fpreal  scalar,
const UT_Vector3 v 
) [inline]

Definition at line 806 of file UT_Vector3.h.

UT_Vector3 operator- ( const UT_Vector3 v,
fpreal  scalar 
) [inline]

Definition at line 800 of file UT_Vector3.h.

UT_Vector3 operator- ( const UT_Vector3 v1,
const UT_Vector3 v2 
) [inline]

Definition at line 770 of file UT_Vector3.h.

UT_Vector3 operator/ ( const UT_Vector3 v1,
const UT_Vector3 v2 
) [inline]

Definition at line 788 of file UT_Vector3.h.

UT_Vector3 operator/ ( fpreal  scalar,
const UT_Vector3 v 
) [inline]

Definition at line 830 of file UT_Vector3.h.

UT_Vector3 operator/ ( const UT_Vector3 v,
fpreal  scalar 
) [inline]

Definition at line 824 of file UT_Vector3.h.

UT_Vector3 project ( const UT_Vector3 u,
const UT_Vector3 v 
) [inline]

The orthogonal projection of a vector u onto a vector v.

Definition at line 853 of file UT_Vector3.h.

UT_API UT_Vector3 rowVecMult ( const UT_Vector3 v,
const UT_DMatrix4 m 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

UT_API UT_Vector3 rowVecMult ( const UT_Vector3 v,
const UT_Matrix4 m 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

UT_API UT_Vector3 rowVecMult ( const UT_Vector3 v,
const UT_DMatrix3 m 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

UT_Vector3 rowVecMult ( const UT_Vector3 v,
const UT_Matrix3 m 
) [inline]

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

Definition at line 859 of file UT_Vector3.h.

UT_API UT_Vector3 rowVecMult3 ( const UT_Vector3 v,
const UT_DMatrix4 m 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

UT_API UT_Vector3 rowVecMult3 ( const UT_Vector3 v,
const UT_Matrix4 m 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult(). The functions that take a 4x4 matrix first extend the vector to 4D (with a trailing 1.0 element).

UT_API UT_Vector2 segmentClosest ( const UT_Vector3 p0,
const UT_Vector3 p1,
const UT_Vector3 a,
const UT_Vector3 b 
)

Returns the U coordinates of the closest points on each of the two line segments

UT_API UT_Vector2 segmentClosestParallel ( const UT_Vector3 p0,
const UT_Vector3 p1,
const UT_Vector3 a,
const UT_Vector3 b 
)

Returns the U coordinates of the closest points on each of the two parallel line segments

fpreal segmentPointDist2 ( const UT_Vector3 pos,
const UT_Vector3 pt1,
const UT_Vector3 pt2 
) [inline]

Definition at line 915 of file UT_Vector3.h.


Generated on Thu May 24 00:09:05 2012 for HDK by  doxygen 1.5.9