HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Vector3T< T > Class Template Reference

3D Vector class. More...

#include <TIL_DeepRasterReader.h>

+ Inheritance diagram for UT_Vector3T< T >:

Public Types

typedef UT_FixedVector< T,
3, true > 
Base
 
typedef T value_type
 
- Public Types inherited from UT_FixedVector< T, 3, true >
typedef UT_FixedVector< T,
SIZE, INSTANTIATED > 
ThisType
 
typedef T value_type
 
typedef T theType
 
typedef UT_StorageNum< TStorage
 

Public Member Functions

SYS_FORCE_INLINE UT_Vector3T ()=default
 
SYS_FORCE_INLINE UT_Vector3T (const UT_Vector3T< T > &that)=default
 
SYS_FORCE_INLINE UT_Vector3T (UT_Vector3T< T > &&that)=default
 
SYS_FORCE_INLINE UT_Vector3T (T v)
 
SYS_FORCE_INLINE UT_Vector3T (T vx, T vy, T vz)
 
SYS_FORCE_INLINE UT_Vector3T (const fpreal16 v[tuple_size])
 
SYS_FORCE_INLINE UT_Vector3T (const fpreal32 v[tuple_size])
 
SYS_FORCE_INLINE UT_Vector3T (const fpreal64 v[tuple_size])
 
SYS_FORCE_INLINE UT_Vector3T (const int32 v[tuple_size])
 
SYS_FORCE_INLINE UT_Vector3T (const int64 v[tuple_size])
 
SYS_FORCE_INLINE UT_Vector3T (const UT_Vector2T< T > &v)
 
SYS_FORCE_INLINE UT_Vector3T (const UT_Vector4T< T > &v)
 
template<typename S >
SYS_FORCE_INLINE UT_Vector3T (const UT_Vector3T< S > &v)
 Our own type of any given value_type. More...
 
template<typename S , bool S_INSTANTIATED>
SYS_FORCE_INLINE UT_Vector3T (const UT_FixedVector< S, tuple_size, S_INSTANTIATED > &v)
 Arbitrary UT_FixedVector of the same size. More...
 
SYS_FORCE_INLINE UT_Vector3T< T > & operator= (const UT_Vector3T< T > &that)=default
 
SYS_FORCE_INLINE UT_Vector3T< T > & operator= (UT_Vector3T< T > &&that)=default
 
template<typename S >
SYS_FORCE_INLINE UT_Vector3T< T > & operator= (const UT_Vector3T< S > &v)
 
UT_Vector3T< T > & operator= (const UT_Vector4T< T > &v)
 
SYS_FORCE_INLINE UT_Vector3T< Toperator- () const
 
void clampZero (T tol=T(0.00001f))
 
SYS_FORCE_INLINE void multiplyComponents (const UT_Vector3T< T > &v)
 
SYS_FORCE_INLINE void cross (const UT_Vector3T< T > &v)
 
SYS_FORCE_INLINE void normal (const UT_Vector3T< T > &va, const UT_Vector3T< T > &vb)
 
void arbitraryPerp (const UT_Vector3T< T > &v)
 Finds an arbitrary perpendicular to v, and sets this to it. More...
 
void makeOrthonormal (const UT_Vector3T< T > &v)
 
void getFrameOfReference (UT_Vector3T< T > &X, UT_Vector3T< T > &Y) const
 
UT_Vector3T< Tproject (const UT_Vector3T< T > &u) const
 Calculates the orthogonal projection of a vector u on the *this vector. More...
 
template<typename S >
UT_Matrix3T< Sproject (bool norm=true)
 
UT_Vector3T< Tprojection (const UT_Vector3T< T > &p, const UT_Vector3T< T > &v) const
 
UT_Vector3T< TprojectOnSegment (const UT_Vector3T< T > &va, const UT_Vector3T< T > &vb) const
 
UT_Vector3T< TprojectOnSegment (const UT_Vector3T< T > &va, const UT_Vector3T< T > &vb, T &t) const
 
UT_Matrix3 symmetry (bool norm=true)
 
int lineIntersect (const UT_Vector3T< T > &p1, const UT_Vector3T< T > &v1, const UT_Vector3T< T > &p2, const UT_Vector3T< T > &v2)
 
int segLineIntersect (const UT_Vector3T< T > &pa, const UT_Vector3T< T > &pb, const UT_Vector3T< T > &p2, const UT_Vector3T< T > &v2)
 
