Brunot
Loading...
Searching...
No Matches
AffineMatrix Struct Reference

#include <AffineMatrix.h>

Public Member Functions

 AffineMatrix ()=default
 AffineMatrix (const AffineMatrix &)=default
 AffineMatrix (const Eigen::Matrix4f &)
auto operator= (const AffineMatrix &) -> AffineMatrix &=default
 ~AffineMatrix ()=default
 AffineMatrix (float x1, float x2, float y1, float y2)
 Creates a matrix with the following dimensions: [ x1 x2 0 0 ] [ y1 y2 0 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ].
 AffineMatrix (float x1, float x2, float x3, float x4, float y1, float y2, float y3, float y4, float z1, float z2, float z3, float z4, float w1, float w2, float w3, float w4)
 Creates a matrix with the following dimensions: [ x1 x2 x3 x4 ] [ y1 y2 y3 y4 ] [ z1 z2 z3 z4 ] [ w1 w2 w3 w4 ].
auto operator*= (const AffineMatrix &Other) -> AffineMatrix &
 NOTE: THIS FLIPS MULTIPLICATION ORDER SO THE MATRICES PROPERLY MULTIPLY e.g.
auto operator* (const AffineMatrix &Other) const -> AffineMatrix
 NOTE: THIS MULTIPLIES MATRICES AS THEY ARE WRITTEN (UNLIKE *=) e.g.
auto identity () -> AffineMatrix &
 Converts the current matrix into the identity matrix.
auto transpose () -> AffineMatrix &
 Transposes the current matrix.
auto scale (float s) -> AffineMatrix &
auto scale (float x, float y) -> AffineMatrix &
auto scale (const Vector4D &vector) -> AffineMatrix &
auto rotate (float angle) -> AffineMatrix &
auto translate (float x, float y) -> AffineMatrix &
auto translate (const Vector4D &vector) -> AffineMatrix &
auto operator() (int row, int col) -> float &
auto operator() (int row, int col) const -> float
auto get (int row, int col) -> float &
auto get (int row, int col) const -> float
auto data () const -> const float *
auto data () -> float *

Private Attributes

Eigen::Matrix4f matrix

Friends

auto operator* (float scalar, const AffineMatrix &matrix) ->AffineMatrix
 scales every value of the matrix by a float
auto operator* (const AffineMatrix &matrix, float scalar) ->AffineMatrix
 scales every value of the matrix by a float
auto operator*= (AffineMatrix &matrix, float scalar) ->AffineMatrix &
 scales every value of the matrix by a float
auto operator* (const AffineMatrix &rhs, const Vector4D &lhs) ->Vector4D
 matrix times vector.
auto operator*= (Vector4D &rhs, const AffineMatrix &lhs) ->Vector4D &
 applies a transformation to a vector.

Constructor & Destructor Documentation

◆ AffineMatrix() [1/5]

AffineMatrix::AffineMatrix ( )
default
Here is the caller graph for this function:

◆ AffineMatrix() [2/5]

AffineMatrix::AffineMatrix ( const AffineMatrix & )
default
Here is the call graph for this function:

◆ AffineMatrix() [3/5]

AffineMatrix::AffineMatrix ( const Eigen::Matrix4f & rhs)

◆ ~AffineMatrix()

AffineMatrix::~AffineMatrix ( )
default
Here is the call graph for this function:

◆ AffineMatrix() [4/5]

AffineMatrix::AffineMatrix ( float x1,
float x2,
float y1,
float y2 )

Creates a matrix with the following dimensions: [ x1 x2 0 0 ] [ y1 y2 0 0 ] [ 0 0 1 0 ] [ 0 0 0 1 ].

Parameters
x1
x2
y1
y2

◆ AffineMatrix() [5/5]

AffineMatrix::AffineMatrix ( float x1,
float x2,
float x3,
float x4,
float y1,
float y2,
float y3,
float y4,
float z1,
float z2,
float z3,
float z4,
float w1,
float w2,
float w3,
float w4 )

Creates a matrix with the following dimensions: [ x1 x2 x3 x4 ] [ y1 y2 y3 y4 ] [ z1 z2 z3 z4 ] [ w1 w2 w3 w4 ].

Parameters
x1
x2
x3
y1
y2
y3
z1
z2
z3

Member Function Documentation

◆ data() [1/2]

auto AffineMatrix::data ( ) ->float *

