HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
GfMatrix4d Class Reference

#include <matrix4d.h>

Public Types

typedef double ScalarType
 

Public Member Functions

 GfMatrix4d ()=default
 Default constructor. Leaves the matrix component values undefined. More...
 
 GfMatrix4d (double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23, double m30, double m31, double m32, double m33)
 
 GfMatrix4d (const double m[4][4])
 
 GfMatrix4d (double s)
 
 GfMatrix4d (const GfVec4d &v)
 
GF_API GfMatrix4d (const std::vector< std::vector< double > > &v)
 
GF_API GfMatrix4d (const std::vector< std::vector< float > > &v)
 
GF_API GfMatrix4d (const std::vector< double > &r0, const std::vector< double > &r1, const std::vector< double > &r2, const std::vector< double > &r3)
 
GF_API GfMatrix4d (const std::vector< float > &r0, const std::vector< float > &r1, const std::vector< float > &r2, const std::vector< float > &r3)
 
GF_API GfMatrix4d (const GfRotation &rotate, const GfVec3d &translate)
 
GF_API GfMatrix4d (const GfMatrix3d &rotmx, const GfVec3d &translate)
 
GF_API GfMatrix4d (const class GfMatrix4f &m)
 This explicit constructor converts a "float" matrix to a "double" matrix. More...
 
void SetRow (int i, const GfVec4d &v)
 Sets a row of the matrix from a Vec4. More...
 
void SetColumn (int i, const GfVec4d &v)
 Sets a column of the matrix from a Vec4. More...
 
GfVec4d GetRow (int i) const
 Gets a row of the matrix as a Vec4. More...
 
GfVec4d GetColumn (int i) const
 Gets a column of the matrix as a Vec4. More...
 
GfMatrix4dSet (double m00, double m01, double m02, double m03, double m10, double m11, double m12, double m13, double m20, double m21, double m22, double m23, double m30, double m31, double m32, double m33)
 
GfMatrix4dSet (const double m[4][4])
 
GfMatrix4dSetIdentity ()
 Sets the matrix to the identity matrix. More...
 
GfMatrix4dSetZero ()
 Sets the matrix to zero. More...
 
GF_API GfMatrix4dSetDiagonal (double s)
 Sets the matrix to s times the identity matrix. More...
 
GF_API GfMatrix4dSetDiagonal (const GfVec4d &)
 Sets the matrix to have diagonal (v[0], v[1], v[2], v[3]). More...
 
GF_API double * Get (double m[4][4]) const
 
double * data ()
 
const double * data () const
 
double * GetArray ()
 Returns vector components as an array of double values. More...
 
const double * GetArray () const
 Returns vector components as a const array of double values. More...
 
double * operator[] (int i)
 
const double * operator[] (int i) const
 
GF_API bool operator== (const GfMatrix4d &m) const
 
GF_API bool operator== (const GfMatrix4f &m) const
 
bool operator!= (const GfMatrix4d &m) const
 
bool operator!= (const GfMatrix4f &m) const
 
GF_API GfMatrix4d GetTranspose () const
 Returns the transpose of the matrix. More...
 
GF_API GfMatrix4d GetInverse (double *det=NULL, double eps=0) const
 
GF_API double GetDeterminant () const
 Returns the determinant of the matrix. More...
 
void SetRow3 (int i, const GfVec3d &v)
 
GfVec3d GetRow3 (int i) const
 Gets a row of the matrix as a Vec3. More...
 
double GetDeterminant3 () const
 
bool HasOrthogonalRows3 () const
 
GF_API bool Orthonormalize (bool issueWarning=true)
 
GF_API GfMatrix4d GetOrthonormalized (bool issueWarning=true) const
 Returns an orthonormalized copy of the matrix. More...
 
GF_API double GetHandedness () const
 
bool IsRightHanded () const
 
bool IsLeftHanded () const
 
GF_API GfMatrix4doperator*= (const GfMatrix4d &m)
 Post-multiplies matrix m into this matrix. More...
 
GF_API GfMatrix4doperator*= (double)
 Multiplies the matrix by a double. More...
 
GF_API GfMatrix4doperator+= (const GfMatrix4d &m)
 Adds matrix m to this matrix. More...
 
GF_API GfMatrix4doperator-= (const GfMatrix4d &m)
 Subtracts matrix m from this matrix. More...
 
GF_API GfMatrix4dSetScale (double scaleFactor)
 Sets matrix to specify a uniform scaling by scaleFactor. More...
 
GF_API GfMatrix4d RemoveScaleShear () const
 
3D Transformation Utilities
GF_API GfMatrix4dSetRotate (const GfQuatd &rot)
 
GF_API GfMatrix4dSetRotateOnly (const GfQuatd &rot)
 
GF_API GfMatrix4dSetRotate (const GfRotation &rot)
 
GF_API GfMatrix4dSetRotateOnly (const GfRotation &rot)
 
GF_API GfMatrix4dSetRotate (const GfMatrix3d &mx)
 
GF_API GfMatrix4dSetRotateOnly (const GfMatrix3d &mx)
 
GF_API GfMatrix4dSetScale (const GfVec3d &scaleFactors)
 
GF_API GfMatrix4dSetTranslate (const GfVec3d &trans)
 
GF_API GfMatrix4dSetTranslateOnly (const GfVec3d &t)
 
GF_API GfMatrix4dSetTransform (const GfRotation &rotate, const GfVec3d &translate)
 
GF_API GfMatrix4dSetTransform (const GfMatrix3d &rotmx, const GfVec3d &translate)
 
GF_API GfMatrix4dSetLookAt (const GfVec3d &eyePoint, const GfVec3d &centerPoint, const GfVec3d &upDirection)
 
GF_API GfMatrix4dSetLookAt (const GfVec3d &eyePoint, const GfRotation &orientation)
 
GF_API bool Factor (GfMatrix4d *r, GfVec3d *s, GfMatrix4d *u, GfVec3d *t, GfMatrix4d *p, double eps=1e-10) const
 
GfVec3d ExtractTranslation () const
 
GF_API GfRotation ExtractRotation () const
 
GF_API GfQuatd ExtractRotationQuat () const
 
GF_API GfVec3d DecomposeRotation (const GfVec3d &axis0, const GfVec3d &axis1, const GfVec3d &axis2) const
 
GF_API GfMatrix3d ExtractRotationMatrix () const
 
GfVec3d Transform (const GfVec3d &vec) const
 
GfVec3f Transform (const GfVec3f &vec) const
 
GfVec3d TransformDir (const GfVec3d &vec) const
 
GfVec3f TransformDir (const GfVec3f &vec) const
 
GfVec3d TransformAffine (const GfVec3d &vec) const
 
GfVec3f TransformAffine (const GfVec3f &vec) const
 

Static Public Attributes

static const size_t numRows = 4
 
static const size_t numColumns = 4
 

Friends

class GfMatrix4f
 
size_t hash_value (GfMatrix4d const &m)
 Hash. More...
 
GfMatrix4d operator* (const GfMatrix4d &m1, double d)
 Returns the product of a matrix and a double. More...
 
GfMatrix4d operator* (double d, const GfMatrix4d &m)
 
GF_API friend GfMatrix4d operator- (const GfMatrix4d &m)
 Returns the unary negation of matrix m. More...
 
GfMatrix4d operator+ (const GfMatrix4d &m1, const GfMatrix4d &m2)
 Adds matrix m2 to m1. More...
 
GfMatrix4d operator- (const GfMatrix4d &m1, const GfMatrix4d &m2)
 Subtracts matrix m2 from m1. More...
 
GfMatrix4d operator* (const GfMatrix4d &m1, const GfMatrix4d &m2)
 Multiplies matrix m1 by m2. More...
 
GfMatrix4d operator/ (const GfMatrix4d &m1, const GfMatrix4d &m2)
 Divides matrix m1 by m2 (that is, m1 * inv(m2)). More...
 
GfVec4d operator* (const GfMatrix4d &m, const GfVec4d &vec)
 Returns the product of a matrix m and a column vector vec. More...
 
GfVec4d operator* (const GfVec4d &vec, const GfMatrix4d &m)
 Returns the product of row vector vec and a matrix m. More...
 
GF_API friend GfVec4f operator* (const GfMatrix4d &m, const GfVec4f &vec)
 
GF_API friend GfVec4f operator* (const GfVec4f &vec, const GfMatrix4d &m)
 

Detailed Description

Stores a 4x4 matrix of double elements. A basic type.

Matrices are defined to be in row-major order, so matrix[i][j] indexes the element in the i th row and the j th column.

3D Transformations

The following methods interpret a GfMatrix4d as a 3D transformation: SetRotate(), SetScale(), SetTranslate(), SetLookAt(), Factor(), ExtractTranslation(), ExtractRotation(), Transform(), TransformDir(). By convention, vectors are treated primarily as row vectors, implying the following:

  • Transformation matrices are organized to deal with row vectors, not column vectors. For example, the last row of a matrix contains the translation amounts.
  • Each of the Set() methods below completely rewrites the matrix; for example, SetTranslate() yields a matrix which does nothing but translate.
  • When multiplying two transformation matrices, the matrix on the left applies a more local transformation to a row vector. For example, if R represents a rotation matrix and T represents a translation matrix, the product R*T will rotate a row vector, then translate it.

Definition at line 87 of file matrix4d.h.

Member Typedef Documentation

typedef double GfMatrix4d::ScalarType

Definition at line 90 of file matrix4d.h.

Constructor & Destructor Documentation

GfMatrix4d::GfMatrix4d ( )
default

Default constructor. Leaves the matrix component values undefined.

GfMatrix4d::GfMatrix4d ( double  m00,
double  m01,
double  m02,
double  m03,
double  m10,
double  m11,
double  m12,
double  m13,
double  m20,
double  m21,
double  m22,
double  m23,
double  m30,
double  m31,
double  m32,
double  m33 
)
inline

Constructor. Initializes the matrix from 16 independent double values, specified in row-major order. For example, parameter m10 specifies the value in row 1 and column 0.

Definition at line 101 of file matrix4d.h.

GfMatrix4d::GfMatrix4d ( const double  m[4][4])
inline

Constructor. Initializes the matrix from a 4x4 array of double values, specified in row-major order.

Definition at line 113 of file matrix4d.h.

GfMatrix4d::GfMatrix4d ( double  s)
inlineexplicit

Constructor. Explicitly initializes the matrix to s times the identity matrix.

Definition at line 119 of file matrix4d.h.

GfMatrix4d::GfMatrix4d ( const GfVec4d v)
inlineexplicit

Constructor. Explicitly initializes the matrix to diagonal form, with the i th element on the diagonal set to v[i].

Definition at line 125 of file matrix4d.h.

GF_API GfMatrix4d::GfMatrix4d ( const std::vector< std::vector< double > > &  v)
explicit

Constructor. Initialize the matrix from a vector of vectors of double. The vector is expected to be 4x4. If it is too big, only the first 4 rows and/or columns will be used. If it is too small, uninitialized elements will be filled in with the corresponding elements from an identity matrix.

GF_API GfMatrix4d::GfMatrix4d ( const std::vector< std::vector< float > > &  v)
explicit

Constructor. Initialize the matrix from a vector of vectors of float. The vector is expected to be 4x4. If it is too big, only the first 4 rows and/or columns will be used. If it is too small, uninitialized elements will be filled in with the corresponding elements from an identity matrix.

GF_API GfMatrix4d::GfMatrix4d ( const std::vector< double > &  r0,
const std::vector< double > &  r1,
const std::vector< double > &  r2,
const std::vector< double > &  r3 
)
explicit

Constructor. Initialize the matrix from 4 row vectors of double. Each vector is expected to length 4. If it is too big, only the first 4 items will be used. If it is too small, uninitialized elements will be filled in with the corresponding elements from an identity matrix.

GF_API GfMatrix4d::GfMatrix4d ( const std::vector< float > &  r0,
const std::vector< float > &  r1,
const std::vector< float > &  r2,
const std::vector< float > &  r3 
)
explicit

Constructor. Initialize the matrix from 4 row vectors of float. Each vector is expected to length 4. If it is too big, only the first 4 items will be used. If it is too small, uninitialized elements will be filled in with the corresponding elements from an identity matrix.

GF_API GfMatrix4d::GfMatrix4d ( const GfRotation rotate,
const GfVec3d translate 
)

Constructor. Initializes a transformation matrix to perform the indicated rotation and translation.

GF_API GfMatrix4d::GfMatrix4d ( const GfMatrix3d rotmx,
const GfVec3d translate 
)

Constructor. Initializes a transformation matrix to perform the indicated rotation and translation.

GF_API GfMatrix4d::GfMatrix4d ( const class GfMatrix4f m)
explicit

This explicit constructor converts a "float" matrix to a "double" matrix.

Member Function Documentation

double* GfMatrix4d::data ( )
inline

Returns raw access to components of matrix as an array of double values. Components are in row-major order.

Definition at line 273 of file matrix4d.h.

const double* GfMatrix4d::data ( ) const
inline

Returns const raw access to components of matrix as an array of double values. Components are in row-major order.

Definition at line 279 of file matrix4d.h.

GF_API GfVec3d GfMatrix4d::DecomposeRotation ( const GfVec3d axis0,
const GfVec3d axis1,
const GfVec3d axis2 
) const

Decompose the rotation corresponding to this matrix about 3 orthogonal axes. If the axes are not orthogonal, warnings will be spewed.

This is a convenience method that is equivalent to calling ExtractRotation().Decompose().

GF_API GfRotation GfMatrix4d::ExtractRotation ( ) const

Returns the rotation corresponding to this matrix. This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

GF_API GfMatrix3d GfMatrix4d::ExtractRotationMatrix ( ) const

Returns the rotation corresponding to this matrix. This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

GF_API GfQuatd GfMatrix4d::ExtractRotationQuat ( ) const

Return the rotation corresponding to this matrix as a quaternion. This works well only if the matrix represents a rotation.

For good results, consider calling Orthonormalize() before calling this method.

GfVec3d GfMatrix4d::ExtractTranslation ( ) const
inline

Returns the translation part of the matrix, defined as the first three elements of the last row.

Definition at line 628 of file matrix4d.h.

GF_API bool GfMatrix4d::Factor ( GfMatrix4d r,
GfVec3d s,
GfMatrix4d u,
GfVec3d t,
GfMatrix4d p,
double  eps = 1e-10 
) const

Factors the matrix into 5 components:

  • M = r * s * -r * u * t where
  • t is a translation.
  • u and r are rotations, and -r is the transpose (inverse) of r. The u matrix may contain shear information.
  • s is a scale. Any projection information could be returned in matrix p, but currently p is never modified.

Returns false if the matrix is singular (as determined by eps). In that case, any zero scales in s are clamped to eps to allow computation of u.

GF_API double* GfMatrix4d::Get ( double  m[4][4]) const

Fills a 4x4 array of double values with the values in the matrix, specified in row-major order.

double* GfMatrix4d::GetArray ( )
inline

Returns vector components as an array of double values.

Definition at line 284 of file matrix4d.h.

const double* GfMatrix4d::GetArray ( ) const
inline

Returns vector components as a const array of double values.

Definition at line 289 of file matrix4d.h.

GfVec4d GfMatrix4d::GetColumn ( int  i) const
inline

Gets a column of the matrix as a Vec4.

Definition at line 208 of file matrix4d.h.

GF_API double GfMatrix4d::GetDeterminant ( ) const

Returns the determinant of the matrix.

double GfMatrix4d::GetDeterminant3 ( ) const
inline

Returns the determinant of the upper 3x3 matrix. This method is useful when the matrix describes a linear transformation such as a rotation or scale because the other values in the 4x4 matrix are not important.

Definition at line 379 of file matrix4d.h.

GF_API double GfMatrix4d::GetHandedness ( ) const

Returns the sign of the determinant of the upper 3x3 matrix, i.e. 1 for a right-handed matrix, -1 for a left-handed matrix, and 0 for a singular matrix.

GF_API GfMatrix4d GfMatrix4d::GetInverse ( double *  det = NULL,
double  eps = 0 
) const

Returns the inverse of the matrix, or FLT_MAX * SetIdentity() if the matrix is singular. (FLT_MAX is the largest value a float can have, as defined by the system.) The matrix is considered singular if the determinant is less than or equal to the optional parameter eps. If det is non-null, *det is set to the determinant.

GF_API GfMatrix4d GfMatrix4d::GetOrthonormalized ( bool  issueWarning = true) const

Returns an orthonormalized copy of the matrix.

GfVec4d GfMatrix4d::GetRow ( int  i) const
inline

Gets a row of the matrix as a Vec4.

Definition at line 203 of file matrix4d.h.

GfVec3d GfMatrix4d::GetRow3 ( int  i) const
inline

Gets a row of the matrix as a Vec3.

Definition at line 372 of file matrix4d.h.

GF_API GfMatrix4d GfMatrix4d::GetTranspose ( ) const

Returns the transpose of the matrix.

bool GfMatrix4d::HasOrthogonalRows3 ( ) const
inline

Returns true, if the row vectors of the upper 3x3 matrix form an orthogonal basis. Note they do not have to be unit length for this test to return true.

Definition at line 386 of file matrix4d.h.

bool GfMatrix4d::IsLeftHanded ( ) const
inline

Returns true if the vectors in the upper 3x3 matrix form a left-handed coordinate system.

Definition at line 424 of file matrix4d.h.

bool GfMatrix4d::IsRightHanded ( ) const
inline

Returns true if the vectors in the upper 3x3 matrix form a right-handed coordinate system.

Definition at line 418 of file matrix4d.h.

bool GfMatrix4d::operator!= ( const GfMatrix4d m) const
inline

Tests for element-wise matrix inequality. All elements must match exactly for matrices to be considered equal.

Definition at line 337 of file matrix4d.h.

bool GfMatrix4d::operator!= ( const GfMatrix4f m) const
inline

Tests for element-wise matrix inequality. All elements must match exactly for matrices to be considered equal.

Definition at line 343 of file matrix4d.h.

GF_API GfMatrix4d& GfMatrix4d::operator*= ( const GfMatrix4d m)

Post-multiplies matrix m into this matrix.

GF_API GfMatrix4d& GfMatrix4d::operator*= ( double  )

Multiplies the matrix by a double.

GF_API GfMatrix4d& GfMatrix4d::operator+= ( const GfMatrix4d m)

Adds matrix m to this matrix.

GF_API GfMatrix4d& GfMatrix4d::operator-= ( const GfMatrix4d m)

Subtracts matrix m from this matrix.

GF_API bool GfMatrix4d::operator== ( const GfMatrix4d m) const

Tests for element-wise matrix equality. All elements must match exactly for matrices to be considered equal.

GF_API bool GfMatrix4d::operator== ( const GfMatrix4f m) const

Tests for element-wise matrix equality. All elements must match exactly for matrices to be considered equal.

double* GfMatrix4d::operator[] ( int  i)
inline

Accesses an indexed row i of the matrix as an array of 4 double values so that standard indexing (such as m[0][1]) works correctly.

Definition at line 296 of file matrix4d.h.

const double* GfMatrix4d::operator[] ( int  i) const
inline

Accesses an indexed row i of the matrix as an array of 4 double values so that standard indexing (such as m[0][1]) works correctly.

Definition at line 301 of file matrix4d.h.

GF_API bool GfMatrix4d::Orthonormalize ( bool  issueWarning = true)

Makes the matrix orthonormal in place. This is an iterative method that is much more stable than the previous cross/cross method. If the iterative method does not converge, a warning is issued.

Returns true if the iteration converged, false otherwise. Leaves any translation part of the matrix unchanged. If issueWarning is true, this method will issue a warning if the iteration does not converge, otherwise it will be silent.

GF_API GfMatrix4d GfMatrix4d::RemoveScaleShear ( ) const

Returns the matrix with any scaling or shearing removed, leaving only the rotation and translation. If the matrix cannot be decomposed, returns the original matrix.

GfMatrix4d& GfMatrix4d::Set ( double  m00,
double  m01,
double  m02,
double  m03,
double  m10,
double  m11,
double  m12,
double  m13,
double  m20,
double  m21,
double  m22,
double  m23,
double  m30,
double  m31,
double  m32,
double  m33 
)
inline

Sets the matrix from 16 independent double values, specified in row-major order. For example, parameter m10 specifies the value in row 1 and column 0.

Definition at line 215 of file matrix4d.h.

GfMatrix4d& GfMatrix4d::Set ( const double  m[4][4])
inline

Sets the matrix from a 4x4 array of double values, specified in row-major order.

Definition at line 228 of file matrix4d.h.

void GfMatrix4d::SetColumn ( int  i,
const GfVec4d v 
)
inline

Sets a column of the matrix from a Vec4.

Definition at line 195 of file matrix4d.h.

GF_API GfMatrix4d& GfMatrix4d::SetDiagonal ( double  s)

Sets the matrix to s times the identity matrix.

GF_API GfMatrix4d& GfMatrix4d::SetDiagonal ( const GfVec4d )

Sets the matrix to have diagonal (v[0], v[1], v[2], v[3]).

GfMatrix4d& GfMatrix4d::SetIdentity ( )
inline

Sets the matrix to the identity matrix.

Definition at line 249 of file matrix4d.h.

GF_API GfMatrix4d& GfMatrix4d::SetLookAt ( const GfVec3d eyePoint,
const GfVec3d centerPoint,
const GfVec3d upDirection 
)

Sets the matrix to specify a viewing matrix from parameters similar to those used by gluLookAt(3G). eyePoint represents the eye point in world space. centerPoint represents the world-space center of attention. upDirection is a vector indicating which way is up.

GF_API GfMatrix4d& GfMatrix4d::SetLookAt ( const GfVec3d eyePoint,
const GfRotation orientation 
)

Sets the matrix to specify a viewing matrix from a world-space eyePoint and a world-space rotation that rigidly rotates the orientation from its canonical frame, which is defined to be looking along the -z axis with the +y axis as the up direction.

GF_API GfMatrix4d& GfMatrix4d::SetRotate ( const GfQuatd rot)

Sets the matrix to specify a rotation equivalent to rot, and clears the translation.

GF_API GfMatrix4d& GfMatrix4d::SetRotate ( const GfRotation rot)

Sets the matrix to specify a rotation equivalent to rot, and clears the translation.

GF_API GfMatrix4d& GfMatrix4d::SetRotate ( const GfMatrix3d mx)

Sets the matrix to specify a rotation equivalent to mx, and clears the translation.

GF_API GfMatrix4d& GfMatrix4d::SetRotateOnly ( const GfQuatd rot)

Sets the matrix to specify a rotation equivalent to rot, without clearing the translation.

GF_API GfMatrix4d& GfMatrix4d::SetRotateOnly ( const GfRotation rot)

Sets the matrix to specify a rotation equivalent to rot, without clearing the translation.

GF_API GfMatrix4d& GfMatrix4d::SetRotateOnly ( const GfMatrix3d mx)

Sets the matrix to specify a rotation equivalent to mx, without clearing the translation.

void GfMatrix4d::SetRow ( int  i,
const GfVec4d v 
)
inline

Sets a row of the matrix from a Vec4.

Definition at line 187 of file matrix4d.h.

void GfMatrix4d::SetRow3 ( int  i,
const GfVec3d v 
)
inline

Sets a row of the matrix from a Vec3. The fourth element of the row is ignored.

Definition at line 365 of file matrix4d.h.

GF_API GfMatrix4d& GfMatrix4d::SetScale ( double  scaleFactor)

Sets matrix to specify a uniform scaling by scaleFactor.

GF_API GfMatrix4d& GfMatrix4d::SetScale ( const GfVec3d scaleFactors)

Sets the matrix to specify a nonuniform scaling in x, y, and z by the factors in vector scaleFactors.

GF_API GfMatrix4d& GfMatrix4d::SetTransform ( const GfRotation rotate,
const GfVec3d translate 
)

Sets matrix to specify a rotation by rotate and a translation by translate.

GF_API GfMatrix4d& GfMatrix4d::SetTransform ( const GfMatrix3d rotmx,
const GfVec3d translate 
)

Sets matrix to specify a rotation by rotmx and a translation by translate.

GF_API GfMatrix4d& GfMatrix4d::SetTranslate ( const GfVec3d trans)

Sets matrix to specify a translation by the vector trans, and clears the rotation.

GF_API GfMatrix4d& GfMatrix4d::SetTranslateOnly ( const GfVec3d t)

Sets matrix to specify a translation by the vector trans, without clearing the rotation.

GfMatrix4d& GfMatrix4d::SetZero ( )
inline

Sets the matrix to zero.

Definition at line 254 of file matrix4d.h.

GfVec3d GfMatrix4d::Transform ( const GfVec3d vec) const
inline

Transforms the row vector vec by the matrix, returning the result. This treats the vector as a 4-component vector whose fourth component is 1.

Definition at line 669 of file matrix4d.h.

GfVec3f GfMatrix4d::Transform ( const GfVec3f vec) const
inline

Transforms the row vector vec by the matrix, returning the result. This treats the vector as a 4-component vector whose fourth component is 1. This is an overloaded method; it differs from the other version in that it returns a different value type.

Definition at line 681 of file matrix4d.h.

GfVec3d GfMatrix4d::TransformAffine ( const GfVec3d vec) const
inline

Transforms the row vector vec by the matrix, returning the result. This treats the vector as a 4-component vector whose fourth component is 1 and ignores the fourth column of the matrix (i.e. assumes it is (0, 0, 0, 1)).

Definition at line 717 of file matrix4d.h.

GfVec3f GfMatrix4d::TransformAffine ( const GfVec3f vec) const
inline

Transforms the row vector vec by the matrix, returning the result. This treats the vector as a 4-component vector whose fourth component is 1 and ignores the fourth column of the matrix (i.e. assumes it is (0, 0, 0, 1)).

Definition at line 728 of file matrix4d.h.

GfVec3d GfMatrix4d::TransformDir ( const GfVec3d vec) const
inline

Transforms row vector vec by the matrix, returning the result. This treats the vector as a direction vector, so the translation information in the matrix is ignored. That is, it treats the vector as a 4-component vector whose fourth component is 0.

Definition at line 693 of file matrix4d.h.

GfVec3f GfMatrix4d::TransformDir ( const GfVec3f vec) const
inline

Transforms row vector vec by the matrix, returning the result. This treats the vector as a direction vector, so the translation information in the matrix is ignored. That is, it treats the vector as a 4-component vector whose fourth component is 0. This is an overloaded method; it differs from the other version in that it returns a different value type.

Definition at line 706 of file matrix4d.h.

Friends And Related Function Documentation

friend class GfMatrix4f
friend

Definition at line 756 of file matrix4d.h.

size_t hash_value ( GfMatrix4d const m)
friend

Hash.

Definition at line 304 of file matrix4d.h.

GfMatrix4d operator* ( const GfMatrix4d m1,
double  d 
)
friend

Returns the product of a matrix and a double.

Definition at line 437 of file matrix4d.h.

GfMatrix4d operator* ( double  d,
const GfMatrix4d m 
)
friend

Definition at line 445 of file matrix4d.h.

GfMatrix4d operator* ( const GfMatrix4d m1,
const GfMatrix4d m2 
)
friend

Multiplies matrix m1 by m2.

Definition at line 479 of file matrix4d.h.

GfVec4d operator* ( const GfMatrix4d m,
const GfVec4d vec 
)
friend

Returns the product of a matrix m and a column vector vec.

Definition at line 493 of file matrix4d.h.

GfVec4d operator* ( const GfVec4d vec,
const GfMatrix4d m 
)
friend

Returns the product of row vector vec and a matrix m.

Definition at line 501 of file matrix4d.h.

GF_API friend GfVec4f operator* ( const GfMatrix4d m,
const GfVec4f vec 
)
friend

Returns the product of a matrix m and a column vector vec. Note that the return type is a GfVec4f.

GF_API friend GfVec4f operator* ( const GfVec4f vec,
const GfMatrix4d m 
)
friend

Returns the product of row vector vec and a matrix m. Note that the return type is a GfVec4f.

GfMatrix4d operator+ ( const GfMatrix4d m1,
const GfMatrix4d m2 
)
friend

Adds matrix m2 to m1.

Definition at line 463 of file matrix4d.h.

GF_API friend GfMatrix4d operator- ( const GfMatrix4d m)
friend

Returns the unary negation of matrix m.

GfMatrix4d operator- ( const GfMatrix4d m1,
const GfMatrix4d m2 
)
friend

Subtracts matrix m2 from m1.

Definition at line 471 of file matrix4d.h.

GfMatrix4d operator/ ( const GfMatrix4d m1,
const GfMatrix4d m2 
)
friend

Divides matrix m1 by m2 (that is, m1 * inv(m2)).

Definition at line 487 of file matrix4d.h.

Member Data Documentation

const size_t GfMatrix4d::numColumns = 4
static

Definition at line 93 of file matrix4d.h.

const size_t GfMatrix4d::numRows = 4
static

Definition at line 92 of file matrix4d.h.


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