class MFloatMatrix

Jump to documentation

A matrix math class for 4x4 matrices of floats. (OpenMaya) (OpenMaya.py)

public members:

MFloatMatrix ()
MFloatMatrix ( const MFloatMatrix & src )
MFloatMatrix ( const double m[4][4] )
MFloatMatrix ( const float m[4][4] )
~MFloatMatrix ()
MFloatMatrix & operator = (const MFloatMatrix &)
float operator() (unsigned int row, unsigned int col ) const
const float* operator[] ( unsigned int row ) const
MStatus get ( double dest[4][4] ) const
MStatus get ( float dest[4][4] ) const
MFloatMatrix transpose () const
MFloatMatrix & setToIdentity ()
MFloatMatrix & setToProduct ( const MFloatMatrix & left, const MFloatMatrix & right )
MFloatMatrix & operator+= ( const MFloatMatrix & right )
MFloatMatrix operator+ ( const MFloatMatrix & right ) const
MFloatMatrix & operator-= ( const MFloatMatrix & right )
MFloatMatrix operator- ( const MFloatMatrix & right ) const
MFloatMatrix & operator*= ( const MFloatMatrix & right )
MFloatMatrix operator* ( const MFloatMatrix & right ) const
MFloatMatrix & operator*= ( float )
MFloatMatrix operator* ( float ) const
bool operator== ( const MFloatMatrix & other ) const
bool operator!= ( const MFloatMatrix & other ) const
MFloatMatrix inverse () const
MFloatMatrix adjoint () const
MFloatMatrix homogenize () const
float det4x4 () const
float det3x3 () const
bool isEquivalent ( const MFloatMatrix & other, float tolerance = MFloatMatrix_kTol ) const
inline float& operator() (unsigned int row, unsigned int col )
NO SCRIPT SUPPORT
inline float* operator[] ( unsigned int row )
NO SCRIPT SUPPORT
friend MFloatMatrix operator* ( float, const MFloatMatrix & right )
NO SCRIPT SUPPORT
friend std::ostream& operator<< ( std::ostream& os, const MFloatMatrix & m )
NO SCRIPT SUPPORT
float matrix[4][4]
the matrix data

Documentation

This class provides access to Maya's matrix math library
Description

This class provides access to Maya's internal matrix math library allowing matrices to be handled easily, and in a manner compatible with internal Maya data structures.

Functions

MFloatMatrix:: MFloatMatrix ()

Description

The default contstructor. The instance is initialized to the 4x4 identity matrix.

MFloatMatrix:: MFloatMatrix (const MFloatMatrix & src)

Description

The copy Constructor.

Arguments

  • src the instance to copy data from

MFloatMatrix:: MFloatMatrix (const float src_matrix[4][4] )

Description

Initialize the instance with a 4x4 matrix of floats

Arguments

  • src_matrix a 4x4 matrix of floats

MFloatMatrix:: MFloatMatrix (const double src_matrix[4][4] )

Description

Initialize the instance with a 4x4 matrix of doubles

Arguments

  • src_matrix a 4x4 matrix of doubles

MFloatMatrix:: ~MFloatMatrix ()

Description

The class destructor.

MFloatMatrix & MFloatMatrix:: operator= (const MFloatMatrix & src)

Description

The assignment operator.

MStatus MFloatMatrix:: get ( float dest[4][4] ) const

Description

Fill a 4x4 matrix of floats with the elements from the instance.

Arguments

  • src_matrix the 4x4 matrix of floats to populate

Returns

  • MS::kSuccess if successful and MS::kFailure otherwise.

MStatus MFloatMatrix:: get ( double dest[4][4] ) const

Description

Fill a 4x4 matrix of doubles with the elements from the instance.

Arguments

  • src_matrix the 4x4 matrix of doubles to populate

Returns

  • MS::kSuccess if successful and MS::kFailure otherwise.

MFloatMatrix & MFloatMatrix:: setToIdentity ()

Description

Set this instance to the 4x4 identity matrix.

MFloatMatrix & MFloatMatrix:: setToProduct (const MFloatMatrix & left, const MFloatMatrix & right)

Description

Set this instance to the inner product of the two argument matrices.

Arguments

  • left the left hand matrix for the operation
  • right the right hand matrix for the operation