◆ data() [2/2]

auto AffineMatrix::data ( ) const->constfloat *
Here is the caller graph for this function:

◆ get() [1/2]

auto AffineMatrix::get ( int row,
int col )->float &

◆ get() [2/2]

auto AffineMatrix::get ( int row,
int col ) const->float

◆ identity()

auto AffineMatrix::identity ( ) ->AffineMatrix &

Converts the current matrix into the identity matrix.

Returns
A reference to this matrix
Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator()() [1/2]

auto AffineMatrix::operator() ( int row,
int col )->float &

◆ operator()() [2/2]

auto AffineMatrix::operator() ( int row,
int col ) const->float

◆ operator*()

auto AffineMatrix::operator* ( const AffineMatrix & Other) const->AffineMatrix

NOTE: THIS MULTIPLIES MATRICES AS THEY ARE WRITTEN (UNLIKE *=) e.g.

S = S * T works as it is written

Parameters
OtherThe matrix you want to multiply this matrix into
Returns
Here is the call graph for this function:

◆ operator*=()

auto AffineMatrix::operator*= ( const AffineMatrix & Other) ->AffineMatrix &

NOTE: THIS FLIPS MULTIPLICATION ORDER SO THE MATRICES PROPERLY MULTIPLY e.g.

S *= T is equivalent to S = T * S

Parameters
OtherThe matrix you want to apply to this matrix
Returns
a reference to this AffineMatrix
Here is the call graph for this function:

◆ operator=()

auto AffineMatrix::operator= ( const AffineMatrix & ) ->AffineMatrix &=default
default
Here is the call graph for this function:

◆ rotate()

auto AffineMatrix::rotate ( float angle) ->AffineMatrix &
Parameters
angleThe angle of the desired transformation in DEGREES
Returns
a reference to this matrix
Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale() [1/3]

auto AffineMatrix::scale ( const Vector4D & vector) ->AffineMatrix &
Here is the call graph for this function:

◆ scale() [2/3]

auto AffineMatrix::scale ( float s) ->AffineMatrix &
Here is the call graph for this function:
Here is the caller graph for this function:

◆ scale() [3/3]

auto AffineMatrix::scale ( float x,
float y )->AffineMatrix &
Here is the call graph for this function:

◆ translate() [1/2]

auto AffineMatrix::translate ( const Vector4D & vector) ->AffineMatrix &
Parameters
vectora vector that you want to set as the translation component of the affine transformation
Returns
a reference to the matrix
Here is the call graph for this function:

◆ translate() [2/2]

auto AffineMatrix::translate ( float x,
float y )->AffineMatrix &
Parameters
x
y
Returns
a reference to the matrix
Here is the call graph for this function:
Here is the caller graph for this function:

◆ transpose()

auto AffineMatrix::transpose ( ) ->AffineMatrix &

Transposes the current matrix.

Returns
A reference to this matrix
Here is the call graph for this function:

◆ operator* [1/3]

auto operator* ( const AffineMatrix & matrix,
float scalar )->AffineMatrix
friend

scales every value of the matrix by a float

Parameters
matrixthe matrix
scalarthe float
Returns
the scaled matrix

◆ operator* [2/3]

auto operator* ( const AffineMatrix & rhs,
const Vector4D & lhs )->Vector4D
friend

matrix times vector.

performs rhs*lhs

Parameters
rhsthe matrix
lhsthe vector
Returns
the new Vector

◆ operator* [3/3]

auto operator* ( float scalar,
const AffineMatrix & matrix )->AffineMatrix
friend

scales every value of the matrix by a float

Parameters
scalarthe float
matrixthe matrix
Returns
the scaled matrix

◆ operator*= [1/2]

auto operator*= ( AffineMatrix & matrix,
float scalar )->AffineMatrix &
friend

scales every value of the matrix by a float

Parameters
matrixthe matrix
scalarthe float
Returns
a reference to the modified matrix

◆ operator*= [2/2]

auto operator*= ( Vector4D & rhs,
const AffineMatrix & lhs )->Vector4D &
friend

applies a transformation to a vector.

a*=b is equivalent to a = b * a

Parameters
rhsthe Vector to operate on
lhsthe transformation to apply
Returns
a reference to the vector for chaining

Member Data Documentation

◆ matrix

Eigen::Matrix4f AffineMatrix::matrix
private

The documentation for this struct was generated from the following files: