HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
openvdb::OPENVDB_VERSION_NAME::math::Mat4< T > Class Template Reference

4x4 -matrix class. More...

#include <Mat3.h>

+ Inheritance diagram for openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >:

Public Types

typedef T value_type
 Data type held by the matrix. More...
 
typedef T ValueType
 
typedef Mat< 4, T > MyBase
 
- Public Types inherited from openvdb::OPENVDB_VERSION_NAME::math::Mat< 4, T >
enum  SIZE_
 
typedef T value_type
 
typedef T ValueType
 

Public Member Functions

 Mat4 ()
 Trivial constructor, the matrix is NOT initialized. More...
 
template<typename Source >
 Mat4 (Source *a)
 Constructor given array of elements, the ordering is in row major form: More...
 
template<typename Source >
 Mat4 (Source a, Source b, Source c, Source d, Source e, Source f, Source g, Source h, Source i, Source j, Source k, Source l, Source m, Source n, Source o, Source p)
 Constructor given array of elements, the ordering is in row major form: More...
 
template<typename Source >
 Mat4 (const Vec4< Source > &v1, const Vec4< Source > &v2, const Vec4< Source > &v3, const Vec4< Source > &v4, bool rows=true)
 
 Mat4 (const Mat< 4, T > &m)
 Copy constructor. More...
 
template<typename Source >
 Mat4 (const Mat4< Source > &m)
 Conversion constructor. More...
 
void setRow (int i, const Vec4< T > &v)
 Set ith row to vector v. More...
 
Vec4< T > row (int i) const
 Get ith row, e.g. Vec4f v = m.row(1);. More...
 
void setCol (int j, const Vec4< T > &v)
 Set jth column to vector v. More...
 
Vec4< T > col (int j) const
 Get jth column, e.g. Vec4f v = m.col(0);. More...
 
T * asPointer ()
 Direct access to the internal data. More...
 
const T * asPointer () const
 
T & operator() (int i, int j)
 
operator() (int i, int j) const
 
void setRows (const Vec4< T > &v1, const Vec4< T > &v2, const Vec4< T > &v3, const Vec4< T > &v4)
 Set the rows of "this" matrix to the vectors v1, v2, v3, v4. More...
 
void setColumns (const Vec4< T > &v1, const Vec4< T > &v2, const Vec4< T > &v3, const Vec4< T > &v4)
 Set the columns of "this" matrix to the vectors v1, v2, v3, v4. More...
 
OPENVDB_DEPRECATED void setBasis (const Vec4< T > &v1, const Vec4< T > &v2, const Vec4< T > &v3, const Vec4< T > &v4)
 Set the rows of "this" matrix to the vectors v1, v2, v3, v4. More...
 
void setZero ()
 
void setIdentity ()
 Set "this" matrix to identity. More...
 
void setMat3 (const Mat3< T > &m)
 Set upper left to a Mat3. More...
 
Mat3< T > getMat3 () const
 
Vec3< T > getTranslation () const
 Return the translation component. More...
 
void setTranslation (const Vec3< T > &t)
 
template<typename Source >
const Mat4operator= (const Mat4< Source > &m)
 Assignment operator. More...
 
bool eq (const Mat4 &m, T eps=1.0e-8) const
 Test if "this" is equivalent to m with tolerance of eps value. More...
 
Mat4< T > operator- () const
 Negation operator, for e.g. m1 = -m2;. More...
 
template<typename S >
const Mat4< T > & operator*= (S scalar)
 Return m, where $m_{i,j} *= scalar$ for $i, j \in [0, 3]$. More...
 
template<typename S >
const Mat4< T > & operator+= (const Mat4< S > &m1)
 Returns m0, where $m0_{i,j} += m1_{i,j}$ for $i, j \in [0, 3]$. More...
 
template<typename S >
const Mat4< T > & operator-= (const Mat4< S > &m1)
 Returns m0, where $m0_{i,j} -= m1_{i,j}$ for $i, j \in [0, 3]$. More...
 
