OGRE  2.0
Object-Oriented Graphics Rendering Engine
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Ogre::ArrayMatrixAf4x3 Class Reference

Cache-friendly container of AFFINE 4x4 matrices represented as a SoA array. More...

#include <OgreArrayMatrixAf4x3.h>

+ Collaboration diagram for Ogre::ArrayMatrixAf4x3:

Public Member Functions

 ArrayMatrixAf4x3 ()
 
 ArrayMatrixAf4x3 ()
 
 ArrayMatrixAf4x3 ()
 
 ArrayMatrixAf4x3 (const ArrayMatrixAf4x3 &copy)
 
 ArrayMatrixAf4x3 (const ArrayMatrixAf4x3 &copy)
 
 ArrayMatrixAf4x3 (const ArrayMatrixAf4x3 &copy)
 
void fromQuaternion (const ArrayQuaternion &q)
 Converts the given quaternion to a 3x3 matrix representation and fill our values. More...
 
void fromQuaternion (const ArrayQuaternion &q)
 Converts the given quaternion to a 3x3 matrix representation and fill our values. More...
 
void fromQuaternion (const ArrayQuaternion &q)
 Converts the given quaternion to a 3x3 matrix representation and fill our values. More...
 
void loadFromAoS (const Matrix4 *RESTRICT_ALIAS src)
 Converts ARRAY_PACKED_REALS matrices into this ArrayMatrix. More...
 
void loadFromAoS (const Matrix4 *RESTRICT_ALIAS src)
 Converts ARRAY_PACKED_REALS matrices into this ArrayMatrix. More...
 
void loadFromAoS (const Matrix4 *RESTRICT_ALIAS src)
 Converts ARRAY_PACKED_REALS matrices into this ArrayMatrix. More...
 
void loadFromAoS (const SimpleMatrixAf4x3 *RESTRICT_ALIAS src)
 
void loadFromAoS (const SimpleMatrixAf4x3 *RESTRICT_ALIAS src)
 
void loadFromAoS (const SimpleMatrixAf4x3 *RESTRICT_ALIAS src)
 
void loadFromAoS (const SimpleMatrixAf4x3 **RESTRICT_ALIAS src)
 
void loadFromAoS (const SimpleMatrixAf4x3 **RESTRICT_ALIAS src)
 
void loadFromAoS (const SimpleMatrixAf4x3 **RESTRICT_ALIAS src)
 
void makeTransform (const ArrayVector3 &position, const ArrayVector3 &scale, const ArrayQuaternion &orientation)
 Building a Matrix4 from orientation / scale / position. More...
 
void makeTransform (const ArrayVector3 &position, const ArrayVector3 &scale, const ArrayQuaternion &orientation)
 Building a Matrix4 from orientation / scale / position. More...
 
void makeTransform (const ArrayVector3 &position, const ArrayVector3 &scale, const ArrayQuaternion &orientation)
 Building a Matrix4 from orientation / scale / position. More...
 
ArrayVector3 operator* (const ArrayVector3 &rhs) const
 
ArrayVector3 operator* (const ArrayVector3 &rhs) const
 
ArrayVector3 operator* (const ArrayVector3 &rhs) const
 
FORCEINLINE void operator*= (const ArrayMatrixAf4x3 &rhs)
 Prefer the update version 'a *= b' A LOT over 'a = a * b' (copying from an ArrayMatrix4 is 256 bytes!) More...
 
void operator*= (const ArrayMatrixAf4x3 &rhs)
 Prefer the update version 'a *= b' A LOT over 'a = a * b' (copying from an ArrayMatrix4 is 256 bytes!) More...
 
FORCEINLINE void operator*= (const ArrayMatrixAf4x3 &rhs)
 Prefer the update version 'a *= b' A LOT over 'a = a * b' (copying from an ArrayMatrix4 is 256 bytes!) More...
 
void retain (ArrayMaskR orientation, ArrayMaskR scale)
 Strips orientation and/or scale components out of this matrix based on the input using branchless selection. More...
 
