Open Inventor Release 2024.1.3
 
Loading...
Searching...
No Matches
SbMatrix3 Class Reference

3x3 matrix class. More...

#include <Inventor/SbMatrix.h>

Public Member Functions

 SbMatrix3 ()
 Default constructor.
 
 SbMatrix3 (float a11, float a12, float a13, float a21, float a22, float a23, float a31, float a32, float a33)
 Constructor.
 
 SbMatrix3 (const SbMat3 &m)
 Constructor.
 
void setValue (const SbMat3 &m)
 Sets value from 3x3 array of elements.
 
void setValue (const float *pMat)
 Sets value from a 9 value float array.
 
void makeIdentity ()
 Sets matrix to be identity.
 
void setRotate (const SbRotation &q)
 Sets matrix to rotate by given rotation.
 
void setScale (float s)
 Sets matrix to scale by given uniform factor.
 
void setScale (const SbVec3f &s)
 Sets matrix to scale by given vector.
 
void getValue (SbMat3 &m) const
 Returns 3x3 array of elements.
 
const SbMat3 & getValue () const
 Returns 3x3 array of elements.
 
SbMatrix3multRight (const SbMatrix3 &m)
 Post-multiplies the matrix by the given matrix.
 
SbMatrix3multLeft (const SbMatrix3 &m)
 Pre-multiplies matrix by the given matrix.
 
void multMatrixVec (const SbVec3f &src, SbVec3f &dst) const
 Post-multiplies matrix by the given column vector, giving a 3D vector result.
 
void multVecMatrix (const SbVec3f &src, SbVec3f &dst) const
 Pre-multiplies matrix by the given row vector, giving a 3D vector result.
 
float det () const
 Returns the determinant of the matrix.
 
SbMatrix3 inverse () const
 Returns the inverse of the matrix.
 
void print (FILE *fp) const
 Prints a formatted version of the matrix to the given file pointer.
 
 operator float * ()
 Cast: returns pointer to storage of first element.
 
 operator SbMat3 & ()
 Cast: returns reference to 3x3 array.
 
float * operator[] (int i)
 Make it look like a usual matrix (so you can do m[2][2]).
 
const float * operator[] (int i) const
 Make it look like a usual matrix (so you can do m[2][2]).
 
SbVec3f operator* (const SbVec3f &v) const
 Multiplies matrices by vector, returning a matrix result.
 
SbMatrix3operator= (const SbMat3 &m)
 Sets value from 3x3 array of elements.
 
SbMatrix3operator= (const SbMatrix3 &m)
 Set the matrix from another SbMatrix3.
 
SbMatrix3operator= (const SbRotation &q)
 Set the matrix from an SbRotation.
 
SbMatrix3operator*= (const SbMatrix3 &m)
 Post-multiplies the matrix by the given matrix (equivalent to multRight() method).
 

Static Public Member Functions

static SbMatrix3 identity ()
 Returns an identity matrix.
 

Friends

SbVec3f operator* (const SbVec3f &v, const SbMatrix3 &m)
 Multiplies matrices by vector, returning a vector result.
 
SbMatrix3 operator* (const SbMatrix3 &m1, const SbMatrix3 &m2)
 Multiplies two matrices, returning a matrix result.
 
int operator== (const SbMatrix3 &m1, const SbMatrix3 &m2)
 Equality comparison operator.
 
int operator!= (const SbMatrix3 &m1, const SbMatrix3 &m2)
 Inequality comparison operator.
 

Detailed Description

3x3 matrix class.

3x3 matrix class/datatype.

See SbMatrix for discussion of storage layout and usage of matrices.

SEE ALSO

SbMatrix, SbMatrixd, SbRotation, SbRotationd, SbVec2d, SbVec2f, SbVec2i32, SbVec2s, SbVec3d, SbVec3f, SbVec3i32, SbVec3s, SbVec4b, SbVec4d, SbVec4f, SbVec4i32, SbVec4s, SbVec4ub, SbVec4ui32, SbVec4us

Definition at line 1186 of file SbMatrix.h.

Constructor & Destructor Documentation

◆ SbMatrix3() [1/3]

SbMatrix3::SbMatrix3 ( )
inline

Default constructor.

The matrix is initialized with zeros.

Definition at line 1192 of file SbMatrix.h.

◆ SbMatrix3() [2/3]

SbMatrix3::SbMatrix3 ( float  a11,
float  a12,
float  a13,
float  a21,
float  a22,
float  a23,
float  a31,
float  a32,
float  a33 
)

Constructor.

◆ SbMatrix3() [3/3]

SbMatrix3::SbMatrix3 ( const SbMat3 &  m)

Constructor.

Member Function Documentation

◆ det()

float SbMatrix3::det ( ) const

Returns the determinant of the matrix.

◆ getValue() [1/2]