template<typename S >
const Mat4< T > & operator*= (const Mat4< S > &m1)
 Return m, where $m_{i,j} = \sum_{k} m0_{i,k}*m1_{k,j}$ for $i, j \in [0, 3]$. More...
 
Mat4 transpose () const
 
Mat4 inverse (T tolerance=0) const
 
det () const
 Determinant of matrix. More...
 
template<typename T0 >
void setToTranslation (const Vec3< T0 > &v)
 Sets the matrix to a matrix that translates by v. More...
 
template<typename T0 >
void preTranslate (const Vec3< T0 > &tr)
 Left multiples by the specified translation, i.e. Trans * (*this) More...
 
template<typename T0 >
void postTranslate (const Vec3< T0 > &tr)
 Right multiplies by the specified translation matrix, i.e. (*this) * Trans. More...
 
template<typename T0 >
void setToScale (const Vec3< T0 > &v)
 Sets the matrix to a matrix that scales by v. More...
 
template<typename T0 >
void preScale (const Vec3< T0 > &v)
 
template<typename T0 >
void postScale (const Vec3< T0 > &v)
 
void setToRotation (Axis axis, T angle)
 Sets the matrix to a rotation about the given axis. More...
 
void setToRotation (const Vec3< T > &axis, T angle)
 Sets the matrix to a rotation about an arbitrary axis. More...
 
void setToRotation (const Vec3< T > &v1, const Vec3< T > &v2)
 Sets the matrix to a rotation that maps v1 onto v2 about the cross product of v1 and v2. More...
 
void preRotate (Axis axis, T angle)
 Left multiplies by a rotation clock-wiseabout the given axis into this matrix. More...
 
void postRotate (Axis axis, T angle)
 Right multiplies by a rotation clock-wiseabout the given axis into this matrix. More...
 
void setToShear (Axis axis0, Axis axis1, T shearby)
 Sets the matrix to a shear along axis0 by a fraction of axis1. More...
 
void preShear (Axis axis0, Axis axis1, T shear)
 Left multiplies a shearing transformation into the matrix. More...
 
void postShear (Axis axis0, Axis axis1, T shear)
 Right multiplies a shearing transformation into the matrix. More...
 
template<typename T0 >
Vec4< T0 > transform (const Vec4< T0 > &v) const
 Transform a Vec4 by post-multiplication. More...
 
template<typename T0 >
Vec3< T0 > transform (const Vec3< T0 > &v) const
 Transform a Vec3 by post-multiplication, without homogenous division. More...
 
template<typename T0 >
Vec4< T0 > pretransform (const Vec4< T0 > &v) const
 Transform a Vec4 by pre-multiplication. More...
 
template<typename T0 >
Vec3< T0 > pretransform (const Vec3< T0 > &v) const
 Transform a Vec3 by pre-multiplication, without homogenous division. More...
 
template<typename T0 >
Vec3< T0 > transformH (const Vec3< T0 > &p) const
 Transform a Vec3 by post-multiplication, doing homogenous divison. More...
 
template<typename T0 >
Vec3< T0 > pretransformH (const Vec3< T0 > &p) const
 Transform a Vec3 by pre-multiplication, doing homogenous division. More...
 
template<typename T0 >
Vec3< T0 > transform3x3 (const Vec3< T0 > &v) const
 Transform a Vec3 by post-multiplication, without translation. More...
 
T * operator[] (int i)
 
const T * operator[] (int i) const
 
- Public Member Functions inherited from openvdb::OPENVDB_VERSION_NAME::math::Mat< 4, T >
 Mat ()
 
 Mat (Mat const &src)
 Copy constructor. Used when the class signature matches exactly. More...
 
Matoperator= (Mat const &src)
 
std::string str (unsigned indentation=0) const
 
void write (std::ostream &os) const
 
void read (std::istream &is)
 
T absMax () const
 Return the maximum of the absolute of all elements in this matrix. More...
 

Static Public Member Functions

static const Mat4< T > & identity ()
 Predefined constant for identity matrix. More...
 
static const Mat4< T > & zero ()
 Predefined constant for zero matrix. More...
 