void retain (ArrayMaskR orientation, ArrayMaskR scale)
 Strips orientation and/or scale components out of this matrix based on the input using branchless selection. More...
 
void retain (ArrayMaskR orientation, ArrayMaskR scale)
 Strips orientation and/or scale components out of this matrix based on the input using branchless selection. More...
 
void setAll (const Matrix4 &m)
 Sets all packed matrices to the same value as the scalar input matrix. More...
 
void setAll (const Matrix4 &m)
 Sets all packed matrices to the same value as the scalar input matrix. More...
 
void setAll (const Matrix4 &m)
 Sets all packed matrices to the same value as the scalar input matrix. More...
 
void setToInverse (void)
 Calculates the inverse of the matrix. More...
 
void setToInverse (void)
 Calculates the inverse of the matrix. More...
 
void setToInverse (void)
 Calculates the inverse of the matrix. More...
 
void setToInverseDegeneratesAsIdentity (void)
 Calculates the inverse of the matrix. More...
 
void setToInverseDegeneratesAsIdentity (void)
 Calculates the inverse of the matrix. More...
 
void setToInverseDegeneratesAsIdentity (void)
 Calculates the inverse of the matrix. More...
 
void storeToAoS (SimpleMatrixAf4x3 *RESTRICT_ALIAS src) const
 
void storeToAoS (SimpleMatrixAf4x3 *RESTRICT_ALIAS src) const
 
void storeToAoS (SimpleMatrixAf4x3 *RESTRICT_ALIAS src) const
 
void streamToAoS (Matrix4 *RESTRICT_ALIAS dst) const
 Converts these matrices contained in this ArrayMatrix to AoS form and stores them in dst. More...
 
void streamToAoS (Matrix4 *RESTRICT_ALIAS dst) const
 Converts these matrices contained in this ArrayMatrix to AoS form and stores them in dst. More...
 
void streamToAoS (Matrix4 *RESTRICT_ALIAS dst) const
 Converts these matrices contained in this ArrayMatrix to AoS form and stores them in dst. More...
 
void streamToAoS (SimpleMatrixAf4x3 *RESTRICT_ALIAS src) const
 
void streamToAoS (SimpleMatrixAf4x3 *RESTRICT_ALIAS src) const
 
void streamToAoS (SimpleMatrixAf4x3 *RESTRICT_ALIAS src) const
 

Static Public Member Functions

static ArrayMatrixAf4x3 createAllFromMatrix4 (const Matrix4 &m)
 
static ArrayMatrixAf4x3 createAllFromMatrix4 (const Matrix4 &m)
 
static ArrayMatrixAf4x3 createAllFromMatrix4 (const Matrix4 &m)
 

Public Attributes

ArrayReal mChunkBase [12]
 

Static Public Attributes

static const ArrayMatrixAf4x3 IDENTITY
 

Friends

ArrayMatrixAf4x3 operator* (const ArrayMatrixAf4x3 &lhs, const ArrayMatrixAf4x3 &rhs)
 
FORCEINLINE friend ArrayMatrixAf4x3 operator* (const ArrayMatrixAf4x3 &lhs, const ArrayMatrixAf4x3 &rhs)
 
FORCEINLINE friend ArrayMatrixAf4x3 operator* (const ArrayMatrixAf4x3 &lhs, const ArrayMatrixAf4x3 &rhs)
 

Detailed Description

Cache-friendly container of AFFINE 4x4 matrices represented as a SoA array.

Remarks
ArrayMatrix4 is a SIMD & cache-friendly version of Matrix4. An operation on an ArrayMatrix4 is done on 4 vectors at a time (the actual amount is defined by ARRAY_PACKED_REALS) Assuming ARRAY_PACKED_REALS == 4, the memory layout will be as following: mChunkBase mChunkBase + 4 a00b00c00d00 a01b01c01d01 Extracting one Matrix4 needs 256 bytes, which needs 4 line fetches for common cache lines of 64 bytes. Make sure extractions are made sequentially to avoid cache trashing and excessive bandwidth consumption, and prefer working on ArrayVector3 & ArrayQuaternion instead Architectures where the cache line == 32 bytes may want to set ARRAY_PACKED_REALS = 2 depending on their needs