bool areCollinear (const UT_Vector3T< T > &p0, const UT_Vector3T< T > &p1, T *t=0, T tol=1e-5) const
 
UT_Vector3T< TgetBary (const UT_Vector3T< T > &t0, const UT_Vector3T< T > &t1, const UT_Vector3T< T > &t2, bool *degen=NULL) const
 
T distance (const UT_Vector3T< T > &p1, const UT_Vector3T< T > &v1) const
 Compute the signed distance from us to a line. More...
 
T distance (const UT_Vector3T< T > &p1, const UT_Vector3T< T > &v1, const UT_Vector3T< T > &p2, const UT_Vector3T< T > &v2) const
 Compute the signed distance between two lines. More...
 
unsigned hash () const
 Compute a hash. More...
 
void assign (T xx=0.0f, T yy=0.0f, T zz=0.0f)
 Set the values of the vector components. More...
 
void assign (const T *v)
 Set the values of the vector components. More...
 
void roundAngles (const UT_Vector3T< T > &base)
 
void roundAngles (const UT_Vector3T< T > &b, const UT_XformOrder &o)
 
template<typename S >
void getDual (UT_Matrix3T< S > &dual) const
 
SYS_FORCE_INLINE void rowVecMult (const UT_Matrix3F &m)
 
SYS_FORCE_INLINE void rowVecMult (const UT_Matrix4F &m)
 
SYS_FORCE_INLINE void rowVecMult (const UT_Matrix3D &m)
 
SYS_FORCE_INLINE void rowVecMult (const UT_Matrix4D &m)
 
SYS_FORCE_INLINE void colVecMult (const UT_Matrix3F &m)
 
SYS_FORCE_INLINE void colVecMult (const UT_Matrix4F &m)
 
SYS_FORCE_INLINE void colVecMult (const UT_Matrix3D &m)
 
SYS_FORCE_INLINE void colVecMult (const UT_Matrix4D &m)
 
SYS_FORCE_INLINE void rowVecMult3 (const UT_Matrix4F &m)
 
SYS_FORCE_INLINE void rowVecMult3 (const UT_Matrix4D &m)
 
SYS_FORCE_INLINE void colVecMult3 (const UT_Matrix4F &m)
 
SYS_FORCE_INLINE void colVecMult3 (const UT_Matrix4D &m)
 
template<typename S >
SYS_FORCE_INLINE UT_Vector3T< T > & operator*= (const UT_Matrix3T< S > &m)
 
template<typename S >
SYS_FORCE_INLINE UT_Vector3T< T > & operator*= (const UT_Matrix4T< S > &m)
 
template<typename S >
SYS_FORCE_INLINE void multiply3 (const UT_Matrix4T< S > &mat)
 
template<typename S >
SYS_FORCE_INLINE void multiplyT (const UT_Matrix3T< S > &mat)
 
template<typename S >
SYS_FORCE_INLINE void multiply3T (const UT_Matrix4T< S > &mat)
 
template<typename S >
SYS_FORCE_INLINE void multiply3 (UT_Vector3T< T > &dest, const UT_Matrix4T< S > &mat) const
 
template<typename S >
SYS_FORCE_INLINE void multiplyT (UT_Vector3T< T > &dest, const UT_Matrix3T< S > &mat) const
 
template<typename S >
SYS_FORCE_INLINE void multiply3T (UT_Vector3T< T > &dest, const UT_Matrix4T< S > &mat) const
 
template<typename S >
SYS_FORCE_INLINE void multiply (UT_Vector3T< T > &dest, const UT_Matrix4T< S > &mat) const
 
template<typename S >
SYS_FORCE_INLINE void multiply (UT_Vector3T< T > &dest, const UT_Matrix3T< S > &mat) const
 
int findMinAbsAxis () const
 These allow you to find out what indices to use for different axes. More...
 
int findMaxAbsAxis () const
 These allow you to find out what indices to use for different axes. More...
 
SYS_FORCE_INLINE Tx (void)
 
SYS_FORCE_INLINE T x (void) const
 
SYS_FORCE_INLINE Ty (void)
 
SYS_FORCE_INLINE T y (void) const
 
SYS_FORCE_INLINE Tz (void)
 
SYS_FORCE_INLINE T z (void) const
 