static Mat4 translation (const Vec3d &v)
 Sets the matrix to a matrix that translates by v. More...
 
- Static Public Member Functions inherited from openvdb::OPENVDB_VERSION_NAME::math::Mat< 4, T >
static unsigned numRows ()
 
static unsigned numColumns ()
 
static unsigned numElements ()
 

Related Functions

(Note that these are not member functions.)

template<typename T0 , typename T1 >
bool operator== (const Mat4< T0 > &m0, const Mat4< T1 > &m1)
 Equality operator, does exact floating point comparisons. More...
 
template<typename T0 , typename T1 >
bool operator!= (const Mat4< T0 > &m0, const Mat4< T1 > &m1)
 Inequality operator, does exact floating point comparisons. More...
 
template<typename S , typename T >
Mat4< typename promote< S, T >
::type
operator* (S scalar, const Mat4< T > &m)
 Returns M, where $M_{i,j} = m_{i,j} * scalar$ for $i, j \in [0, 3]$. More...
 
template<typename S , typename T >
Mat4< typename promote< S, T >
::type
operator* (const Mat4< T > &m, S scalar)
 Returns M, where $M_{i,j} = m_{i,j} * scalar$ for $i, j \in [0, 3]$. More...
 
template<typename T , typename MT >
Vec4< typename promote< T, MT >
::type
operator* (const Mat4< MT > &_m, const Vec4< T > &_v)
 Returns v, where $v_{i} = \sum_{n=0}^3 m_{i,n} * v_n $ for $i \in [0, 3]$. More...
 
template<typename T , typename MT >
Vec4< typename promote< T, MT >
::type
operator* (const Vec4< T > &_v, const Mat4< MT > &_m)
 Returns v, where $v_{i} = \sum_{n=0}^3 m_{n,i} * v_n $ for $i \in [0, 3]$. More...
 
template<typename T , typename MT >
Vec3< typename promote< T, MT >
::type
operator* (const Mat4< MT > &_m, const Vec3< T > &_v)
 Returns v, where $v_{i} = \sum_{n=0}^3\left(m_{i,n} * v_n + m_{i,3}\right)$ for $i \in [0, 2]$. More...
 
template<typename T , typename MT >
Vec3< typename promote< T, MT >
::type
operator* (const Vec3< T > &_v, const Mat4< MT > &_m)
 Returns v, where $v_{i} = \sum_{n=0}^3\left(m_{n,i} * v_n + m_{3,i}\right)$ for $i \in [0, 2]$. More...
 
template<typename T0 , typename T1 >
Mat4< typename promote< T0, T1 >
::type
operator+ (const Mat4< T0 > &m0, const Mat4< T1 > &m1)
 Returns M, where $M_{i,j} = m0_{i,j} + m1_{i,j}$ for $i, j \in [0, 3]$. More...
 
template<typename T0 , typename T1 >
Mat4< typename promote< T0, T1 >
::type
operator- (const Mat4< T0 > &m0, const Mat4< T1 > &m1)
 Returns M, where $M_{i,j} = m0_{i,j} - m1_{i,j}$ for $i, j \in [0, 3]$. More...
 
template<typename T0 , typename T1 >
Mat4< typename promote< T0, T1 >
::type
operator* (const Mat4< T0 > &m0, const Mat4< T1 > &m1)
 Returns M, where $M_{ij} = \sum_{n=0}^3\left(m0_{nj} + m1_{in}\right)$ for $i, j \in [0, 3]$. More...
 

Additional Inherited Members

- Protected Attributes inherited from openvdb::OPENVDB_VERSION_NAME::math::Mat< 4, T >
T mm [SIZE *SIZE]
 

Detailed Description

template<typename T>
class openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >

4x4 -matrix class.

Definition at line 48 of file Mat3.h.

Member Typedef Documentation

template<typename T>
typedef Mat<4, T> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::MyBase

Definition at line 63 of file Mat4.h.

template<typename T>
typedef T openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::value_type

Data type held by the matrix.

Definition at line 61 of file Mat4.h.

