Skip to content

shz::mat4x4

Markdown

C++ type shz::mat4x4.

  • Header: #include <sh4zam/shz_matrix.hpp> (source)
  • C type: shz_mat4x4_t (layout-compatible; the C API accepts it directly)
  • Bases: shz_mat4x4_t
static void copy(shz_mat4x4_t *lhs, const shz_mat4x4_t &rhs) noexcept
static void copy(shz_mat4x4_t *lhs, const float rhs[16]) noexcept

Calls: shz_mat4x4_copy(), shz_mat4x4_copy_unaligned()

static void mult(shz_mat4x4_t *dst, const shz_mat4x4_t &lhs, const shz_mat4x4_t &rhs) noexcept
static void mult(shz_mat4x4_t *dst, const shz_mat4x4_t &lhs, const float rhs[16]) noexcept

Calls: shz_mat4x4_mult(), shz_mat4x4_mult_unaligned()

static void mult_transpose(shz_mat4x4_t *dst, const shz_mat4x4_t &lhs, const shz_mat4x4_t &rhs) noexcept
static void mult_transpose(shz_mat4x4_t *dst, const shz_mat4x4_t &lhs, const float rhs[16]) noexcept

Calls: shz_mat4x4_mult_transpose(), shz_mat4x4_mult_transpose_unaligned()

void init_identity() noexcept

Calls: shz_mat4x4_init_identity()

void init_zero() noexcept

Calls: shz_mat4x4_init_zero()

void init_one() noexcept

Calls: shz_mat4x4_init_one()

void init_fill(float value) noexcept

Calls: shz_mat4x4_init_fill()

void init_translation(float x, float y, float z) noexcept
void init_translation(const vec3 &v) noexcept

Calls: shz_mat4x4_init_translation()

void init_scale(float x, float y, float z) noexcept
void init_scale(const vec3 &v) noexcept

Calls: shz_mat4x4_init_scale()

void init_rotation_x(float angle) noexcept
void init_rotation_x(T angle) noexcept
void init_rotation_x(uint16_t angle) noexcept

Calls: shz_mat4x4_init_rotation_x(), shz_mat4x4_init_rotation_x_u16()

void init_rotation_y(float angle) noexcept
void init_rotation_y(T angle) noexcept
void init_rotation_y(uint16_t angle) noexcept

Calls: shz_mat4x4_init_rotation_y(), shz_mat4x4_init_rotation_y_u16()

void init_rotation_z(float angle) noexcept
void init_rotation_z(T angle) noexcept
void init_rotation_z(uint16_t angle) noexcept

Calls: shz_mat4x4_init_rotation_z(), shz_mat4x4_init_rotation_z_u16()

void init_rotation_xyz(float xAngle, float yAngle, float zAngle) noexcept
void init_rotation_xyz(const vec3 &angles) noexcept
void init_rotation_xyz(uint16_t xAngle, uint16_t yAngle, uint16_t zAngle) noexcept
void init_rotation_xyz(X xAngle, Y yAngle, Z zAngle) noexcept

Calls: shz_mat4x4_init_rotation_xyz(), shz_mat4x4_init_rotation_xyz_u16()

void init_rotation_zyx(float zAngle, float yAngle, float xAngle) noexcept
void init_rotation_zyx(const vec3 &angles) noexcept
void init_rotation_zyx(uint16_t zAngle, uint16_t yAngle, uint16_t xAngle) noexcept
void init_rotation_zyx(Z zAngle, Y yAngle, X xAngle) noexcept

Calls: shz_mat4x4_init_rotation_zyx(), shz_mat4x4_init_rotation_zyx_u16()

void init_rotation_zxy(float zAngle, float xAngle, float yAngle) noexcept
void init_rotation_zxy(const vec3 &angles) noexcept
void init_rotation_zxy(uint16_t zAngle, uint16_t xAngle, uint16_t yAngle) noexcept
void init_rotation_zxy(Z zAngle, X xAngle, Y yAngle) noexcept

Calls: shz_mat4x4_init_rotation_zxy(), shz_mat4x4_init_rotation_zxy_u16()