Definition at line 69 of file C/OgreArrayMatrixAf4x3.h.

Constructor & Destructor Documentation

Ogre::ArrayMatrixAf4x3::ArrayMatrixAf4x3 ( )
inline

Definition at line 74 of file C/OgreArrayMatrixAf4x3.h.

Ogre::ArrayMatrixAf4x3::ArrayMatrixAf4x3 ( const ArrayMatrixAf4x3 copy)
inline

Definition at line 75 of file C/OgreArrayMatrixAf4x3.h.

References mChunkBase.

Ogre::ArrayMatrixAf4x3::ArrayMatrixAf4x3 ( )
inline

Definition at line 74 of file NEON/Single/OgreArrayMatrixAf4x3.h.

Ogre::ArrayMatrixAf4x3::ArrayMatrixAf4x3 ( const ArrayMatrixAf4x3 copy)
inline

Definition at line 75 of file NEON/Single/OgreArrayMatrixAf4x3.h.

References mChunkBase.

Ogre::ArrayMatrixAf4x3::ArrayMatrixAf4x3 ( )
inline

Definition at line 74 of file SSE2/Single/OgreArrayMatrixAf4x3.h.

Ogre::ArrayMatrixAf4x3::ArrayMatrixAf4x3 ( const ArrayMatrixAf4x3 copy)
inline

Definition at line 75 of file SSE2/Single/OgreArrayMatrixAf4x3.h.

References mChunkBase.

Member Function Documentation

static ArrayMatrixAf4x3 Ogre::ArrayMatrixAf4x3::createAllFromMatrix4 ( const Matrix4 m)
inlinestatic

Definition at line 107 of file C/OgreArrayMatrixAf4x3.h.

References setAll().

static ArrayMatrixAf4x3 Ogre::ArrayMatrixAf4x3::createAllFromMatrix4 ( const Matrix4 m)
inlinestatic

Definition at line 107 of file NEON/Single/OgreArrayMatrixAf4x3.h.

References setAll().

static ArrayMatrixAf4x3 Ogre::ArrayMatrixAf4x3::createAllFromMatrix4 ( const Matrix4 m)
inlinestatic

Definition at line 107 of file SSE2/Single/OgreArrayMatrixAf4x3.h.

References setAll().

void Ogre::ArrayMatrixAf4x3::fromQuaternion ( const ArrayQuaternion q)
inline

Converts the given quaternion to a 3x3 matrix representation and fill our values.

Remarks
Similar to
See also
Quaternion::ToRotationMatrix, this function will take the input quaternion and overwrite the first 3x3 subset of this matrix. The 4th row & columns are left untouched. This function is defined in ArrayMatrix4 to avoid including this header into ArrayQuaternion. The idea is that ArrayMatrix4 requires ArrayQuaternion, and ArrayQuaternion requires ArrayVector3. Simple dependency order
Parameters
Thequaternion to convert from.
void Ogre::ArrayMatrixAf4x3::fromQuaternion ( const ArrayQuaternion q)
inline

Converts the given quaternion to a 3x3 matrix representation and fill our values.

Remarks
Similar to
See also
Quaternion::ToRotationMatrix, this function will take the input quaternion and overwrite the first 3x3 subset of this matrix. The 4th row & columns are left untouched. This function is defined in ArrayMatrix4 to avoid including this header into ArrayQuaternion. The idea is that ArrayMatrix4 requires ArrayQuaternion, and ArrayQuaternion requires ArrayVector3. Simple dependency order
Parameters
Thequaternion to convert from.
void Ogre::ArrayMatrixAf4x3::fromQuaternion ( const ArrayQuaternion q)
inline

Converts the given quaternion to a 3x3 matrix representation and fill our values.

Remarks
Similar to
See also
Quaternion::ToRotationMatrix, this function will take the input quaternion and overwrite the first 3x3 subset of this matrix. The 4th row & columns are left untouched. This function is defined in ArrayMatrix4 to avoid including this header into ArrayQuaternion. The idea is that ArrayMatrix4 requires ArrayQuaternion, and ArrayQuaternion requires ArrayVector3. Simple dependency order
Parameters
Thequaternion to convert from.
void Ogre::ArrayMatrixAf4x3::loadFromAoS ( const Matrix4 *RESTRICT_ALIAS  src)
inline

Converts ARRAY_PACKED_REALS matrices into this ArrayMatrix.

Remarks
'src' must be aligned and assumed to have enough memory for ARRAY_PACKED_REALS matrices
void Ogre::ArrayMatrixAf4x3::loadFromAoS ( const Matrix4 *RESTRICT_ALIAS  src)
inline

Converts ARRAY_PACKED_REALS matrices into this ArrayMatrix.

Remarks
'src' must be aligned and assumed to have enough memory for ARRAY_PACKED_REALS matrices
void Ogre::ArrayMatrixAf4x3::loadFromAoS ( const Matrix4 *RESTRICT_ALIAS  src)
inline

Converts ARRAY_PACKED_REALS matrices into this ArrayMatrix.

Remarks
'src' must be aligned and assumed to have enough memory for ARRAY_PACKED_REALS matrices
void Ogre::ArrayMatrixAf4x3::loadFromAoS ( const SimpleMatrixAf4x3 *RESTRICT_ALIAS  src)
inline
void Ogre::ArrayMatrixAf4x3::loadFromAoS ( const SimpleMatrixAf4x3 *RESTRICT_ALIAS  src)
inline
void Ogre::ArrayMatrixAf4x3::loadFromAoS ( const SimpleMatrixAf4x3 *RESTRICT_ALIAS  src)
inline
void Ogre::ArrayMatrixAf4x3::loadFromAoS ( const SimpleMatrixAf4x3 **RESTRICT_ALIAS  src)
inline
void Ogre::ArrayMatrixAf4x3::loadFromAoS ( const SimpleMatrixAf4x3 **RESTRICT_ALIAS  src)
inline
void Ogre::ArrayMatrixAf4x3::loadFromAoS ( const SimpleMatrixAf4x3 **RESTRICT_ALIAS  src)
inline
void Ogre::ArrayMatrixAf4x3::makeTransform ( const ArrayVector3 position,
const ArrayVector3 scale,
const ArrayQuaternion orientation 
)
inline

Building a Matrix4 from orientation / scale / position.

Remarks
Transform is performed in the order scale, rotate, translation, i.e. translation is independent of orientation axes, scale does not affect size of translation, rotation and scaling are always centered on the origin.
void Ogre::ArrayMatrixAf4x3::makeTransform ( const ArrayVector3 position,
const ArrayVector3 scale,
const ArrayQuaternion orientation 
)
inline

Building a Matrix4 from orientation / scale / position.

Remarks
Transform is performed in the order scale, rotate, translation, i.e. translation is independent of orientation axes, scale does not affect size of translation, rotation and scaling are always centered on the origin.
void Ogre::ArrayMatrixAf4x3::makeTransform ( const ArrayVector3 position,
const ArrayVector3 scale,
const ArrayQuaternion orientation 
)
inline

Building a Matrix4 from orientation / scale / position.

Remarks
Transform is performed in the order scale, rotate, translation, i.e. translation is independent of orientation axes, scale does not affect size of translation, rotation and scaling are always centered on the origin.
ArrayVector3 Ogre::ArrayMatrixAf4x3::operator* ( const ArrayVector3 rhs) const
inline
ArrayVector3 Ogre::ArrayMatrixAf4x3::operator* ( const ArrayVector3 rhs) const
inline
ArrayVector3 Ogre::ArrayMatrixAf4x3::operator* ( const ArrayVector3 rhs) const
inline
FORCEINLINE void Ogre::ArrayMatrixAf4x3::operator*= ( const ArrayMatrixAf4x3 rhs)