template<typename T>
typedef T openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::ValueType

Definition at line 62 of file Mat4.h.

Constructor & Destructor Documentation

template<typename T>
openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::Mat4 ( )
inline

Trivial constructor, the matrix is NOT initialized.

Definition at line 66 of file Mat4.h.

template<typename T>
template<typename Source >
openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::Mat4 ( Source *  a)
inline

Constructor given array of elements, the ordering is in row major form:

a[ 0] a[1]  a[ 2] a[ 3]
a[ 4] a[5]  a[ 6] a[ 7]
a[ 8] a[9]  a[10] a[11]
a[12] a[13] a[14] a[15]

Definition at line 76 of file Mat4.h.

template<typename T>
template<typename Source >
openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::Mat4 ( Source  a,
Source  b,
Source  c,
Source  d,
Source  e,
Source  f,
Source  g,
Source  h,
Source  i,
Source  j,
Source  k,
Source  l,
Source  m,
Source  n,
Source  o,
Source  p 
)
inline

Constructor given array of elements, the ordering is in row major form:

a b c d
e f g h
i j k l
m n o p

Definition at line 91 of file Mat4.h.

template<typename T>
template<typename Source >
openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::Mat4 ( const Vec4< Source > &  v1,
const Vec4< Source > &  v2,
const Vec4< Source > &  v3,
const Vec4< Source > &  v4,
bool  rows = true 
)
inline

Construct matrix from rows or columns vectors (defaults to rows for historical reasons)

Definition at line 120 of file Mat4.h.

template<typename T>
openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::Mat4 ( const Mat< 4, T > &  m)
inline

Copy constructor.

Definition at line 131 of file Mat4.h.

template<typename T>
template<typename Source >
openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::Mat4 ( const Mat4< Source > &  m)
inlineexplicit

Conversion constructor.

Definition at line 142 of file Mat4.h.

Member Function Documentation

template<typename T>
T* openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::asPointer ( )
inline

Direct access to the internal data.

Definition at line 216 of file Mat4.h.

template<typename T>
const T* openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::asPointer ( ) const
inline

Definition at line 217 of file Mat4.h.

template<typename T>
Vec4<T> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::col ( int  j) const
inline

Get jth column, e.g. Vec4f v = m.col(0);.

Definition at line 202 of file Mat4.h.

template<typename T>
T openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::det ( ) const
inline

Determinant of matrix.

Definition at line 691 of file Mat4.h.

template<typename T>
bool openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::eq ( const Mat4< T > &  m,
eps = 1.0e-8 
) const
inline

Test if "this" is equivalent to m with tolerance of eps value.

Definition at line 387 of file Mat4.h.

template<typename T>
Mat3<T> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::getMat3 ( ) const
inline

Definition at line 351 of file Mat4.h.

template<typename T>
Vec3<T> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::getTranslation ( ) const
inline

Return the translation component.

Definition at line 363 of file Mat4.h.

template<typename T>
static const Mat4<T>& openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::identity ( )
inlinestatic

Predefined constant for identity matrix.

Definition at line 152 of file Mat4.h.

template<typename T>
Mat4 openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::inverse ( tolerance = 0) const
inline
Returns
inverse of this
Exceptions
ArithmeticErrorif singular

Definition at line 539 of file Mat4.h.

template<typename T>
T& openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::operator() ( int  i,
int  j 
)
inline

Alternative indexed reference to the elements Note that the indices are row first and column second. e.g. m(0,0) = 1;

Definition at line 222 of file Mat4.h.

template<typename T>
T openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::operator() ( int  i,
int  j 
) const
inline

Alternative indexed constant reference to the elements, Note that the indices are row first and column second. e.g. float f = m(1,0);

Definition at line 232 of file Mat4.h.

template<typename T>
template<typename S >
const Mat4<T>& openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::operator*= ( scalar)
inline

Return m, where $m_{i,j} *= scalar$ for $i, j \in [0, 3]$.

Definition at line 409 of file Mat4.h.

template<typename T>
template<typename S >
const Mat4<T>& openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::operator*= ( const Mat4< S > &  m1)
inline

