HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
UT_Vector2.h File Reference
#include "UT_API.h"
#include "UT_Assert.h"
#include "UT_FixedVector.h"
#include "UT_VectorTypes.h"
#include <SYS/SYS_Math.h>
#include <SYS/SYS_Inline.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...
 
struct  UT_FixedVectorTraits< UT_Vector2T< T > >
 

Macros

#define __UT_Vector2_h__
 

Functions

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 >
bool operator< (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 
template<typename T >
bool operator<= (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 
template<typename T >
bool operator> (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 
template<typename T >
bool operator>= (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 
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 >
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 >
UT_Vector2T< T > operator* (const UT_Vector2T< T > &v, const UT_Matrix2T< S > &mat)
 
template<typename T >
dot (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2)
 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 >
UT_Vector2T< T > SYSlerp (const UT_Vector2T< T > &v1, const UT_Vector2T< T > &v2, S t)
 Componentwise 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)
 
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 >
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 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 481 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 436 of file UT_Vector2.h.

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

Definition at line 492 of file UT_Vector2.h.

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

The dot product.

Definition at line 431 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 498 of file UT_Vector2.h.

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

Definition at line 411 of file UT_Vector2.h.

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

Definition at line 416 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 487 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 361 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 351 of file UT_Vector2.h.

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

Definition at line 391 of file UT_Vector2.h.

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

Definition at line 396 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 356 of file UT_Vector2.h.

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

Definition at line 401 of file UT_Vector2.h.

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

Definition at line 406 of file UT_Vector2.h.

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

Definition at line 421 of file UT_Vector2.h.

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

Definition at line 426 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 366 of file UT_Vector2.h.

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

Definition at line 371 of file UT_Vector2.h.

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

Definition at line 376 of file UT_Vector2.h.

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

Definition at line 381 of file UT_Vector2.h.

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

Definition at line 386 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 470 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 475 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

Definition at line 88 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 462 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 452 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 442 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.