Prefer the update version 'a *= b' A LOT over 'a = a * b' (copying from an ArrayMatrix4 is 256 bytes!)

void Ogre::ArrayMatrixAf4x3::operator*= ( const ArrayMatrixAf4x3 rhs)
inline

Prefer the update version 'a *= b' A LOT over 'a = a * b' (copying from an ArrayMatrix4 is 256 bytes!)

FORCEINLINE void Ogre::ArrayMatrixAf4x3::operator*= ( const ArrayMatrixAf4x3 rhs)

Prefer the update version 'a *= b' A LOT over 'a = a * b' (copying from an ArrayMatrix4 is 256 bytes!)

void Ogre::ArrayMatrixAf4x3::retain ( ArrayMaskR  orientation,
ArrayMaskR  scale 
)
inline

Strips orientation and/or scale components out of this matrix based on the input using branchless selection.

Remarks
Scale is always assumed to be positive. Negating the scale is the same as rotating 180° and/or skewing. If negative scale was applied, it is assumed it was done using orientation/skewing alone (if orientation is stripped, the matrix will look in the opposite direction as if scale was positive, if scale is stripped, the matrix will keep looking in the opposite direction as if the scale were still negative) This behavior mimics that of major modeling tools.
void Ogre::ArrayMatrixAf4x3::retain ( ArrayMaskR  orientation,
ArrayMaskR  scale 
)
inline

Strips orientation and/or scale components out of this matrix based on the input using branchless selection.

Remarks
Scale is always assumed to be positive. Negating the scale is the same as rotating 180° and/or skewing. If negative scale was applied, it is assumed it was done using orientation/skewing alone (if orientation is stripped, the matrix will look in the opposite direction as if scale was positive, if scale is stripped, the matrix will keep looking in the opposite direction as if the scale were still negative) This behavior mimics that of major modeling tools.
void Ogre::ArrayMatrixAf4x3::retain ( ArrayMaskR  orientation,
ArrayMaskR  scale 
)
inline

Strips orientation and/or scale components out of this matrix based on the input using branchless selection.

Remarks
Scale is always assumed to be positive. Negating the scale is the same as rotating 180° and/or skewing. If negative scale was applied, it is assumed it was done using orientation/skewing alone (if orientation is stripped, the matrix will look in the opposite direction as if scale was positive, if scale is stripped, the matrix will keep looking in the opposite direction as if the scale were still negative) This behavior mimics that of major modeling tools.
void Ogre::ArrayMatrixAf4x3::setAll ( const Matrix4 m)
inline

Sets all packed matrices to the same value as the scalar input matrix.

Definition at line 91 of file NEON/Single/OgreArrayMatrixAf4x3.h.

References Ogre::Matrix4::_m.

void Ogre::ArrayMatrixAf4x3::setAll ( const Matrix4 m)
inline

Sets all packed matrices to the same value as the scalar input matrix.

Definition at line 91 of file SSE2/Single/OgreArrayMatrixAf4x3.h.

References Ogre::Matrix4::_m.

void Ogre::ArrayMatrixAf4x3::setAll ( const Matrix4 m)
inline

Sets all packed matrices to the same value as the scalar input matrix.

Definition at line 91 of file C/OgreArrayMatrixAf4x3.h.

References Ogre::Matrix4::_m.

Referenced by createAllFromMatrix4().

void Ogre::ArrayMatrixAf4x3::setToInverse ( void  )
inline

Calculates the inverse of the matrix.

If used against degenerate matrices, it may cause NaNs and Infs on those. Use if you want to deal with degenerate matrices.

void Ogre::ArrayMatrixAf4x3::setToInverse ( void  )
inline

Calculates the inverse of the matrix.

