Nirtcpp 2.1.0
Nirtcpp is a high-performance c++ graphics engine.
Loading...
Searching...
No Matches
nirt::core::CMatrix4< T > Class Template Reference

4x4 matrix. Mostly used as transformation matrix for 3d calculations. More...

#include <nirtcpp/core/engine/matrix4.hpp>

Public Types

enum  eConstructor {
  EM4CONST_NOTHING = 0 , EM4CONST_COPY , EM4CONST_IDENTITY , EM4CONST_TRANSPOSED ,
  EM4CONST_INVERSE , EM4CONST_INVERSE_TRANSPOSED
}
 Constructor Flags.
 

Public Member Functions

 CMatrix4 (eConstructor constructor=EM4CONST_IDENTITY)
 Default constructor.
 
 CMatrix4 (const T &r0c0, const T &r0c1, const T &r0c2, const T &r0c3, const T &r1c0, const T &r1c1, const T &r1c2, const T &r1c3, const T &r2c0, const T &r2c1, const T &r2c2, const T &r2c3, const T &r3c0, const T &r3c1, const T &r3c2, const T &r3c3)
 Constructor with value initialization.
 
 CMatrix4 (const CMatrix4< T > &other, eConstructor constructor=EM4CONST_COPY)
 Copy constructor.
 
Toperator() (const s32 row, const s32 col)
 Simple operator for directly accessing every element of the matrix.
 
const Toperator() (const s32 row, const s32 col) const
 Simple operator for directly accessing every element of the matrix.
 
Toperator[] (u32 index)
 Simple operator for linearly accessing every element of the matrix.
 
const Toperator[] (u32 index) const
 Simple operator for linearly accessing every element of the matrix.
 
Toperator[] (nirt::u32 row, nirt::u32 col)
 
const Toperator[] (nirt::u32 row, nirt::u32 col) const
 
CMatrix4< T > & operator= (const CMatrix4< T > &other)
 Sets this matrix equal to the other matrix.
 
CMatrix4< T > & operator= (const T &scalar)
 Sets all elements of this matrix to the value.
 
const Tpointer () const
 Returns pointer to internal array.
 
Tpointer ()
 
bool operator== (const CMatrix4< T > &other) const
 Returns true if other matrix is equal to this matrix.
 
bool operator!= (const CMatrix4< T > &other) const
 Returns true if other matrix is not equal to this matrix.
 
CMatrix4< Toperator+ (const CMatrix4< T > &other) const
 Add another matrix.
 
CMatrix4< T > & operator+= (const CMatrix4< T > &other)
 Add another matrix.
 
CMatrix4< Toperator- (const CMatrix4< T > &other) const
 Subtract another matrix.
 
CMatrix4< T > & operator-= (const CMatrix4< T > &other)
 Subtract another matrix.
 
CMatrix4< T > & setbyproduct (const CMatrix4< T > &other_a, const CMatrix4< T > &other_b)
 set this matrix to the product of two matrices
 
CMatrix4< T > & setbyproduct_nocheck (const CMatrix4< T > &other_a, const CMatrix4< T > &other_b)
 Set this matrix to the product of two matrices.
 
CMatrix4< Toperator* (const CMatrix4< T > &other) const
 Multiply by another matrix.
 
CMatrix4< T > & operator*= (const CMatrix4< T > &other)
 Multiply by another matrix.
 
CMatrix4< Toperator* (const T &scalar) const
 Multiply by scalar.
 
CMatrix4< T > & operator*= (const T &scalar)
 Multiply by scalar.
 
CMatrix4< T > & makeIdentity ()
 Set matrix to identity.
 
bool isIdentity () const
 Returns true if the matrix is the identity matrix.
 
bool isOrthogonal () const
 Returns true if the matrix is orthogonal.
 
bool isIdentity_integer_base () const
 Returns true if the matrix is the identity matrix.
 
CMatrix4< T > & setTranslation (const vector3d< T > &translation)
 Set the translation of the current matrix. Will erase any previous values.
 
vector3d< TgetTranslation () const
 Gets the current translation.
 
CMatrix4< T > & setInverseTranslation (const vector3d< T > &translation)
 Set the inverse translation of the current matrix. Will erase any previous values.
 
