Workspace 6.21.5
Classes | Public Member Functions | Static Public Member Functions | Related Functions | List of all members
TransformMatrix Class Reference

#include <Mesh/Geometry/transformmatrix.h>

Classes

struct  FailedComponentExtraction
 Exception class for when an attempt to extract a component of a transformation fails. More...
 
struct  TransformHasNoInverse
 Exception class for when an attempt is made to find the inverse of a singular transform matrix. More...
 

Public Member Functions

 TransformMatrix ()
 
 TransformMatrix (const double *flatArray)
 
 TransformMatrix (const TransformByComponents &t)
 
 TransformMatrix (const TransformGroup &t)
 
 TransformMatrix (const TransformMatrix &m)
 
double calcDeterminant () const
 
TransformMatrix calcInverse () const
 
double calcMaxAbsoluteValue () const
 
bool getComponents (Vector3d &translation, Vector3d &rotation, Vector3d &scale, Vector3d &shear) const
 
const double * getFlatArray () const
 
Vector3d getRotationComponent () const
 
Vector3d getScaleComponent () const
 
Vector3d getShearComponent () const
 
Vector3d getTranslationComponent () const
 
bool operator!= (const TransformMatrix &m) const
 
double & operator() (int row, int col)
 
const double & operator() (int row, int col) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
TransformMatrixoperator*= (const TransformMatrix &M)
 
TransformMatrixoperator*= (double d)
 
TransformMatrixoperator= (const TransformGroup &g)
 
TransformMatrixoperator= (const TransformMatrix &m)
 
bool operator== (const TransformMatrix &m) const
 
TransformMatrixorthonormalizeRotationComponent ()
 
TransformMatrixrotate (double angle, const Vector3d &axis)
 
TransformMatrixrotateEuler (const Vector3d &angles)
 
TransformMatrixscale (const Vector3d &v)
 
TransformMatrixscale (double d)
 
void setToIdentity ()
 
TransformMatrixshear (const Vector3d &s)
 
TransformMatrixtranslate (const Vector3d &v)
 
TransformMatrixtranspose ()
 

Static Public Member Functions

static TransformMatrix calcOrthographicProjectionMatrix (double left, double right, double bottom, double top, double zNear, double zFar)
 
static TransformMatrix calcPerspectiveProjectionMatrix (double fieldOfViewY, double aspectRatio, double zNear, double zFar)
 
static TransformMatrix calcPerspectiveProjectionMatrix1 (double fieldOfViewX, double fieldOfViewY, double zNear, double zFar)
 
static TransformMatrix calcPerspectiveProjectionMatrix2 (double left, double right, double bottom, double top, double near, double far)
 
static TransformMatrix calcPerspectiveProjectionMatrix3 (double focalLengthX, double focalLengthY, double width, double height, double near, double far, double principlePointX, double principlePointY, double axisSkew)
 
static TransformMatrix calcRotationMatrix (const Vector3d &eulerAngles)
 
static TransformMatrix calcRotationMatrix (const Vector3d &right, const Vector3d &up, const Vector3d &forward)
 
static TransformMatrix calcRotationMatrix (double angle, const Vector3d &axis)
 
static TransformMatrix calcScaleMatrix (const Vector3d &s)
 
static TransformMatrix calcScaleMatrix (double d)
 
static TransformMatrix calcShearMatrix (const Vector3d &s)
 
static TransformMatrix calcTranslationMatrix (const Vector3d &t)
 
static TransformMatrix calcViewMatrix (const Mesh::Vector3d &right, const Mesh::Vector3d &up, const Mesh::Vector3d &view, const Mesh::Vector3d &translate)
 
static Vector3d canoniseEulerAngles (const Vector3d &euler)
 
static Vector3d rotationVectorToEulerAngles (const Vector3d &rotVec)
 

Related Functions

(Note that these are not member functions.)

QVector3D operator* (const TransformMatrix &M, const QVector3D &v)
 
QVector4D operator* (const TransformMatrix &M, const QVector4D &v)
 
Vector3d operator* (const TransformMatrix &M, const Vector3d &v)
 
TransformMatrix operator* (const TransformMatrix &M, double d)
 
TransformMatrix operator* (const TransformMatrix &Mleft, const TransformMatrix &Mright)
 
TransformMatrix operator* (double d, const TransformMatrix &M)
 
TransformMatrix operator+ (const TransformMatrix &m1, const TransformMatrix &m2)
 
TransformMatrix operator- (const TransformMatrix &m1, const TransformMatrix &m2)
 
