3ds Max C++ API Reference
|
#include <matrix3.h>
Public Member Functions | |
Matrix3 () | |
Matrix3 (const Matrix3 &)=default | |
Matrix3 (Matrix3 &&)=default | |
Matrix3 & | operator= (const Matrix3 &)=default |
Matrix3 & | operator= (Matrix3 &&)=default |
const Point3 & | operator[] (int i) const |
void | SetNotIdent () |
void | SetIdentFlags (uint32_t f) |
uint32_t | GetIdentFlags () const |
void | ClearIdentFlag (uint32_t f) |
bool | IsIdentity () const |
void | ValidateFlags () |
MRow * | GetAddr () |
const MRow * | GetAddr () const |
MAX_DEPRECATE_MATRIX_BOOL_CTOR ("Matrix3 and DMatrix3 are now initialized to identity by default.\n" "No need to use the Matrix3(bool) constructor anymore.\n" "Define MAX_SILENCE_DEPRECATED_MATRIX_BOOL_CTOR to silence this warning.") explicit Matrix3(bool) | |
Matrix3 (float(*fp)[3]) | |
Matrix3 (const Point3 &U, const Point3 &V, const Point3 &N, const Point3 &T) | |
Matrix3 & | Set (const Point3 &U, const Point3 &V, const Point3 &N, const Point3 &T) |
int | operator== (const Matrix3 &M) const |
bool | operator!= (const Matrix3 &M) const |
int | Equals (const Matrix3 &M, float epsilon=1E-6f) const |
Matrix3 & | operator-= (const Matrix3 &M) |
Matrix3 & | operator+= (const Matrix3 &M) |
Matrix3 & | operator*= (const Matrix3 &M) |
Multiply this matrix on the right by Matrix m. | |
Matrix3 & | operator*= (float a) |
void | IdentityMatrix () |
void | Zero () |
Point3 | GetRow (int i) const |
void | SetRow (int i, Point3 p) |
Point4 | GetColumn (int i) const |
void | SetColumn (int i, Point4 col) |
Point3 | GetColumn3 (int i) const |
void | NoTrans () |
void | NoRot () |
void | NoScale () |
void | Orthogonalize () |
Ortho-normalize the matrix. | |
void | SetTrans (const Point3 &p) |
void | SetTrans (int i, float v) |
const Point3 & | GetTrans () const |
void | Translate (const Point3 &p) |
void | RotateX (float angle) |
void | RotateY (float angle) |
void | RotateZ (float angle) |
void | Scale (const Point3 &s, bool trans=false) |
void | PreTranslate (const Point3 &p) |
void | PreRotateX (float angle) |
void | PreRotateY (float angle) |
void | PreRotateZ (float angle) |
void | PreScale (const Point3 &s) |
void | SetTranslate (const Point3 &p) |
void | SetRotateX (float angle) |
void | SetRotateY (float angle) |
void | SetRotateZ (float angle) |
void | SetRotate (const Quat &q) |
void | SetRotate (const AngAxis &aa) |
void | SetRotate (float yaw, float pitch, float roll) |
void | SetAngleAxis (const Point3 &axis, float angle) |
void | SetScale (const Point3 &s) |
void | SetFromToUp (const Point3 &from, const Point3 &to, const Point3 &up) |
void | Invert () |
Matrix3 | operator* (const Matrix3 &) const |
Matrix3 | operator+ (const Matrix3 &) const |
Matrix3 | operator- (const Matrix3 &) const |
Point3 | PointTransform (const Point3 &p) const |
Point3 | VectorTransform (const Point3 &p) const |
void | TransformPoints (Point3 *array, int n, int stride=sizeof(Point3)) |
void | TransformPoints (const Point3 *array, Point3 *to, int n, int stride=sizeof(Point3), int strideTo=sizeof(Point3)) |
void | TransformVectors (Point3 *array, int n, int stride=sizeof(Point3)) |
void | TransformVectors (const Point3 *array, Point3 *to, int n, int stride=sizeof(Point3), int strideTo=sizeof(Point3)) |
void | GetYawPitchRoll (float *yaw, float *pitch, float *roll) |
UTILGEOMEXPORT IOResult | Save (ISave *isave) |
Save this Matrix3 to disk. | |
UTILGEOMEXPORT IOResult | Load (ILoad *iload) |
Load the data for this Matrix3. | |
bool | Parity () const |
Static Public Attributes | |
static const Matrix3 | Identity |
An global instance of Matrix3 set to the identity. | |
Friends | |
class | Quat |
Matrix3 | RotateXMatrix (float angle) |
Matrix3 | RotateYMatrix (float angle) |
Matrix3 | RotateZMatrix (float angle) |
Matrix3 | TransMatrix (const Point3 &p) |
Matrix3 | ScaleMatrix (const Point3 &s) |
Matrix3 | RotateYPRMatrix (float Yaw, float Pitch, float Roll) |
Matrix3 | RotAngleAxisMatrix (const Point3 &axis, float angle) |
Matrix3 | Inverse (const Matrix3 &M) |
Matrix3 | PseudoInverse (const Matrix3 &m) |
Matrix3 | InverseHighPrecision (const Matrix3 &M) |
Matrix3 | AffineTranspose (const Matrix3 &M) |
Point3 | operator* (const Matrix3 &A, const Point3 &V) |
Point3 | operator* (const Point3 &V, const Matrix3 &A) |
Point3 | VectorTransform (const Matrix3 &M, const Point3 &V) |
Matrix3 | XFormMat (const Matrix3 &xm, const Matrix3 &m) |
Point3 | VectorTransform (const Point3 &V, const Matrix3 &M) |
void | MatrixMultiply (Matrix3 &outMatrix, const Matrix3 &matrixA, const Matrix3 &matrixB) |
void | Inverse (Matrix3 &outMatrix, const Matrix3 &M) |
void | AffineTranspose (Matrix3 &outMatrix, const Matrix3 &M) |
Matrix3 | ( | ) |
|
explicit |
fp | Specifies the initial values for the matrix. |
U | The data for row 0. |
V | The data for row 1. |
N | The data for row 2. |
T | The data for row 3. |
void SetNotIdent | ( | ) |
void SetIdentFlags | ( | uint32_t | f | ) |
f | Specifies the identity flag bit(s) to set. See Matrix Identity Flags above. |
uint32_t GetIdentFlags | ( | ) | const |
void ClearIdentFlag | ( | uint32_t | f | ) |
f | Specifies the identity flag bit(s) to clear. |
bool IsIdentity | ( | ) | const |
void ValidateFlags | ( | ) |
MRow * GetAddr | ( | ) |
const MRow * GetAddr | ( | ) | const |
MAX_DEPRECATE_MATRIX_BOOL_CTOR | ( | "Matrix3 and DMatrix3 are now initialized to identity by default.\n" "No need to use the Matrix3(bool) constructor anymore.\n" "Define MAX_SILENCE_DEPRECATED_MATRIX_BOOL_CTOR to silence this warning." | ) |
U | The data for row 0. |
V | The data for row 1. |
N | The data for row 2. |
T | The data for row 3. |
M | The matrix to compare against. |
bool operator!= | ( | const Matrix3 & | M | ) | const |
M | The matrix to compare against. |
M | The matrix to compare against. |
epsilon | The tolerance for comparison. If the values in the matrix are within this value (+ epsilon or - epsilon) they are considered equal. |
Matrix3 & operator*= | ( | float | a | ) |
a | The scale to apply to each element of this matrix |
void Zero | ( | ) |
i | Specifies the row to retrieve. |
i | Specifies the row to set. |
p | The values to set. |
i | Specifies the column to get (0-2). |
i | Specifies the column to set (0-2). |
col | The values to set. |
i | Specifies the partial column to get (0-2). |
void NoTrans | ( | ) |
void NoRot | ( | ) |
void NoScale | ( | ) |
void Orthogonalize | ( | ) |
Ortho-normalize the matrix.
This ensures that each axis of the basis is of length 1 and at right angles to the other. This is an "unbiased" orthogonalization, which means that no single axis is used as the basis for the other axis, and all axis will be modified equally.
p | Specifies the values for the translation row. |
i | Specifies the component of the translation row of this matrix to set. |
v | The value to set. |
const Point3 & GetTrans | ( | ) | const |
p | Specifies the translation. |
void RotateX | ( | float | angle | ) |
angle | Specifies the X rotation in radians. |
void RotateY | ( | float | angle | ) |
angle | Specifies the Y rotation in radians. |
void RotateZ | ( | float | angle | ) |
angle | Specifies the Z rotation in radians. |
s | The scale values. |
trans | If set to TRUE, the translation component is scaled. If trans = FALSE the translation component is unaffected. When 3ds Max was originally written there was a bug in the code for this method where the translation portion of the matrix was not being scaled. This meant that when a matrix was scaled the bottom row was not scaled. Thus it would always scale about the local origin of the object, but it would scale the world axes. When this bug was discovered, dependencies existed in the code upon this bug. Thus it could not simply be fixed because it would break the existing code that depended upon it working the incorrect way. To correct this the trans parameter was added. If this is set to TRUE, the translation component will be scaled correctly. The existing plug-ins don't use this parameter, it defaults to FALSE, and the code behaves the old way. |
void PreRotateX | ( | float | angle | ) |
angle | Specifies the X rotation in radians. |
void PreRotateY | ( | float | angle | ) |
angle | Specifies the Y rotation in radians. |
void PreRotateZ | ( | float | angle | ) |
angle | Specifies the Z rotation in radians. |
s | The scale values. The translation component is unaffected. |
p | The translation values to store. |
void SetRotateX | ( | float | angle | ) |
angle | The angle for X rotation (in radians). |
void SetRotateY | ( | float | angle | ) |
angle | The angle for Y rotation (in radians). |
void SetRotateZ | ( | float | angle | ) |
angle | The angle for Z rotation (in radians). |
q | Specifies the rotation to use for the matrix. |
aa | Specifies the rotation to use for the matrix. |
void SetRotate | ( | float | yaw, |
float | pitch, | ||
float | roll | ||
) |
yaw | The yaw angle in radians. |
pitch | The pitch angle in radians. |
roll | The roll angle in radians. |
axis | The axis of rotation. |
angle | The angle of rotation about the axis in radians. |
s | The scale factors for the matrix. |
from | This specifies the viewpoint source location. |
to | This vector specifies the direction of view. |
up | This vector points to the top of the view. |
void Invert | ( | ) |
p | The point to transform by this matrix. |
p | The vector to transform by this matrix. |
array | The array of points to transform with this matrix. |
n | The number of points in the array. |
stride | The size of the increment used when moving to the next point. If you wish to transform an array of data objects which contain x, y, and z coordinates in order (such as a Point4, or a structure containing a Point3 as a member) you can specify a 'stride' value (for instance sizeof(data_object)). |
void TransformPoints | ( | const Point3 * | array, |
Point3 * | to, | ||
int | n, | ||
int | stride = sizeof(Point3) , |
||
int | strideTo = sizeof(Point3) |
||
) |
array | The array of points to transform (the source). |
to | The array to store the transformed points (the destination). |
n | The number of points in the source array. |
stride | The size increment used when moving to the next source location. |
strideTo | The size increment used when moving to the next storage location. |
array | The array of vectors to transform with this matrix. |
n | The number of vectors in the array. |
stride | The size of the increment used when moving to the next vector. If you wish to transform an array of data objects which contain x, y, and z coordinates in order (such as a Point4, or a structure containing a Point3 as a member) you can specify a 'stride' value (for instance sizeof(data_object)). |
void TransformVectors | ( | const Point3 * | array, |
Point3 * | to, | ||
int | n, | ||
int | stride = sizeof(Point3) , |
||
int | strideTo = sizeof(Point3) |
||
) |
array | The array of vectors to transform (the source). |
to | The array to store the transformed vectors (the destination). |
n | The number of vectors in the source array. |
stride | The size increment used when moving to the next source location. |
strideTo | The size increment used when moving to the next storage location. |
void GetYawPitchRoll | ( | float * | yaw, |
float * | pitch, | ||
float * | roll | ||
) |
yaw | The yaw rotation angle is stored here (in radians). |
pitch | The pitch rotation angle is stored here (in radians). |
roll | The roll rotation angle is stored here (in radians). |
UTILGEOMEXPORT IOResult Save | ( | ISave * | isave | ) |
Save this Matrix3 to disk.
isave | The interface responsible for actually saving the data |
UTILGEOMEXPORT IOResult Load | ( | ILoad * | iload | ) |
Load the data for this Matrix3.
iload | The interface responsible for actually loading the data |
bool Parity | ( | ) | const |
|
friend |
|
friend |
angle | Specifies the angle of rotation in radians. |
|
friend |
angle | Specifies the angle of rotation in radians. |
|
friend |
angle | Specifies the angle of rotation in radians. |
p | Specifies the translation values. |
s | Specifies the scale values. |
|
friend |
Yaw | Specifies the yaw angle in radians. |
Pitch | Specifies the pitch angle in radians. |
Roll | Specifies the roll angle in radians. |
axis | Specifies the axis of rotation. Note that this angle is expected to be normalized. |
angle | Specifies the angle of rotation. Note: The direction of the angle in this method is opposite of that in AngAxisFromQ(). |
M | The matrix to compute the inverse of. |
m | The matrix to compute the pseudoinverse of. |
M | The matrix to compute the inverse of. |
M | The matrix to compute the affine transpose of. |
A | The matrix to transform the point with. |
V | The point to transform. |
V | The point to transform. |
A | The matrix to transform the point with. |
xm | Specifies the coordinate system you want to work in. |
m | Specifies the transformation matrix. |
|
friend |
outMatrix | The result of matrixA * matrixB |
matrixA | First matrix to multiply |
matrixB | Second matrix to multiply |
outMatrix | The inversed matrix. |
M | The matrix to compute the inverse of. |
outMatrix | The inversed matrix. |
M | The matrix to compute the affine transpose of. |
|
static |
An global instance of Matrix3 set to the identity.
An identity matrix has no rotation, scale or translation on it. In other words, it is a matrix that has no effect when multiplied with another matrix.
the structure of the Matrix is as follows:
[1, 0, 0]
[0, 1, 0]
[0, 0, 1]
[0, 0, 0]