SYS_FORCE_INLINE Tr (void)
 
SYS_FORCE_INLINE T r (void) const
 
SYS_FORCE_INLINE Tg (void)
 
SYS_FORCE_INLINE T g (void) const
 
SYS_FORCE_INLINE Tb (void)
 
SYS_FORCE_INLINE T b (void) const
 
SYS_FORCE_INLINE Toperator() (unsigned i)
 
SYS_FORCE_INLINE T operator() (unsigned i) const
 
void homogenize (void)
 Express the point in homogeneous coordinates or vice-versa. More...
 
void dehomogenize (void)
 Express the point in homogeneous coordinates or vice-versa. More...
 
void degToRad ()
 conversion between degrees and radians More...
 
void radToDeg ()
 conversion between degrees and radians More...
 
void save (std::ostream &os, bool binary=false) const
 Protected I/O methods. More...
 
bool load (UT_IStream &is)
 Protected I/O methods. More...
 
bool save (UT_JSONWriter &w) const
 
bool save (UT_JSONValue &v) const
 
bool load (UT_JSONParser &p)
 
fpreal64 angleTo (const UT_Vector3T< T > &v) const
 
- Public Member Functions inherited from UT_FixedVector< T, 3, true >
SYS_FORCE_INLINE UT_FixedVector ()=default
 
SYS_FORCE_INLINE UT_FixedVector (T that) noexcept
 Initializes every component to the same value. More...
 
SYS_FORCE_INLINE UT_FixedVector (const ThisType &that)=default
 
SYS_FORCE_INLINE UT_FixedVector (ThisType &&that)=default
 
SYS_FORCE_INLINE UT_FixedVector (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) noexcept
 
SYS_FORCE_INLINE UT_FixedVector (const S that[SIZE]) noexcept
 
SYS_FORCE_INLINE const Toperator[] (exint i) const noexcept
 
SYS_FORCE_INLINE Toperator[] (exint i) noexcept
 
SYS_FORCE_INLINE constexpr
const T
data () const noexcept
 
SYS_FORCE_INLINE Tdata () noexcept
 
SYS_FORCE_INLINE ThisTypeoperator= (const ThisType &that)=default
 
SYS_FORCE_INLINE ThisTypeoperator= (ThisType &&that)=default
 
SYS_FORCE_INLINE ThisTypeoperator= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) noexcept
 
SYS_FORCE_INLINE const ThisTypeoperator= (T that) noexcept
 
SYS_FORCE_INLINE void operator+= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that)
 
SYS_FORCE_INLINE void operator+= (T that)
 
SYS_FORCE_INLINE
UT_FixedVector< typename
UT_StorageBetter< T, S >::Type,
SIZE
operator+ (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const
 
SYS_FORCE_INLINE void operator-= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that)
 
SYS_FORCE_INLINE void operator-= (T that)
 
SYS_FORCE_INLINE
UT_FixedVector< typename
UT_StorageBetter< T, S >::Type,
SIZE
operator- (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const
 
SYS_FORCE_INLINE
UT_FixedVector< T, SIZE
operator- () const
 
SYS_FORCE_INLINE void operator*= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that)
 
SYS_FORCE_INLINE void operator*= (T that)
 
SYS_FORCE_INLINE
UT_FixedVector< typename
UT_StorageBetter< T, S >::Type,
SIZE
operator* (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const
 
SYS_FORCE_INLINE
UT_FixedVector< T, SIZE
operator* (T that) const
 
SYS_FORCE_INLINE void operator/= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that)
 
SYS_FORCE_INLINE void operator/= (T that)
 
