3DCoat  3D-COAT 4.9.xx
3DCoat is the one application that has all the tools you need to take your 3D idea from a block of digital clay all the way to a production ready, fully textured organic or hard surface model.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
coat::scripto::Mat4 Class Reference

Class for working with matrix 4 x 4. More...

#include <SMat4.h>

Public Member Functions

 Mat4 ()
 Constructor for building a zero matrix. More...
 
 operator Quat () const
 Ability for converting Mat4 to Quat. More...
 
 operator std::string () const
 Ability for converting Mat4 to string. More...
 
bool operator== (const Mat4 &b) const
 Comparison. More...
 
bool identity () const
 Returns TRUE when the matrix is identity. More...
 
bool orthonormalized () const
 Returns TRUE when the matrix is ortonormal. More...
 
bool symmetric () const
 Returns TRUE when the matrix is symmetric. More...
 
bool zero () const
 Returns TRUE when all values of the matrix are zero. More...
 
Mat4operator() (int row, int col, float v)
 Setter like array. More...
 
float operator() (int row, int col) const
 Getter like array. More...
 
Mat4 operator- () const
 Negation operator. More...
 
float determinant () const
 Returns determinant of the matrix. More...
 
float trace () const
 Returns trace of the matrix. More...
 
Mat4invert ()
 Invert the matrix. More...
 
Mat4 invertCopy () const
 
Mat4transpose ()
 Transpose the matrix. More...
 
Mat4 transposeCopy () const
 

Detailed Description

Class for working with matrix 4 x 4.

Mat4 a(
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 );
Mat4 b = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
Vec3 scaling( 1, 2, 6 );
Vec3 translation( 10, 30, 90 );
Mat4 a( scaling, translation );
Mat4 a( 0 );
// equivalent to
Mat4 b( 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 );
// equivalent to
Mat4 c = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
See Also
Mat3
mat4.jpg
Since
4.5.32

Constructor & Destructor Documentation

coat::scripto::Mat4::Mat4 ( )
inline

Constructor for building a zero matrix.

Referenced by operator-().

Member Function Documentation

float coat::scripto::Mat4::determinant ( ) const
inline

Returns determinant of the matrix.

Mat4 a( 1 );
float r = a.determinant();
bool coat::scripto::Mat4::identity ( ) const
inline

Returns TRUE when the matrix is identity.

Mat4& coat::scripto::Mat4::invert ( )
inline

Invert the matrix.

Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
a.invert();
Mat4 coat::scripto::Mat4::invertCopy ( ) const
inline
See Also
invert()
coat::scripto::Mat4::operator Quat ( ) const

Ability for converting Mat4 to Quat.

Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
auto m = Quat( a );
coat::scripto::Mat4::operator std::string ( ) const

Ability for converting Mat4 to string.

Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
auto m = string( a );
Mat4& coat::scripto::Mat4::operator() ( int  row,
int  col,
float  v 
)
inline

Setter like array.

Mat4 a( 0 );
// setting a value 9.5 to row 3 and col 2
a[ 3, 2, 9.5 ];
float coat::scripto::Mat4::operator() ( int  row,
int  col 
) const
inline

Getter like array.

Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
float v00 = a[ 0, 0 ];
float v32 = a[ 3, 2 ];
Mat4 coat::scripto::Mat4::operator- ( ) const
inline

Negation operator.

Mat4 a( 1 );
Mat4 na = -a;

References Mat4().

bool coat::scripto::Mat4::operator== ( const Mat4 b) const
inline

Comparison.

Mat4 a;
...
if (a == Mat4( 1 )) { ... }
bool coat::scripto::Mat4::orthonormalized ( ) const
inline

Returns TRUE when the matrix is ortonormal.

bool coat::scripto::Mat4::symmetric ( ) const
inline

Returns TRUE when the matrix is symmetric.

float coat::scripto::Mat4::trace ( ) const
inline

Returns trace of the matrix.

Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
float r = a.trace();
Mat4& coat::scripto::Mat4::transpose ( )
inline

Transpose the matrix.

Mat4 a = {
1, 0, 0, 10,
0, 2, 0, 30,
0, 0, 6, 90,
0, 0, 0, 1 };
a.transpose();
Mat4 coat::scripto::Mat4::transposeCopy ( ) const
inline
See Also
transpose()
bool coat::scripto::Mat4::zero ( ) const
inline

Returns TRUE when all values of the matrix are zero.


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