Return m, where $m_{i,j} = \sum_{k} m0_{i,k}*m1_{k,j}$ for $i, j \in [0, 3]$.

Definition at line 493 of file Mat4.h.

template<typename T>
template<typename S >
const Mat4<T>& openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::operator+= ( const Mat4< S > &  m1)
inline

Returns m0, where $m0_{i,j} += m1_{i,j}$ for $i, j \in [0, 3]$.

Definition at line 435 of file Mat4.h.

template<typename T>
Mat4<T> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::operator- ( ) const
inline

Negation operator, for e.g. m1 = -m2;.

Definition at line 397 of file Mat4.h.

template<typename T>
template<typename S >
const Mat4<T>& openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::operator-= ( const Mat4< S > &  m1)
inline

Returns m0, where $m0_{i,j} -= m1_{i,j}$ for $i, j \in [0, 3]$.

Definition at line 464 of file Mat4.h.

template<typename T>
template<typename Source >
const Mat4& openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::operator= ( const Mat4< Source > &  m)
inline

Assignment operator.

Definition at line 377 of file Mat4.h.

template<typename T>
T* openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::operator[] ( int  i)
inline

Array style reference to ith row e.g. m[1][3] = 4;

Definition at line 211 of file Mat4.h.

template<typename T>
const T* openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::operator[] ( int  i) const
inline

Array style reference to ith row e.g. m[1][3] = 4;

Definition at line 212 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::postRotate ( Axis  axis,
angle 
)
inline

Right multiplies by a rotation clock-wiseabout the given axis into this matrix.

Parameters
axisThe axis (one of X, Y, Z) of rotation.
angleThe clock-wise rotation angle, in radians.

Definition at line 932 of file Mat4.h.

template<typename T>
template<typename T0 >
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::postScale ( const Vec3< T0 > &  v)
inline

Definition at line 812 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::postShear ( Axis  axis0,
Axis  axis1,
shear 
)
inline

Right multiplies a shearing transformation into the matrix.

See Also
setToShear

Definition at line 1037 of file Mat4.h.

template<typename T>
template<typename T0 >
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::postTranslate ( const Vec3< T0 > &  tr)
inline

Right multiplies by the specified translation matrix, i.e. (*this) * Trans.

Definition at line 768 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::preRotate ( Axis  axis,
angle 
)
inline

Left multiplies by a rotation clock-wiseabout the given axis into this matrix.

Parameters
axisThe axis (one of X, Y, Z) of rotation.
angleThe clock-wise rotation angle, in radians.

Definition at line 852 of file Mat4.h.

template<typename T>
template<typename T0 >
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::preScale ( const Vec3< T0 > &  v)
inline

Definition at line 790 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::preShear ( Axis  axis0,
Axis  axis1,
shear 
)
inline

Left multiplies a shearing transformation into the matrix.

See Also
setToShear

Definition at line 1022 of file Mat4.h.

template<typename T>
template<typename T0 >
Vec4<T0> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::pretransform ( const Vec4< T0 > &  v) const
inline

Transform a Vec4 by pre-multiplication.

Definition at line 1066 of file Mat4.h.

template<typename T>
template<typename T0 >
Vec3<T0> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::pretransform ( const Vec3< T0 > &  v) const
inline

Transform a Vec3 by pre-multiplication, without homogenous division.

Definition at line 1073 of file Mat4.h.

template<typename T>
template<typename T0 >
Vec3<T0> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::pretransformH ( const Vec3< T0 > &  p) const
inline

Transform a Vec3 by pre-multiplication, doing homogenous division.

Definition at line 1102 of file Mat4.h.

template<typename T>
template<typename T0 >
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::preTranslate ( const Vec3< T0 > &  tr)
inline

Left multiples by the specified translation, i.e. Trans * (*this)

Definition at line 757 of file Mat4.h.

template<typename T>
Vec4<T> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::row ( int  i) const
inline

Get ith row, e.g. Vec4f v = m.row(1);.

Definition at line 185 of file Mat4.h.