SYS_FORCE_INLINE
UT_FixedVector< typename
UT_StorageBetter< T, S >::Type,
SIZE
operator/ (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const
 
SYS_FORCE_INLINE
UT_FixedVector< T, SIZE
operator/ (T that) const
 
SYS_FORCE_INLINE void negate ()
 
SYS_FORCE_INLINE bool operator== (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
SYS_FORCE_INLINE bool operator!= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
SYS_FORCE_INLINE bool isNan () const
 
SYS_FORCE_INLINE bool isFinite () const
 
SYS_FORCE_INLINE bool isZero () const noexcept
 
SYS_FORCE_INLINE bool equalZero (T tol=T(SYS_FTOLERANCE)) const
 
SYS_FORCE_INLINE bool isEqual (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that, S tol=S(SYS_FTOLERANCE)) const
 
SYS_FORCE_INLINE T maxComponent () const
 
SYS_FORCE_INLINE T minComponent () const
 
SYS_FORCE_INLINE T avgComponent () const
 
SYS_FORCE_INLINE
UT_StorageAtLeast32Bit< T, T >
::Type 
length2 () const noexcept
 
SYS_FORCE_INLINE Storage::MathFloat length () const
 
SYS_FORCE_INLINE
UT_StorageAtLeast32Bit< T, S >
::Type 
dot (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const
 
SYS_FORCE_INLINE
UT_StorageAtLeast32Bit< T, S >
::Type 
distance2 (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const
 
SYS_FORCE_INLINE UT_StorageNum
< typename UT_StorageBetter< T,
S >::Type >::MathFloat 
distance (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const
 
SYS_FORCE_INLINE Storage::MathFloat normalize ()
 
SYS_FORCE_INLINE bool operator< (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
SYS_FORCE_INLINE bool operator<= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
SYS_FORCE_INLINE bool operator> (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
SYS_FORCE_INLINE bool operator>= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 

Static Public Member Functions

static int entries ()
 Returns the vector size. More...
 

Static Public Attributes

static const int tuple_size = 3
 
- Static Public Attributes inherited from UT_FixedVector< T, 3, true >
static const exint theSize
 

Friends

std::ostream & operator<< (std::ostream &os, const UT_Vector3T< T > &v)
 I/O friends. More...
 

Additional Inherited Members

- Public Attributes inherited from UT_FixedVector< T, 3, true >
T vec [SIZE]
 

Detailed Description

Member Typedef Documentation

template<typename T>
typedef UT_FixedVector<T,3,true> UT_Vector3T< T >::Base

Definition at line 187 of file UT_Vector3.h.

template<typename T>
typedef T UT_Vector3T< T >::value_type

Definition at line 203 of file UT_Vector3.h.

Constructor & Destructor Documentation

template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( )
default

Default constructor. No data is initialized! Use it for extra speed.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const UT_Vector3T< T > &  that)
default
template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( UT_Vector3T< T > &&  that)
default
template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( T  v)
inlineexplicit

Definition at line 213 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( T  vx,
T  vy,
T  vz 
)
inline

Definition at line 220 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const fpreal16  v[tuple_size])
inline

Definition at line 226 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const fpreal32  v[tuple_size])
inline

Definition at line 229 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const fpreal64  v[tuple_size])
inline

Definition at line 232 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const int32  v[tuple_size])
inline

Definition at line 235 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const int64  v[tuple_size])
inline

Definition at line 238 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const UT_Vector2T< T > &  v)
explicit

Definition at line 624 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const UT_Vector4T< T > &  v)
explicit

Definition at line 631 of file UT_Vector3.h.

template<typename T>
template<typename S >
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const UT_Vector3T< S > &  v)
inline

Our own type of any given value_type.

Definition at line 247 of file UT_Vector3.h.

template<typename T>
template<typename S , bool S_INSTANTIATED>
SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const UT_FixedVector< S, tuple_size, S_INSTANTIATED > &  v)
inline

Arbitrary UT_FixedVector of the same size.

Definition at line 253 of file UT_Vector3.h.

Member Function Documentation

template<typename T>
fpreal64 UT_Vector3T< T >::angleTo ( const UT_Vector3T< T > &  v) const
inline

Method to return the angle (in radians) between this and another vector

Definition at line 599 of file UT_Vector3.h.

template<typename T>
void UT_Vector3T< T >::arbitraryPerp ( const UT_Vector3T< T > &  v)

Finds an arbitrary perpendicular to v, and sets this to it.

template<typename T>
bool UT_Vector3T< T >::areCollinear ( const UT_Vector3T< T > &  p0,
const UT_Vector3T< T > &  p1,
T t = 0,
T  tol = 1e-5 
) const

Determines whether or not the points p0, p1 and "this" are collinear. If they are t contains the parametric value of where "this" is found on the segment from p0 to p1 and returns true. Otherwise returns false. If p0 and p1 are equal, t is set to std::numeric_limits<T>::max() and true is returned.

template<typename T>
void UT_Vector3T< T >::assign ( T  xx = 0.0f,
T  yy = 0.0f,
T  zz = 0.0f 
)
inline

Set the values of the vector components.

