HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
UT_Vector2.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_Math.h>
#include <SYS/SYS_Inline.h>
#include <VM/VM_SIMD.h>
#include <iosfwd>
#include <limits>
#include "UT_Matrix2.h"
+ Include dependency graph for UT_Vector2.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  UT_Vector2T< T >
 2D Vector class. More...
 
class  UT_FixedVector< T, D >
 
struct  UT_FixedVectorTraits< UT_Vector2T< T > >
 
struct  SYS_IsFixedArrayNoCVRef< UT_Vector2T< T > >
 
struct  SYS_FixedArrayElementNoCVRef< UT_Vector2T< T > >
 
struct  SYS_FixedArraySizeNoCVRef< UT_Vector2T< T > >
 
struct  UT_Vector2TFromUnbounded< T >
 
struct  UT_FromUnbounded< V >
 UT_FromUnbounded creates a V from an unbounded array-like type. More...
 
struct  UT_FromUnbounded< UT_Vector2T< T > >
 
struct  UT_Vector2TFromFixed< T >
 
struct  UT_FromFixed< V >
 
struct  UT_FromFixed< UT_Vector2T< T > >
 

Macros

#define __UT_Vector2_h__
 

Functions

template<typename T >
constexpr UT_Vector2T< T > operator+ (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2) noexcept
 
template<typename T >
constexpr UT_Vector2T< T > operator- (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2) noexcept
 
template<typename T >
constexpr bool operator< (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2) noexcept
 
template<typename T >
constexpr bool operator<= (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2) noexcept
 
template<typename T >
constexpr bool operator> (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2) noexcept
 
template<typename T >
constexpr bool operator>= (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2) noexcept
 
template<typename T , typename S >
UT_Vector2T< T > operator+ (const UT_Vector2T< T > &v, S scalar)
 
template<typename T , typename S >
UT_Vector2T< T > operator- (const UT_Vector2T< T > &v, S scalar)
 
template<typename T , typename S >
UT_Vector2T< T > operator* (const UT_Vector2T< T > &v, S scalar)
 
template<typename T , typename S >
UT_Vector2T< T > operator/ (const UT_Vector2T< T > &v, S scalar)
 
template<typename T , typename S >
UT_Vector2T< T > operator+ (S scalar, const UT_Vector2T< T > &v)
 
template<typename T , typename S >
UT_Vector2T< T > operator- (S scalar, const UT_Vector2T< T > &v)
 
template<typename T , typename S >
constexpr UT_Vector2T< T > operator* (S scalar, const UT_Vector2T< T > &v) noexcept
 
template<typename T , typename S >
UT_Vector2T< T > operator/ (S scalar, const UT_Vector2T< T > &v)
 
template<typename T , typename S >
UT_Vector2T< T > operator* (const UT_Vector2T< T > &v, const UT_Matrix2T< S > &mat)
 
template<typename T >
constexpr auto dot (const UT_Vector2T< T > &a, const UT_Vector2T< T > &b) noexcept
 The dot product. More...
 
template<typename T >
cross (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 Cross product, which for 2d vectors results in a fpreal. More...
 
template<typename T >
UT_Vector2T< T > SYSmin (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 Componentwise min and maximum. More...
 
template<typename T >
UT_Vector2T< T > SYSmax (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 
template<typename T , typename S >
bool SYSisEqual (const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
 Componentwise equality. More...
 
template<typename T >
bool SYSisInteger (const UT_Vector2T< T > &v1)
 Componentwise integer test. More...
 
template<typename T , typename S >
UT_Vector2T< T > SYSlerp (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2, S t)
 Componentwise linear interpolation. More...
 
template<typename T >
UT_Vector2T< T > SYSinvlerp (const UT_Vector2T< T > &a, const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 Componentwise inverse linear interpolation. More...
 
template<typename T , typename S >
UT_Vector2T< T > SYSbilerp (const UT_Vector2T< T > &u0v0, const UT_Vector2T< T > &u1v0, const UT_Vector2T< T > &u0v1, const UT_Vector2T< T > &u1v1, S u, S v)
 Bilinear interpolation. More...
 
template<typename T , typename S >
UT_Vector2T< T > SYSbarycentric (const UT_Vector2T< T > &v0, const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2, S u, S v)
 Barycentric interpolation. More...
 
template<typename T >
UT_Vector2T< T > project (const UT_Vector2T< T > &u, const UT_Vector2T< T > &v)
 The orthogonal projection of a vector u onto a vector v. More...
 
template<typename T >
distance2d (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 
template<typename T >
int UTinverseBilerp (const UT_Vector2T< T > &input, const UT_Vector2T< T > &p0, const UT_Vector2T< T > &du, const UT_Vector2T< T > &dv, const UT_Vector2T< T > &duv, UT_Vector2T< T > outputs[2])
 
template<typename T >
UT_Vector2T< T > operator* (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 
template<typename T >
UT_Vector2T< T > operator/ (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 
template<typename T >
UT_Vector2T< T > SYSabs (const UT_Vector2T< T > &v)
 
template<>
UT_Vector2T< floatrowVecMult (const UT_Vector2T< float > &v, const UT_Matrix2T< float > &m)
 
template<>
UT_Vector2T< floatcolVecMult (const UT_Matrix2T< float > &m, const UT_Vector2T< float > &v)
 
template<typename T >
size_t hash_value (const UT_Vector2T< T > &val)
 
template<typename T >
UT_API size_t format (char *buffer, size_t buffer_size, const UT_Vector2T< T > &v)
 
template<typename TS >
constexpr UT_Vector2T
< SYS_FixedArrayElement_t< TS > > 
UTmakeVector2T (const TS &as) noexcept
 
template<typename T , typename S >
UT_Vector2T< T > rowVecMult (const UT_Vector2T< T > &v, const UT_Matrix2T< S > &m)
 
template<typename T , typename S >
UT_Vector2T< T > colVecMult (const UT_Matrix2T< S > &m, const UT_Vector2T< T > &v)
 

Macro Definition Documentation

#define __UT_Vector2_h__

Definition at line 21 of file UT_Vector2.h.

Function Documentation

template<typename T , typename S >
UT_Vector2T< T > colVecMult ( const UT_Matrix2T< S > &  m,
const UT_Vector2T< T > &  v 
)
inline

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

Definition at line 720 of file UT_Vector2.h.

template<>
UT_Vector2T<float> colVecMult ( const UT_Matrix2T< float > &  m,
const UT_Vector2T< float > &  v 
)
inline

Definition at line 726 of file UT_Vector2.h.

template<typename T >
T cross ( const UT_Vector2T< T > &  v1,
const UT_Vector2T< T > &  v2 
)
inline

Cross product, which for 2d vectors results in a fpreal.

Definition at line 640 of file UT_Vector2.h.

template<typename T >
T distance2d ( const UT_Vector2T< T > &  v1,
const UT_Vector2T< T > &  v2 
)
inline

Definition at line 739 of file UT_Vector2.h.

template<typename T >
constexpr auto dot ( const UT_Vector2T< T > &  a,
const UT_Vector2T< T > &  b 
)
noexcept

The dot product.

Definition at line 634 of file UT_Vector2.h.

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

Definition at line 745 of file UT_Vector2.h.

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

Definition at line 613 of file UT_Vector2.h.

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

Definition at line 618 of file UT_Vector2.h.

template<typename T , typename S >
UT_Vector2T< T > operator* ( const UT_Vector2T< T > &  v,
const UT_Matrix2T< S > &  mat 
)
inline

Definition at line 734 of file UT_Vector2.h.

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

Definition at line 563 of file UT_Vector2.h.

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

Definition at line 553 of file UT_Vector2.h.

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

Definition at line 593 of file UT_Vector2.h.

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

Definition at line 598 of file UT_Vector2.h.

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

Definition at line 558 of file UT_Vector2.h.

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

Definition at line 603 of file UT_Vector2.h.

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

Definition at line 608 of file UT_Vector2.h.

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

Definition at line 623 of file UT_Vector2.h.

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

Definition at line 628 of file UT_Vector2.h.

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

Definition at line 568 of file UT_Vector2.h.

template<typename T >
constexpr bool operator< ( const UT_Vector2T< T > &  v1,
const UT_Vector2T< T > &  v2 
)
noexcept

Lexicographic order comparison operators

Definition at line 573 of file UT_Vector2.h.

template<typename T >
constexpr bool operator<= ( const UT_Vector2T< T > &  v1,
const UT_Vector2T< T > &  v2 
)
noexcept

Definition at line 578 of file UT_Vector2.h.

template<typename T >
constexpr bool operator> ( const UT_Vector2T< T > &  v1,
const UT_Vector2T< T > &  v2 
)
noexcept

Definition at line 583 of file UT_Vector2.h.

template<typename T >
constexpr bool operator>= ( const UT_Vector2T< T > &  v1,
const UT_Vector2T< T > &  v2 
)
noexcept

Definition at line 588 of file UT_Vector2.h.

template<typename T >
UT_Vector2T< T > project ( const UT_Vector2T< T > &  u,
const UT_Vector2T< T > &  v 
)
inline

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

Definition at line 700 of file UT_Vector2.h.

template<typename T , typename S >
UT_Vector2T< T > rowVecMult ( const UT_Vector2T< T > &  v,
const UT_Matrix2T< S > &  m 
)
inline

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

Definition at line 705 of file UT_Vector2.h.

template<>
UT_Vector2T<float> rowVecMult ( const UT_Vector2T< float > &  v,
const UT_Matrix2T< float > &  m 
)
inline

Definition at line 711 of file UT_Vector2.h.

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

Definition at line 646 of file UT_Vector2.h.

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

Barycentric interpolation.

Definition at line 111 of file UT_Vector2.h.

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

Bilinear interpolation.

Definition at line 105 of file UT_Vector2.h.

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

Componentwise inverse linear interpolation.

Definition at line 690 of file UT_Vector2.h.

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

Componentwise equality.

Examples:
DM/DM_ObjectPathHook.C.

Definition at line 674 of file UT_Vector2.h.

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

Componentwise integer test.

Definition at line 93 of file UT_Vector2.h.

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

Componentwise linear interpolation.

Definition at line 681 of file UT_Vector2.h.

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

Definition at line 664 of file UT_Vector2.h.

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

Componentwise min and maximum.

Definition at line 654 of file UT_Vector2.h.

template<typename T >
int UTinverseBilerp ( const UT_Vector2T< T > &  input,
const UT_Vector2T< T > &  p0,
const UT_Vector2T< T > &  du,
const UT_Vector2T< T > &  dv,
const UT_Vector2T< T > &  duv,
UT_Vector2T< T >  outputs[2] 
)

Given a 2D position, input, and a 2D quad, (p0, p0+du, p0+du+dv+duv, p0+dv), finds the 0, 1, or 2 locations in the parameter space of that quad that correspond with the input position. Only parameter locations approximately between 0 and 1 are accepted. The return value is the number of accepted parameter locations.

template<typename TS >
constexpr UT_Vector2T< SYS_FixedArrayElement_t< TS > > UTmakeVector2T ( const TS &  as)
noexcept

Definition at line 824 of file UT_Vector2.h.