void init_rotation_yxz(float yAngle, float xAngle, float zAngle) noexcept
void init_rotation_yxz(const vec3 &angles) noexcept
void init_rotation_yxz(uint16_t yAngle, uint16_t xAngle, uint16_t zAngle) noexcept
void init_rotation_yxz(Y yAngle, X xAngle, Z zAngle) noexcept

Calls: shz_mat4x4_init_rotation_yxz(), shz_mat4x4_init_rotation_yxz_u16()

void init_rotation_x_yz(float y, float z) noexcept

C++ wrapper around shz_mat4x4_init_rotation_x_yz().

Calls: shz_mat4x4_init_rotation_x_yz()

void init_rotation_y_xz(float x, float z) noexcept

C++ wrapper around shz_mat4x4_init_rotation_y_xz().

Calls: shz_mat4x4_init_rotation_y_xz()

void init_rotation_z_xy(float x, float y) noexcept

C++ wrapper around shz_mat4x4_init_rotation_z_xy().

Calls: shz_mat4x4_init_rotation_z_xy()

void init_billboard_x(const vec3 &pos, const vec3 &eye) noexcept

C++ wrapper around shz_mat4x4_init_billboard_x().

Calls: shz_mat4x4_init_billboard_x()

void init_billboard_y(const vec3 &pos, const vec3 &eye) noexcept

C++ wrapper around shz_mat4x4_init_billboard_y().

Calls: shz_mat4x4_init_billboard_y()

void init_billboard_z(const vec3 &pos, const vec3 &eye) noexcept

C++ wrapper around shz_mat4x4_init_billboard_z().

Calls: shz_mat4x4_init_billboard_z()

void init_rotation(float angle, float x, float y, float z) noexcept
void init_rotation(float angle, const vec3 &axis) noexcept
void init_rotation(const quat &q) noexcept

Calls: shz_mat4x4_init_rotation(), shz_mat4x4_init_rotation_quat()

void init_rotation_dir(float angle, float x, float y, float z) noexcept
void init_rotation_dir(float angle, const vec3 &dir) noexcept

Calls: shz_mat4x4_init_rotation_dir()

void init_diagonal(float x, float y, float z, float w) noexcept
void init_diagonal(const vec4 &v) noexcept

Calls: shz_mat4x4_init_diagonal()

void init_upper_triangular(float col1, const vec2 &col2, const vec3 &col3, const vec4 &col4) noexcept

Calls: shz_mat4x4_init_upper_triangular()

void init_lower_triangular(const vec4 &col1, const vec3 &col2, const vec2 &col3, float col4) noexcept

Calls: shz_mat4x4_init_lower_triangular()

void init_symmetric_skew(float x, float y, float z) noexcept
void init_symmetric_skew(const vec3 &v) noexcept

Calls: shz_mat4x4_init_symmetric_skew()

void init_outer_product(const vec4 &v1, const vec4 &v2) noexcept

Calls: shz_mat4x4_init_outer_product()

void init_permutation_wxyz() noexcept

Calls: shz_mat4x4_init_permutation_wxyz()

void init_permutation_yzwx() noexcept

Calls: shz_mat4x4_init_permutation_yzwx()

void init_screen(float width, float height) noexcept

Calls: shz_mat4x4_init_screen()

void init_lookat(const vec3 &eye, const vec3 &center, const vec3 &up) noexcept

Calls: shz_mat4x4_init_lookat()

void init_ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept

Calls: shz_mat4x4_init_ortho()

void init_frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept

Calls: shz_mat4x4_init_frustum()

void init_perspective(float fov, float aspect, float znear) noexcept

Calls: shz_mat4x4_init_perspective()

vec4 row(size_t index) const noexcept

C++ wrapper for shz_mat4x4_row().

Calls: shz_mat4x4_row()

vec4 col(size_t index) const noexcept

C++ wrapper for shz_mat4x4_col().

Calls: shz_mat4x4_col()

vec3 get_translation() const noexcept

Calls: shz_mat4x4_get_translation()

vec3 get_scale() const noexcept

Returns the scaling components from the inner 3x3 matrix of XMTRX, as a 3D vector.

Calls: shz_mat4x4_get_scale()

void get_rotation(float *radians, shz_vec3_t *axis) const noexcept
std::pair< float, vec3 > get_rotation() const noexcept

Returns both the angle and axis of rotation through the pointer arguments.