const SbMat3 & SbMatrix3::getValue ( ) const
inline

Returns 3x3 array of elements.

Definition at line 1263 of file SbMatrix.h.

◆ getValue() [2/2]

void SbMatrix3::getValue ( SbMat3 &  m) const

Returns 3x3 array of elements.

◆ identity()

static SbMatrix3 SbMatrix3::identity ( )
static

Returns an identity matrix.

◆ inverse()

SbMatrix3 SbMatrix3::inverse ( ) const

Returns the inverse of the matrix.

Results are undefined for singular matrices.
The matrix is not modified.

◆ makeIdentity()

void SbMatrix3::makeIdentity ( )

Sets matrix to be identity.

◆ multLeft()

SbMatrix3 & SbMatrix3::multLeft ( const SbMatrix3 m)

Pre-multiplies matrix by the given matrix.

Matrix is replaced by the result.

◆ multMatrixVec()

void SbMatrix3::multMatrixVec ( const SbVec3f src,
SbVec3f dst 
) const

Post-multiplies matrix by the given column vector, giving a 3D vector result.

It is safe to let src and dst be the same instance of SbVec3f.

◆ multRight()

SbMatrix3 & SbMatrix3::multRight ( const SbMatrix3 m)

Post-multiplies the matrix by the given matrix.

Matrix is replaced by the result.

◆ multVecMatrix()

void SbMatrix3::multVecMatrix ( const SbVec3f src,
SbVec3f dst 
) const

Pre-multiplies matrix by the given row vector, giving a 3D vector result.

It is safe to let src and dst be the same instance of SbVec3f.

◆ operator float *()

SbMatrix3::operator float * ( )
inline

Cast: returns pointer to storage of first element.

Definition at line 1308 of file SbMatrix.h.

◆ operator SbMat3 &()

SbMatrix3::operator SbMat3 & ( )
inline

Cast: returns reference to 3x3 array.

Definition at line 1313 of file SbMatrix.h.

◆ operator*()

SbVec3f SbMatrix3::operator* ( const SbVec3f v) const

Multiplies matrices by vector, returning a matrix result.

Return M*v

◆ operator*=()

SbMatrix3 & SbMatrix3::operator*= ( const SbMatrix3 m)
inline

Post-multiplies the matrix by the given matrix (equivalent to multRight() method).

Matrix is replaced by the resulting matrix.

Definition at line 1350 of file SbMatrix.h.

◆ operator=() [1/3]

SbMatrix3 & SbMatrix3::operator= ( const SbMat3 &  m)

Sets value from 3x3 array of elements.

◆ operator=() [2/3]

SbMatrix3 & SbMatrix3::operator= ( const SbMatrix3 m)

Set the matrix from another SbMatrix3.

◆ operator=() [3/3]

SbMatrix3 & SbMatrix3::operator= ( const SbRotation q)
inline

Set the matrix from an SbRotation.

Definition at line 1344 of file SbMatrix.h.

◆ operator[]() [1/2]

float * SbMatrix3::operator[] ( int  i)
inline

Make it look like a usual matrix (so you can do m[2][2]).

Definition at line 1318 of file SbMatrix.h.

◆ operator[]() [2/2]

const float * SbMatrix3::operator[] ( int  i) const
inline

Make it look like a usual matrix (so you can do m[2][2]).

Definition at line 1323 of file SbMatrix.h.

◆ print()

void SbMatrix3::print ( FILE *  fp) const

Prints a formatted version of the matrix to the given file pointer.

◆ setRotate()

void SbMatrix3::setRotate ( const SbRotation q)

Sets matrix to rotate by given rotation.

◆ setScale() [1/2]

void SbMatrix3::setScale ( const SbVec3f s)

Sets matrix to scale by given vector.

◆ setScale() [2/2]

void SbMatrix3::setScale ( float  s)

Sets matrix to scale by given uniform factor.

◆ setValue() [1/2]

void SbMatrix3::setValue ( const float *  pMat)
inline

Sets value from a 9 value float array.

Definition at line 1215 of file SbMatrix.h.

◆ setValue() [2/2]

void SbMatrix3::setValue ( const SbMat3 &  m)

Sets value from 3x3 array of elements.

Friends And Related Symbol Documentation

◆ operator!=

int operator!= ( const SbMatrix3 m1,
const SbMatrix3 m2 
)
friend

Inequality comparison operator.

Definition at line 1370 of file SbMatrix.h.

◆ operator* [1/2]

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

Multiplies two matrices, returning a matrix result.

◆ operator* [2/2]

SbVec3f operator* ( const SbVec3f v,
const SbMatrix3 m 
)
friend

Multiplies matrices by vector, returning a vector result.

Return v*m.

◆ operator==

int operator== ( const SbMatrix3 m1,
const SbMatrix3 m2 
)
friend

Equality comparison operator.


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