SH4ZAM! 0.9.1
Fast math library for the Sega Dreamcast's SH4 CPU
Loading...
Searching...
No Matches
shz_xmtrx.hpp
Go to the documentation of this file.
1/*! \file
2 * \brief C++ Active Matrix API
3 * \ingroup xmtrx
4 *
5 * This file provides an API built around manipulating and performing
6 * calculations using the SH4's "current" 4x4 matrix, which is held within
7 * a secondary back-bank of 16 single-precision floating-point registers.
8 *
9 * \todo
10 * - shz_rotate_quat()
11 *
12 * \author 2025, 2026 Falco Girgis
13 * \copyright MIT License
14 */
15
16#ifndef SHZ_XMTRX_HPP
17#define SHZ_XMTRX_HPP
18
19#include <array>
20
21#include "shz_xmtrx.h"
22#include "shz_vector.hpp"
23#include "shz_quat.hpp"
24
25namespace shz {
26
27/*! Static structure around the 4x4 XMTRX FP register back-bank.
28
29 This structure provides the C++ bindings to the XMTRX API as a series
30 of static member functions wrapping the C API.
31
32 \sa xmtrx
33*/
34struct xmtrx {
35
36 //! FP back-bank registers comprising XMTRX.
37 enum reg {
38 XF0 = SHZ_XMTRX_XF0, //!< FP register XF0
39 XF1 = SHZ_XMTRX_XF1, //!< FP register XF1
40 XF2 = SHZ_XMTRX_XF2, //!< FP register XF2
41 XF3 = SHZ_XMTRX_XF3, //!< FP register XF3
42 XF4 = SHZ_XMTRX_XF4, //!< FP register XF4
43 XF5 = SHZ_XMTRX_XF5, //!< FP register XF5
44 XF6 = SHZ_XMTRX_XF6, //!< FP register XF6
45 XF7 = SHZ_XMTRX_XF7, //!< FP register XF7
46 XF8 = SHZ_XMTRX_XF8, //!< FP register XF8
47 XF9 = SHZ_XMTRX_XF9, //!< FP register XF9
48 XF10 = SHZ_XMTRX_XF10, //!< FP register XF10
49 XF11 = SHZ_XMTRX_XF11, //!< FP register XF11
50 XF12 = SHZ_XMTRX_XF12, //!< FP register XF12
51 XF13 = SHZ_XMTRX_XF13, //!< FP register XF13
52 XF14 = SHZ_XMTRX_XF14, //!< FP register XF14
53 XF15 = SHZ_XMTRX_XF15 //!< FP register XF15
54 };
55
56 //! Non-POSIX style reg_t alias.
57 using reg_t = reg;
58
59/*! \name Accessors
60 \brief Setting and retrieving individual XMTRX register values.
61 @{
62*/
63
64 //! C++ wrapper around shz_xmtrx_read().
65 SHZ_FORCE_INLINE static float read(reg xf) noexcept {
66 return shz_xmtrx_read(static_cast<shz_xmtrx_reg>(xf));
67 }
68
69 //! C++ wrapper around shz_xmtrx_write().
70 SHZ_FORCE_INLINE static void write(reg xf, float value) noexcept {
71 shz_xmtrx_write(static_cast<shz_xmtrx_reg>(xf), value);
72 }
73
74 //! C++ wrapper around shz_xmtrx_read_row().
75 SHZ_FORCE_INLINE static vec4 read_row(unsigned int index) noexcept {
76 return shz_xmtrx_read_row(index);
77 }
78
79 //! C++ wrapper around shz_xmtrx_read_col().
80 SHZ_FORCE_INLINE static vec4 read_col(unsigned int index) noexcept {
81 return shz_xmtrx_read_col(index);
82 }
83
84 //! C++ wrapper around shz_xmtrx_write_row().
85 SHZ_FORCE_INLINE static void write_row(unsigned int index, const vec4& vector) noexcept {
86 shz_xmtrx_write_row(index, vector);
87 }
88
89 //! C++ wrapper around shz_xmtrx_write_col().
90 SHZ_FORCE_INLINE static void write_col(unsigned int index, const vec4& vector) noexcept {
91 shz_xmtrx_write_col(index, vector);
92 }
93
94 //! C++ wrapper around shz_xmtrx_swap_rows().
95 SHZ_FORCE_INLINE static void swap_rows(unsigned int index1, unsigned int index2) noexcept {
96 shz_xmtrx_swap_rows(index1, index2);
97 }
98
99 //! C++ wrapper around shz_xmtrx_swap_cols().
100 SHZ_FORCE_INLINE static void swap_cols(unsigned int index1, unsigned int index2) noexcept {
101 shz_xmtrx_swap_cols(index1, index2);
102 }
103
104//! @}
105
106/*! \name Loading
107 \brief Routines for loading XMTRX contents from memory.
108 @{
109*/
110
111 //! C++ wrapper around shz_xmtrx_load_4x4().
112 SHZ_FORCE_INLINE static void load(const shz_mat4x4_t& mat4) noexcept {
114 }
115
116 //! C++ wrapper around shz_xmtrx_load_unaligned_4x4().
117 SHZ_FORCE_INLINE static void load(const float cArray[16]) noexcept {
119 }
120
121 //! C++ wrapper around shz_xmtrx_load_unaligned_4x4().
122 SHZ_FORCE_INLINE static void load(const std::array<float, 16>& array) noexcept {
123 load(array.data());
124 }
125
126 //! C++ wrapper around shz_xmtrx_load_3x4().
127 SHZ_FORCE_INLINE static void load(const shz_mat3x4_t& mat) noexcept {
129 }
130
131 //! C++ wrapper around shz_xmtrx_load_transpose_4x4().
132 SHZ_FORCE_INLINE static void load_transpose(const shz_mat4x4_t& mat4) noexcept {
134 }
135
136 //! C++ wrapper around shz_xmtrx_load_transpose_unaligned_4x4().
137 SHZ_FORCE_INLINE static void load_transpose(const float cArray[16]) noexcept {
139 }
140
141 //! C++ wrapper around shz_xmtrx_load_transpose_unaligned_4x4().
142 SHZ_FORCE_INLINE static void load_transpose(const std::array<float, 16>& array) noexcept {
143 load_transpose(array.data());
144 }
145
146 //! C++ wrapper around shz_xmtrx_load_transpose_3x4().
147 SHZ_FORCE_INLINE static void load_transpose(const shz_mat3x4_t& mat) noexcept {
149 }
150
151 //! C++ wrapper around shz_xmtrx_load_wxyz_4x4().
152 SHZ_FORCE_INLINE static void load_wxyz(const shz_mat4x4_t& mat4) noexcept {
154 }
155
156 //! C++ wrapper around shz_xmtrx_load_cols_4x4().
157 SHZ_FORCE_INLINE static void load_cols(const shz_vec4_t& c1,
158 const shz_vec4_t& c2,
159 const shz_vec4_t& c3,
160 const shz_vec4_t& c4) noexcept {
161 shz_xmtrx_load_cols_4x4(&c1, &c2, &c3, &c4);
162 }
163
164 //! C++ wrapper around shz_xmtrx_load_cols_3x4().
165 SHZ_FORCE_INLINE static void load_cols(const shz_vec3_t& c1,
166 const shz_vec3_t& c2,
167 const shz_vec3_t& c3,
168 const shz_vec3_t& c4) noexcept {
169 shz_xmtrx_load_cols_3x4(&c1, &c2, &c3, &c4);
170 }
171
172 //! C++ wrapper around shz_xmtrx_load_rows_4x4().
173 SHZ_FORCE_INLINE static void load_rows(const shz_vec4_t& r1,
174 const shz_vec4_t& r2,
175 const shz_vec4_t& r3,
176 const shz_vec4_t& r4) noexcept {
177 shz_xmtrx_load_rows_4x4(&r1, &r2, &r3, &r4);
178 }
179
180 //! C++ wrapper around shz_xmtrx_load_rows_3x4().
181 SHZ_FORCE_INLINE static void load_rows(const shz_vec4_t& r1,
182 const shz_vec4_t& r2,
183 const shz_vec4_t& r3) noexcept {
185 }
186
187//! @}
188
189/*! \name Storing
190 \brief Routines for saving XMTRX contents to memory.
191 @{
192*/
193
194 //! C++ wrapper around shz_xmtrx_store_4x4().
195 SHZ_FORCE_INLINE static void store(shz_mat4x4_t* mat) noexcept {
197 }
198
199 //! C++ wrapper around shz_xmtrx_store_unaligned_4x4().
200 SHZ_FORCE_INLINE static void store(float cArray[16]) noexcept {
202 }
203
204 //! C++ wrapper around shz_xmtrx_store_3x4().
205 SHZ_FORCE_INLINE static void store(shz_mat3x4_t* mat) noexcept {
207 }
208
209 //! C++ wrapper around shz_xmtrx_store_unaligned_4x4().
210 SHZ_FORCE_INLINE static void store(std::array<float, 16>* array) noexcept {
212 }
213
214 //! C++ wrapper around shz_xmtrx_store_transpose_4x4().
215 SHZ_FORCE_INLINE static void store_transpose(shz_mat4x4_t* mat) noexcept {
217 }
218
219 //! C++ wrapper around shz_xmtrx_store_transpose_unaligned_4x4().
220 SHZ_FORCE_INLINE static void store_transpose(float cArray[16]) noexcept {
222 }
223
224 //! C++ wrapper around shz_xmtrx_store_transpose_unaligned_4x4().
225 SHZ_FORCE_INLINE static void store_transpose(std::array<float, 16>* array) noexcept {
226 store_transpose(array->data());
227 }
228
229 //! C++ wrapper around shz_xmtrx_store_transpose_3x4().
230 SHZ_FORCE_INLINE static void store_transpose(shz_mat3x4_t* mat) noexcept {
232 }
233
234//! @}
235
236/*! \name Initialization
237 \brief Routines used to initialize the entirety of XMTRX.
238 @{
239*/
240
241 //! C++ wrapper around shz_xmtrx_init_identity().
242 SHZ_FORCE_INLINE static void init_identity() noexcept {
244 }
245
246 //! C++ wrapper around shz_xmtrx_init_identity_safe().
247 SHZ_DEPRECATED("Operation is always safe now. Use default version.")
248 SHZ_FORCE_INLINE static void init_identity_safe() noexcept {
250 }
251
252 //! C++ wrapper around shz_xmtrx_init_zero().
253 SHZ_FORCE_INLINE static void init_zero() noexcept {
255 }
256
257 //! C++ wrapper around shz_xmtrx_init_one().
258 SHZ_FORCE_INLINE static void init_one() noexcept {
260 }
261
262 //! C++ wrapper around shz_xmtrx_init_fill().
263 SHZ_FORCE_INLINE static void init_fill(float value) noexcept {
265 }
266
267 //! C++ wrapper around shz_xmtrx_init_translation().
268 SHZ_FORCE_INLINE static void init_translation(float x, float y, float z) noexcept {
270 }
271
272 //! C++ wrapper around shz_xmtrx_init_translation().
273 SHZ_FORCE_INLINE static void init_translation(const vec3& v) noexcept {
274 init_translation(v.x, v.y, v.z);
275 }
276
277 //! C++ wrapper around shz_xmtrx_init_scale().
278 SHZ_FORCE_INLINE static void init_scale(float x, float y, float z) noexcept {
280 }
281
282 //! C++ wrapper around shz_xmtrx_init_scale().
283 SHZ_FORCE_INLINE static void init_scale(const vec3& v) noexcept {
284 init_scale(v.x, v.y, v.z);
285 }
286
287 //! C++ wrapper around shz_xmtrx_init_rotation_x().
288 SHZ_FORCE_INLINE static void init_rotation_x(float x) noexcept {
290 }
291
292 //! C++ wrapper around shz_xmtrx_init_rotation_y().
293 SHZ_FORCE_INLINE static void init_rotation_y(float y) noexcept {
295 }
296
297 //! C++ wrapper around shz_xmtrx_init_rotation_z().
298 SHZ_FORCE_INLINE static void init_rotation_z(float z) noexcept {
300 }
301
302 //! C++ wrapper around shz_xmtrx_init_rotation_xyz().
303 SHZ_FORCE_INLINE static void init_rotation_xyz(float x, float y, float z) noexcept {
305 }
306
307 //! C++ wrapper around shz_xmtrx_init_rotation_zyx().
308 SHZ_FORCE_INLINE static void init_rotation_zyx(float z, float y, float x) noexcept {
310 }
311
312 //! C++ wrapper around shz_xmtrx_init_rotation_zxy().
313 SHZ_FORCE_INLINE static void init_rotation_zxy(float z, float x, float y) noexcept {
315 }
316
317 //! C++ wrapper around shz_xmtrx_init_rotation_yxz().
318 SHZ_FORCE_INLINE static void init_rotation_yxz(float y, float x, float z) noexcept {
320 }
321
322 //! C++ wrapper around shz_xmtrx_init_rotation().
323 SHZ_FORCE_INLINE static void init_rotation(float angle, float x, float y, float z) noexcept {
325 }
326
327 //! C++ wrapper around shz_xmtrx_init_rotation().
328 SHZ_FORCE_INLINE static void init_rotation(float angle, const vec3& axis) noexcept {
329 init_rotation(angle, axis.x, axis.y, axis.z);
330 }
331
332 //! C++ wrapper around shz_xmtrx_init_rotation_axis_angle().
333 SHZ_FORCE_INLINE static void init_rotation_dir(float angle, const vec3& dir) noexcept {
334 shz_xmtrx_init_rotation_dir(angle, dir.x, dir.y, dir.z);
335 }
336
337 //! C++ wrapper around shz_xmtrx_init_diagonal().
338 SHZ_FORCE_INLINE static void init_diagonal(float x, float y, float z, float w) noexcept {
340 }
341
342 //! C++ wrapper around shz_xmtrx_init_diagonal().
343 SHZ_FORCE_INLINE static void init_diagonal(const vec4& v) noexcept {
344 init_diagonal(v.x, v.y, v.z, v.w);
345 }
346
347 //! C++ wrapper around shz_xmtrx_init_upper_triangular().
348 SHZ_FORCE_INLINE static void init_upper_triangular(float col1, const vec2& col2, const vec3& col3, const vec4& col4) noexcept {
349 shz_xmtrx_init_upper_triangular(col1, col2, col3, col4);
350 }
351
352 //! C++ wrapper around shz_xmtrx_init_lower_diagonal().
353 SHZ_FORCE_INLINE static void init_lower_triangular(const vec4& col1, const vec3& col2, const vec2& col3, float col4) noexcept {
354 shz_xmtrx_init_lower_triangular(col1, col2, col3, col4);
355 }
356
357 //! C++ wrapper around shz_xmtrx_init_symmetric_skew().
358 SHZ_FORCE_INLINE static void init_symmetric_skew(float x, float y, float z) noexcept {
360 }
361
362 //! C++ wrapper around shz_xmtrx_init_outer_product().
363 SHZ_FORCE_INLINE static void init_outer_product(const vec4& a, const vec4& b) noexcept {
364 shz_xmtrx_init_outer_product(a, b);
365 }
366
367 //! C++ wrapper around shz_xmtrx_init_screen().
368 SHZ_FORCE_INLINE static void init_screen(float width, float height) noexcept {
369 shz_xmtrx_init_screen(width, height);
370 }
371
372 //! C++ wrapper around shz_xmtrx_init_lookat().
373 SHZ_FORCE_INLINE static void init_lookat(const vec3& eye, const vec3& center, const vec3& up) noexcept {
374 shz_xmtrx_init_lookat(eye, center, up);
375 }
376
377 //! C++ wrapper around shz_xmtrx_init_ortho().
378 SHZ_FORCE_INLINE static void init_ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept {
379 shz_xmtrx_init_ortho(left, right, bottom, top, znear, zfar);
380 }
381
382 //! C++ wrapper around shz_xmtrx_init_frustum().
383 SHZ_FORCE_INLINE static void init_frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept {
384 shz_xmtrx_init_frustum(left, right, bottom, top, znear, zfar);
385 }
386
387 //! C++ wrapper around shz_xmtrx_init_perspective().
388 SHZ_FORCE_INLINE static void init_perspective(float fov, float aspect, float znear) noexcept {
389 shz_xmtrx_init_perspective(fov, aspect, znear);
390 }
391
392 //! C++ wrapper around shz_xmtrx_init_rotation_quat().
393 SHZ_FORCE_INLINE static void init_rotation_quat(const quat& q) noexcept {
395 }
396
397 //! C++ wrapper around shz_xmtrx_init_permutation_wxyz().
398 SHZ_FORCE_INLINE static void init_permutation_wxyz() noexcept {
400 }
401
402 //! C++ wrapper around shz_xmtrx_init_permutation_yzwx().
403 SHZ_FORCE_INLINE static void init_permutation_yzwx() noexcept {
405 }
406
407 //! C++ wrapper around shz_xmtrx_init_permutation_wzyx().
408 SHZ_FORCE_INLINE static void init_permutation_wzyx() noexcept {
410 }
411
412//! @}
413
414/*! \name Apply Operation
415 \brief Updates only relevant values of XMTRX based on the given transform.
416 @{
417*/
418
419 //! C++ wrapper around shz_xmtrx_apply_4x4().
420 SHZ_FORCE_INLINE static void apply(const shz_mat4x4_t& mat4) noexcept {
422 }
423
424 //! C++ wrapper around shz_xmtrx_apply_unaligned_4x4().
425 SHZ_FORCE_INLINE static void apply(const float cArray[16]) noexcept {
427 }
428
429 //! C++ wrapper around shz_xmtrx_apply_unaligned_4x4().
430 SHZ_FORCE_INLINE static void apply(const std::array<float, 16>& array) noexcept {
432 }
433
434 //! C++ wrapper around shz_xmtrx_apply_3x4().
435 SHZ_FORCE_INLINE static void apply(const shz_mat3x4_t& mat) noexcept {
437 }
438
439 //! C++ wrapper around shz_xmtrx_apply_transpose_4x4().
440 SHZ_FORCE_INLINE static void apply_transpose(const shz_mat4x4_t& mat4) noexcept {
442 }
443
444 //! C++ wrapper around shz_xmtrx_apply_transpose_unaligned_4x4().
445 SHZ_FORCE_INLINE static void apply_transpose(const float cArray[16]) noexcept {
447 }
448
449 //! C++ wrapper around shz_xmtrx_apply_transpose_unaligned_4x4().
450 SHZ_FORCE_INLINE static void apply_transpose(const std::array<float, 16>& array) noexcept {
452 }
453
454 //! C++ wrapper around shz_xmtrx_apply_transpose_3x4().
455 SHZ_FORCE_INLINE static void apply_transpose(const shz_mat3x4_t& mat) noexcept {
457 }
458
459 //! C++ wrapper around shz_xmtrx_apply_reverse_4x4().
460 SHZ_FORCE_INLINE static void apply_reverse(const shz_mat4x4_t& mat4) noexcept {
462 }
463
464 //! C++ wrapper around shz_xmtrx_apply_reverse_unaligned_4x4().
465 SHZ_FORCE_INLINE static void apply_reverse(const float cArray[16]) noexcept {
467 }
468
469 //! C++ wrapper around shz_xmtrx_apply_reverse_unaligned_4x4().
470 SHZ_FORCE_INLINE static void apply_reverse(const std::array<float, 16>& array) noexcept {
472 }
473
474 //! C++ wrapper around shz_xmtrx_apply_reverse_3x4().
475 SHZ_FORCE_INLINE static void apply_reverse(const shz_mat3x4_t& mat) noexcept {
477 }
478
479 //! C++ wrapper around shz_xmtrx_apply_reverse_transpose_4x4().
480 SHZ_FORCE_INLINE static void apply_reverse_transpose(const shz_mat4x4_t& mat4) noexcept {
482 }
483
484 //! C++ wrapper around shz_xmtrx_apply_reverse_transpose_unaligned_4x4().
485 SHZ_FORCE_INLINE static void apply_reverse_transpose(const float cArray[16]) noexcept {
487 }
488
489 //! C++ wrapper around shz_xmtrx_apply_reverse_transpose_unaligned_4x4().
490 SHZ_FORCE_INLINE static void apply_reverse_transpose(const std::array<float, 16>& array) noexcept {
492 }
493
494 //! C++ wrapper around shz_xmtrx_apply_reverse_transpose_3x4().
495 SHZ_FORCE_INLINE static void apply_reverse_transpose(const shz_mat3x4_t& mat) noexcept {
497 }
498
499 //! C++ wrapper around shz_xmtrx_apply_translation().
500 SHZ_FORCE_INLINE static void apply_translation(float x, float y, float z) noexcept {
502 }
503
504 //! C++ wrapper around shz_xmtrx_apply_translation().
505 SHZ_FORCE_INLINE static void apply_translation(const vec3& v) noexcept {
506 apply_translation(v.x, v.y, v.z);
507 }
508
509 //! C++ wrapper around shz_xmtrx_apply_scale().
510 SHZ_FORCE_INLINE static void apply_scale(float x, float y, float z) noexcept {
512 }
513
514 //! C++ wrapper around shz_xmtrx_apply_scale().
515 SHZ_FORCE_INLINE static void apply_scale(const vec3& v) noexcept {
516 apply_scale(v.x, v.y, v.z);
517 }
518
519 //! C++ wrapper around shz_xmtrx_apply_rotation_x().
520 SHZ_FORCE_INLINE static void apply_rotation_x(float x) noexcept {
522 }
523
524 //! C++ wrapper around shz_xmtrx_apply_rotation_y().
525 SHZ_FORCE_INLINE static void apply_rotation_y(float y) noexcept {
527 }
528
529 //! C++ wrapper around shz_xmtrx_apply_rotation_z().
530 SHZ_FORCE_INLINE static void apply_rotation_z(float z) noexcept {
532 }
533
534 //! C++ wrapper around shz_xmtrx_init_rotation_xyz().
535 SHZ_FORCE_INLINE static void apply_rotation_xyz(float x, float y, float z) noexcept {
537 }
538
539 //! C++ wrapper around shz_xmtrx_apply_rotation_zyx().
540 SHZ_FORCE_INLINE static void apply_rotation_zyx(float z, float y, float x) noexcept {
542 }
543
544 //! C++ wrapper around shz_xmtrx_apply_rotation_zxy().
545 SHZ_FORCE_INLINE static void apply_rotation_zxy(float z, float x, float y) noexcept {
547 }
548
549 //! C++ wrapper around shz_xmtrx_apply_rotation_yxz().
550 SHZ_FORCE_INLINE static void apply_rotation_yxz(float y, float x, float z) noexcept {
552 }
553
554 // C++ wrapper around shz_xmtrx_apply_rotation().
555 SHZ_FORCE_INLINE static void apply_rotation(float angle, float x, float y, float z) noexcept {
557 }
558
559 // C++ wrapper around shz_xmtrx_apply_rotation().
560 SHZ_FORCE_INLINE static void apply_rotation(float angle, const vec3& axis) noexcept {
561 apply_rotation(angle, axis.x, axis.y, axis.z);
562 }
563
564 //! C++ wrapper around shz_xmtrx_apply_rotation_quat().
565 SHZ_FORCE_INLINE static void apply_rotation_quat(const quat& q) noexcept {
567 }
568
569 //! C++ wrapper around shz_xmtrx_apply_lookat().
570 SHZ_FORCE_INLINE static void apply_lookat(const vec3& eye, const vec3& center, const vec3& up) noexcept {
571 shz_xmtrx_apply_lookat(eye, center, up);
572 }
573
574 //! C++ wrapper around shz_xmtrx_apply_ortho().
575 SHZ_FORCE_INLINE static void apply_ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept {
576 shz_xmtrx_apply_ortho(left, right, bottom, top, znear, zfar);
577 }
578
579 //! C++ wrapper around shz_xmtrx_apply_frustum().
580 SHZ_FORCE_INLINE static void apply_frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept {
581 shz_xmtrx_apply_frustum(left, right, bottom, top, znear, zfar);
582 }
583
584 //! C++ wrapper around shz_xmtrx_apply_perspective().
585 SHZ_FORCE_INLINE static void apply_perspective(float fov, float aspect, float znear) noexcept {
586 shz_xmtrx_apply_perspective(fov, aspect, znear);
587 }
588
589 //! C++ wrapper around shz_xmtrx_apply_symmetric_skew().
590 SHZ_FORCE_INLINE static void apply_symmetric_skew(float x, float y, float z) noexcept {
592 }
593
594 //! C++ wrapper around shz_xmtrx_apply_screen().
595 SHZ_FORCE_INLINE static void apply_screen(float width, float height) noexcept {
596 shz_xmtrx_apply_screen(width, height);
597 }
598
599 //! C++ wrapper around shz_xmtrx_apply_permutation_wxyz().
600 SHZ_FORCE_INLINE static void apply_permutation_wxyz() noexcept {
602 }
603
604 //! C++ wrapper around shz_xmtrx_apply_permutation_yzwx().
605 SHZ_FORCE_INLINE static void apply_permutation_yzwx() noexcept {
607 }
608
609 //! C++ wrapper around shz_xmtrx_apply_permutation_wzyx().
610 SHZ_FORCE_INLINE static void apply_permutation_wzyx() noexcept {
612 }
613
614 //! C++ wrapper around shz_xmtrx_apply_self().
615 SHZ_FORCE_INLINE static void apply_self() noexcept {
617 }
618
619//! @}
620
621/*! \name OpenGL Operations
622 \brief OpenGL-style matrix transformation operations.
623 @{
624*/
625
626 //! C++ wrapper around shz_xmtrx_translate().
627 SHZ_FORCE_INLINE static void translate(float x, float y, float z) noexcept {
629 }
630
631 //! C++ wrapper around shz_xmtrx_translate().
632 SHZ_FORCE_INLINE static void translate(vec3 v) noexcept {
633 translate(v.x, v.y, v.z);
634 }
635
636 //! C++ wrapper around shz_xmtrx_scale().
637 SHZ_FORCE_INLINE static void scale(float x, float y, float z) noexcept {
639 }
640
641 //! C++ wrapper around shz_xmtrx_scale().
642 SHZ_FORCE_INLINE static void scale(vec3 v) noexcept {
643 scale(v.x, v.y, v.z);
644 }
645
646 //! C++ wrapper around shz_xmtrx_rotate_x().
647 SHZ_FORCE_INLINE static void rotate_x(float radians) noexcept {
649 }
650
651 //! C++ wrapper around shz_xmtrx_rotate_x().
652 SHZ_FORCE_INLINE static void rotate_y(float radians) noexcept {
654 }
655
656 //! C++ wrapper around shz_xmtrx_rotate_x().
657 SHZ_FORCE_INLINE static void rotate_z(float radians) noexcept {
659 }
660
661 //! C++ wrapper around shz_xmtrx_rotate_xyz().
662 SHZ_FORCE_INLINE static void rotate_xyz(float x, float y, float z) noexcept {
664 }
665
666 //! C++ wrapper around shz_xmtrx_rotate_zyx().
667 SHZ_FORCE_INLINE static void rotate_zyx(float z, float y, float x) noexcept {
669 }
670
671 //! C++ wrapper around shz_xmtrx_rotate_zxy().
672 SHZ_FORCE_INLINE static void rotate_zxy(float z, float x, float y) noexcept {
674 }
675
676 //! C++ wrapper around shz_xmtrx_rotate_yxz().
677 SHZ_FORCE_INLINE static void rotate_yxz(float y, float x, float z) noexcept {
679 }
680
681 //! C++ wrapper around shz_xmtrx_rotate().
682 SHZ_FORCE_INLINE static void rotate(float radians, float x, float y, float z) noexcept {
683 shz_xmtrx_rotate(radians, x, y, z);
684 }
685
686 //! C++ wrapper around shz_xmtrx_rotate().
687 SHZ_FORCE_INLINE static void rotate(float radians, const vec3& axis) noexcept {
688 rotate(radians, axis.x, axis.y, axis.z);
689 }
690
691/*! \name Reverse GL Transformations
692 \brief Pre-multiplication variants of OpenGL-style 4x4 matrix transforms.
693 @{
694*/
695 //! Pre-multiplies and accumulates XMTRX onto the 3D translation matrix with the given components.
696 SHZ_FORCE_INLINE static void translate_reverse(float x, float y, float z) noexcept {
698 }
699
700 //! Pre-multiplies and accumulates XMTRX onto the 3D translation matrix with the given translation vector.
701 SHZ_FORCE_INLINE static void translate_reverse(const shz::vec3& pos) noexcept {
702 translate_reverse(pos.x, pos.y, pos.z);
703 }
704
705 //! Pre-multiplies and accumulatse XMTRX onto the 3D scaling matrix with the given components.
706 SHZ_FORCE_INLINE static void scale_reverse(float x, float y, float z) noexcept {
708 }
709
710 //! Pre-multiplies and accumulatse XMTRX onto the 3D scaling matrix with the given size vector.
711 SHZ_FORCE_INLINE static void scale_reverse(const shz::vec3& size) noexcept {
712 scale_reverse(size.x, size.y, size.z);
713 }
714
715//! @}
716
717/*! \name Compound Operations
718 \brief Multiple operations combined into one pipelined transaction.
719 @{
720*/
721
722 //! C++ wrapper around shz_xmtrx_load_apply_4x4().
723 SHZ_FORCE_INLINE static void load_apply(const shz_mat4x4_t& mat1, const shz_mat4x4_t& mat2) noexcept {
725 }
726
727 //! C++ wrapper around shz_xmtrx_load_apply_unaligned_4x4().
728 SHZ_FORCE_INLINE static void load_apply(const float matrix1[16], const float matrix2[16]) noexcept {
730 }
731
732 //! C++ wrapper around shz_xmtrx_load_apply_3x4().
733 SHZ_FORCE_INLINE static void load_apply(const shz_mat3x4_t& mat1, const shz_mat3x4_t& mat2) noexcept {
735 }
736
737 //! C++ wrapper around shz_xmtrx_apply_store_4x4().
738 SHZ_FORCE_INLINE static void apply_store(shz_mat4x4_t* out, const shz_mat4x4_t& in) noexcept {
740 }
741
742 //! C++ wrapper around shz_xmtrx_apply_store_unaligned_4x4().
743 SHZ_FORCE_INLINE static void apply_store(float out[16], const float in[16]) noexcept {
745 }
746
747 //! C++ wrapper around shz_xmtrx_load_apply_store_4x4().
748 SHZ_FORCE_INLINE static void load_apply_store(shz_mat4x4_t* dst, const shz_mat4x4_t& mat1, const shz_mat4x4_t& mat2) noexcept {
750 }
751
752 //! C++ wrapper around shz_xmtrx_load_apply_store_unaligned_4x4().
753 SHZ_FORCE_INLINE static void load_apply_store(float out[16], const float matrix1[16], const float matrix2[16]) noexcept {
755 }
756
757 //! C++ wrapper around shz_xmtrx_load_apply_store_3x4().
758 SHZ_FORCE_INLINE static void load_apply_store(shz_mat3x4_t* dst, const shz_mat3x4_t& mat1, const shz_mat3x4_t& mat2) noexcept {
760 }
761
762 //! C++ wrapper around shz_xmtrx_load_2x2().
763 SHZ_FORCE_INLINE static void load(const shz_mat2x2_t& mat) noexcept {
765 }
766
767 //! C++ wrapper around shz_xmtrx_store_2x2().
768 SHZ_FORCE_INLINE static void store(shz_mat2x2_t* mat) noexcept {
770 }
771
772 //! C++ wrapper around shz_xmtrx_load_3x3().
773 SHZ_FORCE_INLINE static void load(const shz_mat3x3_t& mat) noexcept {
775 }
776
777 //! C++ wrapper around shz_xmtrx_load_transpose_3x3().
778 SHZ_FORCE_INLINE static void load_transpose(const shz_mat3x3_t& mat) noexcept {
780 }
781
782 //! C++ wrapper around shz_xmtrx_store_3x3().
783 SHZ_FORCE_INLINE static void store(shz_mat3x3_t* mat) noexcept {
785 }
786
787 //! C++ wrapper around shz_xmtrx_store_transpose_3x3().
788 SHZ_FORCE_INLINE static void store_transpose(shz_mat3x3_t* mat) noexcept {
790 }
791
792 //! C++ wrapper around shz_xmtrx_apply_3x3().
793 SHZ_FORCE_INLINE static void apply(const shz_mat3x3_t& mat) noexcept {
795 }
796
797 //! C++ wrapper around shz_xmtrx_apply_transpose_3x3().
798 SHZ_FORCE_INLINE static void apply_transpose(const shz_mat3x3_t& mat) noexcept {
800 }
801
802 //! C++ wrapper around shz_xmtrx_load_apply_store_3x3().
803 SHZ_FORCE_INLINE static void load_apply_store(shz_mat3x3_t* dst, const shz_mat3x3_t& mat1, const shz_mat3x3_t& mat2) noexcept {
805 }
806
807//! @}
808
809/*! \name Transformations
810 \brief Transforming vectors and points against XMTRX.
811 @{
812*/
813
814 //! C++ wrapper around shz_xmtrx_transform_vec4().
815 SHZ_FORCE_INLINE static vec4 transform(const vec4& in) noexcept {
816 return shz_xmtrx_transform_vec4(in);
817 }
818
819 //! C++ wrapper around shz_xmtrx_transform_vec3().
820 SHZ_FORCE_INLINE static vec3 transform(const vec3& in) noexcept {
821 return shz_xmtrx_transform_vec3(in);
822 }
823
824 //! C++ wrapper around shz_xmtrx_transform_vec2().
825 SHZ_FORCE_INLINE static vec2 transform(const vec2& in) noexcept {
826 return shz_xmtrx_transform_vec2(in);
827 }
828
829 //! C++ wrapper around shz_xmtrx_transform_point3().
830 SHZ_FORCE_INLINE static vec3 transform_point(const vec3& pt) noexcept {
831 return shz_xmtrx_transform_point3(pt);
832 }
833
834 //! C++ wrapper around shz_xmtrx_transform_point2().
835 SHZ_FORCE_INLINE static vec2 transform_point(const vec2& pt) noexcept {
836 return shz_xmtrx_transform_point2(pt);
837 }
838
839//! @}
840
841/*! \name Setters
842 \brief Sets the values of related XMTRX components.
843 @{
844*/
845
846 //! C++ wrapper around shz_xmtrx_set_translation().
847 SHZ_FORCE_INLINE static void set_translation(float x, float y, float z) noexcept {
849 }
850
851 //! C++ wrapper around shz_xmtrx_set_translation().
852 SHZ_FORCE_INLINE static void set_translation(const vec3& v) noexcept {
853 set_translation(v.x, v.y, v.z);
854 }
855
856 //! Sets only the inner 3x3 submatrix to be a 3D scale matrix with the given components.
857 SHZ_FORCE_INLINE static void set_scale(float x, float y, float z) noexcept {
859 }
860
861 //! Sets only the inner 3x3 submatrix to be a 3D scale matrix with the given scale vector.
862 SHZ_FORCE_INLINE static void set_scale(const shz::vec3& size) noexcept {
863 set_scale(size.x, size.y, size.z);
864 }
865
866//! @}
867
868/*! \name Getters
869 \brief Gets the values of related XMTRX components.
870 @{
871*/
872
873 //! C++ wrapper around shz_xmtrx_set_translation().
874 SHZ_FORCE_INLINE static vec3 get_translation() noexcept {
876 }
877
878 /*! Returns the scaling components from the inner 3x3 matrix of XMTRX, as a 3D vector.
879
880 \warning This routine assumes XMTRX is a standard TRS-style transform matrix,
881 without shearing or reflection.
882 */
883 SHZ_FORCE_INLINE static vec3 get_scale() noexcept {
885 }
886
887//! @}
888
889/*! \name Miscellaneous
890 \brief Random operations and conversions on XMTRX.
891 @{
892*/
893
894 //! C++ wrapper around shz_xmtrx_add_4x4().
895 SHZ_FORCE_INLINE static void add(const shz_mat4x4_t& mat) noexcept {
897 }
898
899 //! C++ wrapper around shz_xmtrx_sub_4x4().
900 SHZ_FORCE_INLINE static void sub(const shz_mat4x4_t& mat) noexcept {
902 }
903
904 //! C++ wrapper around shz_xmtrx_transpose().
905 SHZ_FORCE_INLINE static void transpose() noexcept {
907 }
908
909 //! C++ wrapper around shz_xmtrx_negate().
910 SHZ_FORCE_INLINE static void negate() noexcept {
912 }
913
914 //! C++ wrapper around shz_xmtrx_abs().
915 SHZ_FORCE_INLINE static void abs() noexcept {
917 }
918
919 //! C++ wrapper around shz_xmtrx_to_quat().
920 SHZ_FORCE_INLINE static quat to_quat() noexcept {
921 return shz_xmtrx_to_quat();
922 }
923
924 //! C++ wrapper around shz_xmtrx_determinant().
925 SHZ_FORCE_INLINE static float determinant() noexcept {
927 }
928
929 //! C++ wrapper around shz_xmtrx_invert().
930 SHZ_FORCE_INLINE static void invert() noexcept {
932 }
933
934 /*! Adds and accumulates a scaled 4x4 matrix onto XMTRX.
935
936 Each component of \p joint_matrix will be multiplied by \p weight, with the result
937 being added to the existing value of that component of XMTRX.
938
939 This is useful for accumulating weighted joint matrices onto an initially
940 zeroed-out XMTRX. This allows for in-place construction of a skin matrix, which can
941 then be directly used to transform the vertices of a mesh against for animation.
942
943 \sa shz_xmtrx_init_zero()
944 */
945 SHZ_FORCE_INLINE static void blend(const shz_mat4x4_t& joint_matrix, float weight) noexcept {
946 shz_xmtrx_blend(&joint_matrix, weight);
947 }
948
949//! @}
950
951};
952}
953
954#endif
Namespace enclosing the SH4ZAM C++ API.
Definition shz_cdefs.hpp:21
void shz_xmtrx_init_diagonal(float x, float y, float z, float w) noexcept
Initializes XMTRX to be a diagonal matrix with the given diagonal values.
void shz_xmtrx_apply_rotation_z(float z) noexcept
Transforms the values of the inner 3x3 matrix by a rotation matrix of z radians about the Z axis.
void shz_xmtrx_apply_transpose_3x3(const shz_mat3x3_t *matrix) noexcept
Multiplies and accumulates the transpose of the given 3x3 matrix onto XMTRX, not modifying other elem...
void shz_xmtrx_load_transpose_3x3(const shz_mat3x3_t *matrix) noexcept
Loads the transpose of the given 3x3 matrix into XMTRX, initializing its remaining elements to identi...
void shz_xmtrx_apply_reverse_3x4(const shz_mat3x4_t *mat) noexcept
Multiplies and accumulates XMTRX onto matrix, storing the result as XMTRX.
shz_vec4_t shz_xmtrx_read_col(unsigned int index) noexcept
Returns the values at the given column index, as a 4D vector.
shz_quat_t shz_xmtrx_to_quat(void) noexcept
Constructs a quaternion from the 3D rotation matrix within XMTRX.
void shz_xmtrx_load_apply_store_unaligned_4x4(float out[16], const float matrix1[16], const float matrix2[16]) noexcept
Loads XMTRX with the result of applying unaligned matrix2 onto unaligned matrix1, storing the result.
void shz_xmtrx_invert(void) noexcept
Inverts XMTRX in-place.
void shz_xmtrx_init_rotation_zyx(float zAngle, float yAngle, float xAngle) noexcept
Initializes XMTRX to be a 3D Z-Y-X rotation matrix, with the corresponding angles given in radians.
void shz_xmtrx_store_3x4(shz_mat3x4_t *matrix) noexcept
Stores the top-left 3x4 values currently held within XMTRX into the given matrix.
void shz_xmtrx_store_unaligned_4x4(float matrix[16]) noexcept
Stores the current values held within XMTRX into the given unaligned 16-float array.
void shz_xmtrx_init_identity(void) noexcept
Initializes XMTRX to the 4x4 identity matrix.
void shz_xmtrx_load_apply_store_3x3(shz_mat3x3_t *out, const shz_mat3x3_t *matrix1, const shz_mat3x3_t *matrix2) noexcept
Loads XMTRX with the 3x3 result of applying matrix2 onto matrix1, storing the result.
void shz_xmtrx_apply_rotation_quat(shz_quat_t quat) noexcept
Transforms the values of the inner 3x3 matrix by the rotation matrix represented by the given quatern...
void shz_xmtrx_blend(const shz_mat4x4_t *joint_matrix, float weight) noexcept
Adds and accumulates a scaled 4x4 matrix onto XMTRX.
void shz_xmtrx_load_transpose_3x4(const shz_mat3x4_t *matrix) noexcept
Loads XMTRX with the transpose of the given 3x4 matrix, initializing the bottom row to identity.
void shz_xmtrx_load_unaligned_4x4(const float matrix[16]) noexcept
Loads the given array of unaligned 16 float values as the 4x4 XMTRX matrix.
void shz_xmtrx_set_scale(float x, float y, float z) noexcept
Sets only the inner 3x3 submatrix of XMTRX to be a scaling matrix.
void shz_xmtrx_rotate_x(float radians) noexcept
Multiplies and accumulates XMTRX by a 3D rotation matrix about the X axis.
void shz_xmtrx_load_cols_3x4(const shz_vec3_t *c1, const shz_vec3_t *c2, const shz_vec3_t *c3, const shz_vec3_t *c4) noexcept
Loads the 3x4 matrix formed from the given 4 3D column vectors into XMTRX.
void shz_xmtrx_set_translation(float x, float y, float z) noexcept
Sets only the translational components of XMTRX to the given values.
void shz_xmtrx_scale_reverse(float x, float y, float z) noexcept
Pre-multiplies and accumulates XMTRX onto the 3D scaling matrix with the given components.
void shz_xmtrx_store_transpose_3x3(shz_mat3x3_t *matrix) noexcept
Stores the transpose of the top-left 3x3 values currently held within XMTRX into the given matrix.
void shz_xmtrx_translate_reverse(float x, float y, float z) noexcept
Pre-multiplies and accumulates XMTRX onto the 3D translation matrix with the given components.
void shz_xmtrx_swap_cols(unsigned int index1, unsigned int index2) noexcept
Swaps the values of the columns with the given indices.
void shz_xmtrx_apply_ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept
Applies a 2D orthographic projection matrix onto XMTRX, equivalent to glOrtho().
void shz_xmtrx_apply_transpose_4x4(const shz_mat4x4_t *matrix) noexcept
Multiplies and accumulates the transpose of the given 4x4 matrix onto XMTRX.
void shz_xmtrx_rotate_z(float radians) noexcept
Multiplies and accumulates XMTRX by a 3D rotation matrix about the Z axis.
void shz_xmtrx_load_apply_store_3x4(shz_mat3x4_t *out, const shz_mat3x4_t *matrix1, const shz_mat3x4_t *matrix2) noexcept
Loads XMTRX with the 3x4 result of applying matrix2 onto matrix1, storing the result.
void shz_xmtrx_negate(void) noexcept
Negates each element held within XMTRX.
void shz_xmtrx_load_apply_4x4(const shz_mat4x4_t *matrix1, const shz_mat4x4_t *matrix2) noexcept
Loads XMTRX with the result of applying matrix2 onto matrix1.
void shz_xmtrx_rotate_zyx(float zRadians, float yRadians, float xRadians) noexcept
Multiplies and accumulates XMTRX by 3D rotation matrices about the Z then Y then X axes.
void shz_xmtrx_load_apply_unaligned_4x4(const float matrix1[16], const float matrix2[16]) noexcept
Loads XMTRX with the result of applying unaligned matrix2 onto matrix1.
void shz_xmtrx_rotate(float radians, float xAxis, float yAxis, float zAxis) noexcept
Multiplies and accumulates XMTRX by the 3D rotation matrix formed by the given axis and angle (glRota...
void shz_xmtrx_apply_reverse_transpose_3x4(const shz_mat3x4_t *mat) noexcept
Multiplies and accumulates XMTRX onto the transpose of matrix, storing the result as XMTRX.
void shz_xmtrx_init_zero(void) noexcept
Initializes XMTRX to contain the value of 0.0f for each element.
void shz_xmtrx_init_one(void) noexcept
Initializes XMTRX to contain the value of 1.0f for each element.
void shz_xmtrx_init_fill(float value) noexcept
Initializes XMTRX to contain the given value for each element.
void shz_xmtrx_add_4x4(const shz_mat4x4_t *mat) noexcept
Adds each element within mat to each element within XMTRX, storing the result in XMTRX.
void shz_xmtrx_rotate_xyz(float xRadians, float yRadians, float zRadians) noexcept
Multiplies and accumulates XMTRX by 3D rotation matrices about the X then Y then Z axes.
void shz_xmtrx_init_rotation_z(float z) noexcept
Initializes XMTRX to be a 3D rotation matrix by z radians about the Z axis.
@ SHZ_XMTRX_XF8
FP register xf8.
Definition shz_xmtrx.h:77
@ SHZ_XMTRX_XF9
FP register xf9.
Definition shz_xmtrx.h:78
@ SHZ_XMTRX_XF12
FP register xf12.
Definition shz_xmtrx.h:81
@ SHZ_XMTRX_XF11
FP register xf11.
Definition shz_xmtrx.h:80
@ SHZ_XMTRX_XF14
FP register xf14.
Definition shz_xmtrx.h:83
@ SHZ_XMTRX_XF3
FP register xf3.
Definition shz_xmtrx.h:72
@ SHZ_XMTRX_XF6
FP register xf6.
Definition shz_xmtrx.h:75
@ SHZ_XMTRX_XF4
FP register xf4.
Definition shz_xmtrx.h:73
@ SHZ_XMTRX_XF13
FP register xf13.
Definition shz_xmtrx.h:82
@ SHZ_XMTRX_XF10
FP register xf10.
Definition shz_xmtrx.h:79
@ SHZ_XMTRX_XF2
FP register xf2.
Definition shz_xmtrx.h:71
@ SHZ_XMTRX_XF0
FP register xf0.
Definition shz_xmtrx.h:69
@ SHZ_XMTRX_XF5
FP register xf5.
Definition shz_xmtrx.h:74
@ SHZ_XMTRX_XF7
FP register xf7.
Definition shz_xmtrx.h:76
@ SHZ_XMTRX_XF15
FP register xf15.
Definition shz_xmtrx.h:84
@ SHZ_XMTRX_XF1
FP register xf1.
Definition shz_xmtrx.h:70
void shz_xmtrx_rotate_zxy(float zRadians, float xRadians, float yRadians) noexcept
Multiplies and accumulates XMTRX by 3D rotation matrices about the Z then X then Y axes.
void shz_xmtrx_apply_frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept
Applies a frustum projection matrix onto XMTRX, equivalent to glFrustum().
void shz_xmtrx_apply_unaligned_4x4(const float matrix[16]) noexcept
Multiplies and accumulates the given 16-entry float array as a 4x4 matrix onto XMTRX.
void shz_xmtrx_load_transpose_unaligned_4x4(const float matrix[16]) noexcept
Loads XMTRX with the transpose of the 4x4 matrix created from the given unaligned array of 16 floats.
void shz_xmtrx_load_wxyz_4x4(const shz_mat4x4_t *matrix) noexcept
Loads the given 4x4 matrix as XMTRX, with the 4th column for translation being loaded as the first co...
void shz_xmtrx_apply_store_unaligned_4x4(float out[16], const float in[16]) noexcept
Multiplies XMTRX by the unaligned matrix, in, storing the result within the unaligned matrix,...
void shz_xmtrx_load_cols_4x4(const shz_vec4_t *c1, const shz_vec4_t *c2, const shz_vec4_t *c3, const shz_vec4_t *c4) noexcept
Sets XMTRX equal to the 4x4 matrix created from the 4 given 4D column vectors.
void shz_xmtrx_apply_symmetric_skew(float x, float y, float z) noexcept
Multiplies and accumulates the 3D symmetric skew matrix with the given components onto XMTRX.
void shz_xmtrx_init_rotation_y(float y) noexcept
Initializes XMTRX to be a 3D rotation matrix by y radians about the Y axis.
void shz_xmtrx_apply_reverse_unaligned_4x4(const float matrix[16]) noexcept
Multiplies and accumulates XMTRX onto the given float array as a 4x4 matrix, storing the result as XM...
void shz_xmtrx_load_2x2(const shz_mat2x2_t *matrix) noexcept
Loads the given 2x2 matrix into XMTRX, initializing its remaining elements to identity.
void shz_xmtrx_init_rotation_quat(shz_quat_t q) noexcept
Initializes XMTRX to a 3D rotation matrix with its orientation given by a quaternion.
shz_vec4_t shz_xmtrx_read_row(unsigned int index) noexcept
Returns the values at the the given row index, as a 4D vector.
void shz_xmtrx_init_ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept
Initializes XMTRX to an orthographic projection matrix, equivalent to glOrtho().
void shz_xmtrx_rotate_y(float radians) noexcept
Multiplies and accumulates XMTRX by a 3D rotation matrix about the Y axis.
void shz_xmtrx_apply_rotation_xyz(float xAngle, float yAngle, float zAngle) noexcept
Multiplies and accumulates XMTRX by a 3D X-Y-Z rotation matrix, with the corresponding angles given i...
void shz_xmtrx_store_transpose_3x4(shz_mat3x4_t *matrix) noexcept
Stores the transpose of the top-left 3x4 values currently held within XMTRX into the given matrix.
shz_vec3_t shz_xmtrx_get_translation(void) noexcept
Returns the translational components from the last column of XMTRX, as a 3D vector.
void shz_xmtrx_apply_permutation_wzyx(void) noexcept
Multiplies and accumulates a permutation matrix, which reorders the components of transformed vectors...
void shz_xmtrx_apply_reverse_4x4(const shz_mat4x4_t *matrix) noexcept
Multiplies and accumulates XMTRX onto matrix, storing the result as XMTRX.
void shz_xmtrx_store_4x4(shz_mat4x4_t *matrix) noexcept
Stores the current values held within XMTRX into the given 4x4 matrix.
void shz_xmtrx_init_rotation_zxy(float zAngle, float xAngle, float yAngle) noexcept
Initializes XMTRX to be a 3D Z-X-Y rotation matrix, with the corresponding angles given in radians.
void shz_xmtrx_apply_3x3(const shz_mat3x3_t *matrix) noexcept
Multiplies and accumulates the given 3x3 matrix onto XMTRX, not modifying other elements.
void shz_xmtrx_init_rotation_yxz(float yAngle, float xAngle, float zAngle) noexcept
Initializes XMTRX to be a 3D Y-X-Z rotation matrix, with the corresponding angles given in radians.
void shz_xmtrx_apply_perspective(float fov, float aspect, float znear) noexcept
Multiplies and accumulates the perspective matrix constructed from the given values onto XMTRX.
void shz_xmtrx_swap_rows(unsigned int index1, unsigned int index2) noexcept
Swaps the values of the rows with the given indices.
void shz_xmtrx_apply_rotation_yxz(float yAngle, float xAngle, float zAngle) noexcept
Multiplies and accumulates XMTRX by a 3D Y-X-Z rotation matrix, with the corresponding angles given i...
void shz_xmtrx_apply_rotation_y(float y) noexcept
Transforms the values of the inner 3x3 matrix by a rotation matrix of y radians about the Y axis.
void shz_xmtrx_init_scale(float x, float y, float z) noexcept
Initializes XMTRX to be a 3D scale matrix with the given dimensions.
void shz_xmtrx_apply_store_4x4(shz_mat4x4_t *out, const shz_mat4x4_t *in) noexcept
Multiplies XMTRX by the matrix, in, storing the result within the matrix, out.
void shz_xmtrx_apply_4x4(const shz_mat4x4_t *matrix) noexcept
Multiplies and accumulates the given 4x4 matrix onto XMTRX.
void shz_xmtrx_load_3x3(const shz_mat3x3_t *matrix) noexcept
Loads the given 3x3 matrix into XMTRX, initalizing its remaining elements to identity.
shz_vec3_t shz_xmtrx_get_scale(void) noexcept
Returns the scaling components from the inner 3x3 matrix of XMTRX, as a 3D vector.
void shz_xmtrx_apply_reverse_transpose_4x4(const shz_mat4x4_t *matrix) noexcept
Multiplies and accumulates XMTRX onto the transpose of matrix, storing the result as XMTRX.
void shz_xmtrx_load_rows_3x4(const shz_vec4_t *r1, const shz_vec4_t *r2, const shz_vec4_t *r3) noexcept
Loads the 3x4 matrix formed from the given 3 4D row vectors into XMTRX.
void shz_xmtrx_init_rotation_xyz(float xAngle, float yAngle, float zAngle) noexcept
Initializes XMTRX to be a 3D X-Y-Z rotation matrix, with the corresponding angles given in radians.
void shz_xmtrx_apply_rotation_zyx(float zAngle, float yAngle, float xAngle) noexcept
Multiplies and accumulates XMTRX by a 3D Z-Y-X rotation matrix, with the corresponding angles given i...
void shz_xmtrx_init_symmetric_skew(float x, float y, float z) noexcept
Initializes XMTRX to be the 3D symmetric skew matrix formed from the given vector components.
void shz_xmtrx_store_transpose_4x4(shz_mat4x4_t *matrix) noexcept
Stores the transpose of the current values held within XMTRX into the given 4x4 matrix.
void shz_xmtrx_apply_self(void) noexcept
Multiplies and accumulatse the XMTRX matrix by itself, squaring it.
float shz_xmtrx_determinant(void) noexcept
Returns the determinant of XMTRX.
void shz_xmtrx_apply_rotation(float angle, float x, float y, float z) noexcept
Transforms the values of the inner 3x3 matrix by a rotation matrix of angle radians about the axis wi...
void shz_xmtrx_store_transpose_unaligned_4x4(float matrix[16]) noexcept
Stores the transpose of the the current values held within XMTRX into the given 16-element float arra...
void shz_xmtrx_apply_transpose_unaligned_4x4(const float matrix[16]) noexcept
Multiplies and accumulates the transpose of the given 16-entry float array as a 4x4 matrix onto XMTRX...
void shz_xmtrx_init_screen(float width, float height) noexcept
Initializes XMTRX to the viewport matrix with the given dimensions.
void shz_xmtrx_transpose(void) noexcept
Transposes the elements within XMTRX, in-place.
void shz_xmtrx_apply_3x4(const shz_mat3x4_t *matrix) noexcept
Multiplies and accumulates the given 3x4 matrix onto XMTRX, not modifying other elements.
void shz_xmtrx_init_rotation_x(float x) noexcept
Initializes XMTRX to be a 3D rotation matrix by x radians about the X axis.
void shz_xmtrx_init_permutation_yzwx(void) noexcept
Initializes XMTRX to a permutation matrix, which reorders the components of transformed vectors to be...
void shz_xmtrx_load_4x4(const shz_mat4x4_t *matrix) noexcept
Loads the given 4x4 matrix as XMTRX.
void shz_xmtrx_scale(float x, float y, float z) noexcept
Multiplies and accumulates XMTRX by a 3D scaling matrix with the given components (glScalef() equival...
void shz_xmtrx_init_perspective(float fov, float aspect, float znear) noexcept
Initializes XMTRX to a perspective projection matrix.
void shz_xmtrx_apply_permutation_yzwx(void) noexcept
Multiplies and accumulates a permutation matrix, which reorders the components of transformed vectors...
void shz_xmtrx_apply_scale(float x, float y, float z) noexcept
Multiplies the values of the inner 3x3 matrix by the given 3D scaling terms.
void shz_xmtrx_load_apply_store_4x4(shz_mat4x4_t *out, const shz_mat4x4_t *matrix1, const shz_mat4x4_t *matrix2) noexcept
Loads XMTRX with the 4x4 result of applying matrix2 onto matrix1, storing the result.
void shz_xmtrx_apply_permutation_wxyz(void) noexcept
Multiplies and accumulates a permutation matrix, which reorders the components of transformed vectors...
void shz_xmtrx_translate(float x, float y, float z) noexcept
Multiplies and accumulates XMTRX by a 3D translation matrix with the given components (glTranslatef()...
void shz_xmtrx_apply_rotation_zxy(float zAngle, float xAngle, float yAngle) noexcept
Multiplies and accumulates XMTRX by a 3D Z-X-Y rotation matrix, with the corresponding angles given i...
float shz_xmtrx_read(shz_xmtrx_reg_t xf) noexcept
Returns the floating-point value held within the given XMTRX register.
void shz_xmtrx_load_transpose_4x4(const shz_mat4x4_t *matrix) noexcept
Loads XMTRX with the transpose of the given 4x4 matrix.
void shz_xmtrx_init_translation(float x, float y, float z) noexcept
Initializes XMTRX to be a 3D translation matrix to the given coordinates.
void shz_xmtrx_sub_4x4(const shz_mat4x4_t *mat) noexcept
Subtracts each element within mat from each element within XMTRX, storing the result in XMTRX.
void shz_xmtrx_init_permutation_wxyz(void) noexcept
Initializes XMTRX to a permutation matrix, which reorders the components of transformed vectors to be...
void shz_xmtrx_apply_reverse_transpose_unaligned_4x4(const float matrix[16]) noexcept
Multiplies and accumulates XMTRX onto the transpose of the given float array as a 4x4 matrix,...
void shz_xmtrx_load_3x4(const shz_mat3x4_t *matrix) noexcept
Loads the given 3x4 matrix into XMTRX, initializing its remaining elements to identity.
void shz_xmtrx_init_permutation_wzyx(void) noexcept
Initializes XMTRX to a permutation matrix, which reorders the components of transformed vectors to be...
void shz_xmtrx_store_3x3(shz_mat3x3_t *matrix) noexcept
Stores the top-left 3x3 values currently held within XMTRX into the given matrix.
void shz_xmtrx_apply_screen(float width, float height) noexcept
Multiplies and accumulates the viewport matrix created with the given components.
void shz_xmtrx_load_apply_3x4(const shz_mat3x4_t *matrix1, const shz_mat3x4_t *matrix2) noexcept
Loads XMTRX with the result of applying matrix2 onto matrix1.
void shz_xmtrx_apply_translation(float x, float y, float z) noexcept
Adds the values of the given 3 components to the 3D translation components of XMTRX.
void shz_xmtrx_rotate_yxz(float yRadians, float xRadians, float zRadians) noexcept
Multiplies and accumulates XMTRX by 3D rotation matrices about the Y then X then Z axes.
void shz_xmtrx_abs(void) noexcept
Takes the absolute value of each element held within XMTRX.
void shz_xmtrx_store_2x2(shz_mat2x2_t *matrix) noexcept
Stores the top-left 2x2 values currently held within XMTRX into the given matrix.
void shz_xmtrx_apply_rotation_x(float x) noexcept
Transforms the values of the inner 3x3 matrix by a rotation matrix of x radians about the X axis.
void shz_xmtrx_init_rotation(float angle, float xAxis, float yAxis, float zAxis) noexcept
Initializes XMTRX to a 3D rotation matrix of angle radians about the vector with the given components...
void shz_xmtrx_write(shz_xmtrx_reg_t xf, float value) noexcept
Sets the floating-point value held within the given XMTRX register to value.
void shz_xmtrx_load_rows_4x4(const shz_vec4_t *r1, const shz_vec4_t *r2, const shz_vec4_t *r3, const shz_vec4_t *r4) noexcept
Sets XMTRX equal to the 4x4 matrix created from the 4 given 4D row vectors.
void shz_xmtrx_apply_transpose_3x4(const shz_mat3x4_t *matrix) noexcept
Multiplies and accumulates the transpose of the given 3x4 matrix onto XMTRX, not modifying other elem...
void shz_xmtrx_init_frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept
Initializes XMTRX to a frustum projection matrix, equivalent to glFrustum().
C++ structure representing a quaternion.
Definition shz_quat.hpp:38
2D Vector type
3D Vector type
4D Vector type
Static structure around the 4x4 XMTRX FP register back-bank.
Definition shz_xmtrx.hpp:34
static vec4 read_row(unsigned int index) noexcept
C++ wrapper around shz_xmtrx_read_row().
Definition shz_xmtrx.hpp:75
static void apply_screen(float width, float height) noexcept
C++ wrapper around shz_xmtrx_apply_screen().
static void init_lookat(const vec3 &eye, const vec3 &center, const vec3 &up) noexcept
C++ wrapper around shz_xmtrx_init_lookat().
static void set_scale(const shz::vec3 &size) noexcept
Sets only the inner 3x3 submatrix to be a 3D scale matrix with the given scale vector.
static void init_symmetric_skew(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_init_symmetric_skew().
static void init_translation(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_init_translation().
static void rotate_x(float radians) noexcept
C++ wrapper around shz_xmtrx_rotate_x().
static void load_transpose(const std::array< float, 16 > &array) noexcept
C++ wrapper around shz_xmtrx_load_transpose_unaligned_4x4().
static void load_apply_store(shz_mat3x4_t *dst, const shz_mat3x4_t &mat1, const shz_mat3x4_t &mat2) noexcept
C++ wrapper around shz_xmtrx_load_apply_store_3x4().
static void apply_transpose(const shz_mat4x4_t &mat4) noexcept
C++ wrapper around shz_xmtrx_apply_transpose_4x4().
static void load_apply(const float matrix1[16], const float matrix2[16]) noexcept
C++ wrapper around shz_xmtrx_load_apply_unaligned_4x4().
static float read(reg xf) noexcept
C++ wrapper around shz_xmtrx_read().
Definition shz_xmtrx.hpp:65
static void init_zero() noexcept
C++ wrapper around shz_xmtrx_init_zero().
static vec3 get_translation() noexcept
C++ wrapper around shz_xmtrx_set_translation().
static void invert() noexcept
C++ wrapper around shz_xmtrx_invert().
static void load(const shz_mat3x4_t &mat) noexcept
C++ wrapper around shz_xmtrx_load_3x4().
static void apply_transpose(const shz_mat3x4_t &mat) noexcept
C++ wrapper around shz_xmtrx_apply_transpose_3x4().
static void store(shz_mat2x2_t *mat) noexcept
C++ wrapper around shz_xmtrx_store_2x2().
static void store(shz_mat3x3_t *mat) noexcept
C++ wrapper around shz_xmtrx_store_3x3().
static void init_rotation(float angle, float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_init_rotation().
static void load_rows(const shz_vec4_t &r1, const shz_vec4_t &r2, const shz_vec4_t &r3, const shz_vec4_t &r4) noexcept
C++ wrapper around shz_xmtrx_load_rows_4x4().
static void apply(const std::array< float, 16 > &array) noexcept
C++ wrapper around shz_xmtrx_apply_unaligned_4x4().
static void load_apply_store(float out[16], const float matrix1[16], const float matrix2[16]) noexcept
C++ wrapper around shz_xmtrx_load_apply_store_unaligned_4x4().
static void write_col(unsigned int index, const vec4 &vector) noexcept
C++ wrapper around shz_xmtrx_write_col().
Definition shz_xmtrx.hpp:90
static void write(reg xf, float value) noexcept
C++ wrapper around shz_xmtrx_write().
Definition shz_xmtrx.hpp:70
static void init_rotation_zyx(float z, float y, float x) noexcept
C++ wrapper around shz_xmtrx_init_rotation_zyx().
static void store_transpose(float cArray[16]) noexcept
C++ wrapper around shz_xmtrx_store_transpose_unaligned_4x4().
static vec2 transform_point(const vec2 &pt) noexcept
C++ wrapper around shz_xmtrx_transform_point2().
static void rotate(float radians, const vec3 &axis) noexcept
C++ wrapper around shz_xmtrx_rotate().
static void init_outer_product(const vec4 &a, const vec4 &b) noexcept
C++ wrapper around shz_xmtrx_init_outer_product().
static void load_transpose(const shz_mat3x3_t &mat) noexcept
C++ wrapper around shz_xmtrx_load_transpose_3x3().
reg
FP back-bank registers comprising XMTRX.
Definition shz_xmtrx.hpp:37
@ XF9
FP register XF9.
Definition shz_xmtrx.hpp:47
@ XF11
FP register XF11.
Definition shz_xmtrx.hpp:49
@ XF10
FP register XF10.
Definition shz_xmtrx.hpp:48
@ XF4
FP register XF4.
Definition shz_xmtrx.hpp:42
@ XF15
FP register XF15.
Definition shz_xmtrx.hpp:53
@ XF7
FP register XF7.
Definition shz_xmtrx.hpp:45
@ XF13
FP register XF13.
Definition shz_xmtrx.hpp:51
@ XF0
FP register XF0.
Definition shz_xmtrx.hpp:38
@ XF8
FP register XF8.
Definition shz_xmtrx.hpp:46
@ XF1
FP register XF1.
Definition shz_xmtrx.hpp:39
@ XF12
FP register XF12.
Definition shz_xmtrx.hpp:50
@ XF6
FP register XF6.
Definition shz_xmtrx.hpp:44
@ XF3
FP register XF3.
Definition shz_xmtrx.hpp:41
@ XF14
FP register XF14.
Definition shz_xmtrx.hpp:52
@ XF5
FP register XF5.
Definition shz_xmtrx.hpp:43
@ XF2
FP register XF2.
Definition shz_xmtrx.hpp:40
static void store_transpose(shz_mat4x4_t *mat) noexcept
C++ wrapper around shz_xmtrx_store_transpose_4x4().
static void load_transpose(const shz_mat3x4_t &mat) noexcept
C++ wrapper around shz_xmtrx_load_transpose_3x4().
static void apply_transpose(const std::array< float, 16 > &array) noexcept
C++ wrapper around shz_xmtrx_apply_transpose_unaligned_4x4().
static void apply_translation(const vec3 &v) noexcept
C++ wrapper around shz_xmtrx_apply_translation().
static void translate(vec3 v) noexcept
C++ wrapper around shz_xmtrx_translate().
static void apply_store(float out[16], const float in[16]) noexcept
C++ wrapper around shz_xmtrx_apply_store_unaligned_4x4().
static void apply_transpose(const shz_mat3x3_t &mat) noexcept
C++ wrapper around shz_xmtrx_apply_transpose_3x3().
static void apply_reverse(const shz_mat3x4_t &mat) noexcept
C++ wrapper around shz_xmtrx_apply_reverse_3x4().
static void init_rotation_dir(float angle, const vec3 &dir) noexcept
C++ wrapper around shz_xmtrx_init_rotation_axis_angle().
static void load_cols(const shz_vec3_t &c1, const shz_vec3_t &c2, const shz_vec3_t &c3, const shz_vec3_t &c4) noexcept
C++ wrapper around shz_xmtrx_load_cols_3x4().
static void swap_cols(unsigned int index1, unsigned int index2) noexcept
C++ wrapper around shz_xmtrx_swap_cols().
static void rotate_zyx(float z, float y, float x) noexcept
C++ wrapper around shz_xmtrx_rotate_zyx().
static void store(shz_mat3x4_t *mat) noexcept
C++ wrapper around shz_xmtrx_store_3x4().
static void load_transpose(const float cArray[16]) noexcept
C++ wrapper around shz_xmtrx_load_transpose_unaligned_4x4().
static void store(shz_mat4x4_t *mat) noexcept
C++ wrapper around shz_xmtrx_store_4x4().
static void write_row(unsigned int index, const vec4 &vector) noexcept
C++ wrapper around shz_xmtrx_write_row().
Definition shz_xmtrx.hpp:85
static void init_fill(float value) noexcept
C++ wrapper around shz_xmtrx_init_fill().
static void apply_permutation_yzwx() noexcept
C++ wrapper around shz_xmtrx_apply_permutation_yzwx().
static void init_identity_safe() noexcept
C++ wrapper around shz_xmtrx_init_identity_safe().
static void init_rotation_z(float z) noexcept
C++ wrapper around shz_xmtrx_init_rotation_z().
static void rotate_z(float radians) noexcept
C++ wrapper around shz_xmtrx_rotate_x().
static void init_screen(float width, float height) noexcept
C++ wrapper around shz_xmtrx_init_screen().
static void load(const std::array< float, 16 > &array) noexcept
C++ wrapper around shz_xmtrx_load_unaligned_4x4().
static void scale_reverse(const shz::vec3 &size) noexcept
Pre-multiplies and accumulatse XMTRX onto the 3D scaling matrix with the given size vector.
static void store(float cArray[16]) noexcept
C++ wrapper around shz_xmtrx_store_unaligned_4x4().
static void apply(const shz_mat3x3_t &mat) noexcept
C++ wrapper around shz_xmtrx_apply_3x3().
static void load_rows(const shz_vec4_t &r1, const shz_vec4_t &r2, const shz_vec4_t &r3) noexcept
C++ wrapper around shz_xmtrx_load_rows_3x4().
static void init_permutation_wxyz() noexcept
C++ wrapper around shz_xmtrx_init_permutation_wxyz().
static void init_rotation_y(float y) noexcept
C++ wrapper around shz_xmtrx_init_rotation_y().
static void load_apply_store(shz_mat4x4_t *dst, const shz_mat4x4_t &mat1, const shz_mat4x4_t &mat2) noexcept
C++ wrapper around shz_xmtrx_load_apply_store_4x4().
static void blend(const shz_mat4x4_t &joint_matrix, float weight) noexcept
Adds and accumulates a scaled 4x4 matrix onto XMTRX.
static void set_translation(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_set_translation().
static void apply_reverse(const std::array< float, 16 > &array) noexcept
C++ wrapper around shz_xmtrx_apply_reverse_unaligned_4x4().
static void abs() noexcept
C++ wrapper around shz_xmtrx_abs().
static void store(std::array< float, 16 > *array) noexcept
C++ wrapper around shz_xmtrx_store_unaligned_4x4().
static void load(const shz_mat4x4_t &mat4) noexcept
C++ wrapper around shz_xmtrx_load_4x4().
static void init_one() noexcept
C++ wrapper around shz_xmtrx_init_one().
static void transpose() noexcept
C++ wrapper around shz_xmtrx_transpose().
static void init_translation(const vec3 &v) noexcept
C++ wrapper around shz_xmtrx_init_translation().
static void apply(const float cArray[16]) noexcept
C++ wrapper around shz_xmtrx_apply_unaligned_4x4().
static void init_permutation_yzwx() noexcept
C++ wrapper around shz_xmtrx_init_permutation_yzwx().
static void init_rotation_zxy(float z, float x, float y) noexcept
C++ wrapper around shz_xmtrx_init_rotation_zxy().
static void init_rotation_xyz(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_init_rotation_xyz().
static void load_wxyz(const shz_mat4x4_t &mat4) noexcept
C++ wrapper around shz_xmtrx_load_wxyz_4x4().
static void init_diagonal(float x, float y, float z, float w) noexcept
C++ wrapper around shz_xmtrx_init_diagonal().
static vec2 transform(const vec2 &in) noexcept
C++ wrapper around shz_xmtrx_transform_vec2().
static void translate_reverse(const shz::vec3 &pos) noexcept
Pre-multiplies and accumulates XMTRX onto the 3D translation matrix with the given translation vector...
static void add(const shz_mat4x4_t &mat) noexcept
C++ wrapper around shz_xmtrx_add_4x4().
static void rotate(float radians, float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_rotate().
static void apply_rotation_x(float x) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_x().
static void apply_rotation_zxy(float z, float x, float y) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_zxy().
static void set_translation(const vec3 &v) noexcept
C++ wrapper around shz_xmtrx_set_translation().
static void apply(const shz_mat4x4_t &mat4) noexcept
C++ wrapper around shz_xmtrx_apply_4x4().
static vec3 get_scale() noexcept
Returns the scaling components from the inner 3x3 matrix of XMTRX, as a 3D vector.
static void load(const float cArray[16]) noexcept
C++ wrapper around shz_xmtrx_load_unaligned_4x4().
static void apply_self() noexcept
C++ wrapper around shz_xmtrx_apply_self().
static void apply_rotation_zyx(float z, float y, float x) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_zyx().
static void scale(vec3 v) noexcept
C++ wrapper around shz_xmtrx_scale().
static void rotate_zxy(float z, float x, float y) noexcept
C++ wrapper around shz_xmtrx_rotate_zxy().
static void scale(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_scale().
static void apply_reverse(const shz_mat4x4_t &mat4) noexcept
C++ wrapper around shz_xmtrx_apply_reverse_4x4().
static void negate() noexcept
C++ wrapper around shz_xmtrx_negate().
static vec4 read_col(unsigned int index) noexcept
C++ wrapper around shz_xmtrx_read_col().
Definition shz_xmtrx.hpp:80
static void translate_reverse(float x, float y, float z) noexcept
Pre-multiplies and accumulates XMTRX onto the 3D translation matrix with the given components.
static void swap_rows(unsigned int index1, unsigned int index2) noexcept
C++ wrapper around shz_xmtrx_swap_rows().
Definition shz_xmtrx.hpp:95
static void load(const shz_mat3x3_t &mat) noexcept
C++ wrapper around shz_xmtrx_load_3x3().
static void store_transpose(shz_mat3x3_t *mat) noexcept
C++ wrapper around shz_xmtrx_store_transpose_3x3().
static void apply_store(shz_mat4x4_t *out, const shz_mat4x4_t &in) noexcept
C++ wrapper around shz_xmtrx_apply_store_4x4().
static void store_transpose(std::array< float, 16 > *array) noexcept
C++ wrapper around shz_xmtrx_store_transpose_unaligned_4x4().
static void scale_reverse(float x, float y, float z) noexcept
Pre-multiplies and accumulatse XMTRX onto the 3D scaling matrix with the given components.
static void init_diagonal(const vec4 &v) noexcept
C++ wrapper around shz_xmtrx_init_diagonal().
static void load_apply(const shz_mat3x4_t &mat1, const shz_mat3x4_t &mat2) noexcept
C++ wrapper around shz_xmtrx_load_apply_3x4().
static quat to_quat() noexcept
C++ wrapper around shz_xmtrx_to_quat().
static void load_apply_store(shz_mat3x3_t *dst, const shz_mat3x3_t &mat1, const shz_mat3x3_t &mat2) noexcept
C++ wrapper around shz_xmtrx_load_apply_store_3x3().
static void load_transpose(const shz_mat4x4_t &mat4) noexcept
C++ wrapper around shz_xmtrx_load_transpose_4x4().
static void init_perspective(float fov, float aspect, float znear) noexcept
C++ wrapper around shz_xmtrx_init_perspective().
static void init_rotation(float angle, const vec3 &axis) noexcept
C++ wrapper around shz_xmtrx_init_rotation().
static void apply_rotation_z(float z) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_z().
static void store_transpose(shz_mat3x4_t *mat) noexcept
C++ wrapper around shz_xmtrx_store_transpose_3x4().
static void init_ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept
C++ wrapper around shz_xmtrx_init_ortho().
static void init_frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept
C++ wrapper around shz_xmtrx_init_frustum().
static void init_rotation_quat(const quat &q) noexcept
C++ wrapper around shz_xmtrx_init_rotation_quat().
static void load_cols(const shz_vec4_t &c1, const shz_vec4_t &c2, const shz_vec4_t &c3, const shz_vec4_t &c4) noexcept
C++ wrapper around shz_xmtrx_load_cols_4x4().
static void init_upper_triangular(float col1, const vec2 &col2, const vec3 &col3, const vec4 &col4) noexcept
C++ wrapper around shz_xmtrx_init_upper_triangular().
static void init_rotation_x(float x) noexcept
C++ wrapper around shz_xmtrx_init_rotation_x().
static void sub(const shz_mat4x4_t &mat) noexcept
C++ wrapper around shz_xmtrx_sub_4x4().
static void apply_reverse(const float cArray[16]) noexcept
C++ wrapper around shz_xmtrx_apply_reverse_unaligned_4x4().
static void apply_rotation_yxz(float y, float x, float z) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_yxz().
static void init_permutation_wzyx() noexcept
C++ wrapper around shz_xmtrx_init_permutation_wzyx().
static void apply_reverse_transpose(const shz_mat3x4_t &mat) noexcept
C++ wrapper around shz_xmtrx_apply_reverse_transpose_3x4().
static void translate(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_translate().
static void init_rotation_yxz(float y, float x, float z) noexcept
C++ wrapper around shz_xmtrx_init_rotation_yxz().
static void init_identity() noexcept
C++ wrapper around shz_xmtrx_init_identity().
static void apply_ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept
C++ wrapper around shz_xmtrx_apply_ortho().
static void apply_rotation_xyz(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_init_rotation_xyz().
static vec3 transform_point(const vec3 &pt) noexcept
C++ wrapper around shz_xmtrx_transform_point3().
static void apply(const shz_mat3x4_t &mat) noexcept
C++ wrapper around shz_xmtrx_apply_3x4().
static void load_apply(const shz_mat4x4_t &mat1, const shz_mat4x4_t &mat2) noexcept
C++ wrapper around shz_xmtrx_load_apply_4x4().
static void rotate_xyz(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_rotate_xyz().
static void apply_permutation_wxyz() noexcept
C++ wrapper around shz_xmtrx_apply_permutation_wxyz().
static void apply_perspective(float fov, float aspect, float znear) noexcept
C++ wrapper around shz_xmtrx_apply_perspective().
static void apply_lookat(const vec3 &eye, const vec3 &center, const vec3 &up) noexcept
C++ wrapper around shz_xmtrx_apply_lookat().
static void init_lower_triangular(const vec4 &col1, const vec3 &col2, const vec2 &col3, float col4) noexcept
C++ wrapper around shz_xmtrx_init_lower_diagonal().
static void apply_permutation_wzyx() noexcept
C++ wrapper around shz_xmtrx_apply_permutation_wzyx().
static void rotate_yxz(float y, float x, float z) noexcept
C++ wrapper around shz_xmtrx_rotate_yxz().
static void apply_rotation_y(float y) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_y().
static vec4 transform(const vec4 &in) noexcept
C++ wrapper around shz_xmtrx_transform_vec4().
static void init_scale(const vec3 &v) noexcept
C++ wrapper around shz_xmtrx_init_scale().
static void apply_rotation_quat(const quat &q) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_quat().
static float determinant() noexcept
C++ wrapper around shz_xmtrx_determinant().
static void load(const shz_mat2x2_t &mat) noexcept
C++ wrapper around shz_xmtrx_load_2x2().
static vec3 transform(const vec3 &in) noexcept
C++ wrapper around shz_xmtrx_transform_vec3().
static void apply_frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept
C++ wrapper around shz_xmtrx_apply_frustum().
static void apply_reverse_transpose(const float cArray[16]) noexcept
C++ wrapper around shz_xmtrx_apply_reverse_transpose_unaligned_4x4().
static void apply_reverse_transpose(const shz_mat4x4_t &mat4) noexcept
C++ wrapper around shz_xmtrx_apply_reverse_transpose_4x4().
static void init_scale(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_init_scale().
static void apply_translation(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_apply_translation().
static void apply_scale(const vec3 &v) noexcept
C++ wrapper around shz_xmtrx_apply_scale().
static void apply_symmetric_skew(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_apply_symmetric_skew().
static void rotate_y(float radians) noexcept
C++ wrapper around shz_xmtrx_rotate_x().
static void apply_transpose(const float cArray[16]) noexcept
C++ wrapper around shz_xmtrx_apply_transpose_unaligned_4x4().
static void apply_scale(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_apply_scale().
static void set_scale(float x, float y, float z) noexcept
Sets only the inner 3x3 submatrix to be a 3D scale matrix with the given components.
static void apply_reverse_transpose(const std::array< float, 16 > &array) noexcept
C++ wrapper around shz_xmtrx_apply_reverse_transpose_unaligned_4x4().