SH4ZAM! 0.8.0
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_transpose_4x4().
127 SHZ_FORCE_INLINE static void load_transpose(const shz_mat4x4_t& mat4) noexcept {
129 }
130
131 //! C++ wrapper around shz_xmtrx_load_transpose_unaligned_4x4().
132 SHZ_FORCE_INLINE static void load_transpose(const float cArray[16]) noexcept {
134 }
135
136 //! C++ wrapper around shz_xmtrx_load_transpose_unaligned_4x4().
137 SHZ_FORCE_INLINE static void load_transpose(const std::array<float, 16>& array) noexcept {
138 load_transpose(array.data());
139 }
140
141 //! C++ wrapper around shz_xmtrx_load_wxyz_4x4().
142 SHZ_FORCE_INLINE static void load_wxyz(const shz_mat4x4_t& mat4) noexcept {
144 }
145
146 //! C++ wrapper around shz_xmtrx_load_cols_4x4().
147 SHZ_FORCE_INLINE static void load_cols(const shz_vec4_t& c1,
148 const shz_vec4_t& c2,
149 const shz_vec4_t& c3,
150 const shz_vec4_t& c4) noexcept {
151 shz_xmtrx_load_cols_4x4(&c1, &c2, &c3, &c4);
152 }
153
154 //! C++ wrapper around shz_xmtrx_load_rows_4x4().
155 SHZ_FORCE_INLINE static void load_rows(const shz_vec4_t& r1,
156 const shz_vec4_t& r2,
157 const shz_vec4_t& r3,
158 const shz_vec4_t& r4) noexcept {
159 shz_xmtrx_load_rows_4x4(&r1, &r2, &r3, &r4);
160 }
161
162 //! C++ wrapper around shz_xmtrx_load_3x4().
163 SHZ_FORCE_INLINE static void load(const shz_mat3x4_t& mat) noexcept {
165 }
166
167//! @}
168
169/*! \name Storing
170 \brief Routines for saving XMTRX contents to memory.
171 @{
172*/
173
174 //! C++ wrapper around shz_xmtrx_store_4x4().
175 SHZ_FORCE_INLINE static void store(shz_mat4x4_t* mat) noexcept {
177 }
178
179 //! C++ wrapper around shz_xmtrx_store_unaligned_4x4().
180 SHZ_FORCE_INLINE static void store(float cArray[16]) noexcept {
182 }
183
184 //! C++ wrapper around shz_xmtrx_store_unaligned_4x4().
185 SHZ_FORCE_INLINE static void store(std::array<float, 16>* array) noexcept {
187 }
188
189 //! C++ wrapper around shz_xmtrx_store_transpose_4x4().
190 SHZ_FORCE_INLINE static void store_transpose(shz_mat4x4_t* mat) noexcept {
192 }
193
194 //! C++ wrapper around shz_xmtrx_store_transpose_unaligned_4x4().
195 SHZ_FORCE_INLINE static void store_transpose(float cArray[16]) noexcept {
197 }
198
199 //! C++ wrapper around shz_xmtrx_store_transpose_unaligned_4x4().
200 SHZ_FORCE_INLINE static void store_transpose(std::array<float, 16>* array) noexcept {
201 store_transpose(array->data());
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//! @}
210
211/*! \name Initialization
212 \brief Routines used to initialize the entirety of XMTRX.
213 @{
214*/
215
216 //! C++ wrapper around shz_xmtrx_init_identity().
217 SHZ_FORCE_INLINE static void init_identity() noexcept {
219 }
220
221 //! C++ wrapper around shz_xmtrx_init_identity_safe().
222 SHZ_DEPRECATED("Operation is always safe now. Use default version.")
223 SHZ_FORCE_INLINE static void init_identity_safe() noexcept {
225 }
226
227 //! C++ wrapper around shz_xmtrx_init_zero().
228 SHZ_FORCE_INLINE static void init_zero() noexcept {
230 }
231
232 //! C++ wrapper around shz_xmtrx_init_one().
233 SHZ_FORCE_INLINE static void init_one() noexcept {
235 }
236
237 //! C++ wrapper around shz_xmtrx_init_fill().
238 SHZ_FORCE_INLINE static void init_fill(float value) noexcept {
240 }
241
242 //! C++ wrapper around shz_xmtrx_init_translation().
243 SHZ_FORCE_INLINE static void init_translation(float x, float y, float z) noexcept {
245 }
246
247 //! C++ wrapper around shz_xmtrx_init_translation().
248 SHZ_FORCE_INLINE static void init_translation(const vec3& v) noexcept {
249 init_translation(v.x, v.y, v.z);
250 }
251
252 //! C++ wrapper around shz_xmtrx_init_scale().
253 SHZ_FORCE_INLINE static void init_scale(float x, float y, float z) noexcept {
255 }
256
257 //! C++ wrapper around shz_xmtrx_init_scale().
258 SHZ_FORCE_INLINE static void init_scale(const vec3& v) noexcept {
259 init_scale(v.x, v.y, v.z);
260 }
261
262 //! C++ wrapper around shz_xmtrx_init_rotation_x().
263 SHZ_FORCE_INLINE static void init_rotation_x(float x) noexcept {
265 }
266
267 //! C++ wrapper around shz_xmtrx_init_rotation_y().
268 SHZ_FORCE_INLINE static void init_rotation_y(float y) noexcept {
270 }
271
272 //! C++ wrapper around shz_xmtrx_init_rotation_z().
273 SHZ_FORCE_INLINE static void init_rotation_z(float z) noexcept {
275 }
276
277 //! C++ wrapper around shz_xmtrx_init_rotation_xyz().
278 SHZ_FORCE_INLINE static void init_rotation_xyz(float x, float y, float z) noexcept {
280 }
281
282 //! C++ wrapper around shz_xmtrx_init_rotation_zyx().
283 SHZ_FORCE_INLINE static void init_rotation_zyx(float z, float y, float x) noexcept {
285 }
286
287 //! C++ wrapper around shz_xmtrx_init_rotation_zxy().
288 SHZ_FORCE_INLINE static void init_rotation_zxy(float z, float x, float y) noexcept {
290 }
291
292 //! C++ wrapper around shz_xmtrx_init_rotation_yxz().
293 SHZ_FORCE_INLINE static void init_rotation_yxz(float y, float x, float z) noexcept {
295 }
296
297 //! C++ wrapper around shz_xmtrx_init_rotation().
298 SHZ_FORCE_INLINE static void init_rotation(float angle, float x, float y, float z) noexcept {
300 }
301
302 //! C++ wrapper around shz_xmtrx_init_rotation().
303 SHZ_FORCE_INLINE static void init_rotation(float angle, const vec3& axis) noexcept {
304 init_rotation(angle, axis.x, axis.y, axis.z);
305 }
306
307 //! C++ wrapper around shz_xmtrx_init_rotation_axis_angle().
308 SHZ_FORCE_INLINE static void init_rotation_dir(float angle, const vec3& dir) noexcept {
309 shz_xmtrx_init_rotation_dir(angle, dir.x, dir.y, dir.z);
310 }
311
312 //! C++ wrapper around shz_xmtrx_init_diagonal().
313 SHZ_FORCE_INLINE static void init_diagonal(float x, float y, float z, float w) noexcept {
315 }
316
317 //! C++ wrapper around shz_xmtrx_init_diagonal().
318 SHZ_FORCE_INLINE static void init_diagonal(const vec4& v) noexcept {
319 init_diagonal(v.x, v.y, v.z, v.w);
320 }
321
322 //! C++ wrapper around shz_xmtrx_init_upper_triangular().
323 SHZ_FORCE_INLINE static void init_upper_triangular(float col1, const vec2& col2, const vec3& col3, const vec4& col4) noexcept {
324 shz_xmtrx_init_upper_triangular(col1, col2, col3, col4);
325 }
326
327 //! C++ wrapper around shz_xmtrx_init_lower_diagonal().
328 SHZ_FORCE_INLINE static void init_lower_triangular(const vec4& col1, const vec3& col2, const vec2& col3, float col4) noexcept {
329 shz_xmtrx_init_lower_triangular(col1, col2, col3, col4);
330 }
331
332 //! C++ wrapper around shz_xmtrx_init_symmetric_skew().
333 SHZ_FORCE_INLINE static void init_symmetric_skew(float x, float y, float z) noexcept {
335 }
336
337 //! C++ wrapper around shz_xmtrx_init_outer_product().
338 SHZ_FORCE_INLINE static void init_outer_product(const vec4& a, const vec4& b) noexcept {
339 shz_xmtrx_init_outer_product(a, b);
340 }
341
342 //! C++ wrapper around shz_xmtrx_init_screen().
343 SHZ_FORCE_INLINE static void init_screen(float width, float height) noexcept {
344 shz_xmtrx_init_screen(width, height);
345 }
346
347 //! C++ wrapper around shz_xmtrx_init_lookat().
348 SHZ_FORCE_INLINE static void init_lookat(const vec3& eye, const vec3& center, const vec3& up) noexcept {
349 shz_xmtrx_init_lookat(eye, center, up);
350 }
351
352 //! C++ wrapper around shz_xmtrx_init_ortho().
353 SHZ_FORCE_INLINE static void init_ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept {
354 shz_xmtrx_init_ortho(left, right, bottom, top, znear, zfar);
355 }
356
357 //! C++ wrapper around shz_xmtrx_init_frustum().
358 SHZ_FORCE_INLINE static void init_frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept {
359 shz_xmtrx_init_frustum(left, right, bottom, top, znear, zfar);
360 }
361
362 //! C++ wrapper around shz_xmtrx_init_perspective().
363 SHZ_FORCE_INLINE static void init_perspective(float fov, float aspect, float znear) noexcept {
364 shz_xmtrx_init_perspective(fov, aspect, znear);
365 }
366
367 //! C++ wrapper around shz_xmtrx_init_rotation_quat().
368 SHZ_FORCE_INLINE static void init_rotation_quat(const quat& q) noexcept {
370 }
371
372 //! C++ wrapper around shz_xmtrx_init_permutation_wxyz().
373 SHZ_FORCE_INLINE static void init_permutation_wxyz() noexcept {
375 }
376
377 //! C++ wrapper around shz_xmtrx_init_permutation_yzwx().
378 SHZ_FORCE_INLINE static void init_permutation_yzwx() noexcept {
380 }
381
382 //! C++ wrapper around shz_xmtrx_init_permutation_wzyx().
383 SHZ_FORCE_INLINE static void init_permutation_wzyx() noexcept {
385 }
386
387//! @}
388
389/*! \name Apply Operation
390 \brief Updates only relevant values of XMTRX based on the given transform.
391 @{
392*/
393
394 //! C++ wrapper around shz_xmtrx_apply_4x4().
395 SHZ_FORCE_INLINE static void apply(const shz_mat4x4_t& mat4) noexcept {
397 }
398
399 //! C++ wrapper around shz_xmtrx_apply_unaligned_4x4().
400 SHZ_FORCE_INLINE static void apply(const float cArray[16]) noexcept {
402 }
403
404 //! C++ wrapper around shz_xmtrx_apply_unaligned_4x4().
405 SHZ_FORCE_INLINE static void apply(const std::array<float, 16>& array) noexcept {
407 }
408
409 //! C++ wrapper around shz_xmtrx_apply_transpose_4x4().
410 SHZ_FORCE_INLINE static void apply_transpose(const shz_mat4x4_t& mat4) noexcept {
412 }
413
414 //! C++ wrapper around shz_xmtrx_apply_transpose_unaligned_4x4().
415 SHZ_FORCE_INLINE static void apply_transpose(const float cArray[16]) noexcept {
417 }
418
419 //! C++ wrapper around shz_xmtrx_apply_transpose_unaligned_4x4().
420 SHZ_FORCE_INLINE static void apply_transpose(const std::array<float, 16>& array) noexcept {
422 }
423
424 //! C++ wrapper around shz_xmtrx_apply_reverse_4x4().
425 SHZ_FORCE_INLINE static void apply_reverse(const shz_mat4x4_t& mat4) noexcept {
427 }
428
429 //! C++ wrapper around shz_xmtrx_apply_reverse_unaligned_4x4().
430 SHZ_FORCE_INLINE static void apply_reverse(const float cArray[16]) noexcept {
432 }
433
434 //! C++ wrapper around shz_xmtrx_apply_reverse_unaligned_4x4().
435 SHZ_FORCE_INLINE static void apply_reverse(const std::array<float, 16>& array) noexcept {
437 }
438
439 //! C++ wrapper around shz_xmtrx_apply_reverse_transpose_4x4().
440 SHZ_FORCE_INLINE static void apply_reverse_transpose(const shz_mat4x4_t& mat4) noexcept {
442 }
443
444 //! C++ wrapper around shz_xmtrx_apply_reverse_transpose_unaligned_4x4().
445 SHZ_FORCE_INLINE static void apply_reverse_transpose(const float cArray[16]) noexcept {
447 }
448
449 //! C++ wrapper around shz_xmtrx_apply_reverse_transpose_unaligned_4x4().
450 SHZ_FORCE_INLINE static void apply_reverse_transpose(const std::array<float, 16>& array) noexcept {
452 }
453
454 //! C++ wrapper around shz_xmtrx_apply_3x4().
455 SHZ_FORCE_INLINE static void apply(const shz_mat3x4_t& mat) noexcept {
457 }
458
459 //! C++ wrapper around shz_xmtrx_apply_translation().
460 SHZ_FORCE_INLINE static void apply_translation(float x, float y, float z) noexcept {
462 }
463
464 //! C++ wrapper around shz_xmtrx_apply_translation().
465 SHZ_FORCE_INLINE static void apply_translation(const vec3& v) noexcept {
466 apply_translation(v.x, v.y, v.z);
467 }
468
469 //! C++ wrapper around shz_xmtrx_apply_scale().
470 SHZ_FORCE_INLINE static void apply_scale(float x, float y, float z) noexcept {
472 }
473
474 //! C++ wrapper around shz_xmtrx_apply_scale().
475 SHZ_FORCE_INLINE static void apply_scale(const vec3& v) noexcept {
476 apply_scale(v.x, v.y, v.z);
477 }
478
479 //! C++ wrapper around shz_xmtrx_apply_rotation_x().
480 SHZ_FORCE_INLINE static void apply_rotation_x(float x) noexcept {
482 }
483
484 //! C++ wrapper around shz_xmtrx_apply_rotation_y().
485 SHZ_FORCE_INLINE static void apply_rotation_y(float y) noexcept {
487 }
488
489 //! C++ wrapper around shz_xmtrx_apply_rotation_z().
490 SHZ_FORCE_INLINE static void apply_rotation_z(float z) noexcept {
492 }
493
494 //! C++ wrapper around shz_xmtrx_init_rotation_xyz().
495 SHZ_FORCE_INLINE static void apply_rotation_xyz(float x, float y, float z) noexcept {
497 }
498
499 //! C++ wrapper around shz_xmtrx_apply_rotation_zyx().
500 SHZ_FORCE_INLINE static void apply_rotation_zyx(float z, float y, float x) noexcept {
502 }
503
504 //! C++ wrapper around shz_xmtrx_apply_rotation_zxy().
505 SHZ_FORCE_INLINE static void apply_rotation_zxy(float z, float x, float y) noexcept {
507 }
508
509 //! C++ wrapper around shz_xmtrx_apply_rotation_yxz().
510 SHZ_FORCE_INLINE static void apply_rotation_yxz(float y, float x, float z) noexcept {
512 }
513
514 // C++ wrapper around shz_xmtrx_apply_rotation().
515 SHZ_FORCE_INLINE static void apply_rotation(float angle, float x, float y, float z) noexcept {
517 }
518
519 // C++ wrapper around shz_xmtrx_apply_rotation().
520 SHZ_FORCE_INLINE static void apply_rotation(float angle, const vec3& axis) noexcept {
521 apply_rotation(angle, axis.x, axis.y, axis.z);
522 }
523
524 //! C++ wrapper around shz_xmtrx_apply_rotation_quat().
525 SHZ_FORCE_INLINE static void apply_rotation_quat(const quat& q) noexcept {
527 }
528
529 //! C++ wrapper around shz_xmtrx_apply_lookat().
530 SHZ_FORCE_INLINE static void apply_lookat(const vec3& eye, const vec3& center, const vec3& up) noexcept {
531 shz_xmtrx_apply_lookat(eye, center, up);
532 }
533
534 //! C++ wrapper around shz_xmtrx_apply_ortho().
535 SHZ_FORCE_INLINE static void apply_ortho(float left, float right, float bottom, float top, float znear, float zfar) noexcept {
536 shz_xmtrx_apply_ortho(left, right, bottom, top, znear, zfar);
537 }
538
539 //! C++ wrapper around shz_xmtrx_apply_frustum().
540 SHZ_FORCE_INLINE static void apply_frustum(float left, float right, float bottom, float top, float znear, float zfar) noexcept {
541 shz_xmtrx_apply_frustum(left, right, bottom, top, znear, zfar);
542 }
543
544 //! C++ wrapper around shz_xmtrx_apply_perspective().
545 SHZ_FORCE_INLINE static void apply_perspective(float fov, float aspect, float znear) noexcept {
546 shz_xmtrx_apply_perspective(fov, aspect, znear);
547 }
548
549 //! C++ wrapper around shz_xmtrx_apply_symmetric_skew().
550 SHZ_FORCE_INLINE static void apply_symmetric_skew(float x, float y, float z) noexcept {
552 }
553
554 //! C++ wrapper around shz_xmtrx_apply_screen().
555 SHZ_FORCE_INLINE static void apply_screen(float width, float height) noexcept {
556 shz_xmtrx_apply_screen(width, height);
557 }
558
559 //! C++ wrapper around shz_xmtrx_apply_permutation_wxyz().
560 SHZ_FORCE_INLINE static void apply_permutation_wxyz() noexcept {
562 }
563
564 //! C++ wrapper around shz_xmtrx_apply_permutation_yzwx().
565 SHZ_FORCE_INLINE static void apply_permutation_yzwx() noexcept {
567 }
568
569 //! C++ wrapper around shz_xmtrx_apply_permutation_wzyx().
570 SHZ_FORCE_INLINE static void apply_permutation_wzyx() noexcept {
572 }
573
574 //! C++ wrapper around shz_xmtrx_apply_self().
575 SHZ_FORCE_INLINE static void apply_self() noexcept {
577 }
578
579//! @}
580
581/*! \name OpenGL Operations
582 \brief OpenGL-style matrix transformation operations.
583 @{
584*/
585
586 //! C++ wrapper around shz_xmtrx_translate().
587 SHZ_FORCE_INLINE static void translate(float x, float y, float z) noexcept {
589 }
590
591 //! C++ wrapper around shz_xmtrx_translate().
592 SHZ_FORCE_INLINE static void translate(vec3 v) noexcept {
593 translate(v.x, v.y, v.z);
594 }
595
596 //! C++ wrapper around shz_xmtrx_scale().
597 SHZ_FORCE_INLINE static void scale(float x, float y, float z) noexcept {
599 }
600
601 //! C++ wrapper around shz_xmtrx_scale().
602 SHZ_FORCE_INLINE static void scale(vec3 v) noexcept {
603 scale(v.x, v.y, v.z);
604 }
605
606 //! C++ wrapper around shz_xmtrx_rotate_x().
607 SHZ_FORCE_INLINE static void rotate_x(float radians) noexcept {
609 }
610
611 //! C++ wrapper around shz_xmtrx_rotate_x().
612 SHZ_FORCE_INLINE static void rotate_y(float radians) noexcept {
614 }
615
616 //! C++ wrapper around shz_xmtrx_rotate_x().
617 SHZ_FORCE_INLINE static void rotate_z(float radians) noexcept {
619 }
620
621 //! C++ wrapper around shz_xmtrx_rotate_xyz().
622 SHZ_FORCE_INLINE static void rotate_xyz(float x, float y, float z) noexcept {
624 }
625
626 //! C++ wrapper around shz_xmtrx_rotate_zyx().
627 SHZ_FORCE_INLINE static void rotate_zyx(float z, float y, float x) noexcept {
629 }
630
631 //! C++ wrapper around shz_xmtrx_rotate_zxy().
632 SHZ_FORCE_INLINE static void rotate_zxy(float z, float x, float y) noexcept {
634 }
635
636 //! C++ wrapper around shz_xmtrx_rotate_yxz().
637 SHZ_FORCE_INLINE static void rotate_yxz(float y, float x, float z) noexcept {
639 }
640
641 //! C++ wrapper around shz_xmtrx_rotate().
642 SHZ_FORCE_INLINE static void rotate(float radians, float x, float y, float z) noexcept {
643 shz_xmtrx_rotate(radians, x, y, z);
644 }
645
646 //! C++ wrapper around shz_xmtrx_rotate().
647 SHZ_FORCE_INLINE static void rotate(float radians, const vec3& axis) noexcept {
648 rotate(radians, axis.x, axis.y, axis.z);
649 }
650
651/*! \name Reverse GL Transformations
652 \brief Pre-multiplication variants of OpenGL-style 4x4 matrix transforms.
653 @{
654*/
655 //! Pre-multiplies and accumulates XMTRX onto the 3D translation matrix with the given components.
656 SHZ_FORCE_INLINE static void translate_reverse(float x, float y, float z) noexcept {
658 }
659
660 //! Pre-multiplies and accumulates XMTRX onto the 3D translation matrix with the given translation vector.
661 SHZ_FORCE_INLINE static void translate_reverse(const shz::vec3& pos) noexcept {
662 translate_reverse(pos.x, pos.y, pos.z);
663 }
664
665 //! Pre-multiplies and accumulatse XMTRX onto the 3D scaling matrix with the given components.
666 SHZ_FORCE_INLINE static void scale_reverse(float x, float y, float z) noexcept {
668 }
669
670 //! Pre-multiplies and accumulatse XMTRX onto the 3D scaling matrix with the given size vector.
671 SHZ_FORCE_INLINE static void scale_reverse(const shz::vec3& size) noexcept {
672 scale_reverse(size.x, size.y, size.z);
673 }
674
675//! @}
676
677/*! \name Compound Operations
678 \brief Multiple operations combined into one pipelined transaction.
679 @{
680*/
681
682 //! C++ wrapper around shz_xmtrx_load_apply_4x4().
683 SHZ_FORCE_INLINE static void load_apply(const shz_mat4x4_t& mat1, const shz_mat4x4_t& mat2) noexcept {
685 }
686
687 //! C++ wrapper around shz_xmtrx_load_apply_unaligned_4x4().
688 SHZ_FORCE_INLINE static void load_apply(const float matrix1[16], const float matrix2[16]) noexcept {
690 }
691
692 //! C++ wrapper around shz_xmtrx_apply_store_4x4().
693 SHZ_FORCE_INLINE static void apply_store(shz_mat4x4_t* out, const shz_mat4x4_t& in) noexcept {
695 }
696
697 //! C++ wrapper around shz_xmtrx_apply_store_unaligned_4x4().
698 SHZ_FORCE_INLINE static void apply_store(float out[16], const float in[16]) noexcept {
700 }
701
702 //! C++ wrapper around shz_xmtrx_load_apply_store_4x4().
703 SHZ_FORCE_INLINE static void load_apply_store(shz_mat4x4_t* dst, const shz_mat4x4_t& mat1, const shz_mat4x4_t& mat2) noexcept {
705 }
706
707 //! C++ wrapper around shz_xmtrx_load_apply_store_unaligned_4x4().
708 SHZ_FORCE_INLINE static void load_apply_store(float out[16], const float matrix1[16], const float matrix2[16]) noexcept {
710 }
711
712 //! C++ wrapper around shz_xmtrx_load_apply_store_3x4().
713 SHZ_FORCE_INLINE static void load_apply_store(shz_mat3x4_t* dst, const shz_mat3x4_t& mat1, const shz_mat3x4_t& mat2) noexcept {
715 }
716
717 //! C++ wrapper around shz_xmtrx_load_apply_store_3x3().
718 SHZ_FORCE_INLINE static void load_apply_store(shz_mat3x3_t* dst, const shz_mat3x3_t& mat1, const shz_mat3x3_t& mat2) noexcept {
720 }
721
722//! @}
723
724/*! \name Transformations
725 \brief Transforming vectors and points against XMTRX.
726 @{
727*/
728
729 //! C++ wrapper around shz_xmtrx_transform_vec4().
730 SHZ_FORCE_INLINE static vec4 transform(const vec4& in) noexcept {
731 return shz_xmtrx_transform_vec4(in);
732 }
733
734 //! C++ wrapper around shz_xmtrx_transform_vec3().
735 SHZ_FORCE_INLINE static vec3 transform(const vec3& in) noexcept {
736 return shz_xmtrx_transform_vec3(in);
737 }
738
739 //! C++ wrapper around shz_xmtrx_transform_vec2().
740 SHZ_FORCE_INLINE static vec2 transform(const vec2& in) noexcept {
741 return shz_xmtrx_transform_vec2(in);
742 }
743
744 //! C++ wrapper around shz_xmtrx_transform_point3().
745 SHZ_FORCE_INLINE static vec3 transform_point(const vec3& pt) noexcept {
746 return shz_xmtrx_transform_point3(pt);
747 }
748
749 //! C++ wrapper around shz_xmtrx_transform_point2().
750 SHZ_FORCE_INLINE static vec2 transform_point(const vec2& pt) noexcept {
751 return shz_xmtrx_transform_point2(pt);
752 }
753
754//! @}
755
756/*! \name Setters
757 \brief Sets the values of related XMTRX components.
758 @{
759*/
760
761 //! C++ wrapper around shz_xmtrx_set_translation().
762 SHZ_FORCE_INLINE static void set_translation(float x, float y, float z) noexcept {
764 }
765
766 //! C++ wrapper around shz_xmtrx_set_translation().
767 SHZ_FORCE_INLINE static void set_translation(const vec3& v) noexcept {
768 set_translation(v.x, v.y, v.z);
769 }
770
771 //! Sets only the inner 3x3 submatrix to be a 3D scale matrix with the given components.
772 SHZ_FORCE_INLINE static void set_scale(float x, float y, float z) noexcept {
774 }
775
776 //! Sets only the inner 3x3 submatrix to be a 3D scale matrix with the given scale vector.
777 SHZ_FORCE_INLINE static void set_scale(const shz::vec3& size) noexcept {
778 set_scale(size.x, size.y, size.z);
779 }
780
781//! @}
782
783/*! \name Getters
784 \brief Gets the values of related XMTRX components.
785 @{
786*/
787
788 //! C++ wrapper around shz_xmtrx_set_translation().
789 SHZ_FORCE_INLINE static vec3 get_translation() noexcept {
791 }
792
793 /*! Returns the scaling components from the inner 3x3 matrix of XMTRX, as a 3D vector.
794
795 \warning This routine assumes XMTRX is a standard TRS-style transform matrix,
796 without shearing or reflection.
797 */
798 SHZ_FORCE_INLINE static vec3 get_scale() noexcept {
800 }
801
802//! @}
803
804/*! \name Miscellaneous
805 \brief Random operations and conversions on XMTRX.
806 @{
807*/
808
809 //! C++ wrapper around shz_xmtrx_add_4x4().
810 SHZ_FORCE_INLINE static void add(const shz_mat4x4_t& mat) noexcept {
812 }
813
814 //! C++ wrapper around shz_xmtrx_sub_4x4().
815 SHZ_FORCE_INLINE static void sub(const shz_mat4x4_t& mat) noexcept {
817 }
818
819 //! C++ wrapper around shz_xmtrx_add_diagonal().
820 SHZ_FORCE_INLINE static void add_diagonal(float x, float y, float z, float w) noexcept {
822 }
823
824 //! C++ wrapper around shz_xmtrx_add_diagonal().
825 SHZ_FORCE_INLINE static void add_diagonal(const vec4& v) noexcept {
826 add_diagonal(v.x, v.y, v.z, v.w);
827 }
828
829 //! C++ wrapper around shz_xmtrx_add_symmetric_skew().
830 SHZ_FORCE_INLINE static void add_symmetric_skew(float x, float y, float z) noexcept {
832 }
833
834 //! C++ wrapper around shz_xmtrx_add_symmetric_skew().
835 SHZ_FORCE_INLINE static void add_symmetric_skew(const vec3& v) noexcept {
836 add_symmetric_skew(v.x, v.y, v.z);
837 }
838
839 //! C++ wrapper around shz_xmtrx_transpose().
840 SHZ_FORCE_INLINE static void transpose() noexcept {
842 }
843
844 //! C++ wrapper around shz_xmtrx_negate().
845 SHZ_FORCE_INLINE static void negate() noexcept {
847 }
848
849 //! C++ wrapper around shz_xmtrx_abs().
850 SHZ_FORCE_INLINE static void abs() noexcept {
852 }
853
854 //! C++ wrapper around shz_xmtrx_to_quat().
855 SHZ_FORCE_INLINE static quat to_quat() noexcept {
856 return shz_xmtrx_to_quat();
857 }
858
859 //! C++ wrapper around shz_xmtrx_determinant().
860 SHZ_FORCE_INLINE static float determinant() noexcept {
862 }
863
864 //! C++ wrapper around shz_xmtrx_invert().
865 SHZ_FORCE_INLINE static void invert() noexcept {
867 }
868
869 /*! Adds and accumulates a scaled 4x4 matrix onto XMTRX.
870
871 Each component of \p joint_matrix will be multiplied by \p weight, with the result
872 being added to the existing value of that component of XMTRX.
873
874 This is useful for accumulating weighted joint matrices onto an initially
875 zeroed-out XMTRX. This allows for in-place construction of a skin matrix, which can
876 then be directly used to transform the vertices of a mesh against for animation.
877
878 \sa shz_xmtrx_init_zero()
879 */
880 SHZ_FORCE_INLINE static void blend(const shz_mat4x4_t& joint_matrix, float weight) noexcept {
881 shz_xmtrx_blend(&joint_matrix, weight);
882 }
883
884//! @}
885
886};
887}
888
889#endif
Namespace enclosing the SH4ZAM C++ API.
Definition shz_cdefs.hpp:21
void shz_xmtrx_rotate_z(float radians) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by a 3D rotation matrix about the Z axis.
float shz_xmtrx_determinant(void) SHZ_NOEXCEPT
Returns the determinant of XMTRX.
void shz_xmtrx_blend(const shz_mat4x4_t *joint_matrix, float weight) SHZ_NOEXCEPT
Adds and accumulates a scaled 4x4 matrix onto XMTRX.
void shz_xmtrx_load_transpose_4x4(const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
Loads XMTRX with the transpose of the given 4x4 matrix.
void shz_xmtrx_load_apply_store_4x4(shz_mat4x4_t *out, const shz_mat4x4_t *matrix1, const shz_mat4x4_t *matrix2) SHZ_NOEXCEPT
Loads XMTRX with the 4x4 result of applying matrix2 onto matrix1, storing the result.
void shz_xmtrx_init_ortho(float left, float right, float bottom, float top, float znear, float zfar) SHZ_NOEXCEPT
Initializes XMTRX to an orthographic projection matrix, equivalent to glOrtho().
void shz_xmtrx_init_identity(void) SHZ_NOEXCEPT
Initializes XMTRX to the 4x4 identity matrix.
shz_quat_t shz_xmtrx_to_quat(void) SHZ_NOEXCEPT
Constructs a quaternion from the 3D rotation matrix within XMTRX.
void shz_xmtrx_apply_rotation_zxy(float zAngle, float xAngle, float yAngle) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by a 3D Z-X-Y rotation matrix, with the corresponding angles given i...
void shz_xmtrx_rotate_xyz(float xRadians, float yRadians, float zRadians) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by 3D rotation matrices about the X then Y then Z axes.
void shz_xmtrx_load_apply_store_3x4(shz_mat3x4_t *out, const shz_mat3x4_t *matrix1, const shz_mat3x4_t *matrix2) SHZ_NOEXCEPT
Loads XMTRX with the 3x4 result of applying matrix2 onto matrix1, storing the result.
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) SHZ_NOEXCEPT
Sets XMTRX equal to the 4x4 matrix created from the 4 given 4D row vectors.
void shz_xmtrx_init_fill(float value) SHZ_NOEXCEPT
Initializes XMTRX to contain the given value for each element.
void shz_xmtrx_apply_rotation_zyx(float zAngle, float yAngle, float xAngle) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by a 3D Z-Y-X rotation matrix, with the corresponding angles given i...
void shz_xmtrx_rotate_y(float radians) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by a 3D rotation matrix about the Y axis.
void shz_xmtrx_load_transpose_unaligned_4x4(const float matrix[16]) SHZ_NOEXCEPT
Loads XMTRX with the transpose of the 4x4 matrix created from the given unaligned array of 16 floats.
void shz_xmtrx_apply_rotation_y(float y) SHZ_NOEXCEPT
Transforms the values of the inner 3x3 matrix by a rotation matrix of y radians about the Y axis.
void shz_xmtrx_init_translation(float x, float y, float z) SHZ_NOEXCEPT
Initializes XMTRX to be a 3D translation matrix to the given coordinates.
void shz_xmtrx_rotate_zxy(float zRadians, float xRadians, float yRadians) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by 3D rotation matrices about the Z then X then Y axes.
void shz_xmtrx_apply_store_unaligned_4x4(float out[16], const float in[16]) SHZ_NOEXCEPT
Multiplies XMTRX by the unaligned matrix, in, storing the result within the unaligned matrix,...
void shz_xmtrx_apply_permutation_wzyx(void) SHZ_NOEXCEPT
Multiplies and accumulates a permutation matrix, which reorders the components of transformed vectors...
void shz_xmtrx_rotate_x(float radians) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by a 3D rotation matrix about the X axis.
void shz_xmtrx_init_rotation(float angle, float xAxis, float yAxis, float zAxis) SHZ_NOEXCEPT
Initializes XMTRX to a 3D rotation matrix of angle radians about the vector with the given components...
void shz_xmtrx_apply_reverse_4x4(const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX onto matrix, storing the result as XMTRX.
float shz_xmtrx_read(shz_xmtrx_reg_t xf) SHZ_NOEXCEPT
Returns the floating-point value held within the given XMTRX register.
void shz_xmtrx_load_wxyz_4x4(const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
Loads the given 4x4 matrix as XMTRX, with the 4th column for translation being loaded as the first co...
void shz_xmtrx_apply_screen(float width, float height) SHZ_NOEXCEPT
Multiplies and accumulates the viewport matrix created with the given components.
void shz_xmtrx_store_4x4(shz_mat4x4_t *matrix) SHZ_NOEXCEPT
Stores the current values held within XMTRX into the given 4x4 matrix.
void shz_xmtrx_load_4x4(const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
Loads the given 4x4 matrix as XMTRX.
void shz_xmtrx_apply_transpose_unaligned_4x4(const float matrix[16]) SHZ_NOEXCEPT
Multiplies and accumulates the transpose of the given 16-entry float array as a 4x4 matrix onto XMTRX...
void shz_xmtrx_set_translation(float x, float y, float z) SHZ_NOEXCEPT
Sets only the translational components of XMTRX to the given values.
@ 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_add_4x4(const shz_mat4x4_t *mat) SHZ_NOEXCEPT
Adds each element within mat to each element within XMTRX, storing the result in XMTRX.
void shz_xmtrx_init_permutation_wxyz(void) SHZ_NOEXCEPT
Initializes XMTRX to a permutation matrix, which reorders the components of transformed vectors to be...
void shz_xmtrx_invert(void) SHZ_NOEXCEPT
Inverts XMTRX in-place.
void shz_xmtrx_load_apply_4x4(const shz_mat4x4_t *matrix1, const shz_mat4x4_t *matrix2) SHZ_NOEXCEPT
Loads XMTRX with the result of applying matrix2 onto matrix1.
void shz_xmtrx_translate(float x, float y, float z) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by a 3D translation matrix with the given components (glTranslatef()...
shz_vec4_t shz_xmtrx_read_row(unsigned int index) SHZ_NOEXCEPT
Returns the values at the the given row index, as a 4D vector.
void shz_xmtrx_rotate_zyx(float zRadians, float yRadians, float xRadians) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by 3D rotation matrices about the Z then Y then X axes.
void shz_xmtrx_apply_permutation_yzwx(void) SHZ_NOEXCEPT
Multiplies and accumulates a permutation matrix, which reorders the components of transformed vectors...
void shz_xmtrx_init_rotation_z(float z) SHZ_NOEXCEPT
Initializes XMTRX to be a 3D rotation matrix by z radians about the Z axis.
void shz_xmtrx_set_scale(float x, float y, float z) SHZ_NOEXCEPT
Sets only the inner 3x3 submatrix of XMTRX to be a scaling matrix.
void shz_xmtrx_rotate_yxz(float yRadians, float xRadians, float zRadians) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by 3D rotation matrices about the Y then X then Z axes.
void shz_xmtrx_apply_ortho(float left, float right, float bottom, float top, float znear, float zfar) SHZ_NOEXCEPT
Applies a 2D orthographic projection matrix onto XMTRX, equivalent to glOrtho().
void shz_xmtrx_apply_3x4(const shz_mat3x4_t *matrix) SHZ_NOEXCEPT
Multiplies and accumulates the given 3x4 matrix onto XMTRX, not modifying other elements.
void shz_xmtrx_apply_translation(float x, float y, float z) SHZ_NOEXCEPT
Adds the values of the given 3 components to the 3D translation components of XMTRX.
void shz_xmtrx_apply_rotation(float angle, float x, float y, float z) SHZ_NOEXCEPT
Transforms the values of the inner 3x3 matrix by a rotation matrix of angle radians about the axis wi...
void shz_xmtrx_abs(void) SHZ_NOEXCEPT
Takes the absolute value of each element held within XMTRX.
void shz_xmtrx_apply_permutation_wxyz(void) SHZ_NOEXCEPT
Multiplies and accumulates a permutation matrix, which reorders the components of transformed vectors...
void shz_xmtrx_apply_frustum(float left, float right, float bottom, float top, float znear, float zfar) SHZ_NOEXCEPT
Applies a frustum projection matrix onto XMTRX, equivalent to glFrustum().
void shz_xmtrx_init_frustum(float left, float right, float bottom, float top, float znear, float zfar) SHZ_NOEXCEPT
Initializes XMTRX to a frustum projection matrix, equivalent to glFrustum().
void shz_xmtrx_apply_unaligned_4x4(const float matrix[16]) SHZ_NOEXCEPT
Multiplies and accumulates the given 16-entry float array as a 4x4 matrix onto XMTRX.
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) SHZ_NOEXCEPT
Sets XMTRX equal to the 4x4 matrix created from the 4 given 4D column vectors.
void shz_xmtrx_translate_reverse(float x, float y, float z) SHZ_NOEXCEPT
Pre-multiplies and accumulates XMTRX onto the 3D translation matrix with the given components.
void shz_xmtrx_store_transpose_4x4(shz_mat4x4_t *matrix) SHZ_NOEXCEPT
Stores the transpose of the current values held within XMTRX into the given 4x4 matrix.
void shz_xmtrx_apply_self(void) SHZ_NOEXCEPT
Multiplies and accumulatse the XMTRX matrix by itself, squaring it.
void shz_xmtrx_load_apply_unaligned_4x4(const float matrix1[16], const float matrix2[16]) SHZ_NOEXCEPT
Loads XMTRX with the result of applying unaligned matrix2 onto matrix1.
void shz_xmtrx_transpose(void) SHZ_NOEXCEPT
Transposes the elements within XMTRX, in-place.
void shz_xmtrx_apply_rotation_z(float z) SHZ_NOEXCEPT
Transforms the values of the inner 3x3 matrix by a rotation matrix of z radians about the Z axis.
void shz_xmtrx_load_unaligned_4x4(const float matrix[16]) SHZ_NOEXCEPT
Loads the given array of unaligned 16 float values as the 4x4 XMTRX matrix.
void shz_xmtrx_init_permutation_wzyx(void) SHZ_NOEXCEPT
Initializes XMTRX to a permutation matrix, which reorders the components of transformed vectors to be...
void shz_xmtrx_scale(float x, float y, float z) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by a 3D scaling matrix with the given components (glScalef() equival...
void shz_xmtrx_init_symmetric_skew(float x, float y, float z) SHZ_NOEXCEPT
Initializes XMTRX to be the 3D symmetric skew matrix formed from the given vector components.
void shz_xmtrx_load_3x4(const shz_mat3x4_t *matrix) SHZ_NOEXCEPT
Loads the given 3x4 matrix into XMTRX, initializing its remaining elements to identity.
void shz_xmtrx_apply_rotation_quat(shz_quat_t quat) SHZ_NOEXCEPT
Transforms the values of the inner 3x3 matrix by the rotation matrix represented by the given quatern...
void shz_xmtrx_store_unaligned_4x4(float matrix[16]) SHZ_NOEXCEPT
Stores the current values held within XMTRX into the given unaligned 16-float array.
void shz_xmtrx_init_rotation_quat(shz_quat_t q) SHZ_NOEXCEPT
Initializes XMTRX to a 3D rotation matrix with its orientation given by a quaternion.
void shz_xmtrx_apply_4x4(const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
Multiplies and accumulates the given 4x4 matrix onto XMTRX.
void shz_xmtrx_apply_rotation_yxz(float yAngle, float xAngle, float zAngle) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by a 3D Y-X-Z rotation matrix, with the corresponding angles given i...
void shz_xmtrx_init_rotation_x(float x) SHZ_NOEXCEPT
Initializes XMTRX to be a 3D rotation matrix by x radians about the X axis.
void shz_xmtrx_apply_perspective(float fov, float aspect, float znear) SHZ_NOEXCEPT
Multiplies and accumulates the perspective matrix constructed from the given values onto XMTRX.
void shz_xmtrx_init_scale(float x, float y, float z) SHZ_NOEXCEPT
Initializes XMTRX to be a 3D scale matrix with the given dimensions.
void shz_xmtrx_store_3x4(shz_mat3x4_t *matrix) SHZ_NOEXCEPT
Stores the top-left 3x4 values currently held within XMTRX into the given matrix.
void shz_xmtrx_init_diagonal(float x, float y, float z, float w) SHZ_NOEXCEPT
Initializes XMTRX to be a diagonal matrix with the given diagonal values.
void shz_xmtrx_write(shz_xmtrx_reg_t xf, float value) SHZ_NOEXCEPT
Sets the floating-point value held within the given XMTRX register to value.
void shz_xmtrx_load_apply_store_3x3(shz_mat3x3_t *out, const shz_mat3x3_t *matrix1, const shz_mat3x3_t *matrix2) SHZ_NOEXCEPT
Loads XMTRX with the 3x3 result of applying matrix2 onto matrix1, storing the result.
void shz_xmtrx_scale_reverse(float x, float y, float z) SHZ_NOEXCEPT
Pre-multiplies and accumulates XMTRX onto the 3D scaling matrix with the given components.
void shz_xmtrx_init_screen(float width, float height) SHZ_NOEXCEPT
Initializes XMTRX to the viewport matrix with the given dimensions.
void shz_xmtrx_sub_4x4(const shz_mat4x4_t *mat) SHZ_NOEXCEPT
Subtracts each element within mat from each element within XMTRX, storing the result in XMTRX.
void shz_xmtrx_swap_rows(unsigned int index1, unsigned int index2) SHZ_NOEXCEPT
Swaps the values of the rows with the given indices.
void shz_xmtrx_add_symmetric_skew(float x, float y, float z) SHZ_NOEXCEPT
Adds the values of a 3D symmetric skew matrix constructed from the given components to XMTRX.
void shz_xmtrx_store_transpose_unaligned_4x4(float matrix[16]) SHZ_NOEXCEPT
Stores the transpose of the the current values held within XMTRX into the given 16-element float arra...
void shz_xmtrx_apply_reverse_transpose_unaligned_4x4(const float matrix[16]) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX onto the transpose of the given float array as a 4x4 matrix,...
void shz_xmtrx_apply_rotation_x(float x) SHZ_NOEXCEPT
Transforms the values of the inner 3x3 matrix by a rotation matrix of x radians about the X axis.
void shz_xmtrx_apply_scale(float x, float y, float z) SHZ_NOEXCEPT
Multiplies the values of the inner 3x3 matrix by the given 3D scaling terms.
void shz_xmtrx_load_apply_store_unaligned_4x4(float out[16], const float matrix1[16], const float matrix2[16]) SHZ_NOEXCEPT
Loads XMTRX with the result of applying unaligned matrix2 onto unaligned matrix1, storing the result.
void shz_xmtrx_init_rotation_xyz(float xAngle, float yAngle, float zAngle) SHZ_NOEXCEPT
Initializes XMTRX to be a 3D X-Y-Z rotation matrix, with the corresponding angles given in radians.
void shz_xmtrx_add_diagonal(float x, float y, float z, float w) SHZ_NOEXCEPT
Adds the values of a 4D diagonal matrix constructed from the given components to XMTRX.
void shz_xmtrx_init_rotation_zyx(float zAngle, float yAngle, float xAngle) SHZ_NOEXCEPT
Initializes XMTRX to be a 3D Z-Y-X rotation matrix, with the corresponding angles given in radians.
shz_vec4_t shz_xmtrx_read_col(unsigned int index) SHZ_NOEXCEPT
Returns the values at the given column index, as a 4D vector.
shz_vec3_t shz_xmtrx_get_scale(void) SHZ_NOEXCEPT
Returns the scaling components from the inner 3x3 matrix of XMTRX, as a 3D vector.
void shz_xmtrx_apply_rotation_xyz(float xAngle, float yAngle, float zAngle) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by a 3D X-Y-Z rotation matrix, with the corresponding angles given i...
void shz_xmtrx_init_rotation_yxz(float yAngle, float xAngle, float zAngle) SHZ_NOEXCEPT
Initializes XMTRX to be a 3D Y-X-Z rotation matrix, with the corresponding angles given in radians.
void shz_xmtrx_init_zero(void) SHZ_NOEXCEPT
Initializes XMTRX to contain the value of 0.0f for each element.
void shz_xmtrx_apply_transpose_4x4(const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
Multiplies and accumulates the transpose of the given 4x4 matrix onto XMTRX.
void shz_xmtrx_negate(void) SHZ_NOEXCEPT
Negates each element held within XMTRX.
void shz_xmtrx_init_rotation_zxy(float zAngle, float xAngle, float yAngle) SHZ_NOEXCEPT
Initializes XMTRX to be a 3D Z-X-Y rotation matrix, with the corresponding angles given in radians.
void shz_xmtrx_init_permutation_yzwx(void) SHZ_NOEXCEPT
Initializes XMTRX to a permutation matrix, which reorders the components of transformed vectors to be...
void shz_xmtrx_apply_store_4x4(shz_mat4x4_t *out, const shz_mat4x4_t *in) SHZ_NOEXCEPT
Multiplies XMTRX by the matrix, in, storing the result within the matrix, out.
shz_vec3_t shz_xmtrx_get_translation(void) SHZ_NOEXCEPT
Returns the translational components from the last column of XMTRX, as a 3D vector.
void shz_xmtrx_apply_reverse_unaligned_4x4(const float matrix[16]) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX onto the given float array as a 4x4 matrix, storing the result as XM...
void shz_xmtrx_swap_cols(unsigned int index1, unsigned int index2) SHZ_NOEXCEPT
Swaps the values of the columns with the given indices.
void shz_xmtrx_apply_reverse_transpose_4x4(const shz_mat4x4_t *matrix) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX onto the transpose of matrix, storing the result as XMTRX.
void shz_xmtrx_apply_symmetric_skew(float x, float y, float z) SHZ_NOEXCEPT
Multiplies and accumulates the 3D symmetric skew matrix with the given components onto XMTRX.
void shz_xmtrx_init_one(void) SHZ_NOEXCEPT
Initializes XMTRX to contain the value of 1.0f for each element.
void shz_xmtrx_init_rotation_y(float y) SHZ_NOEXCEPT
Initializes XMTRX to be a 3D rotation matrix by y radians about the Y axis.
void shz_xmtrx_init_perspective(float fov, float aspect, float znear) SHZ_NOEXCEPT
Initializes XMTRX to a perspective projection matrix.
void shz_xmtrx_rotate(float radians, float xAxis, float yAxis, float zAxis) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by the 3D rotation matrix formed by the given axis and angle (glRota...
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 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().
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 add_diagonal(const vec4 &v) noexcept
C++ wrapper around shz_xmtrx_add_diagonal().
static void store_transpose(shz_mat4x4_t *mat) noexcept
C++ wrapper around shz_xmtrx_store_transpose_4x4().
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 init_rotation_dir(float angle, const vec3 &dir) noexcept
C++ wrapper around shz_xmtrx_init_rotation_axis_angle().
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 add_diagonal(float x, float y, float z, float w) noexcept
C++ wrapper around shz_xmtrx_add_diagonal().
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 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 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 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 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 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 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 add_symmetric_skew(const vec3 &v) noexcept
C++ wrapper around shz_xmtrx_add_symmetric_skew().
static void apply_scale(const vec3 &v) noexcept
C++ wrapper around shz_xmtrx_apply_scale().
static void add_symmetric_skew(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_add_symmetric_skew().
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().