Open 3D Engine AzCore API Reference  24.09
O3DE is an open-source, fully-featured, high-fidelity, modular 3D engine for building games and simulations, available to every industry.
AZ::Matrix3x3 Class Reference

#include <Matrix3x3.h>

Public Member Functions

 AZ_TYPE_INFO (Matrix3x3, "{15A4332F-7C3F-4A58-AC35-50E1CE53FB9C}")
 
 Matrix3x3 ()=default
 Default constructor does not initialize the matrix.
 
 Matrix3x3 (const Matrix3x3 &rhs)=default
 
 Matrix3x3 (Simd::Vec3::FloatArgType row0, Simd::Vec3::FloatArgType row1, Simd::Vec3::FloatArgType row2)
 
 Matrix3x3 (const Quaternion &quaternion)
 
void StoreToRowMajorFloat9 (float *values) const
 
void StoreToColumnMajorFloat9 (float *values) const
 
float operator() (int32_t row, int32_t col) const
 Indexed access using operator().
 
Matrix3x3 TransposedMultiply (const Matrix3x3 &rhs) const
 Calculates (this->GetTranspose() * rhs).
 
Vector3 operator* (const Vector3 &rhs) const
 Post-multiplies the matrix by a vector.
 
Matrix3x3 operator- () const
 Operator for negating all matrix's elements.
 
bool operator== (const Matrix3x3 &rhs) const
 
bool operator!= (const Matrix3x3 &rhs) const
 
Vector3 RetrieveScale () const
 Gets the scale part of the transformation, i.e. the length of the scale components.
 
Vector3 RetrieveScaleSq () const
 Gets the squared scale part of the transformation (the squared length of the basis vectors).
 
Vector3 ExtractScale ()
 Gets the scale part of the transformation as in RetrieveScale, and also removes this scaling from the matrix.
 
void MultiplyByScale (const Vector3 &scale)
 Quick multiplication by a scale matrix, equivalent to m*=Matrix3x3::CreateScale(scale).
 
Matrix3x3 GetReciprocalScaled () const
 Returns a matrix with the reciprocal scale, keeping the same rotation and translation.
 
Matrix3x3 GetPolarDecomposition () const
 
void GetPolarDecomposition (Matrix3x3 *orthogonalOut, Matrix3x3 *symmetricOut) const
 Polar decomposition, M=U*H, U is orthogonal (unitary) and H is symmetric (hermitian).
 
bool IsOrthogonal (float tolerance=Constants::Tolerance) const
 
Matrix3x3 GetOrthogonalized () const
 Adjusts an almost orthogonal matrix to be orthogonal.
 
void Orthogonalize ()
 Adjusts an almost orthogonal matrix to be orthogonal.
 
bool IsClose (const Matrix3x3 &rhs, float tolerance=Constants::Tolerance) const
 
void SetRotationPartFromQuaternion (const Quaternion &q)
 
Vector3 GetDiagonal () const
 
float GetDeterminant () const
 
Matrix3x3 GetAdjugate () const
 
bool IsFinite () const
 
const Simd::Vec3::FloatType * GetSimdValues () const
 
Simd::Vec3::FloatType * GetSimdValues ()
 
float GetElement (int32_t row, int32_t col) const
 
void SetElement (int32_t row, int32_t col, float value)
 
Vector3 GetRow (int32_t row) const
 
void SetRow (int32_t row, float x, float y, float z)
 
void SetRow (int32_t row, const Vector3 &v)
 
void GetRows (Vector3 *row0, Vector3 *row1, Vector3 *row2) const
 
void SetRows (const Vector3 &row0, const Vector3 &row1, const Vector3 &row2)
 
Vector3 GetColumn (int32_t col) const
 
void SetColumn (int32_t col, float x, float y, float z)
 
void SetColumn (int32_t col, const Vector3 &v)
 
void GetColumns (Vector3 *col0, Vector3 *col1, Vector3 *col2) const
 
void SetColumns (const Vector3 &col0, const Vector3 &col1, const Vector3 &col2)
 
Vector3 GetBasisX () const
 
void SetBasisX (float x, float y, float z)
 
void SetBasisX (const Vector3 &v)
 
Vector3 GetBasisY () const
 
void SetBasisY (float x, float y, float z)
 
void SetBasisY (const Vector3 &v)
 
Vector3 GetBasisZ () const
 
void SetBasisZ (float x, float y, float z)
 
void SetBasisZ (const Vector3 &v)
 
void GetBasis (Vector3 *basisX, Vector3 *basisY, Vector3 *basisZ) const
 
void SetBasis (const Vector3 &basisX, const Vector3 &basisY, const Vector3 &basisZ)
 
Matrix3x3 operator+ (const Matrix3x3 &rhs) const
 
Matrix3x3operator+= (const Matrix3x3 &rhs)
 
Matrix3x3 operator- (const Matrix3x3 &rhs) const
 
Matrix3x3operator-= (const Matrix3x3 &rhs)
 
Matrix3x3 operator* (const Matrix3x3 &rhs) const
 
Matrix3x3operator*= (const Matrix3x3 &rhs)
 
Matrix3x3 operator* (float multiplier) const
 
Matrix3x3operator*= (float multiplier)
 
Matrix3x3 operator/ (float divisor) const
 
Matrix3x3operator/= (float divisor)
 
Matrix3x3 GetTranspose () const
 
void Transpose ()
 
Matrix3x3 GetInverseFull () const
 
void InvertFull ()
 
Matrix3x3 GetInverseFast () const
 
void InvertFast ()
 

Static Public Member Functions

static void Reflect (ReflectContext *context)
 
static Matrix3x3 CreateIdentity ()
 
static Matrix3x3 CreateZero ()
 