MFloatMatrix & MFloatMatrix:: operator+= (const MFloatMatrix & right)

Description

The in place matrix addition operator.

MFloatMatrix MFloatMatrix:: operator+ (const MFloatMatrix & right) const

Description

The matrix addition operator.

MFloatMatrix & MFloatMatrix:: operator-= (const MFloatMatrix & right)

Description

The in place matrix subtraction operator.

MFloatMatrix MFloatMatrix:: operator- (const MFloatMatrix & right) const

Description

The matrix subtraction operator.

MFloatMatrix & MFloatMatrix:: operator*= (const MFloatMatrix & right)

Description

The in place matrix multiplication operator.

MFloatMatrix MFloatMatrix:: operator* (const MFloatMatrix & right) const

Description

The matrix multiplication operator.

MFloatMatrix & MFloatMatrix:: operator*= (float factor)

Description

The in place matrix multiply by a scalar operator.

MFloatMatrix MFloatMatrix:: operator* (float factor) const

Description

The matrix multiply by a scalar operator.

MFloatMatrix operator* (float factor, const MFloatMatrix & right )

Description

The multiplication operator that allows the scalar value to preceed the matrix.

bool MFloatMatrix:: operator== (const MFloatMatrix & other) const

Description

The matrix equality operator. The matrices must be identical.

bool MFloatMatrix:: operator!= (const MFloatMatrix & other) const

Description

The matrix inequality operator.

MFloatMatrix MFloatMatrix:: inverse () const

Description

Compute and return the inverse of this instance.

Return Value

  • the inverted matrix

MFloatMatrix MFloatMatrix:: transpose () const

Description

Compute and return the transpose of this instance.

Return Value

  • the transposed matrix

MFloatMatrix MFloatMatrix:: adjoint () const

Description

Compute and return the adjoint of this instance.

Return Value

  • the adjoint of this matrix

MFloatMatrix MFloatMatrix:: homogenize () const

Description

Compute and return a homogenized version of this instance.

Return Value

  • the homogenized matrix

float MFloatMatrix:: det3x3 () const

Description

Compute and return the determinant of the upper left 3x3 submatrix of this instance

Return Value

  • the determinant

float MFloatMatrix:: det4x4 () const

Description

Compute and return the determinant of this instance

Return Value

  • the determinant

bool MFloatMatrix:: isEquivalent (const MFloatMatrix & other, float tolerance) const

Description

Determine if the given matrix is equivalent to this instance within the specified tolerance.

Arguments

  • other the matrix to compare to
  • tolerance the tolerance to use during the comparison

Return Value

  • true if the matrices are equivalent and false otherwise

std::ostream& operator<< ( std::ostream& os, const MFloatMatrix & m )

Description

Print the contents of the given MFloatMatrix on the given ostream. The format used is [[r11, r12, r13, r14] [r21, r22, r23, r24] [r31, r32, r33, r34] [r41, r42, r43, r44]].

Arguments

  • s the ostream to print to
  • str the MFloatMatrix whose value is to be printed

Return Value

  • the ostream reference, s, provided as the first parameter.

float& MFloatMatrix:: operator() (unsigned int row, unsigned int col )

Description

Index operator. Given row and column indices, it will return the value at the specified location in the matrix.

Arguments

  • row index of the row to access
  • col index of the column to access

Return Value

  • the value at the specified location in the matrix.

float MFloatMatrix:: operator() (unsigned int row, unsigned int col ) const

Description

Index operator. Given row and column indices, it will return the value at the specified location in the matrix.

Arguments

  • row index of the row to access
  • col index of the column to access

Return Value

  • the value at the specified location in the matrix.

float* MFloatMatrix:: operator[] (unsigned int row)

Description

Index operator. Returns an entire row of the matrix as an array of floats.

Arguments

  • row index of the row to access

Return Value

  • float array containing the values of the specified row

const float* MFloatMatrix:: operator[] (unsigned int row) const

Description

Index operator. Returns an entire row of the matrix as an array of floats.

Arguments

  • row index of the row to access

Return Value

  • float array containing the values of the specified row

This class has no child classes.


Autodesk® Maya® 2008 © 1997-2007 Autodesk, Inc. All rights reserved. doc++ Copyright