# Matrix3C

# Class hierarchy

Matrix3C

# Overview

Matrix3C class defines a 2 by 3 matrix class which is used by the Demopaja system The matrix class implements standard set of methods and overdriven operators for easy use.

This class is implemented by the system.

Header: | Matrix3C.h
Library: | core.lib

# Class members

`Matrix3C( const float32* pMat );`

#### Parameters

pMat
  A pointer to array of floating point values which defines the matrix.

#### Remarks

Creates a new vector with the values as the array pointed by the argument. The array should contain 6 values, 2 for each row in the matrix. The rows are in the array continously.

`Matrix3C operator*( const Matrix3C& rMat ) const;`

#### Remarks

Multiplies two matrices and returns the result.

`Matrix3C& operator*=( const Matrix3C& rMat ) const;`

#### Remarks

Multiplies two matrices and stores the result.

`Vector3C& operators[]( int32 i );`

`Vector3C& operators[]( int32 i );`

#### Parameters

i
  Index to the row in the matrix. Range 0..2

#### Return value

Reference to the vector at a row pointed by the index.

#### Remarks

The index values from 0 to 2 corresponds to the rows in the matrix. There are two versions of this method, the first enables to assign values and the second is for retrieving the values.

#### Example

`Matrix3C& set_identity();`

#### Return value

Reference to the matrix.

#### Remarks

Sets the matrix as identity matrix

`Matrix3C& set_trans( const Vector3C& rVec );`

#### Parameters

rVec
  Reference to the vector specifying the position.

#### Remarks

Sets the matrix to identity and then translates the matrix to the value of the argument.

`Matrix3C& set_scale( const Vector3C& rVec );`

#### Parameters

rVec
  Reference to the vector specifying the scale.

#### Remarks

Sets the matrix to identity and then scales the matrix to the value of the argument.

`Matrix3C& set_rot_x( float32 f32XAngle );`

#### Parameters

f32XAngle
  Real number specifying the rotation around the X-axis in radians.

#### Remarks

Sets the matrix to identity and then rotates the matrix around the X-axis to the value of the argument.

`Matrix3C& set_rot_y( float32 f32YAngle );`

#### Parameters

f32YAngle
  Real number specifying the rotation around the Y-axis in radians.

#### Remarks

Sets the matrix to identity and then rotates the matrix around the Y-axis to the value of the argument.

`Matrix3C& set_rot_z( float32 f32ZAngle );`

#### Parameters

f32ZAngle
  Real number specifying the rotation around the Z-axis in radians.

#### Remarks

Sets the matrix to identity and then rotates the matrix around the Z-axis to the value of the argument.

`Matrix3C& set_rot_xyz( float32 f32XAngle float32 f32YAngle float32 f32ZAngle );`

#### Parameters

f32XAngle
  Real number specifying the rotation around the X-axis in radians.
f32YAngle
  Real number specifying the rotation around the Y-axis in radians.
f32ZAngle
  Real number specifying the rotation around the Z-axis in radians.

#### Remarks

Sets the matrix to identity and then rotates the matrix to the values of the arguments. The rotation order is XYZ.

`Matrix3C& set_rot( QuatC rQuat );`

#### Parameters

rQuat
  Reference to the quaternion to represent the rotation.

#### Remarks

Converts quaternion to matrix and stores the result to the matrix.

`friend Vector3C operator*( const Matrix3C& rMat> const Vector3C& rVec> );`

#### Remarks

Multiplies the specified vector by the specified matrix and returns the result.

`friend Vector3C operator*( const Vector3C& rVec> const Matrix3C& rMat> );`

#### Remarks

Multiplies the specified vector by the specified matrix and returns the result.

`friend Vector3C operator*( const Vector3C& rVec> const Matrix3C& rMat> );`

#### Remarks

Multiplies the specified vector by the specified matrix and stores the result to the vector.

`Matrix3C pre_trans( const Vector3C& rVec ) const;`

#### Remarks

Pretranslates the matrix and returns the result.

`Matrix3C invert() const;`

#### Remarks

Inverts the matrix and returns the result.

`Matrix3C transpose() const`

#### Remarks

Transposes the matrix and returns the result.

`Matrix3C ortho_norm() const`

#### Remarks

Ortho normalizes the matrix and returns the result.

Copyright © 2000 Moppi Productions