GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  SBMATRIX (3)

NAME

SbMatrix — 4x4 matrix class

CONTENTS

Inherits From
Synopsis
Description
Methods
File Format/defaults
See Also

INHERITS FROM

SbMatrix

SYNOPSIS

#include <Inventor/SbLinear.h>

Methods from class SbMatrix:

       
                    
                     SbMatrix()    
   
                    
                     SbMatrix(float a11, float a12, float a13, float a14, float a21, float a22, float a23, float a24, float a31, float a32, float a33, float a34, float a41, float a42, float a43, float a44)    
   
                    
                     SbMatrix(const SbMat &m)    
void    
                    
void                 setValue(const SbMat &m)    
void    
                    
void                 getValue(SbMat &m) const    
const SbMat &    
                    
const SbMat &        getValue() const    
void    
                    
void                 makeIdentity()    
static SbMatrix    
                    
static SbMatrix      identity()    
void    
                    
void                 setRotate(const SbRotation &q)    
void    
                    
void                 setScale(float s)    
void    
                    
void                 setScale(const SbVec3f &s)    
void    
                    
void                 setTranslate(const SbVec3f &t)    
void    
                    
void                 setTransform(const SbVec3f &t, const SbRotation &r, const SbVec3f &s)    
void    
                    
void                 setTransform(const SbVec3f &t, const SbRotation &r, const SbVec3f &s, const SbRotation &so)    
void    
                    
void                 setTransform(const SbVec3f &translation, const SbRotation &rotation, const SbVec3f &scaleFactor, const SbRotation &scaleOrientation, const SbVec3f ¢er)    
void    
                    
void                 getTransform(SbVec3f &t, SbRotation &r, SbVec3f &s, SbRotation &so) const    
void    
                    
void                 getTransform(SbVec3f &translation, SbRotation &rotation, SbVec3f &scaleFactor, SbRotation &scaleOrientation, const SbVec3f ¢er) const    
float    
                    
float                det3(int r1, int r2, int r3, int c1, int c2, int c3) const    
float    
                    
float                det3() const    
float    
                    
float                det4() const    
SbBool    
                    
SbBool               factor(SbMatrix &r, SbVec3f &s, SbMatrix &u, SbVec3f &t, SbMatrix &proj) const    
SbMatrix    
                    
SbMatrix             inverse() const    
SbBool    
                    
SbBool               LUDecomposition(int index[4], float &d)    
void    
                    
void                 LUBackSubstitution(int index[4], float b[4]) const    
SbMatrix    
                    
SbMatrix             transpose() const    
SbMatrix &    
                    
SbMatrix &           multRight(const SbMatrix &m)    
SbMatrix &    
                    
SbMatrix &           multLeft(const SbMatrix &m)    
void    
                    
void                 multMatrixVec(const SbVec3f &src, SbVec3f &dst) const    
void    
                    
void                 multVecMatrix(const SbVec3f &src, SbVec3f &dst) const    
void    
                    
void                 multDirMatrix(const SbVec3f &src, SbVec3f &dst) const    
void    
                    
void                 multLineMatrix(const SbLine &src, SbLine &dst) const    
void    
                    
void                 print(FILE *fp) const    
float *    
                    
float *              operator float*()    
SbMat    
                    
SbMat                operator SbMat&()    
float *    
                    
float *              operator [](int i)    
const float *    
                    
const float *        operator [](int i) const    
SbMatrix &    
                    
SbMatrix &           operator =(const SbMat &m)    
SbMatrix &    
                    
SbMatrix &           operator =(const SbMatrix &m)    
SbMatrix &    
                    
SbMatrix &           operator =(const SbRotation &q)    
SbMatrix &    
                    
SbMatrix &           operator *=(const SbMatrix &m)    
SbMatrix    
                    
SbMatrix             operator *(const SbMatrix &m1, const SbMatrix &m2)    
int    
                    
int                  operator ==(const SbMatrix &m1, const SbMatrix &m2)    
int    
                    
int                  operator !=(const SbMatrix &m1, const SbMatrix &m2)    
SbBool    
                    
SbBool               equals(const SbMatrix &m, float tolerance) const

DESCRIPTION

4x4 matrix class/datatype used by many Inventor node and action classes. The matrices are stored in row-major order.

METHODS

       
                    
                     SbMatrix()    
   
                    
                     SbMatrix(float a11, float a12, float a13, float a14, float a21, float a22, float a23, float a24, float a31, float a32, float a33, float a34, float a41, float a42, float a43, float a44)    
   
                    
                     SbMatrix(const SbMat &m)
Constructors.

    void    
                    
void                 setValue(const SbMat &m)
Sets value from 4x4 array of elements.

    void    
                    
void                 getValue(SbMat &m) const    
const SbMat &    
                    
