HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Vector3.h File Reference
#include "UT_API.h"
#include "UT_Assert.h"
#include "UT_FixedVector.h"
#include "UT_VectorTypes.h"
#include "UT_Vector2.h"
#include <SYS/SYS_Deprecated.h>
#include <SYS/SYS_Inline.h>
#include <SYS/SYS_Math.h>
#include <iosfwd>
#include <limits>
#include "UT_Vector4.h"
+ Include dependency graph for UT_Vector3.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

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

Macros

#define __UT_Vector3_h__
 

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 > SYSmin (const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2)
 Componentwise min and maximum. More...
 
template<typename T >
UT_Vector3T< T > SYSmax (const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2)
 
template<typename T , typename S >
UT_Vector3T< T > SYSlerp (const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2, S t)
 Componentwise linear interpolation. More...
 
template<typename T , typename S >
UT_Vector3T< T > SYSbilerp (const UT_Vector3T< T > &u0v0, const UT_Vector3T< T > &u1v0, const UT_Vector3T< T > &u0v1, const UT_Vector3T< T > &u1v1, S u, S v)
 
template<typename T >
SYStrihat (const UT_Vector3T< T > &v, const UT_Vector3T< T > &s)
 Trilinear hat function over kernel widths in s. More...
 
template<typename T >
UT_Vector3T< T > SYStrihatgrad (const UT_Vector3T< T > &v, const UT_Vector3T< T > &s)
 Gradient of trilinear hat function over kernel widths in s. More...
 
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. More...
 
template<typename T >
distance3d (const UT_Vector3T< T > &p1, const UT_Vector3T< T > &p2)
 Compute the distance between two points. More...
 
template<typename T >
distance2 (const UT_Vector3T< T > &p1, const UT_Vector3T< T > &p2)
 Compute the distance squared. More...
 
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_APIsegmentClosest (const UT_Vector3T< T > &p0, const UT_Vector3T< T > &p1, const UT_Vector3T< T > &a)
 
template<typename T >
segmentDistance2 (const UT_Vector3T< T > &p0, const UT_Vector3T< T > &p1, const UT_Vector3T< T > &a, const UT_Vector3T< T > &b)
 Returns the squared distance between two line segments: p0-p1 and a-b. More...
 
template<typename T >
segmentDistance (const UT_Vector3T< T > &p0, const UT_Vector3T< T > &p1, const UT_Vector3T< T > &a, const UT_Vector3T< T > &b)
 Returns the distance between two line segments: p0-p1 and a-b. More...
 
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 >
int UTinverseTrilerpFlat (const UT_Vector3T< T > &input, const UT_Vector3T< T > &p0, const UT_Vector3T< T > &du, const UT_Vector3T< T > &dv, const UT_Vector3T< T > &dw, UT_Vector3T< T > &output)
 
template<typename T >
size_t hash_value (const UT_Vector3T< T > &val)
 
template<typename T >
UT_API size_t format (char *buffer, size_t buffer_size, const UT_Vector3T< T > &v)
 
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) More...
 
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) More...
 
template<typename T >
fpreal64 UTangleBetween (const UT_Vector3T< T > &v1, const UT_Vector3T< T > &v2)
 The angle between two vectors in radians. More...
 

Macro Definition Documentation

#define __UT_Vector3_h__

Definition at line 20 of file UT_Vector3.h.

Function Documentation

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 739 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 824 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:
RAY/RAY_DemoMountain.C.

Definition at line 818 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 732 of file UT_Vector3.h.

template<typename T >
UT_API size_t format ( char *  buffer,
size_t  buffer_size,
const UT_Vector3T< T > &  v 
)
template<typename T >
size_t hash_value ( const UT_Vector3T< T > &  val)
inline

Definition at line 912 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 
)

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 
)

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 , typename S >
UT_Vector3T<T> operator* ( const UT_Vector3T< T > &  v,
const UT_Matrix3T< S > &  m 
)
inline

Definition at line 1306 of file UT_Matrix3.h.

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

Definition at line 1783 of file UT_Matrix4.h.

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

Definition at line 697 of file UT_Vector3.h.

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

Definition at line 704 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 662 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 641 of file UT_Vector3.h.

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

Definition at line 655 of file UT_Vector3.h.

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

Definition at line 676 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 648 of file UT_Vector3.h.

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

Definition at line 683 of file UT_Vector3.h.

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

Definition at line 690 of file UT_Vector3.h.

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

Definition at line 711 of file UT_Vector3.h.

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

Definition at line 725 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 669 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 811 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 
)

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

template<typename T >
UT_API T segmentClosest ( const UT_Vector3T< T > &  p0,
const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  a 
)

Returns the U coordinate of the point on line segment p0->p1 that is closest to a.

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 
)

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

template<typename T >
T segmentDistance ( const UT_Vector3T< T > &  p0,
const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  a,
const UT_Vector3T< T > &  b 
)
inline

Returns the distance between two line segments: p0-p1 and a-b.

Definition at line 878 of file UT_Vector3.h.

template<typename T >
T segmentDistance2 ( const UT_Vector3T< T > &  p0,
const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  a,
const UT_Vector3T< T > &  b 
)
inline

Returns the squared distance between two line segments: p0-p1 and a-b.

Definition at line 867 of file UT_Vector3.h.

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

Definition at line 832 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T<T> SYSbilerp ( const UT_Vector3T< T > &  u0v0,
const UT_Vector3T< T > &  u1v0,
const UT_Vector3T< T > &  u0v1,
const UT_Vector3T< T > &  u1v1,
u,
v 
)
inline

Definition at line 94 of file UT_Vector3.h.

template<typename T , typename S >
UT_Vector3T< T > SYSlerp ( const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  v2,
t 
)
inline

Componentwise linear interpolation.

Definition at line 782 of file UT_Vector3.h.

template<typename T >
UT_Vector3T< T > SYSmax ( 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 > SYSmin ( const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  v2 
)
inline

Componentwise min and maximum.

Definition at line 760 of file UT_Vector3.h.

template<typename T >
T SYStrihat ( const UT_Vector3T< T > &  v,
const UT_Vector3T< T > &  s 
)
inline

Trilinear hat function over kernel widths in s.

Definition at line 792 of file UT_Vector3.h.

template<typename T >
UT_Vector3T< T > SYStrihatgrad ( const UT_Vector3T< T > &  v,
const UT_Vector3T< T > &  s 
)
inline

Gradient of trilinear hat function over kernel widths in s.

Definition at line 799 of file UT_Vector3.h.

template<typename T >
fpreal64 UTangleBetween ( const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  v2 
)
inline

The angle between two vectors in radians.

Definition at line 751 of file UT_Vector3.h.

template<typename T >
int UTinverseTrilerpFlat ( const UT_Vector3T< T > &  input,
const UT_Vector3T< T > &  p0,
const UT_Vector3T< T > &  du,
const UT_Vector3T< T > &  dv,
const UT_Vector3T< T > &  dw,
UT_Vector3T< T > &  output 
)

Given a 3D position, input, and a 3D parallelpiped with corner p0 and directions du, dv, and dw, finds the 0 or 1 locations in the parameter space of that parallelpiped that correspond with the input position. Only a parameter location approximately between 0 and 1 is accepted. The return value is the number of accepted parameter locations, i.e. 0 or 1.

Definition at line 891 of file UT_Vector3.h.