template<typename T>
OPENVDB_DEPRECATED void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setBasis ( const Vec4< T > &  v1,
const Vec4< T > &  v2,
const Vec4< T > &  v3,
const Vec4< T > &  v4 
)
inline

Set the rows of "this" matrix to the vectors v1, v2, v3, v4.

Definition at line 290 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setCol ( int  j,
const Vec4< T > &  v 
)
inline

Set jth column to vector v.

Definition at line 192 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setColumns ( const Vec4< T > &  v1,
const Vec4< T > &  v2,
const Vec4< T > &  v3,
const Vec4< T > &  v4 
)
inline

Set the columns of "this" matrix to the vectors v1, v2, v3, v4.

Definition at line 265 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setIdentity ( )
inline

Set "this" matrix to identity.

Definition at line 319 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setMat3 ( const Mat3< T > &  m)
inline

Set upper left to a Mat3.

Definition at line 344 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setRow ( int  i,
const Vec4< T > &  v 
)
inline

Set ith row to vector v.

Definition at line 174 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setRows ( const Vec4< T > &  v1,
const Vec4< T > &  v2,
const Vec4< T > &  v3,
const Vec4< T > &  v4 
)
inline

Set the rows of "this" matrix to the vectors v1, v2, v3, v4.

Definition at line 240 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setToRotation ( Axis  axis,
angle 
)
inline

Sets the matrix to a rotation about the given axis.

Parameters
axisThe axis (one of X, Y, Z) to rotate about.
angleThe rotation angle, in radians.

Definition at line 837 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setToRotation ( const Vec3< T > &  axis,
angle 
)
inline

Sets the matrix to a rotation about an arbitrary axis.

Parameters
axisThe axis of rotation (cannot be zero-length)
angleThe rotation angle, in radians.

Definition at line 842 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setToRotation ( const Vec3< T > &  v1,
const Vec3< T > &  v2 
)
inline

Sets the matrix to a rotation that maps v1 onto v2 about the cross product of v1 and v2.

Definition at line 846 of file Mat4.h.

template<typename T>
template<typename T0 >
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setToScale ( const Vec3< T0 > &  v)
inline

Sets the matrix to a matrix that scales by v.

Definition at line 780 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setToShear ( Axis  axis0,
Axis  axis1,
shearby 
)
inline

Sets the matrix to a shear along axis0 by a fraction of axis1.

Parameters
axis0The fixed axis of the shear.
axis1The shear axis.
shearbyThe shear factor.

Definition at line 1014 of file Mat4.h.

template<typename T>
template<typename T0 >
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setToTranslation ( const Vec3< T0 > &  v)
inline

Sets the matrix to a matrix that translates by v.

Definition at line 732 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setTranslation ( const Vec3< T > &  t)
inline

Definition at line 368 of file Mat4.h.

template<typename T>
void openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::setZero ( )
inline

Definition at line 298 of file Mat4.h.

template<typename T>
template<typename T0 >
Vec4<T0> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::transform ( const Vec4< T0 > &  v) const
inline

Transform a Vec4 by post-multiplication.

Definition at line 1052 of file Mat4.h.

template<typename T>
template<typename T0 >
Vec3<T0> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::transform ( const Vec3< T0 > &  v) const
inline

Transform a Vec3 by post-multiplication, without homogenous division.

Definition at line 1059 of file Mat4.h.

template<typename T>
template<typename T0 >
Vec3<T0> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::transform3x3 ( const Vec3< T0 > &  v) const
inline

Transform a Vec3 by post-multiplication, without translation.

Definition at line 1123 of file Mat4.h.

template<typename T>
template<typename T0 >
Vec3<T0> openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::transformH ( const Vec3< T0 > &  p) const
inline

Transform a Vec3 by post-multiplication, doing homogenous divison.

Definition at line 1080 of file Mat4.h.

template<typename T>
static Mat4 openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::translation ( const Vec3d v)
inlinestatic

Sets the matrix to a matrix that translates by v.

Definition at line 721 of file Mat4.h.