std::ostream & operator<< (std::ostream &output, const TransformMatrix &m)
 
std::istream & operator>> (std::istream &input, TransformMatrix &m)
 

Detailed Description

We use the same row-column ordering as OpenGL for efficiency reasons. This allows a common performance-sensitive use of a transform matrix to be efficient.

The transformation matrix is a 4x4 matrix stored in column-major order. ie

\[
     \begin{bmatrix}
     m_0 & m_4 & m_8    & m_{12}
     m_1 & m_5 & m_9    & m_{13}
     m_2 & m_6 & m_{10} & m_{14}
     m_3 & m_7 & m_{11} & m_{15}
     \end{bmatrix}
 \]

To apply the transform to a 3D vector, you need to pre-multiply the w-augmented vector by the transformation matrix:

\[
     \left\{ \begin{matrix} x\prime y\prime z\prime w\prime \end{matrix} \right\} =
     \begin{bmatrix} M_{4 \times 4} \end{bmatrix}
     \left\{ \begin{matrix} x y z w \end{matrix} \right\}
 \]

where w is usually 1.0 and generally only deviates from this when performing advanced techniques such as perspective division, etc. If you want to use the matrix to post-multiply a vector, post-multiply the vector by the transpose of the matrix. ie

\[
     \left\{ \begin{matrix} x\prime & y\prime & z\prime & w\prime \end{matrix} \right\} =
     \left\{ \begin{matrix} x & y & z & w \end{matrix} \right\}
     \begin{bmatrix} M_{4 \times 4} \end{bmatrix}^T
 \]

To access a particular element of the matrix, use the object as though it were callable as a function with the two parameters specifying the row and column to retrieve. For example:

M(1,3) = 22.7;
M(0,2) += M(2,1);
Definition: transformmatrix.h:150

When breaking the transform matrix up into separate components, these components are applied in the following order:

This is important, since if you extract transformation components and want to reassemble the transform matrix, you must ensure that you apply the components in the correct order if you expect to end up back with the same matrix from which the components were derived.

Extracting matrix components: shear, scale, rotation and translation

Given a well-formed (i.e. invertible) TransformMatrix M, it is always possible to uniquely extract the shear and translation components of the matrix. However there is no unique scale and rotation factors, one reason for which is the following:

Therefore three negative scaling factors is the same as one negative scale factor and a rotation of $\pi$ about the same axis carrying the negative scale. Also, one positive and two negative scaling factors is the same as three positive factors and a $\pi$ rotation about the axis carrying the original positive scale.

Moreover, given one negative and two positive scaling factors, there exists a rotation of $\pi$ about a well defined axis that allows any of the three axes to be associated with a negative scaling factor.

Given these considerations, in an attempt to make the result of extracting scale and rotation from a matrix predictable we make the following convention:

This uniquely specifies the scaling vector.

For the extracted rotation vector, it will always have an angle in the interval [0, $\pi$]. If the angle is in the interval (0, $\pi$), then the rotation vector is uniquely specified.

Above all, we guarantee that when reconstructing the matrix from its extracted components, in the order shear, scale, rotation and finally translation, that the original and reconstructed matrix agree up to numerical precision.

Constructor & Destructor Documentation

◆ TransformMatrix() [1/5]

TransformMatrix ( )
inline

Constructs an identity matrix (ie no transformation).

◆ TransformMatrix() [2/5]

TransformMatrix ( const TransformMatrix m)
inline
Parameters
mThe matrix to copy.

◆ TransformMatrix() [3/5]

TransformMatrix ( const double *  flatArray)
inline
Parameters
flatArrayThe array of data to copy into the matrix.

◆ TransformMatrix() [4/5]

Parameters
tThe transform to use for this transformation matrix.

◆ TransformMatrix() [5/5]

Parameters
tThe transform components to use for this transformation matrix.

Member Function Documentation

◆ calcDeterminant()

double calcDeterminant ( ) const
Returns
The determinant of this matrix.

◆ calcInverse()

TransformMatrix calcInverse ( ) const

The algorithm currently employed is not particularly sophisticated. If performance is particularly important, consider using an LU factorisation instead.

Returns
The inverse of this transform matrix.
Exceptions
TransformHasNoInverseThrown if we are trying to invert a singular transform matrix.

◆ calcMaxAbsoluteValue()

double calcMaxAbsoluteValue ( ) const
Returns
The maximum absolute value in the matrix.

This function is mostly used as an error checking mechanism when used on a matrix that is the result of the difference of two TransformMatrix instances which should be the same. This is usually just a test or debugging aid.