const SbMat &        getValue() const
Returns 4x4 array of elements.

    void    
                    
void                 makeIdentity()
Sets matrix to be identity.

    static SbMatrix    
                    
static SbMatrix      identity()
Returns an identity matrix.

    void    
                    
void                 setRotate(const SbRotation &q)
Sets matrix to rotate by given rotation.

    void    
                    
void                 setScale(float s)
Sets matrix to scale by given uniform factor.

    void    
                    
void                 setScale(const SbVec3f &s)
Sets matrix to scale by given vector.

    void    
                    
void                 setTranslate(const SbVec3f &t)
Sets matrix to translate by given vector.

    void    
                    
void                 setTransform(const SbVec3f &t, const SbRotation &r, const SbVec3f &s)    
void    
                    
void                 setTransform(const SbVec3f &t, const SbRotation &r, const SbVec3f &s, const SbRotation &so)    
void    
                    
void                 setTransform(const SbVec3f &translation, const SbRotation &rotation, const SbVec3f &scaleFactor, const SbRotation &scaleOrientation, const SbVec3f ¢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.

    void    
                    
void                 getTransform(SbVec3f &t, SbRotation &r, SbVec3f &s, SbRotation &so) const
Return translation, rotation, scale, and scale orientation components of the matrix.

    void    
                    
void                 getTransform(SbVec3f &translation, SbRotation &rotation, SbVec3f &scaleFactor, SbRotation &scaleOrientation, const SbVec3f ¢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.

    float    
                    
float                det3(int r1, int r2, int r3, int c1, int c2, int c3) const
Returns determinant of 3x3 submatrix composed of given row and column indices (0-3 for each).

    float    
                    
float                det3() const
Returns determinant of upper-left 3x3 submatrix.

    float    
                    
float                det4() const
Returns determinant of entire matrix.

    SbBool    
                    
SbBool               factor(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.

    SbMatrix    
                    
SbMatrix             inverse() const
Returns inverse of matrix. Results are undefined for singular matrices. Uses LU decomposition.

    SbBool    
                    
SbBool               LUDecomposition(int index[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.

    void    
                    
void                 LUBackSubstitution(int index[4], float b[4]) const
Perform back-substitution on LU-decomposed matrix. Index is permutation of rows from original matrix.

    SbMatrix    
                    
SbMatrix             transpose() const
Returns transpose of matrix.

    SbMatrix &    
                    
SbMatrix &           multRight(const SbMatrix &m)    
SbMatrix &    
                    
SbMatrix &           multLeft(const SbMatrix &m)
Multiplies matrix by given matrix on right or left.

    void    
                    
void                 multMatrixVec(const SbVec3f &src, SbVec3f &dst) const
Multiplies matrix by given column vector, giving vector result.

    void    
                    
void                 multVecMatrix(const SbVec3f &src, SbVec3f &dst) const
Multiplies given row vector by matrix, giving vector result.

    void    
                    
void                 multDirMatrix(const SbVec3f &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.

    void    
                    
void                 multLineMatrix(const SbLine &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.

    void    
                    
void                 print(FILE *fp) const
Prints a formatted version of the matrix to the given file pointer.

    float *    
                    
float *              operator float*()
Cast: returns pointer to storage of first element.

    SbMat    
                    
SbMat                operator SbMat&()
Cast: returns reference to 4x4 array.

    float *    
                    
float *              operator [](int i)    
const float *    
                    
const float *        operator [](int i) const
Make it look like a usual matrix (so you can do m[3][2]).

    SbMatrix &    
                    
SbMatrix &           operator =(const SbMat &m)
Sets value from 4x4 array of elements.

    SbMatrix &    
                    
SbMatrix &           operator =(const SbMatrix &m)
Set the matrix from another SbMatrix.

    SbMatrix &    
                    
SbMatrix &           operator =(const SbRotation &q)
Set the matrix from an SbRotation.

    SbMatrix &    
                    
SbMatrix &           operator *=(const SbMatrix &m)
Performs right multiplication with another matrix.

    SbMatrix    
                    
SbMatrix             operator *(const SbMatrix &m1, const SbMatrix &m2)
Binary multiplication of matrices.

    int    
                    
int                  operator ==(const SbMatrix &m1, const SbMatrix &m2)    
int    
                    
int                  operator !=(const SbMatrix &m1, const SbMatrix &m2)
Equality comparison operators.

    SbBool    
                    
SbBool               equals(const SbMatrix &m, float tolerance) const
Equality comparison within given tolerance, for each component.

FILE FORMAT/DEFAULTS

SEE ALSO

SbVec3f, SbRotation

Search for    or go to Top of page |  Section 3 |  Main Index


SBMATRIX(3IV) (-->)

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.