lxgui
Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | List of all members
lxgui::gui::matrix4f Struct Reference

A 4x4 matrix, used for coordinate transformations. More...

#include <gui_matrix4.hpp>

Public Types

using element_type = float
 

Public Member Functions

 matrix4f () noexcept=default
 
 matrix4f (std::initializer_list< element_type > list) noexcept
 
 matrix4f (const element_type *mat) noexcept
 
element_typeoperator() (std::size_t row, std::size_t col) noexcept
 
element_type operator() (std::size_t row, std::size_t col) const noexcept
 
element_typeoperator() (std::size_t i) noexcept
 
element_type operator() (std::size_t i) const noexcept
 
void transpose () noexcept
 
void invert () noexcept
 

Static Public Member Functions

static matrix4f translation (const vector2f &dx) noexcept
 
static matrix4f scaling (const vector2f &scale) noexcept
 
static matrix4f rotation (float rot) noexcept
 
static matrix4f transformation (const vector2f &dx, const vector2f &scale, float rot) noexcept
 
static matrix4f view (const vector2f &window) noexcept
 
static matrix4f view (const vector2f &window, const vector2f &center) noexcept
 
static matrix4f transpose (const matrix4f &m) noexcept
 
static matrix4f invert (const matrix4f &m) noexcept
 

Public Attributes

element_type data [16] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}
 

Static Public Attributes

static const matrix4f identity = build_identity()
 

Detailed Description

A 4x4 matrix, used for coordinate transformations.

Definition at line 13 of file gui_matrix4.hpp.

Member Typedef Documentation

◆ element_type

Definition at line 14 of file gui_matrix4.hpp.

Constructor & Destructor Documentation

◆ matrix4f() [1/3]

lxgui::gui::matrix4f::matrix4f ( )
defaultnoexcept

◆ matrix4f() [2/3]

lxgui::gui::matrix4f::matrix4f ( std::initializer_list< element_type list)
noexcept

Definition at line 20 of file gui_matrix4.cpp.

◆ matrix4f() [3/3]

lxgui::gui::matrix4f::matrix4f ( const element_type mat)
explicitnoexcept

Definition at line 25 of file gui_matrix4.cpp.

Member Function Documentation

◆ invert() [1/2]

void lxgui::gui::matrix4f::invert ( )
noexcept

Definition at line 69 of file gui_matrix4.cpp.

◆ invert() [2/2]

matrix4f lxgui::gui::matrix4f::invert ( const matrix4f m)
staticnoexcept

Definition at line 79 of file gui_matrix4.cpp.

◆ operator()() [1/4]

element_type lxgui::gui::matrix4f::operator() ( std::size_t  i) const
inlinenoexcept

Definition at line 32 of file gui_matrix4.hpp.

◆ operator()() [2/4]

element_type& lxgui::gui::matrix4f::operator() ( std::size_t  i)
inlinenoexcept

Definition at line 28 of file gui_matrix4.hpp.

◆ operator()() [3/4]

element_type lxgui::gui::matrix4f::operator() ( std::size_t  row,
std::size_t  col 
) const
inlinenoexcept

Definition at line 24 of file gui_matrix4.hpp.

◆ operator()() [4/4]

element_type& lxgui::gui::matrix4f::operator() ( std::size_t  row,
std::size_t  col 
)
inlinenoexcept

Definition at line 20 of file gui_matrix4.hpp.

◆ rotation()

matrix4f lxgui::gui::matrix4f::rotation ( float  rot)
staticnoexcept

Definition at line 39 of file gui_matrix4.cpp.

◆ scaling()

matrix4f lxgui::gui::matrix4f::scaling ( const vector2f scale)
staticnoexcept

Definition at line 34 of file gui_matrix4.cpp.

◆ transformation()

matrix4f lxgui::gui::matrix4f::transformation ( const vector2f dx,
const vector2f scale,
float  rot 
)
staticnoexcept

Definition at line 46 of file gui_matrix4.cpp.

◆ translation()

matrix4f lxgui::gui::matrix4f::translation ( const vector2f dx)
staticnoexcept

Definition at line 29 of file gui_matrix4.cpp.

◆ transpose() [1/2]

void lxgui::gui::matrix4f::transpose ( )
noexcept

Definition at line 62 of file gui_matrix4.cpp.

◆ transpose() [2/2]

matrix4f lxgui::gui::matrix4f::transpose ( const matrix4f m)
staticnoexcept

Definition at line 73 of file gui_matrix4.cpp.

◆ view() [1/2]

matrix4f lxgui::gui::matrix4f::view ( const vector2f window)
staticnoexcept

Definition at line 53 of file gui_matrix4.cpp.

◆ view() [2/2]

matrix4f lxgui::gui::matrix4f::view ( const vector2f window,
const vector2f center 
)
staticnoexcept

Definition at line 58 of file gui_matrix4.cpp.

Member Data Documentation

◆ data

element_type lxgui::gui::matrix4f::data[16] = {1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1}

Definition at line 49 of file gui_matrix4.hpp.

◆ identity

const matrix4f lxgui::gui::matrix4f::identity = build_identity()
static

Definition at line 51 of file gui_matrix4.hpp.


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