Examples:
CVEX/cvexsample.C.

Definition at line 528 of file UT_Vector3.h.

template<typename T>
void UT_Vector3T< T >::assign ( const T v)
inline

Set the values of the vector components.

Definition at line 533 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T& UT_Vector3T< T >::b ( void  )
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 508 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T UT_Vector3T< T >::b ( void  ) const
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 509 of file UT_Vector3.h.

template<typename T>
void UT_Vector3T< T >::clampZero ( T  tol = T(0.00001f))
inline

Definition at line 277 of file UT_Vector3.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::colVecMult ( const UT_Matrix3F m)

If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.

Definition at line 1336 of file UT_Matrix3.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::colVecMult ( const UT_Matrix4F m)

If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.

Definition at line 1888 of file UT_Matrix4.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::colVecMult ( const UT_Matrix3D m)

If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.

Definition at line 1342 of file UT_Matrix3.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::colVecMult ( const UT_Matrix4D m)

If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.

Definition at line 1894 of file UT_Matrix4.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::colVecMult3 ( const UT_Matrix4F m)

This multiply will not extend the vector by adding a fourth element. Instead, it converts the Matrix4 to a Matrix3. This means that the translate component of the matrix is not applied to the vector

Definition at line 1912 of file UT_Matrix4.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::colVecMult3 ( const UT_Matrix4D m)

This multiply will not extend the vector by adding a fourth element. Instead, it converts the Matrix4 to a Matrix3. This means that the translate component of the matrix is not applied to the vector

Definition at line 1918 of file UT_Matrix4.h.

template<typename T>
SYS_FORCE_INLINE void UT_Vector3T< T >::cross ( const UT_Vector3T< T > &  v)
inline

Definition at line 369 of file UT_Vector3.h.

template<typename T>
void UT_Vector3T< T >::degToRad ( )

conversion between degrees and radians

template<typename T>
void UT_Vector3T< T >::dehomogenize ( void  )
inline

Express the point in homogeneous coordinates or vice-versa.

Definition at line 545 of file UT_Vector3.h.

template<typename T>
T UT_Vector3T< T >::distance ( const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  v1 
) const

Compute the signed distance from us to a line.

template<typename T>
T UT_Vector3T< T >::distance ( const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  p2,
const UT_Vector3T< T > &  v2 
) const

Compute the signed distance between two lines.

template<typename T>
static int UT_Vector3T< T >::entries ( void  )
inlinestatic

Returns the vector size.

Definition at line 606 of file UT_Vector3.h.

template<typename T>
int UT_Vector3T< T >::findMaxAbsAxis ( ) const
inline

These allow you to find out what indices to use for different axes.

Definition at line 397 of file UT_Vector3.h.

template<typename T>
int UT_Vector3T< T >::findMinAbsAxis ( ) const
inline

These allow you to find out what indices to use for different axes.

Definition at line 389 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T& UT_Vector3T< T >::g ( void  )
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 506 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T UT_Vector3T< T >::g ( void  ) const
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 507 of file UT_Vector3.h.

template<typename T>
UT_Vector3T<T> UT_Vector3T< T >::getBary ( const UT_Vector3T< T > &  t0,
const UT_Vector3T< T > &  t1,
const UT_Vector3T< T > &  t2,
bool *  degen = NULL 
) const

