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_VectorTypes.h"
#include "UT_Matrix3.h"
#include "UT_Matrix4.h"
#include "UT_Vector4.h"

Go to the source code of this file.

Classes

class  UT_Vector3T< T >
 3D Vector class. More...

Functions

template<typename T , typename S >
UT_Vector3T< T > operator* (const UT_Vector3T< T > &v, const UT_Matrix3T< S > &m)
template<typename T , typename S >
UT_Vector3T< T > operator* (const UT_Vector3T< T > &v, const UT_Matrix4T< S > &m)
template<typename T >
UT_Vector3T< T > operator+ (const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2)
template<typename T >
UT_Vector3T< T > operator- (const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2)
template<typename T , typename S >
UT_Vector3T< T > operator+ (const UT_Vector3T< T > &v, S scalar)
template<typename T , typename S >
UT_Vector3T< T > operator- (const UT_Vector3T< T > &v, S scalar)
template<typename T , typename S >
UT_Vector3T< T > operator* (const UT_Vector3T< T > &v, S scalar)
template<typename T , typename S >
UT_Vector3T< T > operator/ (const UT_Vector3T< T > &v, S scalar)
template<typename T , typename S >
UT_Vector3T< T > operator+ (S scalar, const UT_Vector3T< T > &v)
template<typename T , typename S >
UT_Vector3T< T > operator- (S scalar, const UT_Vector3T< T > &v)
template<typename T , typename S >
UT_Vector3T< T > operator* (S scalar, const UT_Vector3T< T > &v)
template<typename T , typename S >
UT_Vector3T< T > operator/ (S scalar, const UT_Vector3T< T > &v)
template<typename T >
UT_Vector3T< T > project (const UT_Vector3T< T > &u, const UT_Vector3T< T > &v)
 The orthogonal projection of a vector u onto a vector v.
template<typename T >
distance3d (const UT_Vector3T< T > &p1, const UT_Vector3T< T > &p2)
 Compute the distance between two points.
template<typename T >
distance2 (const UT_Vector3T< T > &p1, const UT_Vector3T< T > &p2)
 Compute the distance squared.
template<typename T >
segmentPointDist2 (const UT_Vector3T< T > &pos, const UT_Vector3T< T > &pt1, const UT_Vector3T< T > &pt2)
template<typename T >
UT_API double intersectLines (const UT_Vector3T< T > &p1, const UT_Vector3T< T > &v1, const UT_Vector3T< T > &p2, const UT_Vector3T< T > &v2, T &t1, T &t2)
template<typename T >
UT_API bool intersectSegments (const UT_Vector3T< T > &p0, const UT_Vector3T< T > &p1, const UT_Vector3T< T > &a, const UT_Vector3T< T > &b, T &t)
template<typename T >
UT_API UT_Vector2T< T > segmentClosestParallel (const UT_Vector3T< T > &p0, const UT_Vector3T< T > &p1, const UT_Vector3T< T > &a, const UT_Vector3T< T > &b)
template<typename T >
UT_API UT_Vector2T< T > segmentClosest (const UT_Vector3T< T > &p0, const UT_Vector3T< T > &p1, const UT_Vector3T< T > &a, const UT_Vector3T< T > &b)
template<typename T >
UT_Vector3T< T > operator* (const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2)
template<typename T >
UT_Vector3T< T > operator/ (const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2)
template<typename T >
dot (const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2)
 The dot and cross products between two vectors (see operator*() too).
template<typename T >
UT_Vector3T< T > cross (const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2)
 The dot and cross products between two vectors (see operator*() too).
template<typename T , typename S >
UT_Vector3T< T > rowVecMult (const UT_Vector3T< T > &v, const UT_Matrix3T< S > &m)
template<typename T , typename S >
UT_Vector3T< T > colVecMult (const UT_Matrix3T< S > &m, const UT_Vector3T< T > &v)
template<typename T , typename S >
UT_Vector3T< T > rowVecMult (const UT_Vector3T< T > &v, const UT_Matrix4T< S > &m)
template<typename T , typename S >
UT_Vector3T< T > colVecMult (const UT_Matrix4T< S > &m, const UT_Vector3T< T > &v)
template<typename T , typename S >
UT_Vector3T< T > rowVecMult3 (const UT_Vector3T< T > &v, const UT_Matrix4T< S > &m)
template<typename T , typename S >
UT_Vector3T< T > colVecMult3 (const UT_Matrix4T< S > &m, const UT_Vector3T< T > &v)


