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

Go to the source code of this file.

Classes

class  UT_Vector4T< T >
 4D Vector class. More...
 
class  UT_FixedVector< T, D >
 
struct  UT_FixedVectorTraits< UT_Vector4T< T > >
 
struct  SYS_IsFixedArrayNoCVRef< UT_Vector4T< T > >
 
struct  SYS_FixedArrayElementNoCVRef< UT_Vector4T< T > >
 
struct  SYS_FixedArraySizeNoCVRef< UT_Vector4T< T > >
 
struct  UT_Vector4TFromUnbounded< T >
 
struct  UT_FromUnbounded< V >
 UT_FromUnbounded creates a V from an unbounded array-like type. More...
 
struct  UT_FromUnbounded< UT_Vector4T< T > >
 
struct  UT_Vector4TFromFixed< T >
 
struct  UT_FromFixed< V >
 
struct  UT_FromFixed< UT_Vector4T< T > >
 

Macros

#define __UT_Vector4_h__
 

Functions

template<typename T , typename S >
UT_Vector4T< T > operator* (const UT_Vector4T< T > &v, const UT_Matrix4T< S > &m)
 
template<typename T >
constexpr UT_Vector4T< T > operator+ (const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2) noexcept
 
template<typename T >
constexpr UT_Vector4T< T > operator- (const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2) noexcept
 
template<typename T , typename S >
UT_Vector4T< T > operator+ (const UT_Vector4T< T > &v, S scalar)
 
template<typename T , typename S >
UT_Vector4T< T > operator- (const UT_Vector4T< T > &v, S scalar)
 
template<typename T , typename S >
UT_Vector4T< T > operator* (const UT_Vector4T< T > &v, S scalar)
 
template<typename T , typename S >
UT_Vector4T< T > operator/ (const UT_Vector4T< T > &v, S scalar)
 
template<typename T , typename S >
UT_Vector4T< T > operator+ (S scalar, const UT_Vector4T< T > &v)
 
template<typename T , typename S >
UT_Vector4T< T > operator- (S scalar, const UT_Vector4T< T > &v)
 
template<typename T , typename S >
constexpr UT_Vector4T< T > operator* (S scalar, const UT_Vector4T< T > &v) noexcept
 
template<typename T , typename S >
UT_Vector4T< T > operator/ (S scalar, const UT_Vector4T< T > &v)
 
template<typename T >
UT_API UT_Vector3T< T > cross (const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
 
template<typename T >
UT_API UT_Vector3T< T > cross (const UT_Vector3T< T > &v1, const UT_Vector4T< T > &v2)
 
template<typename T >
UT_API UT_Vector3T< T > cross (const UT_Vector4T< T > &v1, const UT_Vector3T< T > &v2)
 
template<typename T >
UT_Vector4T< T > SYSmin (const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
 Componentwise min and maximum. More...
 
template<typename T >
UT_Vector4T< T > SYSmax (const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
 
template<typename T , typename S >
bool SYSisEqual (const UT_Vector4T< T > &a, const UT_Vector4T< T > &b, S tol=SYS_FTOLERANCE)
 Componentwise equality. More...
 
template<typename T >
bool SYSisInteger (const UT_Vector4T< T > &v1)
 Componentwise integer test. More...
 
template<typename T , typename S >
UT_Vector4T< T > SYSlerp (const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2, S t)
 Componentwise linear interpolation. More...
 
template<typename T >
UT_Vector4T< T > SYSinvlerp (const UT_Vector4T< T > &a, const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
 
template<typename T , typename S >
UT_Vector4T< T > SYSbilerp (const UT_Vector4T< T > &u0v0, const UT_Vector4T< T > &u1v0, const UT_Vector4T< T > &u0v1, const UT_Vector4T< T > &u1v1, S u, S v)
 Bilinear interpolation. More...
 
template<typename T , typename S >
UT_Vector4T< T > SYSbarycentric (const UT_Vector4T< T > &v0, const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2, S u, S v)
 Barycentric interpolation. More...
 
template<typename T >
UT_Vector3T< T > operator+ (const UT_Vector4T< T > &v1, const UT_Vector3T< T > &v2)
 
template<typename T >
UT_Vector3T< T > operator+ (const UT_Vector3T< T > &v1, const UT_Vector4T< T > &v2)
 
template<typename T >
UT_Vector3T< T > operator- (const UT_Vector4T< T > &v1, const UT_Vector3T< T > &v2)
 
template<typename T >
UT_Vector3T< T > operator- (const UT_Vector3T< T > &v1, const UT_Vector4T< T > &v2)
 
template<typename T >
UT_Vector4T< T > operator* (const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
 
template<typename T >
UT_Vector4T< T > operator/ (const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
 
template<>
UT_Vector4T< floatoperator* (const UT_Vector4T< float > &v1, const UT_Vector4T< float > &v2)
 
template<>
UT_Vector4T< floatoperator/ (const UT_Vector4T< float > &v1, const UT_Vector4T< float > &v2)
 
template<typename T >
UT_Vector4T< T > SYSabs (const UT_Vector4T< T > &v)
 
template<>
UT_Vector4T< floatSYSlerp (const UT_Vector4T< float > &v1, const UT_Vector4T< float > &v2, float t)
 
template<typename T >
distance (const UT_Vector4T< T > &v1, const UT_Vector4T< T > &v2)
 
template<>
float distance (const UT_Vector4T< float > &v1, const UT_Vector4T< float > &v2)
 
template<>
float distance3 (const UT_Vector4T< float > &v1, const UT_Vector4T< float > &v2)
 
template<typename T >
size_t hash_value (const UT_Vector4T< T > &val)
 
template<typename T >
UT_API size_t format (char *buffer, size_t buffer_size, const UT_Vector4T< T > &v)
 
template<typename TS >
constexpr UT_Vector4T
< SYS_FixedArrayElement_t< TS > > 
UTmakeVector4T (const TS &as) noexcept
 
template<typename T >
dot (const UT_Vector4T< T > &v1, const UT_Vector3T< T > &v2)
 The dot product between two vectors. More...
 
template<typename T >
dot (const UT_Vector3T< T > &v1, const UT_Vector4T< T > &v2)
 The dot product between two vectors. More...
 
template<typename T , typename S >
UT_API UT_Vector4T< T > rowVecMult (const UT_Vector4T< T > &v, const UT_Matrix4T< S > &m)
 
template<typename T , typename S >
UT_API UT_Vector4T< T > colVecMult (const UT_Matrix4T< S > &m, const UT_Vector4T< T > &v)
 
template<typename T , typename S >
UT_API UT_Vector4T< T > rowVecMult3 (const UT_Vector4T< T > &v, const UT_Matrix4T< S > &m)
 
template<typename T , typename S >
UT_API UT_Vector4T< T > colVecMult3 (const UT_Matrix4T< S > &m, const UT_Vector4T< T > &v)
 
template<typename T >
distance4 (const UT_Vector4T< T > &p1, const UT_Vector4T< T > &p2)
 Compute the distance between two points. More...
 
template<typename T >
distance3 (const UT_Vector4T< T > &p1, const UT_Vector4T< T > &p2)
 Compute the distance between two points. More...
 
template<typename T >
distance3d (const UT_Vector4T< T > &p1, const UT_Vector4T< T > &p2)
 Compute the distance between two points. More...
 
template<typename T >
distance3d (const UT_Vector3T< T > &p1, const UT_Vector4T< T > &p2)
 Compute the distance between two points. More...
 
template<typename T >
distance3d (const UT_Vector4T< T > &p1, const UT_Vector3T< T > &p2)
 Compute the distance between two points. More...
 

Macro Definition Documentation

#define __UT_Vector4_h__

Definition at line 21 of file UT_Vector4.h.

Function Documentation

template<typename T , typename S >
UT_API UT_Vector4T<T> colVecMult ( const UT_Matrix4T< S > &  m,
const UT_Vector4T< T > &  v 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult().

template<typename T , typename S >
UT_API UT_Vector4T<T> colVecMult3 ( const UT_Matrix4T< S > &  m,
const UT_Vector4T< T > &  v 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult().

template<typename T >
UT_API UT_Vector3T<T> cross ( const UT_Vector4T< T > &  v1,
const UT_Vector4T< T > &  v2 
)

Although the cross product is undefined for 4D vectors, we believe it's useful in practice to define a function that takes two 4D vectors and computes the cross-product of their first 3 components

template<typename T >
UT_API UT_Vector3T<T> cross ( const UT_Vector3T< T > &  v1,
const UT_Vector4T< T > &  v2 
)
template<typename T >
UT_API UT_Vector3T<T> cross ( const UT_Vector4T< T > &  v1,
const UT_Vector3T< T > &  v2 
)
template<typename T >
T distance ( const UT_Vector4T< T > &  v1,
const UT_Vector4T< T > &  v2 
)
inline

Definition at line 918 of file UT_Vector4.h.

template<>
float distance ( const UT_Vector4T< float > &  v1,
const UT_Vector4T< float > &  v2 
)
inline

Definition at line 937 of file UT_Vector4.h.

template<typename T >
T distance3 ( const UT_Vector4T< T > &  p1,
const UT_Vector4T< T > &  p2 
)
inline

Compute the distance between two points.

Definition at line 927 of file UT_Vector4.h.

template<>
float distance3 ( const UT_Vector4T< float > &  v1,
const UT_Vector4T< float > &  v2 
)
inline

Definition at line 947 of file UT_Vector4.h.

template<typename T >
T distance3d ( const UT_Vector4T< T > &  p1,
const UT_Vector4T< T > &  p2 
)
inline

Compute the distance between two points.

Definition at line 162 of file UT_Vector4.h.

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

Compute the distance between two points.

Definition at line 165 of file UT_Vector4.h.

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

Compute the distance between two points.

Definition at line 168 of file UT_Vector4.h.

template<typename T >
T distance4 ( const UT_Vector4T< T > &  p1,
const UT_Vector4T< T > &  p2 
)
inline

Compute the distance between two points.

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

The dot product between two vectors.

Definition at line 824 of file UT_Vector4.h.

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

The dot product between two vectors.

Definition at line 829 of file UT_Vector4.h.

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

Definition at line 959 of file UT_Vector4.h.

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

Definition at line 913 of file UT_Vector4.h.

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

Definition at line 800 of file UT_Vector4.h.

template<typename T , typename S >
constexpr UT_Vector4T< T > operator* ( scalar,
const UT_Vector4T< T > &  v 
)
noexcept

Definition at line 805 of file UT_Vector4.h.

template<typename T >
UT_Vector4T<T> operator* ( const UT_Vector4T< T > &  v1,
const UT_Vector4T< T > &  v2 
)
inline

Definition at line 750 of file UT_Vector4.h.

template<>
UT_Vector4T<float> operator* ( const UT_Vector4T< float > &  v1,
const UT_Vector4T< float > &  v2 
)
inline

Definition at line 762 of file UT_Vector4.h.

template<typename T >
constexpr UT_Vector4T< T > operator+ ( const UT_Vector4T< T > &  v1,
const UT_Vector4T< T > &  v2 
)
noexcept

Definition at line 714 of file UT_Vector4.h.

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

Definition at line 780 of file UT_Vector4.h.

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

Definition at line 785 of file UT_Vector4.h.

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

Definition at line 720 of file UT_Vector4.h.

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

Definition at line 726 of file UT_Vector4.h.

template<typename T >
constexpr UT_Vector4T< T > operator- ( const UT_Vector4T< T > &  v1,
const UT_Vector4T< T > &  v2 
)
noexcept

Definition at line 732 of file UT_Vector4.h.

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

Definition at line 790 of file UT_Vector4.h.

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

Definition at line 795 of file UT_Vector4.h.

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

Definition at line 738 of file UT_Vector4.h.

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

Definition at line 744 of file UT_Vector4.h.

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

Definition at line 810 of file UT_Vector4.h.

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

Definition at line 818 of file UT_Vector4.h.

template<typename T >
UT_Vector4T<T> operator/ ( const UT_Vector4T< T > &  v1,
const UT_Vector4T< T > &  v2 
)
inline

Definition at line 756 of file UT_Vector4.h.

template<>
UT_Vector4T<float> operator/ ( const UT_Vector4T< float > &  v1,
const UT_Vector4T< float > &  v2 
)
inline

Definition at line 770 of file UT_Vector4.h.

template<typename T , typename S >
UT_API UT_Vector4T<T> rowVecMult ( const UT_Vector4T< T > &  v,
const UT_Matrix4T< S > &  m 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult().

template<typename T , typename S >
UT_API UT_Vector4T<T> rowVecMult3 ( const UT_Vector4T< T > &  v,
const UT_Matrix4T< S > &  m 
)

Multiplication of a row or column vector by a matrix (ie. right vs. left multiplication respectively). The operator*() declared above is an alias for rowVecMult().

template<typename T >
UT_Vector4T<T> SYSabs ( const UT_Vector4T< T > &  v)
inline

Definition at line 835 of file UT_Vector4.h.

template<typename T , typename S >
UT_Vector4T<T> SYSbarycentric ( const UT_Vector4T< T > &  v0,
const UT_Vector4T< T > &  v1,
const UT_Vector4T< T > &  v2,
u,
v 
)
inline

Barycentric interpolation.

Definition at line 122 of file UT_Vector4.h.

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

Bilinear interpolation.

Definition at line 115 of file UT_Vector4.h.

template<typename T >
UT_Vector4T< T > SYSinvlerp ( const UT_Vector4T< T > &  a,
const UT_Vector4T< T > &  v1,
const UT_Vector4T< T > &  v2 
)
inline

Definition at line 900 of file UT_Vector4.h.

template<typename T , typename S >
bool SYSisEqual ( const UT_Vector4T< T > &  a,
const UT_Vector4T< T > &  b,
tol = SYS_FTOLERANCE 
)
inline

Componentwise equality.

Definition at line 871 of file UT_Vector4.h.

template<typename T >
bool SYSisInteger ( const UT_Vector4T< T > &  v1)
inline

Componentwise integer test.

Definition at line 103 of file UT_Vector4.h.

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

Componentwise linear interpolation.

Definition at line 878 of file UT_Vector4.h.

template<>
UT_Vector4T<float> SYSlerp ( const UT_Vector4T< float > &  v1,
const UT_Vector4T< float > &  v2,
float  t 
)
inline

Definition at line 889 of file UT_Vector4.h.

template<typename T >
UT_Vector4T< T > SYSmax ( const UT_Vector4T< T > &  v1,
const UT_Vector4T< T > &  v2 
)
inline

Definition at line 859 of file UT_Vector4.h.

template<typename T >
UT_Vector4T< T > SYSmin ( const UT_Vector4T< T > &  v1,
const UT_Vector4T< T > &  v2 
)
inline

Componentwise min and maximum.

Definition at line 847 of file UT_Vector4.h.

template<typename TS >
constexpr UT_Vector4T< SYS_FixedArrayElement_t< TS > > UTmakeVector4T ( const TS &  as)
noexcept

Definition at line 1036 of file UT_Vector4.h.