CMatrix4< T > & setRotationRadians (const vector3d< T > &rotation)
 Make a rotation matrix from Euler angles. The 4th row and column are unmodified.
 
CMatrix4< T > & setRotationDegrees (const vector3d< T > &rotation)
 Make a rotation matrix from Euler angles. The 4th row and column are unmodified.
 
core::vector3d< TgetRotationDegrees (const vector3d< T > &scale) const
 Get the rotation, as set by setRotation() when you already know the scale used to create the matrix.
 
core::vector3d< TgetRotationDegrees () const
 Returns the rotation, as set by setRotation().
 
CMatrix4< T > & setInverseRotationRadians (const vector3d< T > &rotation)
 Make an inverted rotation matrix from Euler angles.
 
CMatrix4< T > & setInverseRotationDegrees (const vector3d< T > &rotation)
 Make an inverted rotation matrix from Euler angles.
 
CMatrix4< T > & setRotationAxisRadians (const T &angle, const vector3d< T > &axis)
 Make a rotation matrix from angle and axis, assuming left handed rotation.
 
CMatrix4< T > & setScale (const vector3d< T > &scale)
 Set Scale.
 
CMatrix4< T > & setScale (const T scale)
 Set Scale.
 
core::vector3d< TgetScale () const
 Get Scale.
 
void inverseTranslateVect (vector3df &vect) const
 Translate a vector by the inverse of the translation part of this matrix.
 
void inverseRotateVect (vector3df &vect) const
 Tranform (rotate/scale) a vector by the inverse of the rotation part this matrix.
 
void rotateVect (vector3df &vect) const
 Transform (rotate/scale) a vector by the rotation part of this matrix.
 
void rotateVect (core::vector3df &out, const core::vector3df &in) const
 An alternate transform vector method, writing into a second vector.
 
void rotateVect (T *out, const core::vector3df &in) const
 An alternate transform vector method, writing into an array of 3 floats.
 
void transformVect (vector3df &vect) const
 Transforms the vector by this matrix.
 
void transformVect (vector3df &out, const vector3df &in) const
 Transforms input vector by this matrix and stores result in output vector.
 
void transformVect (T *out, const core::vector3df &in) const
 An alternate transform vector method, writing into an array of 4 floats.
 
void transformVec3 (T *out, const T *in) const
 An alternate transform vector method, reading from and writing to an array of 3 floats.
 
void transformVec4 (T *out, const T *in) const
 An alternate transform vector method, reading from and writing to an array of 4 floats.
 
void translateVect (vector3df &vect) const
 Translate a vector by the translation part of this matrix.
 
void transformPlane (core::plane3d< f32 > &plane) const
 Transforms a plane by this matrix.
 
void transformPlane (const core::plane3d< f32 > &in, core::plane3d< f32 > &out) const
 Transforms a plane by this matrix.
 
void transformBox (core::aabbox3d< f32 > &box) const
 Transforms a axis aligned bounding box.
 
void transformBoxEx (core::aabbox3d< f32 > &box) const
 Transforms a axis aligned bounding box.
 
void multiplyWith1x4Matrix (T *matrix) const
 Multiplies this matrix by a 1x4 matrix.
 
bool makeInverse ()
 Calculates inverse of matrix. Slow.
 
bool getInversePrimitive (CMatrix4< T > &out) const
 Inverts a primitive matrix which only contains a translation and a rotation.
 
bool getInverse (CMatrix4< T > &out) const
 Gets the inverse matrix of this one.
 
CMatrix4< T > & buildProjectionMatrixPerspectiveFovRH (f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar, bool zClipFromZero=true)
 Builds a right-handed perspective projection matrix based on a field of view.
 
CMatrix4< T > & buildProjectionMatrixPerspectiveFovLH (f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 zFar, bool zClipFromZero=true)
 Builds a left-handed perspective projection matrix based on a field of view.
 
CMatrix4< T > & buildProjectionMatrixPerspectiveFovInfinityLH (f32 fieldOfViewRadians, f32 aspectRatio, f32 zNear, f32 epsilon=0)
 Builds a left-handed perspective projection matrix based on a field of view, with far plane at infinity.
 
CMatrix4< T > & buildProjectionMatrixPerspectiveRH (f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar, bool zClipFromZero=true)
 Builds a right-handed perspective projection matrix.
 