If used against degenerate matrices, it may cause NaNs and Infs on those. Use if you want to deal with degenerate matrices.

void Ogre::ArrayMatrixAf4x3::setToInverse ( void  )
inline

Calculates the inverse of the matrix.

If used against degenerate matrices, it may cause NaNs and Infs on those. Use if you want to deal with degenerate matrices.

void Ogre::ArrayMatrixAf4x3::setToInverseDegeneratesAsIdentity ( void  )
inline

Calculates the inverse of the matrix.

If one (or more) of the matrices are degenerate (don't have an inverse), those are set to identity.

void Ogre::ArrayMatrixAf4x3::setToInverseDegeneratesAsIdentity ( void  )
inline

Calculates the inverse of the matrix.

If one (or more) of the matrices are degenerate (don't have an inverse), those are set to identity.

void Ogre::ArrayMatrixAf4x3::setToInverseDegeneratesAsIdentity ( void  )
inline

Calculates the inverse of the matrix.

If one (or more) of the matrices are degenerate (don't have an inverse), those are set to identity.

void Ogre::ArrayMatrixAf4x3::storeToAoS ( SimpleMatrixAf4x3 *RESTRICT_ALIAS  src) const
inline
void Ogre::ArrayMatrixAf4x3::storeToAoS ( SimpleMatrixAf4x3 *RESTRICT_ALIAS  src) const
inline
void Ogre::ArrayMatrixAf4x3::storeToAoS ( SimpleMatrixAf4x3 *RESTRICT_ALIAS  src) const
inline
void Ogre::ArrayMatrixAf4x3::streamToAoS ( Matrix4 *RESTRICT_ALIAS  dst) const
inline

Converts these matrices contained in this ArrayMatrix to AoS form and stores them in dst.

Remarks
'dst' must be aligned and assumed to have enough memory for ARRAY_PACKED_REALS matrices
void Ogre::ArrayMatrixAf4x3::streamToAoS ( Matrix4 *RESTRICT_ALIAS  dst) const
inline

Converts these matrices contained in this ArrayMatrix to AoS form and stores them in dst.

Remarks
'dst' must be aligned and assumed to have enough memory for ARRAY_PACKED_REALS matrices
void Ogre::ArrayMatrixAf4x3::streamToAoS ( Matrix4 *RESTRICT_ALIAS  dst) const
inline

Converts these matrices contained in this ArrayMatrix to AoS form and stores them in dst.

Remarks
'dst' must be aligned and assumed to have enough memory for ARRAY_PACKED_REALS matrices
void Ogre::ArrayMatrixAf4x3::streamToAoS ( SimpleMatrixAf4x3 *RESTRICT_ALIAS  src) const
inline
void Ogre::ArrayMatrixAf4x3::streamToAoS ( SimpleMatrixAf4x3 *RESTRICT_ALIAS  src) const
inline
void Ogre::ArrayMatrixAf4x3::streamToAoS ( SimpleMatrixAf4x3 *RESTRICT_ALIAS  src) const
inline

Friends And Related Function Documentation

ArrayMatrixAf4x3 operator* ( const ArrayMatrixAf4x3 lhs,
const ArrayMatrixAf4x3 rhs 
)
friend
FORCEINLINE friend ArrayMatrixAf4x3 operator* ( const ArrayMatrixAf4x3 lhs,
const ArrayMatrixAf4x3 rhs 
)
friend
FORCEINLINE friend ArrayMatrixAf4x3 operator* ( const ArrayMatrixAf4x3 lhs,
const ArrayMatrixAf4x3 rhs 
)
friend

Member Data Documentation

static const ArrayMatrixAf4x3 Ogre::ArrayMatrixAf4x3::IDENTITY
static

Definition at line 179 of file C/OgreArrayMatrixAf4x3.h.

ArrayReal Ogre::ArrayMatrixAf4x3::mChunkBase

Definition at line 72 of file C/OgreArrayMatrixAf4x3.h.

Referenced by ArrayMatrixAf4x3().


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