Calls: shz_mat4x4_get_rotation()

void set_row(size_t index, vec4 values) noexcept

Calls: shz_mat4x4_set_row()

void set_col(size_t index, vec4 values) noexcept

Calls: shz_mat4x4_set_col()

void swap_rows(size_t row1, size_t row2) noexcept

Calls: shz_mat4x4_swap_rows()

void swap_cols(size_t col1, size_t col2) noexcept

Calls: shz_mat4x4_swap_cols()

void set_translation(float x, float y, float z) noexcept
void set_translation(const vec3 &v) noexcept

Calls: shz_mat4x4_set_translation()

void set_scale(float x, float y, float z) noexcept
void set_scale(const vec3 &v) noexcept

Calls: shz_mat4x4_set_scale()

void set_rotation(const quat &rot) noexcept

Calls: shz_mat4x4_set_rotation_quat()

void set_diagonal(float x, float y, float z, float w) noexcept
void set_diagonal(const vec4 &v) noexcept

Calls: shz_mat4x4_set_diagonal()

void apply(const shz_mat4x4_t &mat) noexcept
void apply(const float mat[16]) noexcept

Calls: shz_mat4x4_apply(), shz_mat4x4_apply_unaligned()

void apply_transpose(const shz_mat4x4_t &mat) noexcept
void apply_transpose(const float mat[16]) noexcept

Calls: shz_mat4x4_apply_transpose(), shz_mat4x4_apply_transpose_unaligned()

void scale_3x3(float x, float y, float z) noexcept
void scale_3x3(const vec3 &v) noexcept

Calls: shz_mat4x4_scale_3x3()

void add_translation(float x, float y, float z) noexcept
void add_translation(const vec3 &v) noexcept

Calls: shz_mat4x4_add_translation()

void lookat(vec3 pos, vec3 target, vec3 up) noexcept

Calls: shz_mat4x4_lookat()

void ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept

Calls: shz_mat4x4_ortho()

void frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept

Calls: shz_mat4x4_frustum()

void perspective(float fov, float aspect, float znear) noexcept

Calls: shz_mat4x4_perspective()

void screen(float width, float height) noexcept

Calls: shz_mat4x4_screen()

void skew_symmetric(float x, float y, float z) noexcept

Calls: shz_mat4x4_skew_symmetric()

void permute_wxyz() noexcept

Calls: shz_mat4x4_permute_wxyz()

void permute_yzwx() noexcept

Calls: shz_mat4x4_permute_yzwx()

void permute_wzyx() noexcept

Calls: shz_mat4x4_permute_wzyx()

void apply_self() noexcept

Calls: shz_mat4x4_apply_self()

void translate(float x, float y, float z) noexcept
void translate(vec3 v) noexcept

Calls: shz_mat4x4_translate()

void scale(float x, float y, float z) noexcept
void scale(vec3 v) noexcept

Calls: shz_mat4x4_scale()

void rotate_x(float radians) noexcept
void rotate_x(T radians) noexcept
void rotate_x(uint16_t radians16) noexcept

Calls: shz_mat4x4_rotate_x(), shz_mat4x4_rotate_x_u16()

void rotate_y(float radians) noexcept
void rotate_y(T radians) noexcept
void rotate_y(uint16_t radians16) noexcept

Calls: shz_mat4x4_rotate_y(), shz_mat4x4_rotate_y_u16()

void rotate_z(float radians) noexcept
void rotate_z(T radians) noexcept
void rotate_z(uint16_t radians16) noexcept

Calls: shz_mat4x4_rotate_z(), shz_mat4x4_rotate_z_u16()

void rotate_xyz(float xRadians, float yRadians, float zRadians) noexcept
void rotate_xyz(const vec3 &angles) noexcept
void rotate_xyz(uint16_t xAngle, uint16_t yAngle, uint16_t zAngle) noexcept
void rotate_xyz(X xRadians, Y yRadians, Z zRadians) noexcept

Calls: shz_mat4x4_rotate_xyz(), shz_mat4x4_rotate_xyz_u16()

void rotate_zyx(float zRadians, float yRadians, float xRadians) noexcept
void rotate_zyx(const vec3 &angles) noexcept
void rotate_zyx(uint16_t zAngle, uint16_t yAngle, uint16_t xAngle) noexcept
void rotate_zyx(Z zRadians, Y yRadians, X xRadians) noexcept

Calls: shz_mat4x4_rotate_zyx(), shz_mat4x4_rotate_zyx_u16()

void rotate_zxy(float zRadians, float xRadians, float yRadians) noexcept
void rotate_zxy(const vec3 &angles) noexcept
void rotate_zxy(uint16_t zAngle, uint16_t xAngle, uint16_t yAngle) noexcept
void rotate_zxy(Z zRadians, X xRadians, Y yRadians) noexcept

Calls: shz_mat4x4_rotate_zxy(), shz_mat4x4_rotate_zxy_u16()

void rotate_yxz(float yRadians, float xRadians, float zRadians) noexcept
void rotate_yxz(const vec3 &angles) noexcept
void rotate_yxz(uint16_t yAngle, uint16_t xAngle, uint16_t zAngle) noexcept
void rotate_yxz(Y yRadians, X xRadians, Z zRadians) noexcept

Calls: shz_mat4x4_rotate_yxz(), shz_mat4x4_rotate_yxz_u16()

void rotate_x_yz(float y, float z) noexcept

C++ wrapper around shz_mat4x4_rotate_x_yz().

Calls: shz_mat4x4_rotate_x_yz()

void rotate_y_xz(float x, float z) noexcept

C++ wrapper around shz_mat4x4_rotate_y_xz().

Calls: shz_mat4x4_rotate_y_xz()

void rotate_z_xy(float x, float y) noexcept

C++ wrapper around shz_mat4x4_rotate_z_xy().

Calls: shz_mat4x4_rotate_z_xy()

void billboard_x(const vec3 &pos, const vec3 &eye) noexcept

C++ wrapper around shz_mat4x4_billboard_x().

Calls: shz_mat4x4_billboard_x()

void billboard_y(const vec3 &pos, const vec3 &eye) noexcept

C++ wrapper around shz_mat4x4_billboard_y().

Calls: shz_mat4x4_billboard_y()

void billboard_z(const vec3 &pos, const vec3 &eye) noexcept

C++ wrapper around shz_mat4x4_billboard_z().

Calls: shz_mat4x4_billboard_z()

void rotate(float radians, float xAxis, float yAxis, float zAxis) noexcept
void rotate(float radians, vec3 axis) noexcept
void rotate(const quat &q) noexcept
void rotate(uint16_t radians16, float xAxis, float yAxis, float zAxis) noexcept
void rotate(uint16_t radians16, const vec3 &axis) noexcept

C++ wrapper around shz_mat4x4_rotate_u16().

Calls: shz_mat4x4_rotate(), shz_mat4x4_rotate_quat(), shz_mat4x4_rotate_u16()

void rotate_dir(float radians, float x, float y, float z) noexcept
void rotate_dir(float radians, vec3 dir) noexcept
void rotate_dir(uint16_t radians16, float x, float y, float z) noexcept
void rotate_dir(uint16_t radians16, const vec3 &dir) noexcept

C++ wrapper around shz_mat4x4_rotate_dir_u16(). The axis must be prenormalized!

Calls: shz_mat4x4_rotate_dir(), shz_mat4x4_rotate_dir_u16()

void translate_reverse(float x, float y, float z) noexcept
void translate_reverse(const shz::vec3 &pos) noexcept

Pre-multiplies and accumulates the given matrix onto the 3D translation matrix with the given components.

Calls: shz_mat4x4_translate_reverse()

void scale_reverse(float x, float y, float z) noexcept
void scale_reverse(const shz::vec3 &size) noexcept

Pre-multiplies and accumulates the given matrix onto the 3D scaling matrix with the given components.

Calls: shz_mat4x4_scale_reverse()

vec2 transform(const vec2 &in) const noexcept
vec3 transform(const vec3 &in) const noexcept
vec4 transform(const vec4 &in) const noexcept

Calls: shz_mat4x4_transform_vec2(), shz_mat4x4_transform_vec3(), shz_mat4x4_transform_vec4()

vec2 transform_point(const vec2 &pt) const noexcept
vec3 transform_point(const vec3 &pt) const noexcept