CMatrix4< T > & buildProjectionMatrixPerspectiveLH (f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar, bool zClipFromZero=true)
 Builds a left-handed perspective projection matrix.
 
CMatrix4< T > & buildProjectionMatrixOrthoLH (f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar, bool zClipFromZero=true)
 Builds a left-handed orthogonal projection matrix.
 
CMatrix4< T > & buildProjectionMatrixOrthoRH (f32 widthOfViewVolume, f32 heightOfViewVolume, f32 zNear, f32 zFar, bool zClipFromZero=true)
 Builds a right-handed orthogonal projection matrix.
 
CMatrix4< T > & buildCameraLookAtMatrixLH (const vector3df &position, const vector3df &target, const vector3df &upVector)
 Builds a left-handed look-at matrix.
 
CMatrix4< T > & buildCameraLookAtMatrixRH (const vector3df &position, const vector3df &target, const vector3df &upVector)
 Builds a right-handed look-at matrix.
 
CMatrix4< T > & buildShadowMatrix (const core::vector3df &light, core::plane3df plane, f32 point=1.0f)
 Builds a matrix that flattens geometry into a plane.
 
CMatrix4< T > & buildNDCToDCMatrix (const core::rect< s32 > &area, f32 zScale)
 Builds a matrix which transforms a normalized Device Coordinate to Device Coordinates.
 
CMatrix4< Tinterpolate (const core::CMatrix4< T > &b, f32 time) const
 Creates a new matrix as interpolated matrix from two other ones.
 
CMatrix4< TgetTransposed () const
 Gets transposed matrix.
 
void getTransposed (CMatrix4< T > &dest) const
 Gets transposed matrix.
 
CMatrix4< T > & buildRotateFromTo (const core::vector3df &from, const core::vector3df &to)
 Builds a matrix that rotates from one vector to another.
 
void setRotationCenter (const core::vector3df &center, const core::vector3df &translate)
 Builds a combined matrix which translates to a center before rotation and translates from origin afterwards.
 
void buildAxisAlignedBillboard (const core::vector3df &camPos, const core::vector3df &center, const core::vector3df &translation, const core::vector3df &axis, const core::vector3df &from)
 Builds a matrix which rotates a source vector to a look vector over an arbitrary axis.
 
CMatrix4< T > & buildTextureTransform (f32 rotateRad, const core::vector2df &rotatecenter, const core::vector2df &translate, const core::vector2df &scale)
 Set to a texture transformation matrix with the given parameters.
 
CMatrix4< T > & setTextureRotationCenter (f32 radAngle)
 Set texture transformation rotation.
 
CMatrix4< T > & setTextureTranslate (f32 x, f32 y)
 Set texture transformation translation.
 
void getTextureTranslate (f32 &x, f32 &y) const
 Get texture transformation translation.
 
CMatrix4< T > & setTextureTranslateTransposed (f32 x, f32 y)
 Set texture transformation translation, using a transposed representation.
 
CMatrix4< T > & setTextureScale (f32 sx, f32 sy)
 Set texture transformation scale.
 
void getTextureScale (f32 &sx, f32 &sy) const
 Get texture transformation scale.
 
CMatrix4< T > & setTextureScaleCenter (f32 sx, f32 sy)
 Set texture transformation scale, and recenter at (0.5,0.5)
 
CMatrix4< T > & setM (const T *data)
 Sets all matrix data members at once.
 
void setDefinitelyIdentityMatrix (bool isDefinitelyIdentityMatrix)
 Sets if the matrix is definitely identity matrix.
 
bool getDefinitelyIdentityMatrix () const
 Gets if the matrix is definitely identity matrix.
 
bool equals (const core::CMatrix4< T > &other, const T tolerance=(T) ROUNDING_ERROR_f64) const
 Compare two matrices using the equal method.
 

Detailed Description

template<typename T>
class nirt::core::CMatrix4< T >

4x4 matrix. Mostly used as transformation matrix for 3d calculations.

The matrix is a D3D style matrix, row major with translations in the 4th row.

Constructor & Destructor Documentation

◆ CMatrix4() [1/2]