◆ calcOrthographicProjectionMatrix()

TransformMatrix calcOrthographicProjectionMatrix ( double  left,
double  right,
double  bottom,
double  top,
double  zNear,
double  zFar 
)
static
Parameters
leftCoord for the left vertical clipping plane
rightCoord for the right vertical clipping plane
bottomCoord for the bottom horizontal clipping plane
topCoord for the top horizontal clipping plane
zNearCoord for the near depth clipping plane
zFarCoord for the far depth clipping plane

◆ calcPerspectiveProjectionMatrix()

TransformMatrix calcPerspectiveProjectionMatrix ( double  fieldOfViewY,
double  aspectRatio,
double  zNear,
double  zFar 
)
static
Parameters
fieldOfViewYThe field of view to apply in the perspective projection
aspectRatioThe width to height ratio of the projection
zNearThe near clipping plane
zFarThe far clipping plane

Calculate and return a perspective projection matrix for a right-handed coordinate system.

◆ calcPerspectiveProjectionMatrix1()

TransformMatrix calcPerspectiveProjectionMatrix1 ( double  fieldOfViewX,
double  fieldOfViewY,
double  zNear,
double  zFar 
)
static
Parameters
fieldOfViewXThe horizontal field of view to apply in the perspective projection
fieldOfViewYThe vertical field of view to apply in the perspective projection
zNearThe near clipping plane
zFarThe far clipping plane

Calculate and return a perspective projection matrix for a right-handed coordinate system.

◆ calcPerspectiveProjectionMatrix2()

TransformMatrix calcPerspectiveProjectionMatrix2 ( double  left,
double  right,
double  bottom,
double  top,
double  near,
double  far 
)
static

Calculate and return a perspective projection matrix for a right-handed coordinate system. Rather than taking a field of view, assume near is the focal length of the camera.

Parameters
leftLeft-most boundary of the frustum at the view plane.
rightRight-most boundary of the frustum at the view plane.
bottomBottom-most boundary of the frustum at the view plane.
topTop-most boundary of the frustum at the view plane.
nearNear-clipping plane.
farFar-clipping plane.

◆ calcPerspectiveProjectionMatrix3()

TransformMatrix calcPerspectiveProjectionMatrix3 ( double  focalLengthX,
double  focalLengthY,
double  width,
double  height,
double  near,
double  far,
double  principlePointX,
double  principlePointY,
double  axisSkew 
)
static

Calculate and return a perspective projection matrix for a right-handed coordinate system using the camera's intrinsic properties (its focal length, axis skew and principal point).

To understand the model of the camera's intrinsic params, this link is fairly helpful: http://ksimek.github.io/2013/08/13/intrinsic/

Parameters
focalLengthXThe horizontal focal length of the camera (mm)
focalLengthYThe vertical focal length of the camera (mm)
widthWidth of the projected image
heightHeight of the projected image
nearThe near clipping plane
farThe far clipping plane
principlePointXX-coordinate of the principle point (i.e. point on the image plane that the principle axis intersects)
principlePointYY-coordinate of the principle point (i.e. point on the image plane that the principle axis intersects)
axisSkewAny axis skew that needs to be taken into account

◆ calcRotationMatrix() [1/3]

TransformMatrix calcRotationMatrix ( const Vector3d eulerAngles)
static
Parameters
eulerAnglesThe euler angles defining the rotation.

The implementation of this function follows more or less directly Appendix G of the "OpenGL Programming Guide", otherwise known as "The Red Book".

◆ calcRotationMatrix() [2/3]

TransformMatrix calcRotationMatrix ( const Vector3d right,
const Vector3d up,
const Vector3d forward 
)
static

Construct a rotation matrix from three basis vectors.

Parameters
forwardThe forward vector of the basic matrix we are trying to create
upThe up vector of the matrix
rightThe right vector of the matrix

◆ calcRotationMatrix() [3/3]

TransformMatrix calcRotationMatrix ( double  angle,
const Vector3d axis 
)
static
Parameters
angleThe angle (in radians) to rotate about axis.
axisThe vector defining the axis about which to rotate. It need not be a unit vector, since a copy of it is converted to a unit vector by this function.
Precondition
axis must not be a zero vector.

The implementation of this function follows more or less directly Appendix G of the "OpenGL Programming Guide", otherwise known as "The Red Book".

◆ calcScaleMatrix() [1/2]