Calls: shz_mat4x4_transform_point2(), shz_mat4x4_transform_point3()

vec2 transform_transpose(const vec2 &in) const noexcept
vec3 transform_transpose(const vec3 &in) const noexcept
vec4 transform_transpose(const vec4 &in) const noexcept

Calls: shz_mat4x4_transform_vec2_transpose(), shz_mat4x4_transform_vec3_transpose(), shz_mat4x4_transform_vec4_transpose()

vec2 transform_point_transpose(const vec2 &pt) const noexcept
vec3 transform_point_transpose(const vec3 &pt) const noexcept

Calls: shz_mat4x4_transform_point2_transpose(), shz_mat4x4_transform_point3_transpose()

quat to_quat() const noexcept

Calls: shz_mat4x4_to_quat()

float determinant() const noexcept

Calls: shz_mat4x4_determinant()

float trace() const noexcept

Calls: shz_mat4x4_trace()

void inverse(mat4x4 *out) const noexcept

Calls: shz_mat4x4_inverse()

void inverse_block_triangular(mat4x4 *out) const noexcept

Calls: shz_mat4x4_inverse_block_triangular()

void inverse_rigid(mat4x4 *out) const noexcept

Calls: shz_mat4x4_inverse_rigid()

void decompose(vec3 *translation, quat *rotation, vec3 *scale) const noexcept

Calls: shz_mat4x4_decompose()

void blend(const shz_mat4x4_t &matrix, float weight) noexcept

Adds and accumulates a scaled 4x4 matrix into the given matrix.

Calls: shz_mat4x4_blend()

void swap(shz_mat4x4_t &matA, shz_mat4x4_t &matB) noexcept
void init_identity_safe() noexcept

Calls: shz_mat4x4_init_identity()

void apply_scale(float x, float y, float z) noexcept
void apply_scale(const vec3 &v) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_scale(). Renamed to scale_3x3().

void apply_translation(float x, float y, float z) noexcept
void apply_translation(const vec3 &v) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_translation(). Renamed to add_translation().

void apply_rotation_x(float angle) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_rotation_x(). Renamed to rotate_x().

void apply_rotation_y(float angle) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_rotation_y(). Renamed to rotate_y().

void apply_rotation_z(float angle) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_rotation_z(). Renamed to rotate_z().

void apply_rotation_xyz(float xAngle, float yAngle, float zAngle) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_rotation_xyz(). Renamed to rotate_xyz().

void apply_rotation_zyx(float zAngle, float yAngle, float xAngle) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_rotation_zyx(). Renamed to rotate_zyx().

void apply_rotation_zxy(float zAngle, float xAngle, float yAngle) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_rotation_zxy(). Renamed to rotate_zxy().

void apply_rotation_yxz(float yAngle, float xAngle, float zAngle) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_rotation_yxz(). Renamed to rotate_yxz().

void apply_rotation(float angle, float x, float y, float z) noexcept
void apply_rotation(float angle, vec3 axis) noexcept
void apply_rotation(const quat &q) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_rotation(). Renamed to rotate().

void apply_lookat(vec3 pos, vec3 target, vec3 up) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_lookat(). Renamed to lookat().

void apply_ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_ortho(). Renamed to ortho().

void apply_frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_frustum(). Renamed to frustum().

void apply_perspective(float fov, float aspect, float znear) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_perspective(). Renamed to perspective().

void apply_screen(float width, float height) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_screen(). Renamed to screen().

void apply_symmetric_skew(float x, float y, float z) noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_symmetric_skew(). Renamed to skew_symmetric().

void apply_permutation_wxyz() noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_permutation_wxyz(). Renamed to permute_wxyz().

void apply_permutation_yzwx() noexcept

Deprecated C++ wrapper around shz_mat4x4_apply_permutation_yzwx(). Renamed to permute_yzwx().

mat4x4() noexcept=default
mat4x4(const mat4x4 &other) noexcept
mat4x4(const shz_mat4x4_t &other) noexcept

Calls: shz_mat4x4_copy()

mat4x4 & operator=(const shz_mat4x4_t &other) noexcept

Calls: shz_mat4x4_copy()

bool operator==(const mat4x4 &lhs, const mat4x4 &rhs) noexcept

Overloaded equality operator, for comparing vectors.