template<class T >
nirt::core::CMatrix4< T >::CMatrix4 ( eConstructor  constructor = EM4CONST_IDENTITY)
inline

Default constructor.

Parameters
constructorChoose the initialization style

◆ CMatrix4() [2/2]

template<class T >
nirt::core::CMatrix4< T >::CMatrix4 ( const CMatrix4< T > &  other,
eConstructor  constructor = EM4CONST_COPY 
)
inline

Copy constructor.

Parameters
otherOther matrix to copy from
constructorChoose the initialization style

Member Function Documentation

◆ buildAxisAlignedBillboard()

template<class T >
void nirt::core::CMatrix4< T >::buildAxisAlignedBillboard ( const core::vector3df camPos,
const core::vector3df center,
const core::vector3df translation,
const core::vector3df axis,
const core::vector3df from 
)
inline

Builds a matrix which rotates a source vector to a look vector over an arbitrary axis.

Parameters
camPosviewer position in world coo
centerobject position in world-coo and rotation pivot
translationobject final translation from center
axisaxis to rotate about
fromsource vector to rotate from
camPosviewer position in world coord
centerobject position in world-coord, rotation pivot
translationobject final translation from center
axisaxis to rotate about
fromsource vector to rotate from

◆ buildNDCToDCMatrix()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::buildNDCToDCMatrix ( const core::rect< s32 > &  area,
f32  zScale 
)
inline

Builds a matrix which transforms a normalized Device Coordinate to Device Coordinates.

Used to scale <-1,-1><1,1> to viewport, for example from <-1,-1> <1,1> to the viewport <0,0><0,640>

◆ buildRotateFromTo()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::buildRotateFromTo ( const core::vector3df from,
const core::vector3df to 
)
inline

Builds a matrix that rotates from one vector to another.

Parameters
fromvector to rotate from
tovector to rotate to
fromvector to rotate from
tovector to rotate to
http://www.euclideanspace.com/maths/geometry/rotations/conversions/angleToMatrix/index.htm

◆ buildShadowMatrix()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::buildShadowMatrix ( const core::vector3df light,
core::plane3df  plane,
f32  point = 1.0f 
)
inline

Builds a matrix that flattens geometry into a plane.

Parameters
lightlight source
planeplane into which the geometry if flattened into
pointvalue between 0 and 1, describing the light source. If this is 1, it is a point light, if it is 0, it is a directional light.

◆ buildTextureTransform()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::buildTextureTransform ( f32  rotateRad,
const core::vector2df rotatecenter,
const core::vector2df translate,
const core::vector2df scale 
)
inline

Set to a texture transformation matrix with the given parameters.

Generate texture coordinates as linear functions so that: u = Ux*x + Uy*y + Uz*z + Uw v = Vx*x + Vy*y + Vz*z + Vw The matrix M for this case is: Ux Vx 0 0 Uy Vy 0 0 Uz Vz 0 0 Uw Vw 0 0

◆ getInverse()

template<class T >
bool nirt::core::CMatrix4< T >::getInverse ( CMatrix4< T > &  out) const
inline

Gets the inverse matrix of this one.

Parameters
outwhere result matrix is written to.
Returns
Returns false if there is no inverse matrix.

Calculates the inverse of this Matrix The inverse is calculated using Cramers rule. If no inverse exists then 'false' is returned.

◆ getInversePrimitive()

template<class T >
bool nirt::core::CMatrix4< T >::getInversePrimitive ( CMatrix4< T > &  out) const
inline

Inverts a primitive matrix which only contains a translation and a rotation.

Parameters
outwhere result matrix is written to.

Inverts a primitive matrix which only contains a translation and a rotation

Parameters
outwhere result matrix is written to.

◆ getRotationDegrees() [1/2]

template<class T >
core::vector3d< T > nirt::core::CMatrix4< T >::getRotationDegrees ( ) const
inline

Returns the rotation, as set by setRotation().

Returns a rotation that is equivalent to that set by setRotationDegrees().

NOTE: You will have the same end-rotation as used in setRotation, but it might not use the same axis values. NOTE: This only works correct if no other matrix operations have been done on the inner 3x3 matrix besides setting rotation (so no scale/shear). Thought it (probably) works as long as scale doesn't flip handedness. NOTE: It does not necessarily return the same Euler angles as those set by setRotationDegrees(), but the rotation will be equivalent, i.e. will have the same result when used to rotate a vector or node.

◆ getRotationDegrees() [2/2]

template<class T >
core::vector3d< T > nirt::core::CMatrix4< T >::getRotationDegrees ( const vector3d< T > &  scale_) const
inline

Get the rotation, as set by setRotation() when you already know the scale used to create the matrix.

Returns a rotation which (mostly) works in combination with the given scale.

NOTE: The scale needs to be the correct one used to create this matrix. You can not use the result of getScale(), but have to save your scale variable in another place (like ISceneNode does). NOTE: No scale value can be 0 or the result is undefined. NOTE: It does not necessarily return the same Euler angles as those set by setRotationDegrees(), but the rotation will be equivalent, i.e. will have the same result when used to rotate a vector or node. NOTE: It will (usually) give wrong results when further transformations have been added in the matrix (like shear). WARNING: There have been troubles with this function over the years and we may still have missed some corner cases. It's generally safer to keep the rotation and scale you used to create the matrix around and work with those.

This code was originally written by by Chev (assuming no scaling back then, we can be blamed for all problems added by regarding scale)

◆ getScale()

template<class T >
vector3d< T > nirt::core::CMatrix4< T >::getScale ( ) const
inline

Get Scale.

Returns the absolute values of the scales of the matrix.

Note: You only get back original values if the matrix only set the scale. Otherwise the result is a scale you can use to normalize the matrix axes, but it's usually no longer what you did set with setScale.

◆ getTextureScale()

template<class T >
void nirt::core::CMatrix4< T >::getTextureScale ( f32 sx,
f32 sy 
) const
inline

Get texture transformation scale.

Parameters
sxReturns x axis scale factor
syReturns y axis scale factor

◆ getTextureTranslate()

template<class T >
void nirt::core::CMatrix4< T >::getTextureTranslate ( f32 x,
f32 y 
) const
inline

Get texture transformation translation.

Parameters
xreturns offset on x axis
yreturns offset on y axis

◆ interpolate()

template<class T >
CMatrix4< T > nirt::core::CMatrix4< T >::interpolate ( const core::CMatrix4< T > &  b,
f32  time 
) const
inline

Creates a new matrix as interpolated matrix from two other ones.

Parameters
bother matrix to interpolate with
timeMust be a value between 0 and 1.

◆ makeInverse()

template<class T >
bool nirt::core::CMatrix4< T >::makeInverse ( )
inline

Calculates inverse of matrix. Slow.

Returns
Returns false if there is no inverse matrix.

◆ operator*()

template<class T >
CMatrix4< T > nirt::core::CMatrix4< T >::operator* ( const CMatrix4< T > &  other) const
inline

Multiply by another matrix.

multiply by another matrix

Calculate other*this

◆ operator*=()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::operator*= ( const CMatrix4< T > &  other)
inline

Multiply by another matrix.

Like calling: (*this) = (*this) * other

◆ setbyproduct()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::setbyproduct ( const CMatrix4< T > &  other_a,
const CMatrix4< T > &  other_b 
)
inline

set this matrix to the product of two matrices

multiply by another matrix

Calculate b*a

◆ setbyproduct_nocheck()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::setbyproduct_nocheck ( const CMatrix4< T > &  other_a,
const CMatrix4< T > &  other_b 
)
inline

Set this matrix to the product of two matrices.

multiply by another matrix

Calculate b*a, no optimization used, use it if you know you never have an identity matrix

◆ setInverseRotationDegrees()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::setInverseRotationDegrees ( const vector3d< T > &  rotation)
inline

Make an inverted rotation matrix from Euler angles.

The 4th row and column are unmodified.

◆ setInverseRotationRadians()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::setInverseRotationRadians ( const vector3d< T > &  rotation)
inline

Make an inverted rotation matrix from Euler angles.

Sets matrix to rotation matrix of inverse angles given as parameters.

The 4th row and column are unmodified.

◆ setRotationAxisRadians()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::setRotationAxisRadians ( const T angle,
const vector3d< T > &  axis 
)
inline

Make a rotation matrix from angle and axis, assuming left handed rotation.

Sets matrix to rotation matrix defined by axis and angle, assuming LH rotation.

The 4th row and column are unmodified.

◆ setRotationCenter()

template<class T >
void nirt::core::CMatrix4< T >::setRotationCenter ( const core::vector3df center,
const core::vector3df translate 
)
inline

Builds a combined matrix which translates to a center before rotation and translates from origin afterwards.

Builds a combined matrix which translate to a center before rotation and translate afterward.

Parameters
centerPosition to rotate around
translateTranslation applied after the rotation

◆ setTextureRotationCenter()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::setTextureRotationCenter ( f32  radAngle)
inline

Set texture transformation rotation.

Rotate about z axis, recenter at (0.5,0.5). Doesn't clear other elements than those affected

Parameters
radAngleAngle in radians
Returns
Altered matrix

◆ setTextureScale()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::setTextureScale ( f32  sx,
f32  sy 
)
inline

Set texture transformation scale.

Doesn't clear other elements than those affected.

Parameters
sxScale factor on x axis
syScale factor on y axis
Returns
Altered matrix.

◆ setTextureScaleCenter()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::setTextureScaleCenter ( f32  sx,
f32  sy 
)
inline

Set texture transformation scale, and recenter at (0.5,0.5)

Doesn't clear other elements than those affected.

Parameters
sxScale factor on x axis
syScale factor on y axis
Returns
Altered matrix.

◆ setTextureTranslate()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::setTextureTranslate ( f32  x,
f32  y 
)
inline

Set texture transformation translation.

Doesn't clear other elements than those affected.

Parameters
xOffset on x axis
yOffset on y axis
Returns
Altered matrix

◆ setTextureTranslateTransposed()

template<class T >
CMatrix4< T > & nirt::core::CMatrix4< T >::setTextureTranslateTransposed ( f32  x,
f32  y 
)
inline

Set texture transformation translation, using a transposed representation.

Doesn't clear other elements than those affected.

Parameters
xOffset on x axis
yOffset on y axis
Returns
Altered matrix

◆ transformBox()

template<class T >
NIRT_DEPRECATED void nirt::core::CMatrix4< T >::transformBox ( core::aabbox3d< f32 > &  box) const
inline

Transforms a axis aligned bounding box.

The result box of this operation may not be accurate at all. For correct results, use transformBoxEx()

Transforms the edge-points of a bounding box Deprecated as it's usually not what people need (regards only 2 corners, but other corners might be outside the box after transformation) Use transformBoxEx instead.

◆ transformBoxEx()

template<class T >
void nirt::core::CMatrix4< T >::transformBoxEx ( core::aabbox3d< f32 > &  box) const
inline

Transforms a axis aligned bounding box.

Transforms a axis aligned bounding box more accurately than transformBox()

The result box of this operation should be accurate, but this operation is slower than transformBox().

◆ transformVec3()

template<class T >
void nirt::core::CMatrix4< T >::transformVec3 ( T out,
const T in 
) const
inline

An alternate transform vector method, reading from and writing to an array of 3 floats.

This operation is performed as if the vector was 4d with the 4th component =1 NOTE: out[3] will be written to (4th vector component)

◆ transformVect() [1/3]

template<class T >
void nirt::core::CMatrix4< T >::transformVect ( T out,
const core::vector3df in 
) const
inline

An alternate transform vector method, writing into an array of 4 floats.

This operation is performed as if the vector was 4d with the 4th component =1. NOTE: out[3] will be written to (4th vector component)

◆ transformVect() [2/3]

template<class T >
void nirt::core::CMatrix4< T >::transformVect ( vector3df out,
const vector3df in 
) const
inline

Transforms input vector by this matrix and stores result in output vector.

This operation is performed as if the vector was 4d with the 4th component =1

◆ transformVect() [3/3]

template<class T >
void nirt::core::CMatrix4< T >::transformVect ( vector3df vect) const
inline

Transforms the vector by this matrix.

This operation is performed as if the vector was 4d with the 4th component =1

◆ translateVect()

template<class T >
void nirt::core::CMatrix4< T >::translateVect ( vector3df vect) const
inline

Translate a vector by the translation part of this matrix.

This operation is performed as if the vector was 4d with the 4th component =1


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

Nirtcpp    @cppfx.xyz

Utxcpp    utx::print