Function Documentation

template<typename T , typename S >
UT_Vector3T< T > colVecMult ( const UT_Matrix4T< S > &  m,
const UT_Vector3T< T > &  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 921 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > colVecMult ( const UT_Matrix3T< S > &  m,
const UT_Vector3T< T > &  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 888 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > colVecMult3 ( const UT_Matrix4T< S > &  m,
const UT_Vector3T< T > &  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 932 of file UT_Vector3.h.

template<typename T >
UT_Vector3T< T > cross ( const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  v2 
) [inline]

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

Definition at line 858 of file UT_Vector3.h.

template<typename T >
T distance2 ( const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  p2 
) [inline]

Compute the distance squared.

Definition at line 964 of file UT_Vector3.h.

template<typename T >
T distance3d ( const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  p2 
) [inline]

Compute the distance between two points.

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

Definition at line 958 of file UT_Vector3.h.

template<typename T >
T dot ( const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  v2 
) [inline]

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

Definition at line 851 of file UT_Vector3.h.

template<typename T >
UT_API double intersectLines ( const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  p2,
const UT_Vector3T< T > &  v2,
T &  t1,
T &  t2 
) [inline]

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.

template<typename T >
UT_API bool intersectSegments ( const UT_Vector3T< T > &  p0,
const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  a,
const UT_Vector3T< T > &  b,
T &  t 
) [inline]

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.

template<typename T >
UT_Vector3T<T> operator* ( const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  v2 
) [inline]

Definition at line 785 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > operator* ( scalar,
const UT_Vector3T< T > &  v 
) [inline]

Definition at line 827 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > operator* ( const UT_Vector3T< T > &  v,
scalar 
) [inline]

Definition at line 820 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > operator* ( const UT_Vector3T< T > &  v,
const UT_Matrix4T< S > &  m 
) [inline]

Definition at line 951 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > operator* ( const UT_Vector3T< T > &  v,
const UT_Matrix3T< S > &  m 
) [inline]

Definition at line 944 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > operator+ ( scalar,
const UT_Vector3T< T > &  v 
) [inline]

Definition at line 799 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > operator+ ( const UT_Vector3T< T > &  v,
scalar 
) [inline]

Definition at line 778 of file UT_Vector3.h.

template<typename T >
UT_Vector3T< T > operator+ ( const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  v2 
) [inline]

Definition at line 764 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > operator- ( scalar,
const UT_Vector3T< T > &  v 
) [inline]

Definition at line 813 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > operator- ( const UT_Vector3T< T > &  v,
scalar 
) [inline]

Definition at line 806 of file UT_Vector3.h.

template<typename T >
UT_Vector3T< T > operator- ( const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  v2 
) [inline]

Definition at line 771 of file UT_Vector3.h.

template<typename T >
UT_Vector3T<T> operator/ ( const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  v2 
) [inline]

Definition at line 792 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > operator/ ( scalar,
const UT_Vector3T< T > &  v 
) [inline]

Definition at line 844 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > operator/ ( const UT_Vector3T< T > &  v,
scalar 
) [inline]

Definition at line 834 of file UT_Vector3.h.

template<typename T >
UT_Vector3T< T > project ( const UT_Vector3T< T > &  u,
const UT_Vector3T< T > &  v 
) [inline]

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

Definition at line 870 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > rowVecMult ( const UT_Vector3T< T > &  v,
const UT_Matrix4T< S > &  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 899 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > rowVecMult ( const UT_Vector3T< T > &  v,
const UT_Matrix3T< S > &  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 877 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > rowVecMult3 ( const UT_Vector3T< T > &  v,
const UT_Matrix4T< S > &  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 910 of file UT_Vector3.h.

template<typename T >
UT_API UT_Vector2T<T> segmentClosest ( const UT_Vector3T< T > &  p0,
const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  a,
const UT_Vector3T< T > &  b 
) [inline]

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

template<typename T >
UT_API UT_Vector2T<T> segmentClosestParallel ( const UT_Vector3T< T > &  p0,
const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  a,
const UT_Vector3T< T > &  b 
) [inline]

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

template<typename T >
T segmentPointDist2 ( const UT_Vector3T< T > &  pos,
const UT_Vector3T< T > &  pt1,
const UT_Vector3T< T > &  pt2 
) [inline]

Definition at line 972 of file UT_Vector3.h.


Generated on Mon Jan 28 00:27:57 2013 for HDK by  doxygen 1.5.9