Compute (homogeneous) barycentric co-ordinates of this point relative to the triangle defined by t0, t1 and t2. (The point is projected into the triangle's plane.)

template<typename T>
template<typename S >
void UT_Vector3T< T >::getDual ( UT_Matrix3T< S > &  dual) const

Return the dual of the vector The dual is a matrix which acts like the cross product when multiplied by other vectors. The following are equivalent: a.getDual(A); c = colVecMult(A, b) c = cross(a, b)

template<typename T>
void UT_Vector3T< T >::getFrameOfReference ( UT_Vector3T< T > &  X,
UT_Vector3T< T > &  Y 
) const
inline

Given this vector as the z-axis, get a frame of reference such that the X and Y vectors are orthonormal to the vector. This vector should be normalized.

Definition at line 410 of file UT_Vector3.h.

template<typename T>
unsigned UT_Vector3T< T >::hash ( ) const
inline

Compute a hash.

Definition at line 523 of file UT_Vector3.h.

template<typename T>
void UT_Vector3T< T >::homogenize ( void  )
inline

Express the point in homogeneous coordinates or vice-versa.

Definition at line 540 of file UT_Vector3.h.

template<typename T>
int UT_Vector3T< T >::lineIntersect ( const UT_Vector3T< T > &  p1,
const UT_Vector3T< T > &  v1,
const UT_Vector3T< T > &  p2,
const UT_Vector3T< T > &  v2 
)

This method stores in (*this) the intersection between two 3D lines, p1+t*v1 and p2+u*v2. If the two lines do not actually intersect, we shift the 2nd line along the perpendicular on both lines (along the line of min distance) and return the shifted intersection point; this point thus lies on the 1st line. If we find an intersection point (shifted or not) we return 0; if the two lines are parallel we return -1; and if they intersect behind our back we return -2. When we return -2 there still is a valid intersection point in (*this).

template<typename T>
bool UT_Vector3T< T >::load ( UT_IStream is)

Protected I/O methods.

template<typename T>
bool UT_Vector3T< T >::load ( UT_JSONParser p)

Methods to serialize to a JSON stream. The vector is stored as an array of 3 reals.

template<typename T>
void UT_Vector3T< T >::makeOrthonormal ( const UT_Vector3T< T > &  v)

Makes this orthogonal to the given vector. If they are colinear, does an arbitrary perp

template<typename T>
template<typename S >
SYS_FORCE_INLINE void UT_Vector3T< T >::multiply ( UT_Vector3T< T > &  dest,
const UT_Matrix4T< S > &  mat 
) const

The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".

Definition at line 1961 of file UT_Matrix4.h.

template<typename T>
template<typename S >
SYS_FORCE_INLINE void UT_Vector3T< T >::multiply ( UT_Vector3T< T > &  dest,
const UT_Matrix3T< S > &  mat 
) const

The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".

Definition at line 1371 of file UT_Matrix3.h.

template<typename T >
template<typename S >
SYS_FORCE_INLINE void UT_Vector3T< T >::multiply3 ( const UT_Matrix4T< S > &  mat)

The *=, multiply, multiply3 and multiplyT routines are provided for legacy reasons. They all assume that *this is a row vector. Generally, the rowVecMult and colVecMult methods are preferred, since they're more explicit about the row vector assumption.

Definition at line 1933 of file UT_Matrix4.h.

template<typename T>
template<typename S >
SYS_FORCE_INLINE void UT_Vector3T< T >::multiply3 ( UT_Vector3T< T > &  dest,
const UT_Matrix4T< S > &  mat 
) const

The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".

Definition at line 1947 of file UT_Matrix4.h.

template<typename T >
template<typename S >
SYS_FORCE_INLINE void UT_Vector3T< T >::multiply3T ( const UT_Matrix4T< S > &  mat)

This multiply will multiply the (row) vector by the transpose of the matrix instead of the matrix itself. This is faster than transposing the matrix, then multiplying (as well there's potentially less storage requirements).

Definition at line 1940 of file UT_Matrix4.h.

template<typename T>
template<typename S >
SYS_FORCE_INLINE void UT_Vector3T< T >::multiply3T ( UT_Vector3T< T > &  dest,
const UT_Matrix4T< S > &  mat 
) const

The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".

Definition at line 1954 of file UT_Matrix4.h.

template<typename T>
SYS_FORCE_INLINE void UT_Vector3T< T >::multiplyComponents ( const UT_Vector3T< T > &  v)
inline

Definition at line 285 of file UT_Vector3.h.

template<typename T >
template<typename S >
SYS_FORCE_INLINE void UT_Vector3T< T >::multiplyT ( const UT_Matrix3T< S > &  mat)

This multiply will multiply the (row) vector by the transpose of the matrix instead of the matrix itself. This is faster than transposing the matrix, then multiplying (as well there's potentially less storage requirements).

Definition at line 1357 of file UT_Matrix3.h.

template<typename T>
template<typename S >
SYS_FORCE_INLINE void UT_Vector3T< T >::multiplyT ( UT_Vector3T< T > &  dest,
const UT_Matrix3T< S > &  mat 
) const

The following methods implement multiplies (row) vector by a matrix, however, the resulting vector is specified by the dest parameter These operations are safe even if "dest" is the same as "this".

Definition at line 1364 of file UT_Matrix3.h.

template<typename T>
SYS_FORCE_INLINE void UT_Vector3T< T >::normal ( const UT_Vector3T< T > &  va,
const UT_Vector3T< T > &  vb 
)
inline

Definition at line 374 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T& UT_Vector3T< T >::operator() ( unsigned  i)
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 510 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T UT_Vector3T< T >::operator() ( unsigned  i) const
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 515 of file UT_Vector3.h.

template<typename T >
template<typename S >
SYS_FORCE_INLINE UT_Vector3T< T > & UT_Vector3T< T >::operator*= ( const UT_Matrix3T< S > &  m)

The *=, multiply, multiply3 and multiplyT routines are provided for legacy reasons. They all assume that *this is a row vector. Generally, the rowVecMult and colVecMult methods are preferred, since they're more explicit about the row vector assumption.

Definition at line 1349 of file UT_Matrix3.h.

template<typename T >
template<typename S >
SYS_FORCE_INLINE UT_Vector3T< T > & UT_Vector3T< T >::operator*= ( const UT_Matrix4T< S > &  m)

The *=, multiply, multiply3 and multiplyT routines are provided for legacy reasons. They all assume that *this is a row vector. Generally, the rowVecMult and colVecMult methods are preferred, since they're more explicit about the row vector assumption.

Definition at line 1925 of file UT_Matrix4.h.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T<T> UT_Vector3T< T >::operator- ( ) const
inline

It's unclear why this is needed, given UT_FixedVector::operator-(), but the compiler seems not to accept not having it.

Definition at line 272 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE UT_Vector3T<T>& UT_Vector3T< T >::operator= ( const UT_Vector3T< T > &  that)
default
template<typename T>
SYS_FORCE_INLINE UT_Vector3T<T>& UT_Vector3T< T >::operator= ( UT_Vector3T< T > &&  that)
default
template<typename T>
template<typename S >
SYS_FORCE_INLINE UT_Vector3T<T>& UT_Vector3T< T >::operator= ( const UT_Vector3T< S > &  v)
inline

Definition at line 261 of file UT_Vector3.h.

template<typename T>
UT_Vector3T<T>& UT_Vector3T< T >::operator= ( const UT_Vector4T< T > &  v)

Assignment operator that truncates a V4 to a V3. TODO: remove this. This should require an explicit UT_Vector3() construction, since it's unsafe.

template<typename T>
UT_Vector3T<T> UT_Vector3T< T >::project ( const UT_Vector3T< T > &  u) const

Calculates the orthogonal projection of a vector u on the *this vector.

template<typename T>
template<typename S >
UT_Matrix3T<S> UT_Vector3T< T >::project ( bool  norm = true)

Create a matrix of projection onto this vector: the matrix transforms a vector v into its projection on the direction of (*this) vector, ie. dot(*this, v) * this->normalize(); If we need to be normalized, set norm to non-false.

template<typename T>
UT_Vector3T<T> UT_Vector3T< T >::projection ( const UT_Vector3T< T > &  p,
const UT_Vector3T< T > &  v 
) const

Vector p (representing a point in 3-space) and vector v define a line. This member returns the projection of "this" onto the line (the point on the line that is closest to this point).

template<typename T>
UT_Vector3T<T> UT_Vector3T< T >::projectOnSegment ( const UT_Vector3T< T > &  va,
const UT_Vector3T< T > &  vb 
) const

Projects this onto the line segement [a,b]. The returned point will lie between a and b.

template<typename T>
UT_Vector3T<T> UT_Vector3T< T >::projectOnSegment ( const UT_Vector3T< T > &  va,
const UT_Vector3T< T > &  vb,
T t 
) const

Projects this onto the line segment [a, b]. The fpreal t is set to the parametric position of intersection, a being 0 and b being 1.

template<typename T>
SYS_FORCE_INLINE T& UT_Vector3T< T >::r ( void  )
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 504 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T UT_Vector3T< T >::r ( void  ) const
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 505 of file UT_Vector3.h.

template<typename T>
void UT_Vector3T< T >::radToDeg ( )

conversion between degrees and radians

template<typename T>
void UT_Vector3T< T >::roundAngles ( const UT_Vector3T< T > &  base)

assuming that "this" is a rotation (in radians, of course), the equivalent set of rotations which are closest to the "base" rotation are found. The equivalent rotations are the same as the original rotations +2*n*PI

template<typename T>
void UT_Vector3T< T >::roundAngles ( const UT_Vector3T< T > &  b,
const UT_XformOrder o 
)

It seems that given any rotation matrix and transform order, there are two distinct triples of rotations that will result in the same overall rotation. This method will find the closest of the two after finding the closest using the above method.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::rowVecMult ( const UT_Matrix3F m)

If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.

Definition at line 1324 of file UT_Matrix3.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::rowVecMult ( const UT_Matrix4F m)

If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.

Definition at line 1876 of file UT_Matrix4.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::rowVecMult ( const UT_Matrix3D m)

If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.

Definition at line 1330 of file UT_Matrix3.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::rowVecMult ( const UT_Matrix4D m)

If you need a multiplication operator that left multiplies the vector by a matrix (M * v), use the following colVecMult() functions. If you'd rather not use operator*=() for right-multiplications (v * M), use the following rowVecMult() functions. The methods that take a 4x4 matrix first extend this vector to 4D by adding an element equal to 1.0.

Definition at line 1882 of file UT_Matrix4.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::rowVecMult3 ( const UT_Matrix4F m)

This multiply will not extend the vector by adding a fourth element. Instead, it converts the Matrix4 to a Matrix3. This means that the translate component of the matrix is not applied to the vector

Examples:
standalone/i3ddsmgen.C.

Definition at line 1900 of file UT_Matrix4.h.

template<typename T >
SYS_FORCE_INLINE void UT_Vector3T< T >::rowVecMult3 ( const UT_Matrix4D m)

This multiply will not extend the vector by adding a fourth element. Instead, it converts the Matrix4 to a Matrix3. This means that the translate component of the matrix is not applied to the vector

Definition at line 1906 of file UT_Matrix4.h.

template<typename T>
void UT_Vector3T< T >::save ( std::ostream &  os,
bool  binary = false 
) const

Protected I/O methods.

template<typename T>
bool UT_Vector3T< T >::save ( UT_JSONWriter w) const

Methods to serialize to a JSON stream. The vector is stored as an array of 3 reals.

template<typename T>
bool UT_Vector3T< T >::save ( UT_JSONValue v) const

Methods to serialize to a JSON stream. The vector is stored as an array of 3 reals.

template<typename T>
int UT_Vector3T< T >::segLineIntersect ( const UT_Vector3T< T > &  pa,
const UT_Vector3T< T > &  pb,
const UT_Vector3T< T > &  p2,
const UT_Vector3T< T > &  v2 
)

Compute the intersection of vector p2+t*v2 and the line segment between points pa and pb. If the two lines do not intersect we shift the (p2, v2) line along the line of min distance and return the point where it intersects the segment. If we find an intersection point along the stretch between pa and pb, we return 0. If the lines are parallel we return -1. If they intersect before pa we return -2, and if after pb, we return -3. The intersection point is valid with return codes 0,-2,-3.

template<typename T>
UT_Matrix3 UT_Vector3T< T >::symmetry ( bool  norm = true)

Create a matrix of symmetry around this vector: the matrix transforms a vector v into its symmetry around (*this), ie. two times the projection of v onto (*this) minus v. If we need to be normalized, set norm to non-false.

template<typename T>
SYS_FORCE_INLINE T& UT_Vector3T< T >::x ( void  )
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Examples:
SOP/SOP_BrushHairLen.h, and standalone/geo2voxel.C.

Definition at line 498 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T UT_Vector3T< T >::x ( void  ) const
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 499 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T& UT_Vector3T< T >::y ( void  )
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Examples:
standalone/geo2voxel.C.

Definition at line 500 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T UT_Vector3T< T >::y ( void  ) const
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 501 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T& UT_Vector3T< T >::z ( void  )
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Examples:
standalone/geo2voxel.C.

Definition at line 502 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T UT_Vector3T< T >::z ( void  ) const
inline

Return the components of the vector. The () operator does NOT check for the boundary condition.

Definition at line 503 of file UT_Vector3.h.

Friends And Related Function Documentation

template<typename T>
std::ostream& operator<< ( std::ostream &  os,
const UT_Vector3T< T > &  v 
)
friend

I/O friends.

Definition at line 611 of file UT_Vector3.h.

Member Data Documentation

template<typename T>
const int UT_Vector3T< T >::tuple_size = 3
static

Definition at line 204 of file UT_Vector3.h.


The documentation for this class was generated from the following files: