SbMatrix()SbMatrix(floata11,floata12,floata13,floata14,floata21,floata22,floata23,floata24,floata31,floata32,floata33,floata34,floata41,floata42,floata43,floata44)SbMatrix(constSbMat&m)
Constructors.
voidsetValue(constSbMat&m)
Sets value from 4x4 array of elements.
voidgetValue(SbMat&m)constconstSbMat&getValue()const
Returns 4x4 array of elements.
voidmakeIdentity()
Sets matrix to be identity.
staticSbMatrixidentity()
Returns an identity matrix.
voidsetRotate(constSbRotation&q)
Sets matrix to rotate by given rotation.
voidsetScale(floats)
Sets matrix to scale by given uniform factor.
voidsetScale(constSbVec3f&s)
Sets matrix to scale by given vector.
voidsetTranslate(constSbVec3f&t)
Sets matrix to translate by given vector.
voidsetTransform(constSbVec3f&t,constSbRotation&r,constSbVec3f&s)voidsetTransform(constSbVec3f&t,constSbRotation&r,constSbVec3f&s,constSbRotation&so)voidsetTransform(constSbVec3f&translation,constSbRotation&rotation,constSbVec3f&scaleFactor,constSbRotation&scaleOrientation,constSbVec3f¢er)
Composes the matrix based on a translation, rotation, scale, orientation for scale, and center. The
center is the center point for scaling and rotation. The scaleOrientation chooses the primary axes for
the scale.
voidgetTransform(SbVec3f&t,SbRotation&r,SbVec3f&s,SbRotation&so)const
Return translation, rotation, scale, and scale orientation components of the matrix.
voidgetTransform(SbVec3f&translation,SbRotation&rotation,SbVec3f&scaleFactor,SbRotation&scaleOrientation,constSbVec3f¢er)const
Decomposes the matrix into a translation, rotation, scale, and scale orientation. Any projection
information is discarded. The decomposition depends upon choice of center point for rotation and
scaling, which is optional as the last parameter. Note that if the center is 0, decompose() is the
same as factor() where t is translation, u is rotation, s is scaleFactor, and r is ScaleOrientation.
floatdet3(intr1,intr2,intr3,intc1,intc2,intc3)const
Returns determinant of 3x3 submatrix composed of given row and column indices (0-3 for each).
floatdet3()const
Returns determinant of upper-left 3x3 submatrix.
floatdet4()const
Returns determinant of entire matrix.
SbBoolfactor(SbMatrix&r,SbVec3f&s,SbMatrix&u,SbVec3f&t,SbMatrix&proj)const
Factors a matrix m into 5 pieces: m = r s r^ u t, where r^ means transpose of r, and r and u are
rotations, s is a scale, and t is a translation. Any projection information is returned in proj. NOTE:
the projection matrix is always set to identity.
SbMatrixinverse()const
Returns inverse of matrix. Results are undefined for singular matrices. Uses LU decomposition.
SbBoolLUDecomposition(intindex[4],float&d)
Perform in-place LU decomposition of matrix. index is index of rows in matrix. d is the parity of row
swaps. Returns FALSE if singular.
voidLUBackSubstitution(intindex[4],floatb[4])const
Perform back-substitution on LU-decomposed matrix. Index is permutation of rows from original matrix.
SbMatrixtranspose()const
Returns transpose of matrix.
SbMatrix&multRight(constSbMatrix&m)SbMatrix&multLeft(constSbMatrix&m)
Multiplies matrix by given matrix on right or left.
voidmultMatrixVec(constSbVec3f&src,SbVec3f&dst)const
Multiplies matrix by given column vector, giving vector result.
voidmultVecMatrix(constSbVec3f&src,SbVec3f&dst)const
Multiplies given row vector by matrix, giving vector result.
voidmultDirMatrix(constSbVec3f&src,SbVec3f&dst)const
Multiplies given row vector by matrix, giving vector result. src is assumed to be a direction vector,
so translation part of matrix is ignored. Note: if you wish to transform surface points and normals by
a matrix, call multVecMatrix() for the points and call multDirMatrix() on the inverse transpose of
the matrix for the normals.
voidmultLineMatrix(constSbLine&src,SbLine&dst)const
Multiplies the given line's origin by the matrix, and the line's direction by the rotation portion of
the matrix.
voidprint(FILE*fp)const
Prints a formatted version of the matrix to the given file pointer.
float*operatorfloat*()
Cast: returns pointer to storage of first element.
SbMatoperatorSbMat&()
Cast: returns reference to 4x4 array.
float*operator[](inti)constfloat*operator[](inti)const
Make it look like a usual matrix (so you can do m[3][2]).
SbMatrix&operator=(constSbMat&m)
Sets value from 4x4 array of elements.
SbMatrix&operator=(constSbMatrix&m)
Set the matrix from another SbMatrix.
SbMatrix&operator=(constSbRotation&q)
Set the matrix from an SbRotation.
SbMatrix&operator*=(constSbMatrix&m)
Performs right multiplication with another matrix.
SbMatrixoperator*(constSbMatrix&m1,constSbMatrix&m2)
Binary multiplication of matrices.
intoperator==(constSbMatrix&m1,constSbMatrix&m2)intoperator!=(constSbMatrix&m1,constSbMatrix&m2)
Equality comparison operators.
SbBoolequals(constSbMatrix&m,floattolerance)const
Equality comparison within given tolerance, for each component.