Data Structures | Functions | Variables
AtMatrix API

AtMatrix type creation and operation. More...

Data Structures

struct  AtMatrix
 

Functions

bool AtMatrix::operator== (const AtMatrix &m) const
 
constexpr const float * AtMatrix::operator[] (int t) const
 
float * AtMatrix::operator[] (int t)
 
AI_API AI_DEVICE AtMatrix AiM4Identity ()
 Create an identity matrix. More...
 
AI_API AtMatrix AiM4Translation (const AtVector &t)
 Create a translation matrix from a translation vector. More...
 
AI_API AI_DEVICE AtMatrix AiM4RotationX (float x)
 Create a X-axis rotation matrix. More...
 
AI_API AI_DEVICE AtMatrix AiM4RotationY (float y)
 Create a Y-axis rotation matrix. More...
 
AI_API AI_DEVICE AtMatrix AiM4RotationZ (float z)
 Create a Z-axis rotation matrix. More...
 
AI_API AtMatrix AiM4Scaling (const AtVector &s)
 Create a scaling matrix from a scaling vector. More...
 
AI_API AI_DEVICE AtMatrix AiM4Frame (const AtVector &o, const AtVector &u, const AtVector &v, const AtVector &w)
 Create a matrix that transforms into a new coordinate frame. More...
 
AI_API AI_DEVICE AtVector AiM4PointByMatrixMult (const AtMatrix &m, const AtVector &pin)
 Left-multiply a point by a matrix. More...
 
AI_API AI_DEVICE AtHPoint AiM4HPointByMatrixMult (const AtMatrix &m, const AtHPoint &pin)
 Left-multiply a 4D point by a matrix. More...
 
AI_API AI_DEVICE AtVector AiM4VectorByMatrixMult (const AtMatrix &m, const AtVector &vin)
 Left-multiply a vector by a matrix. More...
 
AI_API AI_DEVICE AtVector AiM4VectorByMatrixTMult (const AtMatrix &m, const AtVector &vin)
 Right-multiply a vector by a matrix. More...
 
AI_API AI_DEVICE AtMatrix AiM4Mult (const AtMatrix &ma, const AtMatrix &mb)
 Multiply two matrices. More...
 
AI_API AI_DEVICE AtMatrix AiM4Transpose (const AtMatrix &min)
 Calculate the transpose of a matrix. More...
 
AI_API AI_DEVICE AtMatrix AiM4Invert (const AtMatrix &min)
 Calculate the inverse of a matrix. More...
 
AI_API AI_PURE float AiM4Determinant (const AtMatrix &m)
 Determinant of a matrix. More...
 
AI_API AI_DEVICE AtMatrix AiM4Lerp (float t, const AtMatrix &ma, const AtMatrix &mb)
 Linear interpolation of two matrices. More...
 
AI_API AI_PURE bool AiM4IsIdentity (const AtMatrix &m)
 Is this an identity matrix? More...
 
AI_API AI_PURE bool AiM4IsSingular (const AtMatrix &m)
 Is this a singular matrix? More...
 

Variables

float AtMatrix::data [4][4]
 

Detailed Description

AtMatrix type creation and operation.

Function Documentation

◆ AiM4Identity()

AI_API AI_DEVICE AtMatrix AiM4Identity ( )

Create an identity matrix.

Parameters
[out]moutidentity matrix result

◆ AiM4Translation()

AI_API AtMatrix AiM4Translation ( const AtVector t)

Create a translation matrix from a translation vector.

Parameters
[out]moutmatrix result
ttranslation vector

◆ AiM4RotationX()

AI_API AI_DEVICE AtMatrix AiM4RotationX ( float  x)

Create a X-axis rotation matrix.

Parameters
[out]moutmatrix result
xangle from the X axis (in degrees)

◆ AiM4RotationY()

AI_API AI_DEVICE AtMatrix AiM4RotationY ( float  y)

Create a Y-axis rotation matrix.

Parameters
[out]moutmatrix result
yangle from the Y axis (in degrees)

◆ AiM4RotationZ()

AI_API AI_DEVICE AtMatrix AiM4RotationZ ( float  z)

Create a Z-axis rotation matrix.

Parameters
[out]moutmatrix result
zangle from the Z axis (in degrees)

◆ AiM4Scaling()

AI_API AtMatrix AiM4Scaling ( const AtVector s)

Create a scaling matrix from a scaling vector.

Parameters
[out]moutmatrix result
sscaling vector

◆ AiM4Frame()

AI_API AI_DEVICE AtMatrix AiM4Frame ( const AtVector o,
const AtVector u,
const AtVector v,
const AtVector w 
)

Create a matrix that transforms into a new coordinate frame.

The new coordinate frame is formed from an origin and a set of orthonormal vectors {U,V,W}, all expressed in world coordinates.

Parameters
[out]moutmatrix result
oorigin vector
uU basis vector
vV basis vector
wW basis vector

◆ AiM4PointByMatrixMult()

AI_API AI_DEVICE AtVector AiM4PointByMatrixMult ( const AtMatrix m,
const AtVector pin 
)

Left-multiply a point by a matrix.

Parameters
[out]poutmultiplied point pout = m pin
minput matrix
pininput point

◆ AiM4HPointByMatrixMult()

AI_API AI_DEVICE AtHPoint AiM4HPointByMatrixMult ( const AtMatrix m,
const AtHPoint pin 
)

Left-multiply a 4D point by a matrix.

Parameters
[out]poutmultiplied 4D point, pout = m pin
minput matrix
pininput 4D point

◆ AiM4VectorByMatrixMult()

AI_API AI_DEVICE AtVector AiM4VectorByMatrixMult ( const AtMatrix m,
const AtVector vin 
)

Left-multiply a vector by a matrix.

Note that multiplying a vector by a matrix is different than multiplying a point by a matrix.

Parameters
[out]voutmultiplied vector, vout = m vin
minput matrix
vininput vector

◆ AiM4VectorByMatrixTMult()

AI_API AI_DEVICE AtVector AiM4VectorByMatrixTMult ( const AtMatrix m,
const AtVector vin 
)

Right-multiply a vector by a matrix.

This is equivalent to left-multiply vector by transpose of a matrix: vout = (m^T) vin

Parameters
[out]voutmultiplied vector, vout = vin m
minput matrix
vininput vector

◆ AiM4Mult()

AI_API AI_DEVICE AtMatrix AiM4Mult ( const AtMatrix ma,
const AtMatrix mb 
)

Multiply two matrices.

Parameters
[out]moutmultiplied matrix result, mout = ma mb
mainput matrix
mbinput matrix

◆ AiM4Transpose()

AI_API AI_DEVICE AtMatrix AiM4Transpose ( const AtMatrix min)

Calculate the transpose of a matrix.

Parameters
mininput matrix
[out]mouttranspose matrix: mout = min^T

◆ AiM4Invert()

AI_API AI_DEVICE AtMatrix AiM4Invert ( const AtMatrix min)

Calculate the inverse of a matrix.

Parameters
mininput matrix to be inverted
[out]moutinverted matrix: mout = min^-1

◆ AiM4Determinant()

AI_API AI_PURE float AiM4Determinant ( const AtMatrix m)

Determinant of a matrix.

Parameters
minput matrix
Returns
determinant of m

◆ AiM4Lerp()

AI_API AI_DEVICE AtMatrix AiM4Lerp ( float  t,
const AtMatrix ma,
const AtMatrix mb 
)

Linear interpolation of two matrices.

Parameters
[out]moutinterpolated matrix: mout = (1-t)*ma + t*mb
tinterpolation parameter, in [0,1]
mainput matrix at t=0
mbinput matrix at t=1

◆ AiM4IsIdentity()

AI_API AI_PURE bool AiM4IsIdentity ( const AtMatrix m)

Is this an identity matrix?

Parameters
minput matrix
Returns
true if m is the identity

◆ AiM4IsSingular()

AI_API AI_PURE bool AiM4IsSingular ( const AtMatrix m)

Is this a singular matrix?

Parameters
minput matrix
Returns
true if m is singular (its determinant is zero or almost zero)

© 2023 Autodesk, Inc. · All rights reserved · www.arnoldrenderer.com