template<typename T>
Mat4 openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::transpose ( ) const
inline
Returns
transpose of this

Definition at line 526 of file Mat4.h.

template<typename T>
static const Mat4<T>& openvdb::OPENVDB_VERSION_NAME::math::Mat4< T >::zero ( )
inlinestatic

Predefined constant for zero matrix.

Definition at line 163 of file Mat4.h.

Friends And Related Function Documentation

template<typename T0 , typename T1 >
bool operator!= ( const Mat4< T0 > &  m0,
const Mat4< T1 > &  m1 
)
related

Inequality operator, does exact floating point comparisons.

Definition at line 1166 of file Mat4.h.

template<typename S , typename T >
Mat4< typename promote< S, T >::type > operator* ( scalar,
const Mat4< T > &  m 
)
related

Returns M, where $M_{i,j} = m_{i,j} * scalar$ for $i, j \in [0, 3]$.

Definition at line 1171 of file Mat4.h.

template<typename S , typename T >
Mat4< typename promote< S, T >::type > operator* ( const Mat4< T > &  m,
scalar 
)
related

Returns M, where $M_{i,j} = m_{i,j} * scalar$ for $i, j \in [0, 3]$.

Definition at line 1179 of file Mat4.h.

template<typename T , typename MT >
Vec4< typename promote< T, MT >::type > operator* ( const Mat4< MT > &  _m,
const Vec4< T > &  _v 
)
related

Returns v, where $v_{i} = \sum_{n=0}^3 m_{i,n} * v_n $ for $i \in [0, 3]$.

Definition at line 1190 of file Mat4.h.

template<typename T , typename MT >
Vec4< typename promote< T, MT >::type > operator* ( const Vec4< T > &  _v,
const Mat4< MT > &  _m 
)
related

Returns v, where $v_{i} = \sum_{n=0}^3 m_{n,i} * v_n $ for $i \in [0, 3]$.

Definition at line 1205 of file Mat4.h.

template<typename T , typename MT >
Vec3< typename promote< T, MT >::type > operator* ( const Mat4< MT > &  _m,
const Vec3< T > &  _v 
)
related

Returns v, where $v_{i} = \sum_{n=0}^3\left(m_{i,n} * v_n + m_{i,3}\right)$ for $i \in [0, 2]$.

Definition at line 1221 of file Mat4.h.

template<typename T , typename MT >
Vec3< typename promote< T, MT >::type > operator* ( const Vec3< T > &  _v,
const Mat4< MT > &  _m 
)
related

Returns v, where $v_{i} = \sum_{n=0}^3\left(m_{n,i} * v_n + m_{3,i}\right)$ for $i \in [0, 2]$.

Definition at line 1236 of file Mat4.h.

template<typename T0 , typename T1 >
Mat4< typename promote< T0, T1 >::type > operator* ( const Mat4< T0 > &  m0,
const Mat4< T1 > &  m1 
)
related

Returns M, where $M_{ij} = \sum_{n=0}^3\left(m0_{nj} + m1_{in}\right)$ for $i, j \in [0, 3]$.

Definition at line 1273 of file Mat4.h.

template<typename T0 , typename T1 >
Mat4< typename promote< T0, T1 >::type > operator+ ( const Mat4< T0 > &  m0,
const Mat4< T1 > &  m1 
)
related

Returns M, where $M_{i,j} = m0_{i,j} + m1_{i,j}$ for $i, j \in [0, 3]$.

Definition at line 1250 of file Mat4.h.

template<typename T0 , typename T1 >
Mat4< typename promote< T0, T1 >::type > operator- ( const Mat4< T0 > &  m0,
const Mat4< T1 > &  m1 
)
related

Returns M, where $M_{i,j} = m0_{i,j} - m1_{i,j}$ for $i, j \in [0, 3]$.

Definition at line 1261 of file Mat4.h.

template<typename T0 , typename T1 >
bool operator== ( const Mat4< T0 > &  m0,
const Mat4< T1 > &  m1 
)
related

Equality operator, does exact floating point comparisons.

Definition at line 1154 of file Mat4.h.


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