TransformMatrix calcScaleMatrix ( const Vector3d s)
static
Parameters
sThe scale factors to convert into a transform matrix.

The implementation of this function follows more or less directly Appendix G of the "OpenGL Programming Guide", otherwise known as "The Red Book".

See also
calcScaleMatrix(double)

◆ calcScaleMatrix() [2/2]

TransformMatrix calcScaleMatrix ( double  d)
static
Parameters
dThe uniform scale factor to convert into a transform matrix. This is equivalent to setting the scale factor to d for all three scale components.

The implementation of this function follows more or less directly Appendix G of the "OpenGL Programming Guide", otherwise known as "The Red Book".

See also
calcScaleMatrix(const Vector3d&)

◆ calcShearMatrix()

TransformMatrix calcShearMatrix ( const Vector3d s)
static
Parameters
sThe shear factors to convert into a transform matrix, where s.x, s,y and s,z is respectively the x/y, x/z, y/z shear ratios

Calculate the shear transform matrix corresponding to s.

◆ calcTranslationMatrix()

TransformMatrix calcTranslationMatrix ( const Vector3d t)
static
Parameters
tThe translation to convert into a transform matrix.

The implementation of this function follows more or less directly Appendix G of the "OpenGL Programming Guide", otherwise known as "The Red Book".

◆ calcViewMatrix()

TransformMatrix calcViewMatrix ( const Mesh::Vector3d right,
const Mesh::Vector3d up,
const Mesh::Vector3d view,
const Mesh::Vector3d translate 
)
static

◆ canoniseEulerAngles()

Vector3d canoniseEulerAngles ( const Vector3d euler)
static
Parameters
eulerThe Euler angles to canonise as a Vector3d. Each member should hold the rotation about it's axis, so euler is equivalent to (bank, attitude, heading).
Returns
The canonical version of the Euler angles passed in euler. This is a unique vector in the set of Euler angles where heading and bank are constrained to the range $[-\pi,\pi]$, and pitch is constrained to the range $[-\frac{\pi}{2},\frac{\pi}{2}]$, with the caveat that if pitch is either $\frac{\pi}{2}$ or $\frac{-\pi}{2}$ bank is set to zero (avoids phenomenon known as "gimbal lock").

◆ getComponents()

bool getComponents ( Vector3d translation,
Vector3d rotation,
Vector3d scale,
Vector3d shear 
) const
Parameters
translationOn successful return, this will contain the translation component of the matrix.
rotationOn successful return, this will contain the rotation component as a vector in the direction of the rotation axis. The magnitude of this vector is equal to the angle of rotation (in radians). Rotation in the rotation vector form returned by this method may be converted to Euler angles by rotationVectorToEulerAngles().
scaleOn successful return, this will contain the (x,y,z) scale factors.
shearOn successful return, this will contain the shear factors.

See the class description for details on the correct ordering when applying transformation components separately. This function exists so that all four components can be extracted at once. This can be more efficient than calling each of the component extraction functions separately, since certain parts of the extraction calculations can be re-used for more than one component.

The function assumes that the transformation matrix will be applied to a vector whose w component is 1.0 (a vector can always be scaled to meet this requirement).

See TransformMatrix overview documentation for the convention used for rotation and negative scaling.

Returns
True if all four components were able to be successfully extracted. If any of the extractions fail, the function returns false and all four parameters will remain unchanged from the values they had when the function was called.
See also
getTranslationComponent(), getRotationComponent(), getScaleComponent(), getShearComponent()

◆ getFlatArray()

const double * getFlatArray ( ) const
inline
Returns
The flat array holding the 16 values of the matrix. This is useful for passing directly to things like the glMultMatrix() function in OpenGL.

◆ getRotationComponent()

Vector3d getRotationComponent ( ) const
Returns
The rotation component of the 4x4 transformation matrix as a vector in the direction of the rotation axis with magnitude equal to the angle rotated in radians.

Rotation should be applied before an object is translated, but after scaling and shear.

The function assumes that the transformation matrix will be applied to a vector whose w component is 1.0 (a vector can always be scaled to meet this requirement).

Rotation in the rotation vector form returned by this method may be converted to Euler angles by

See also
rotationVectorToEulerAngles().

See TransformMatrix overview documentation for the convention used for rotation and negative scaling.

Exceptions
FailedComponentExtractionThis exception is thrown if the function was unable to extract the requested component. For a non-throwing way to extract components, use getComponents() instead.

◆ getScaleComponent()

Vector3d getScaleComponent ( ) const
Returns
The scale component of the 4x4 transformation matrix.