static Matrix3x3 CreateFromValue (float value)
 Constructs a matrix with all components set to the specified value.
 
static Matrix3x3 CreateFromRowMajorFloat9 (const float *values)
 Constructs from an array of 9 floats stored in row-major order.
 
static Matrix3x3 CreateFromRows (const Vector3 &row0, const Vector3 &row1, const Vector3 &row2)
 
static Matrix3x3 CreateFromColumnMajorFloat9 (const float *values)
 Constructs from an array of 9 floats stored in column-major order.
 
static Matrix3x3 CreateFromColumns (const Vector3 &col0, const Vector3 &col1, const Vector3 &col2)
 
static Matrix3x3 CreateFromMatrix3x4 (const Matrix3x4 &m)
 Sets the matrix from the left 3x3 sub-matrix of a Matrix3x4.
 
static Matrix3x3 CreateFromMatrix4x4 (const Matrix4x4 &m)
 Sets the matrix from the upper 3x3 sub-matrix of a Matrix4x4.
 
static Matrix3x3 CreateFromTransform (const Transform &t)
 Creates a matrix using the scale and orientation portions of a Transform.
 
static Matrix3x3 CreateFromQuaternion (const Quaternion &q)
 Sets the matrix from a quaternion.
 
static Matrix3x3 CreateScale (const Vector3 &scale)
 Sets the matrix to be a scale matrix.
 
static Matrix3x3 CreateDiagonal (const Vector3 &diagonal)
 Sets the matrix to be a diagonal matrix.
 
static Matrix3x3 CreateCrossProduct (const Vector3 &p)
 Creates the skew-symmetric cross product matrix, i.e. M*a=p.Cross(a).
 
static Matrix3x3 CreateRotationX (float angle)
 
static Matrix3x3 CreateRotationY (float angle)
 
static Matrix3x3 CreateRotationZ (float angle)
 

Static Public Attributes

static constexpr int32_t RowCount = 3
 
static constexpr int32_t ColCount = 3
 

Detailed Description

Matrix with 3 rows and 3 columns. See Matrix4x4 for general information about matrices.

Member Function Documentation

◆ CreateRotationX()

AZ_MATH_INLINE Matrix3x3 AZ::Matrix3x3::CreateRotationX ( float  angle)
static

Sets the matrix to be a rotation around a specified axis.

◆ GetAdjugate()

AZ_MATH_INLINE Matrix3x3 AZ::Matrix3x3::GetAdjugate ( ) const

This is the transpose of the matrix of cofactors. Also known as the adjoint, adjugate is the modern name which avoids confusion with the adjoint conjugate transpose.

◆ GetBasisX()

AZ_MATH_INLINE Vector3 AZ::Matrix3x3::GetBasisX ( ) const

Basis (column) access functions.

◆ GetColumn()

AZ_MATH_INLINE Vector3 AZ::Matrix3x3::GetColumn ( int32_t  col) const

Column access functions.

◆ GetElement()

AZ_MATH_INLINE float AZ::Matrix3x3::GetElement ( int32_t  row,
int32_t  col 
) const

Indexed accessor functions.

◆ GetInverseFast()

AZ_MATH_INLINE Matrix3x3 AZ::Matrix3x3::GetInverseFast ( ) const

Fast inversion assumes the matrix is orthogonal.

◆ GetInverseFull()

AZ_MATH_INLINE Matrix3x3 AZ::Matrix3x3::GetInverseFull ( ) const

Gets the inverse of the matrix. Use GetInverseFast instead of this if the matrix is orthogonal.

◆ GetPolarDecomposition()

Matrix3x3 AZ::Matrix3x3::GetPolarDecomposition ( ) const

Polar decomposition, M=U*H, U is orthogonal (unitary) and H is symmetric (hermitian). This function returns the orthogonal part only

◆ GetRow()

AZ_MATH_INLINE Vector3 AZ::Matrix3x3::GetRow ( int32_t  row) const

Row access functions.

◆ GetTranspose()

AZ_MATH_INLINE Matrix3x3 AZ::Matrix3x3::GetTranspose ( ) const

Transpose calculation, flips the rows and columns.

◆ operator*() [1/2]

AZ_MATH_INLINE Matrix3x3 AZ::Matrix3x3::operator* ( const Matrix3x3 rhs) const

Operator for matrix-matrix multiplication.

◆ operator*() [2/2]

AZ_MATH_INLINE Matrix3x3 AZ::Matrix3x3::operator* ( float  multiplier) const

Operator for multiplying all matrix's elements with a scalar

◆ operator+()

AZ_MATH_INLINE Matrix3x3 AZ::Matrix3x3::operator+ ( const Matrix3x3 rhs) const

Operator for matrix-matrix addition.

◆ operator-()

AZ_MATH_INLINE Matrix3x3 AZ::Matrix3x3::operator- ( const Matrix3x3 rhs) const

Operator for matrix-matrix substraction.

◆ operator/()

AZ_MATH_INLINE Matrix3x3 AZ::Matrix3x3::operator/ ( float  divisor) const

Operator for dividing all matrix's elements with a scalar

◆ Reflect()

static void AZ::Matrix3x3::Reflect ( ReflectContext context)
static

AzCore Reflection.

Parameters
contextreflection context

◆ StoreToColumnMajorFloat9()

AZ_MATH_INLINE void AZ::Matrix3x3::StoreToColumnMajorFloat9 ( float *  values) const

Stores the matrix into to an array of 9 floats. The floats need only be 4 byte aligned, 16 byte alignment is not required.

◆ StoreToRowMajorFloat9()

AZ_MATH_INLINE void AZ::Matrix3x3::StoreToRowMajorFloat9 ( float *  values) const

Stores the matrix into to an array of 9 floats. The floats need only be 4 byte aligned, 16 byte alignment is not required.


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