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 T value_type
 
using MF = typename UT_StorageNum< T >::MathFloat
 

Public Member Functions

SYS_FORCE_INLINE UT_Vector3T ()=default
 
constexpr SYS_FORCE_INLINE UT_Vector3T (const UT_Vector3T< T > &that)=default
 
constexpr SYS_FORCE_INLINE UT_Vector3T (UT_Vector3T< T > &&that)=default
 
constexpr SYS_FORCE_INLINE UT_Vector3T (T v) noexcept
 
constexpr SYS_FORCE_INLINE UT_Vector3T (const T vx, const T vy, const T vz) noexcept
 
constexpr SYS_FORCE_INLINE UT_Vector3T (const fpreal16 v[tuple_size]) noexcept
 
constexpr SYS_FORCE_INLINE UT_Vector3T (const fpreal32 v[tuple_size]) noexcept
 
constexpr SYS_FORCE_INLINE UT_Vector3T (const fpreal64 v[tuple_size]) noexcept
 
constexpr SYS_FORCE_INLINE UT_Vector3T (const int32 v[tuple_size]) noexcept
 
constexpr SYS_FORCE_INLINE UT_Vector3T (const int64 v[tuple_size]) noexcept
 
SYS_FORCE_INLINE UT_Vector3T (const UT_Vector2T< T > &v)
 
SYS_FORCE_INLINE UT_Vector3T (const UT_Vector4T< T > &v)
 
template<typename S >
constexpr SYS_FORCE_INLINE UT_Vector3T (const UT_Vector3T< S > &v) noexcept
 Our own type of any given value_type. More...
 
template<typename S , bool S_INSTANTIATED>
constexpr SYS_FORCE_INLINE UT_Vector3T (const UT_FixedVector< S, tuple_size, S_INSTANTIATED > &v) noexcept
 Arbitrary UT_FixedVector of the same size. More...
 
constexpr SYS_FORCE_INLINE
UT_Vector3T< T > & 
operator= (const UT_Vector3T< T > &that)=default
 
constexpr 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)
 
constexpr SYS_FORCE_INLINE
UT_Vector3T< T
operator- () const noexcept
 
void clampZero (T tol=T(0.00001f))
 
SYS_FORCE_INLINE void multiplyComponents (const UT_Vector3T< T > &v)
 
constexpr SYS_FORCE_INLINE void cross (const UT_Vector3T< T > &v) noexcept
 
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 ()
 
SYS_FORCE_INLINE T x () const
 
SYS_FORCE_INLINE Ty ()
 
SYS_FORCE_INLINE T y () const
 
SYS_FORCE_INLINE Tz ()
 
SYS_FORCE_INLINE T z () const
 
SYS_FORCE_INLINE Tr ()
 
SYS_FORCE_INLINE T r () const
 
SYS_FORCE_INLINE Tg ()
 
SYS_FORCE_INLINE T g () const
 
SYS_FORCE_INLINE Tb ()
 
SYS_FORCE_INLINE T b () const
 
constexpr SYS_FORCE_INLINE Toperator() (unsigned i) noexcept
 
constexpr SYS_FORCE_INLINE T operator() (unsigned i) const noexcept
 
void homogenize ()
 Express the point in homogeneous coordinates or vice-versa. More...
 
void dehomogenize ()
 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
 
constexpr SYS_FORCE_INLINE UT_FixedVector (const T that) noexcept
 Initializes every component to the same value. More...
 
SYS_FORCE_INLINE UT_FixedVector (const UT_FixedVector &that)=default
 
SYS_FORCE_INLINE UT_FixedVector (UT_FixedVector &&that)=default
 
SYS_FORCE_INLINE UT_FixedVector (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) noexcept
 
constexpr SYS_FORCE_INLINE UT_FixedVector (const S that[SIZE]) noexcept
 
constexpr SYS_FORCE_INLINE
const T
operator[] (exint i) const noexcept
 
constexpr SYS_FORCE_INLINE Toperator[] (exint i) noexcept
 
constexpr SYS_FORCE_INLINE
const T
data () const noexcept
 
constexpr SYS_FORCE_INLINE Tdata () noexcept
 
constexpr SYS_FORCE_INLINE
UT_FixedVector
operator= (const UT_FixedVector &that)=default
 
constexpr SYS_FORCE_INLINE
UT_FixedVector
operator= (UT_FixedVector &&that)=default
 
constexpr SYS_FORCE_INLINE
UT_FixedVector
operator= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) noexcept
 
constexpr SYS_FORCE_INLINE
const UT_FixedVector
operator= (T that) noexcept
 
constexpr SYS_FORCE_INLINE void operator+= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) noexcept
 
constexpr SYS_FORCE_INLINE void operator+= (T that) noexcept
 
constexpr SYS_FORCE_INLINE
UT_FixedVector< typename
UT_StorageBetter< T, S >::Type,
SIZE
operator+ (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
constexpr SYS_FORCE_INLINE void operator-= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) noexcept
 
constexpr SYS_FORCE_INLINE void operator-= (T that) noexcept
 
constexpr SYS_FORCE_INLINE
UT_FixedVector< typename
UT_StorageBetter< T, S >::Type,
SIZE
operator- (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
constexpr SYS_FORCE_INLINE
UT_FixedVector< T, SIZE
operator- () const noexcept
 
constexpr SYS_FORCE_INLINE void operator*= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) noexcept
 
constexpr SYS_FORCE_INLINE void operator*= (T that) noexcept
 
constexpr SYS_FORCE_INLINE
UT_FixedVector< typename
UT_StorageBetter< T, S >::Type,
SIZE
operator* (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
constexpr SYS_FORCE_INLINE
UT_FixedVector< T, SIZE
operator* (T that) const noexcept
 
constexpr SYS_FORCE_INLINE void operator/= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) noexcept
 
constexpr SYS_FORCE_INLINE void operator/= (T that) noexcept
 
constexpr SYS_FORCE_INLINE
UT_FixedVector< typename
UT_StorageBetter< T, S >::Type,
SIZE
operator/ (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
constexpr SYS_FORCE_INLINE
UT_FixedVector< T, SIZE
operator/ (T that) const noexcept
 
constexpr SYS_FORCE_INLINE void negate () noexcept
 
constexpr SYS_FORCE_INLINE bool operator== (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
constexpr 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
 
constexpr SYS_FORCE_INLINE
UT_StorageAtLeast32Bit< T, T >
::Type 
length2 () const noexcept
 
SYS_FORCE_INLINE MF 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 MF normalize ()
 
constexpr SYS_FORCE_INLINE bool operator< (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
constexpr SYS_FORCE_INLINE bool operator<= (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
constexpr SYS_FORCE_INLINE bool operator> (const UT_FixedVector< S, SIZE, S_INSTANTIATED > &that) const noexcept
 
constexpr 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 constexpr int tuple_size = 3
 
- Static Public Attributes inherited from UT_FixedVector< T, 3, true >
static constexpr 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]
 
- Protected Types inherited from UT_FixedVector< T, 3, true >
using CT = UT_FixedVectorCT
 
- Protected Member Functions inherited from UT_FixedVector< T, 3, true >
constexpr UT_FixedVector (const CT::ComponentFormType, const AS...as) noexcept
 

Detailed Description

Member Typedef Documentation

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

Definition at line 201 of file UT_Vector3.h.

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

Definition at line 218 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>
constexpr SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const UT_Vector3T< T > &  that)
default
template<typename T>
constexpr SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( UT_Vector3T< T > &&  that)
default
template<typename T>
constexpr SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( T  v)
inlineexplicitnoexcept

Definition at line 228 of file UT_Vector3.h.

template<typename T>
constexpr SYS_FORCE_INLINE UT_Vector3T< T >::UT_Vector3T ( const T  vx,
const T  vy,
const T  vz 
)
inlinenoexcept

Definition at line 231 of file UT_Vector3.h.

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

Definition at line 234 of file UT_Vector3.h.

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

Definition at line 237 of file UT_Vector3.h.

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

Definition at line 240 of file UT_Vector3.h.

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

Definition at line 243 of file UT_Vector3.h.

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

Definition at line 246 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 633 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 640 of file UT_Vector3.h.

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

Our own type of any given value_type.

Definition at line 255 of file UT_Vector3.h.

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

Arbitrary UT_FixedVector of the same size.

Definition at line 261 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 608 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 537 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 542 of file UT_Vector3.h.

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

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

Definition at line 516 of file UT_Vector3.h.

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

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

Definition at line 517 of file UT_Vector3.h.

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

Definition at line 285 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 1518 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 1957 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 1524 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 1963 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 1981 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 1987 of file UT_Matrix4.h.

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

Definition at line 377 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 ( )
inline

Express the point in homogeneous coordinates or vice-versa.

Definition at line 554 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 ( )
inlinestatic

Returns the vector size.

Definition at line 615 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 405 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 397 of file UT_Vector3.h.

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

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

Definition at line 514 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T UT_Vector3T< T >::g ( ) 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>
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 418 of file UT_Vector3.h.

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

Compute a hash.

Definition at line 532 of file UT_Vector3.h.

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

Express the point in homogeneous coordinates or vice-versa.

Definition at line 549 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 2030 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 1553 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 2002 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 2016 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 2009 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 2023 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 293 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 1539 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 1546 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 382 of file UT_Vector3.h.

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

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

Definition at line 519 of file UT_Vector3.h.

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

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

Definition at line 524 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 1531 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 1994 of file UT_Matrix4.h.

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

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

Definition at line 280 of file UT_Vector3.h.

template<typename T>
constexpr SYS_FORCE_INLINE UT_Vector3T<T>& UT_Vector3T< T >::operator= ( const UT_Vector3T< T > &  that)
default
template<typename T>
constexpr 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 269 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 ( )
inline

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

Definition at line 512 of file UT_Vector3.h.

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

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

Definition at line 513 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 1506 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 1945 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 1512 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 1951 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 1969 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 1975 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 ( )
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 506 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T UT_Vector3T< T >::x ( ) 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>
SYS_FORCE_INLINE T& UT_Vector3T< T >::y ( )
inline

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

Examples:
standalone/geo2voxel.C.

Definition at line 508 of file UT_Vector3.h.

template<typename T>
SYS_FORCE_INLINE T UT_Vector3T< T >::y ( ) 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>
SYS_FORCE_INLINE T& UT_Vector3T< T >::z ( )
inline

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

Examples:
standalone/geo2voxel.C.

Definition at line 510 of file UT_Vector3.h.

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

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

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

Member Data Documentation

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

Definition at line 219 of file UT_Vector3.h.


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