Represents a two dimensional affine transformation. More...
#include <MatrixAffine2.h>
Public Types | |
typedef T | TYPE |
typedef T | value_type |
Public Member Functions | |
MatrixAffine2 () | |
MatrixAffine2 (T s) | |
MatrixAffine2 (const T *dt) | |
MatrixAffine2 (T d0, T d1, T d2, T d3, T d4, T d5) | |
MatrixAffine2 (const Vec2< T > &vx, const Vec2< T > &vy, const Vec2< T > &vz) | |
template<typename FromT > | |
MatrixAffine2 (const MatrixAffine2< FromT > &src) | |
MatrixAffine2 (const MatrixAffine2< T > &src) | |
MatrixAffine2< T > & | operator= (const MatrixAffine2< T > &rhs) |
MatrixAffine2< T > & | operator= (T rhs) |
template<typename FromT > | |
MatrixAffine2< T > & | operator= (const MatrixAffine2< FromT > &rhs) |
bool | equalCompare (const MatrixAffine2< T > &rhs, T epsilon) const |
bool | operator== (const MatrixAffine2< T > &rhs) const |
bool | operator!= (const MatrixAffine2< T > &rhs) const |
MatrixAffine2< T > & | operator*= (const MatrixAffine2< T > &rhs) |
MatrixAffine2< T > & | operator+= (const MatrixAffine2< T > &rhs) |
MatrixAffine2< T > & | operator-= (const MatrixAffine2< T > &rhs) |
MatrixAffine2< T > & | operator*= (T s) |
MatrixAffine2< T > & | operator/= (T s) |
MatrixAffine2< T > & | operator+= (T s) |
MatrixAffine2< T > & | operator-= (T s) |
const MatrixAffine2< T > | operator* (const MatrixAffine2< T > &rhs) const |
const MatrixAffine2< T > | operator+ (const MatrixAffine2< T > &rhs) const |
const MatrixAffine2< T > | operator- (const MatrixAffine2< T > &rhs) const |
Vec2< T > | transformPoint (const Vec2< T > &rhs) const |
post-multiplies column vector [rhs.x rhs.y 1] | |
const Vec2< T > | operator* (const Vec2< T > &rhs) const |
post-multiplies column vector [rhs.x rhs.y 1] | |
Vec2< T > | transformVec (const Vec2< T > &v) const |
post-multiplies column vector [rhs.x rhs.y 0] | |
const MatrixAffine2< T > | operator* (T rhs) const |
const MatrixAffine2< T > | operator/ (T rhs) const |
const MatrixAffine2< T > | operator+ (T rhs) const |
const MatrixAffine2< T > | operator- (T rhs) const |
T & | at (int row, int col) |
const T & | at (int row, int col) const |
T & | operator[] (int idx) |
const T & | operator[] (int idx) const |
void | set (const T *dt) |
void | set (T d0, T d1, T d2, T d3, T d4, T d5) |
Vec2< T > | getColumn (int col) const |
void | setColumn (int col, const Vec2< T > &v) |
Vec3< T > | getRow (int row) const |
void | setRow (int row, const Vec3< T > &v) |
void | getColumns (Vec2< T > *c0, Vec2< T > *c1, Vec2< T > *c2) const |
void | setColumns (const Vec2< T > &c0, const Vec2< T > &c1, const Vec2< T > &c2) |
void | getRows (Vec3< T > *r0, Vec3< T > *r1, Vec3< T > *r2) const |
void | setRows (const Vec3< T > &r0, const Vec3< T > &r1, const Vec3< T > &r2) |
void | setToNull () |
Sets the matrix to all zeros. | |
void | setToIdentity () |
Sets the matrix to the identity matrix. | |
bool | isSingular () const |
Returns whether the matrix is singular (and consequently not invertible) or not. | |
void | invert (T epsilon=EPSILON) |
Returns a copy of the matrix inverted. epsilon specifies the tolerance for testing for singularity. | |
MatrixAffine2< T > | invertCopy (T epsilon=EPSILON) const |
Returns a copy of the matrix inverted. epsilon specifies the tolerance for testing for singularity. | |
void | translate (const Vec2< T > &v) |
concatenate translation by v (conceptually, translate is before 'this') | |
MatrixAffine2 | translateCopy (const Vec2< T > &v) const |
Returns a copy of the matrix translated by v. | |
void | rotate (T radians) |
concatenate rotation by radians (conceptually, rotate is before 'this') | |
void | rotate (T radians, const Vec2< T > &pt) |
concatenate rotation by radians around the point pt (conceptually, rotate is before 'this') | |
MatrixAffine2 | rotateCopy (const Vec2< T > &v) const |
Returns a copy of the matrix rotate by radians. | |
MatrixAffine2 | rotateCopy (const Vec2< T > &v, const Vec2< T > &pt) const |
Returns a copy of the matrix rotate by radians around the point pt. | |
void | scale (T s) |
concatenate scale (conceptually, scale is before 'this') | |
void | scale (const Vec2< T > &v) |
concatenate scale (conceptually, scale is before 'this') | |
MatrixAffine2 | scaleCopy (T s) const |
Returns a copy of the matrix scaled by s. | |
MatrixAffine2 | scaleCopy (const Vec2< T > &v) const |
Returns a copy of the matrix scaled by v. | |
Static Public Member Functions | |
static MatrixAffine2< T > | identity () |
static MatrixAffine2< T > | one () |
static MatrixAffine2< T > | zero () |
static MatrixAffine2< T > | makeTranslate (const Vec2< T > &v) |
static MatrixAffine2< T > | makeRotate (T radians) |
static MatrixAffine2< T > | makeRotate (T radians, const Vec2< T > &pt) |
static MatrixAffine2< T > | makeScale (T s) |
static MatrixAffine2< T > | makeScale (const Vec2< T > &v) |
static MatrixAffine2< T > | makeSkewX (T radians) |
static MatrixAffine2< T > | makeSkewY (T radians) |
Public Attributes | |
union { | |
T m [6] | |
struct { | |
T m00 | |
T m10 | |
T m01 | |
T m11 | |
T m02 | |
T m12 | |
} | |
T mcols [3][2] | |
}; | |
Static Public Attributes | |
static const size_t | MEM_LEN = sizeof(T)*6 |
Friends | |
std::ostream & | operator<< (std::ostream &lhs, const MatrixAffine2< T > &rhs) |
Represents a two dimensional affine transformation.
typedef T cinder::MatrixAffine2< T >::TYPE |
typedef T cinder::MatrixAffine2< T >::value_type |
cinder::MatrixAffine2< T >::MatrixAffine2 | ( | ) |
cinder::MatrixAffine2< T >::MatrixAffine2 | ( | T | s | ) |
cinder::MatrixAffine2< T >::MatrixAffine2 | ( | const T * | dt | ) |
cinder::MatrixAffine2< T >::MatrixAffine2 | ( | T | d0, |
T | d1, | ||
T | d2, | ||
T | d3, | ||
T | d4, | ||
T | d5 | ||
) |
cinder::MatrixAffine2< T >::MatrixAffine2 | ( | const Vec2< T > & | vx, |
const Vec2< T > & | vy, | ||
const Vec2< T > & | vz | ||
) |
cinder::MatrixAffine2< T >::MatrixAffine2 | ( | const MatrixAffine2< FromT > & | src | ) |
cinder::MatrixAffine2< T >::MatrixAffine2 | ( | const MatrixAffine2< T > & | src | ) |
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator= | ( | const MatrixAffine2< T > & | rhs | ) |
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator= | ( | T | rhs | ) |
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator= | ( | const MatrixAffine2< FromT > & | rhs | ) |
bool cinder::MatrixAffine2< T >::equalCompare | ( | const MatrixAffine2< T > & | rhs, |
T | epsilon | ||
) | const |
bool cinder::MatrixAffine2< T >::operator== | ( | const MatrixAffine2< T > & | rhs | ) | const |
bool cinder::MatrixAffine2< T >::operator!= | ( | const MatrixAffine2< T > & | rhs | ) | const |
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator*= | ( | const MatrixAffine2< T > & | rhs | ) |
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator+= | ( | const MatrixAffine2< T > & | rhs | ) |
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator-= | ( | const MatrixAffine2< T > & | rhs | ) |
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator*= | ( | T | s | ) |
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator/= | ( | T | s | ) |
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator+= | ( | T | s | ) |
MatrixAffine2< T > & cinder::MatrixAffine2< T >::operator-= | ( | T | s | ) |
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator* | ( | const MatrixAffine2< T > & | rhs | ) | const |
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator+ | ( | const MatrixAffine2< T > & | rhs | ) | const |
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator- | ( | const MatrixAffine2< T > & | rhs | ) | const |
Vec2< T > cinder::MatrixAffine2< T >::transformPoint | ( | const Vec2< T > & | rhs | ) | const |
post-multiplies column vector [rhs.x rhs.y 1]
const Vec2< T > cinder::MatrixAffine2< T >::operator* | ( | const Vec2< T > & | rhs | ) | const |
post-multiplies column vector [rhs.x rhs.y 1]
Vec2< T > cinder::MatrixAffine2< T >::transformVec | ( | const Vec2< T > & | v | ) | const |
post-multiplies column vector [rhs.x rhs.y 0]
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator* | ( | T | rhs | ) | const |
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator/ | ( | T | rhs | ) | const |
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator+ | ( | T | rhs | ) | const |
const MatrixAffine2< T > cinder::MatrixAffine2< T >::operator- | ( | T | rhs | ) | const |
T & cinder::MatrixAffine2< T >::at | ( | int | row, |
int | col | ||
) |
const T & cinder::MatrixAffine2< T >::at | ( | int | row, |
int | col | ||
) | const |
T& cinder::MatrixAffine2< T >::operator[] | ( | int | idx | ) |
const T& cinder::MatrixAffine2< T >::operator[] | ( | int | idx | ) | const |
void cinder::MatrixAffine2< T >::set | ( | const T * | dt | ) |
void cinder::MatrixAffine2< T >::set | ( | T | d0, |
T | d1, | ||
T | d2, | ||
T | d3, | ||
T | d4, | ||
T | d5 | ||
) |
Vec2< T > cinder::MatrixAffine2< T >::getColumn | ( | int | col | ) | const |
void cinder::MatrixAffine2< T >::setColumn | ( | int | col, |
const Vec2< T > & | v | ||
) |
Vec3< T > cinder::MatrixAffine2< T >::getRow | ( | int | row | ) | const |
void cinder::MatrixAffine2< T >::setRow | ( | int | row, |
const Vec3< T > & | v | ||
) |
void cinder::MatrixAffine2< T >::getColumns | ( | Vec2< T > * | c0, |
Vec2< T > * | c1, | ||
Vec2< T > * | c2 | ||
) | const |
void cinder::MatrixAffine2< T >::setColumns | ( | const Vec2< T > & | c0, |
const Vec2< T > & | c1, | ||
const Vec2< T > & | c2 | ||
) |
void cinder::MatrixAffine2< T >::getRows | ( | Vec3< T > * | r0, |
Vec3< T > * | r1, | ||
Vec3< T > * | r2 | ||
) | const |
void cinder::MatrixAffine2< T >::setRows | ( | const Vec3< T > & | r0, |
const Vec3< T > & | r1, | ||
const Vec3< T > & | r2 | ||
) |
void cinder::MatrixAffine2< T >::setToNull | ( | ) |
Sets the matrix to all zeros.
void cinder::MatrixAffine2< T >::setToIdentity | ( | ) |
Sets the matrix to the identity matrix.
bool cinder::MatrixAffine2< T >::isSingular | ( | ) | const |
Returns whether the matrix is singular (and consequently not invertible) or not.
void cinder::MatrixAffine2< T >::invert | ( | T | epsilon = EPSILON | ) |
Returns a copy of the matrix inverted. epsilon specifies the tolerance for testing for singularity.
MatrixAffine2< T > cinder::MatrixAffine2< T >::invertCopy | ( | T | epsilon = EPSILON | ) | const |
Returns a copy of the matrix inverted. epsilon specifies the tolerance for testing for singularity.
void cinder::MatrixAffine2< T >::translate | ( | const Vec2< T > & | v | ) |
concatenate translation by v (conceptually, translate is before 'this')
MatrixAffine2 cinder::MatrixAffine2< T >::translateCopy | ( | const Vec2< T > & | v | ) | const |
Returns a copy of the matrix translated by v.
void cinder::MatrixAffine2< T >::rotate | ( | T | radians | ) |
concatenate rotation by radians (conceptually, rotate is before 'this')
void cinder::MatrixAffine2< T >::rotate | ( | T | radians, |
const Vec2< T > & | pt | ||
) |
concatenate rotation by radians around the point pt (conceptually, rotate is before 'this')
MatrixAffine2 cinder::MatrixAffine2< T >::rotateCopy | ( | const Vec2< T > & | v | ) | const |
Returns a copy of the matrix rotate by radians.
MatrixAffine2 cinder::MatrixAffine2< T >::rotateCopy | ( | const Vec2< T > & | v, |
const Vec2< T > & | pt | ||
) | const |
Returns a copy of the matrix rotate by radians around the point pt.
void cinder::MatrixAffine2< T >::scale | ( | T | s | ) |
concatenate scale (conceptually, scale is before 'this')
void cinder::MatrixAffine2< T >::scale | ( | const Vec2< T > & | v | ) |
concatenate scale (conceptually, scale is before 'this')
MatrixAffine2 cinder::MatrixAffine2< T >::scaleCopy | ( | T | s | ) | const |
Returns a copy of the matrix scaled by s.
MatrixAffine2 cinder::MatrixAffine2< T >::scaleCopy | ( | const Vec2< T > & | v | ) | const |
Returns a copy of the matrix scaled by v.
static MatrixAffine2<T> cinder::MatrixAffine2< T >::identity | ( | ) | [static] |
static MatrixAffine2<T> cinder::MatrixAffine2< T >::one | ( | ) | [static] |
static MatrixAffine2<T> cinder::MatrixAffine2< T >::zero | ( | ) | [static] |
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeTranslate | ( | const Vec2< T > & | v | ) | [static] |
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeRotate | ( | T | radians | ) | [static] |
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeRotate | ( | T | radians, |
const Vec2< T > & | pt | ||
) | [static] |
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeScale | ( | T | s | ) | [static] |
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeScale | ( | const Vec2< T > & | v | ) | [static] |
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeSkewX | ( | T | radians | ) | [static] |
MatrixAffine2< T > cinder::MatrixAffine2< T >::makeSkewY | ( | T | radians | ) | [static] |
std::ostream& operator<< | ( | std::ostream & | lhs, |
const MatrixAffine2< T > & | rhs | ||
) | [friend] |
const size_t cinder::MatrixAffine2< T >::MEM_LEN = sizeof(T)*6 [static] |
T cinder::MatrixAffine2< T >::m[6] |
T cinder::MatrixAffine2< T >::m00 |
T cinder::MatrixAffine2< T >::m10 |
T cinder::MatrixAffine2< T >::m01 |
T cinder::MatrixAffine2< T >::m11 |
T cinder::MatrixAffine2< T >::m02 |
T cinder::MatrixAffine2< T >::m12 |
T cinder::MatrixAffine2< T >::mcols[3][2] |
union { ... } |