Scale should be applied before rotation and translation, but after shear.

The function assumes that the transformation matrix will be applied to a vector whose w component is 1.0 (a vector can always be scaled to meet this requirement).

See TransformMatrix overview documentation for the convention used for rotation and negative scaling.

Exceptions
FailedComponentExtractionThis exception is thrown if the function was unable to extract the requested component. For a non-throwing way to extract components, use getComponents() instead.

◆ getShearComponent()

Vector3d getShearComponent ( ) const
Returns
The shear component of the 4x4 transformation matrix.

Shear should be the first component in the transform to be applied. It must occur before scale, rotation and translation.

The function assumes that the transformation matrix will be applied to a vector whose w component is 1.0 (a vector can always be scaled to meet this requirement).

The x value of the return is x shear with respect to y (x/y shear) The y value of the return is the x/z shear. The z value of the return is the y/z shear.

Returns
Shear as a Vector3d ( x/y shear, x/z shear, y/z shear ).
Exceptions
FailedComponentExtractionThis exception is thrown if the function was unable to extract the requested component. For a non-throwing way to extract components, use getComponents() instead.

◆ getTranslationComponent()

Vector3d getTranslationComponent ( ) const
Returns
The translation component of the 4x4 transformation matrix.

Translation is the last component of the transform to be applied. Therefore, if applying a transform component-by-component, ensure that shear, scale and rotation are applied first (in that order).

The function assumes that the transformation matrix will be applied to a vector whose w component is 1.0 (a vector can always be scaled to meet this requirement).

◆ operator!=()

bool operator!= ( const TransformMatrix m) const
inline
Parameters
mMatrix to compare to this object.
Returns
True if m is not identical to this matrix.

◆ operator()() [1/2]

double & operator() ( int  row,
int  col 
)
inline

Access individual matrix elements

◆ operator()() [2/2]

const double & operator() ( int  row,
int  col 
) const
inline

◆ operator*=() [1/2]

TransformMatrix & operator*= ( const TransformMatrix M)
inline

Post-multiply the current matrix by M.

◆ operator*=() [2/2]

TransformMatrix & operator*= ( double  d)
inline

Multiply the current matrix by the scalar d.

◆ operator=() [1/2]

TransformMatrix & operator= ( const TransformGroup g)
Parameters
gThe transform group to assign to this object.
Returns
A reference to this matrix.

◆ operator=() [2/2]

TransformMatrix & operator= ( const TransformMatrix m)
inline
Parameters
mThe matrix to assign to this object.
Returns
A reference to this matrix.

◆ operator==()

bool operator== ( const TransformMatrix m) const
inline
Parameters
mMatrix to compare to this object.
Returns
True if m is identical to this matrix, ignoring rounding errors.

◆ orthonormalizeRotationComponent()

TransformMatrix & orthonormalizeRotationComponent ( )

Orthonormalizes the rotation component of the matrix using the Gram-Schmidt orthonormalization process.

Returns
the TransformMatrix so this function can be chained with others.

◆ rotate()

TransformMatrix & rotate ( double  angle,
const Vector3d axis 
)
Parameters
angleThe angle in radians to rotate about the specified axis.
axisThe rotation axis specified as a unit vector. No checking is performed to test that this is the case - that is the caller's responsibility.

Calling this function is equivalent to pre-multiplying the existing matrix by the result of calcRotationMatrix(). Note that we pre-multiply so that this rotation occurs after the current transformation.

Returns
This object to allow calls to be chained.

◆ rotateEuler()

TransformMatrix & rotateEuler ( const Vector3d eulerAngles)
Parameters
eulerAnglesThe euler angles defining the rotation.

Calling this function is equivalent to pre-multiplying the existing matrix by the result of calcRotationMatrix(). Note that we pre-multiply so that this rotation occurs after the current transformation.

Returns
This object to allow calls to be chained.

◆ rotationVectorToEulerAngles()

Vector3d rotationVectorToEulerAngles ( const Vector3d rotVec)
static
Parameters
rotVecA rotation vector with magnitude equal to the rotation angle (in radians) in the direction of the rotation axis.

This method returns canonical Euler angles. Canonical Euler angles unlike normal Euler angles have the property that no two canonical Euler angles result in the same net rotation.

Returns
Euler angles as a Vector3d assuming rotations were applied in z-rot then y-rot then x-rot order.

◆ scale() [1/2]

TransformMatrix & scale ( const Vector3d v)
Parameters
vA vector containing the three scaling factors to apply to the transformation matrix. In most cases, all three components will hold the same value, in which case the other overload of this function might be easier to use.

