Matrix64 Struct Reference

#include <ge_lmatrix.h>

Detailed Description

Represents a double precision matrix.

Note
Cinema 4D uses a left-handed coordinate system.

Vector Components

Vector64 off
 
Vector64 v1
 
Vector64 v2
 
Vector64 v3
 

Constructors

 Matrix64 ()
 
 Matrix64 (const Vector64 &off_in, const Vector64 &v1_in, const Vector64 &v2_in, const Vector64 &v3_in)
 
 Matrix64 (_DONTCONSTRUCT v)
 
 Matrix64 (const Matrix32 &m)
 

Get/Set Components

Vector64operator[] (Int32 i) const
 

Operators

Matrix64 operator* (const Matrix64 &m2) const
 
Vector64 operator* (const Vector64 &v) const
 
Matrix64 operator* (Float64 s) const
 
Matrix64 operator* (Float64 s, const Matrix64 &m)
 
const Matrix64 operator/ (const Matrix64 &m, const Float64 s)
 
const Matrix64 operator+ (const Matrix64 &m1, const Matrix64 &m2)
 
const Matrix64 operator- (const Matrix64 &m1, const Matrix64 &m2)
 
Bool operator== (const Matrix64 &m1, const Matrix64 &m2)
 
Bool operator!= (const Matrix64 &m1, const Matrix64 &m2)
 
const Matrix64 operator~ (const Matrix64 &m)
 

Math Operations

Matrix64 GetTensorMatrix (void) const
 
void Normalize (void)
 
void Scale (const Vector64 &v)
 
void Scale (Float64 r)
 
Vector64 GetScale () const
 
Vector64 Scale () const
 
Vector64 TransformVector (const Vector64 &v) const
 

Constructor & Destructor Documentation

§ Matrix64() [1/4]

Matrix64 ( )

Default constructor. Constructs a unit matrix.

§ Matrix64() [2/4]

Matrix64 ( const Vector64 off_in,
const Vector64 v1_in,
const Vector64 v2_in,
const Vector64 v3_in 
)
explicit

Constructs a matrix from the given vectors.

Parameters
[in]off_inAssigned to Matrix64::off.
[in]v1_inAssigned to Matrix64::v1.
[in]v2_inAssigned to Matrix64::v2.
[in]v3_inAssigned to Matrix64::v3.

§ Matrix64() [3/4]

Matrix64 ( _DONTCONSTRUCT  v)
explicit

Constructs an uninitialized matrix.

Parameters
[in]vDummy argument. Pass DC.

§ Matrix64() [4/4]

Matrix64 ( const Matrix32 m)
explicit

Constructs a double precision matrix from a single precision matrix.

Parameters
[in]mA single precision matrix.

Member Function Documentation

§ operator[]()

Vector64& operator[] ( Int32  i) const

Gets/sets a vector in the matrix at index i.

Parameters
[in]iThe vector index in the matrix. 0 <= i < 3.
0 returns off, 1 returns v1, 2 returns v2, 3 returns v3.
Any other value must not be used and will crash.
Returns
The vector at index i.

§ operator*() [1/3]

Matrix64 operator* ( const Matrix64 m2) const

Matrix product. Multiplies the matrix and matrix m2.
The rule is the matrix after m2.

Note
If a point is transformed with the result matrix, this is identical to first transforming with m2 and then with the matrix.
Parameters
[in]m2The matrix to multiply with.
Returns
The result of the matrix product.

§ operator*() [2/3]

Vector64 operator* ( const Vector64 v) const

Transforms the vector v by the matrix.

Parameters
[in]vThe vector to transform.
Returns
The vector v transformed by the matrix.

§ operator*() [3/3]

Matrix64 operator* ( Float64  s) const

Scales each vector of the matrix by scalar s.

Parameters
[in]sThe scalar.
Returns
The result of the scalar multiplication.

§ GetTensorMatrix()

Matrix64 GetTensorMatrix ( void  ) const

Gets the matrix's tensor.

Returns
The tensor matrix.

§ Normalize()

void Normalize ( void  )

Normalizes the matrix.

§ Scale() [1/3]

void Scale ( const Vector64 v)

Non-uniform matrix scaling.

Parameters
[in]vThe scaling vector.

§ Scale() [2/3]

void Scale ( Float64  r)

Uniform matrix scaling.

Parameters
[in]rThe scaling scalar.

§ GetScale()

Vector64 GetScale ( void  ) const

Retrieves the scaling vector.

Since
R18
Returns
The scaling vector.

§ Scale() [3/3]

Vector64 Scale ( ) const

Retrieves the scaling vector.

Returns
The scaling vector.

§ TransformVector()

Vector64 TransformVector ( const Vector64 v) const

Transforms vector v by the matrix.

Parameters
[in]vThe vector to transform.
Returns
The vector v transformed by the matrix.

Friends And Related Function Documentation

§ operator*

Matrix64 operator* ( Float64  s,
const Matrix64 m 
)
friend

Scales each vector of matrix m by scalar s.

Parameters
[in]sThe scalar.
[in]mThe matrix to multiply.
Returns
The result of the scalar multiplication.

§ operator/

const Matrix64 operator/ ( const Matrix64 m,
const Float64  s 
)
friend

Divides each vector in matrix m by scalar s.

Parameters
[in]mThe matrix to divide.
[in]sThe scalar.
Returns
The result of the scalar division.

§ operator+

const Matrix64 operator+ ( const Matrix64 m1,
const Matrix64 m2 
)
friend

Adds matrices m1 and m2.

Parameters
[in]m1The first matrix.
[in]m2The second matrix.
Returns
The result of the addition.

§ operator-

const Matrix64 operator- ( const Matrix64 m1,
const Matrix64 m2 
)
friend

Subtracts matrices m1 and m2.

Parameters
[in]m1The first matrix.
[in]m2The second matrix.
Returns
The result of the subtraction.

§ operator==

Bool operator== ( const Matrix64 m1,
const Matrix64 m2 
)
friend

Equality operator. Checks if matrix m1 and matrix m2 are equal.

Parameters
[in]m1The first matrix.
[in]m2The second matrix.
Returns
true if matrix m1 and matrix m2 are equal, otherwise false.

§ operator!=

Bool operator!= ( const Matrix64 m1,
const Matrix64 m2 
)
friend

Equality operator. Checks if matrix m1 and matrix m2 are different.

Parameters
[in]m1The first matrix.
[in]m2The second matrix.
Returns
true if matrix m1 and matrix m2 are not equal, otherwise false.

§ operator~

const Matrix64 operator~ ( const Matrix64 m)
friend

Inverts matrix m.

Parameters
[in]mA matrix.
Returns
The matrix m inverted.

Member Data Documentation

§ off

Vector64 off

The translation vector.

§ v1

The X-axis coordinate of a left-handed coordinate system.

§ v2

The Y-axis coordinate of a left-handed coordinate system.

§ v3

The Z-axis coordinate of a left-handed coordinate system.