Calling this function is equivalent to pre-multiplying the existing matrix by the result of calcScaleMatrix(). Note that we pre-multiply so that this scaling occurs after the current transformation.

Returns
This object to allow calls to be chained.
See also
scale(double)

◆ scale() [2/2]

TransformMatrix & scale ( double  d)
Parameters
dA scalar to be used for all three components of the scale factor to apply to the transformation matrix.

Calling this function is equivalent to pre-multiplying the existing matrix by the result of calcScaleMatrix(). Note that we pre-multiply so that this scaling occurs after the current transformation.

Returns
This object to allow calls to be chained.
See also
scale(const Vector3d&)

◆ setToIdentity()

void setToIdentity ( )
inline

Discard the current matrix and replace it by the identity matrix (ie no transform).

◆ shear()

TransformMatrix & shear ( const Vector3d s)

◆ translate()

TransformMatrix & translate ( const Vector3d v)
Parameters
vThe 3D translation vector to apply to this matrix.

Calling this function is equivalent to pre-multiplying the existing matrix by the result of calcTranslationMatrix(). Note that we pre-multiply so that this translation occurs after the current transformation.

Returns
This object to allow calls to be chained.

◆ transpose()

TransformMatrix & transpose ( )

Transposes the matrix.

Returns
This object to allow calls to be chained.

Friends And Related Function Documentation

◆ operator*() [1/6]

QVector3D operator* ( const TransformMatrix M,
const QVector3D &  v 
)
related
Parameters
MThe transformation matrix to apply.
vThe 3D vector to be transformed. It is assumed that the 4th component of the vector (usually labelled as w) is unity for the purposes of the multiplication.
Returns
The result of pre-multiplying v by M.

◆ operator*() [2/6]

QVector4D operator* ( const TransformMatrix M,
const QVector4D &  v 
)
related
Parameters
MThe transform matrix to apply.
vThe 4D vector to be transformed. Unlike the Vector3D overload, the 4th component of the vector (w) will be multiplied out based on the assumption that it will not evaluate as unity.
Returns
The result of pre-multiplying v by M.

◆ operator*() [3/6]

Vector3d operator* ( const TransformMatrix M,
const Vector3d v 
)
related
Parameters
MThe transformation matrix to apply.
vThe 3D vector to be transformed. It is assumed that the 4th component of the vector (usually labelled as w) is unity for the purposes of the multiplication.
Returns
The result of pre-multiplying v by M.

◆ operator*() [4/6]

TransformMatrix operator* ( const TransformMatrix M,
double  d 
)
related
Parameters
MA transformation matrix.
dA scalar value to multiply the matrix by.
Returns
M * d which is equivalent to d * M

◆ operator*() [5/6]

TransformMatrix operator* ( const TransformMatrix Mleft,
const TransformMatrix Mright 
)
related
Parameters
MleftTransformation matrix on left hand side of multiplication.
MrightTransformation matrix on right hand side of multiplication.
Returns
Mleft * Mright

◆ operator*() [6/6]

TransformMatrix operator* ( double  d,
const TransformMatrix M 
)
related
Parameters
dA scalar value to multiply the matrix by.
MA transformation matrix.
Returns
M * d which is equivalent to d * M

◆ operator+()

TransformMatrix operator+ ( const TransformMatrix m1,
const TransformMatrix m2 
)
related
Parameters
m1A transformation matrix.
m2A transformation matrix.
Returns
m1 + m2

This operator has no meaning for a transformation matrix. It is mostly useful for debugging when comparing two different matrices.

◆ operator-()

TransformMatrix operator- ( const TransformMatrix m1,
const TransformMatrix m2 
)
related
Parameters
m1A transformation matrix.
m2A transformation matrix.
Returns
m1 - m2

This operator has no meaning for a transformation matrix. It is mostly useful for debugging when comparing two different matrices.

See also
TransformMatrix::calcMaxAbsoluteValue()

◆ operator<<()

std::ostream & operator<< ( std::ostream &  output,
const TransformMatrix m 
)
related

Provides output stream functionality for TransformMatrix objects.

◆ operator>>()

std::istream & operator>> ( std::istream &  input,
TransformMatrix m 
)
related

Provides input stream functionality for TransformMatrix objects.

Warning
The current implementation performs no error checking to ensure that the data is formatted correctly. It simply assumes that it can read 16 numbers consecutively with only whitespace (optionally including new-lines) between numbers.