SH4ZAM! 0.1.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 * - Fourier transforms
11 * - Arbitrarily-sized matrix routines
12 * - shz_rotate_quat()
13 *
14 * \author 2025, 2026 Falco Girgis
15 * \copyright MIT License
16 */
17
18#ifndef SHZ_XMTRX_HPP
19#define SHZ_XMTRX_HPP
20
21#include <array>
22
23#include "shz_xmtrx.h"
24#include "shz_vector.hpp"
25#include "shz_quat.hpp"
26
27namespace shz {
28
29/*! Static structure around the 4x4 XMTRX FP register back-bank.
30
31 This structure provides the C++ bindings to the XMTRX API as a series
32 of static member functions wrapping the C API.
33
34 \sa xmtrx
35*/
36struct xmtrx {
37
38 //! FP back-bank registers comprising XMTRX.
39 enum reg {
40 XF0 = SHZ_XMTRX_XF0, //!< FP register XF0
41 XF1 = SHZ_XMTRX_XF1, //!< FP register XF1
42 XF2 = SHZ_XMTRX_XF2, //!< FP register XF2
43 XF3 = SHZ_XMTRX_XF3, //!< FP register XF3
44 XF4 = SHZ_XMTRX_XF4, //!< FP register XF4
45 XF5 = SHZ_XMTRX_XF5, //!< FP register XF5
46 XF6 = SHZ_XMTRX_XF6, //!< FP register XF6
47 XF7 = SHZ_XMTRX_XF7, //!< FP register XF7
48 XF8 = SHZ_XMTRX_XF8, //!< FP register XF8
49 XF9 = SHZ_XMTRX_XF9, //!< FP register XF9
50 XF10 = SHZ_XMTRX_XF10, //!< FP register XF10
51 XF11 = SHZ_XMTRX_XF11, //!< FP register XF11
52 XF12 = SHZ_XMTRX_XF12, //!< FP register XF12
53 XF13 = SHZ_XMTRX_XF13, //!< FP register XF13
54 XF14 = SHZ_XMTRX_XF14, //!< FP register XF14
55 XF15 = SHZ_XMTRX_XF15 //!< FP register XF15
56 };
57
58 //! Non-POSIX style reg_t alias.
59 using reg_t = reg;
60
61/*! \name Accessors
62 \brief Setting and retrieving individual XMTRX register values.
63 @{
64*/
65
66 //! C++ wrapper around shz_xmtrx_read().
67 SHZ_FORCE_INLINE static float read(reg xf) noexcept {
68 return shz_xmtrx_read(static_cast<shz_xmtrx_reg>(xf));
69 }
70
71 //! C++ wrapper around shz_xmtrx_write().
72 SHZ_FORCE_INLINE static void write(reg xf, float value) noexcept {
73 shz_xmtrx_write(static_cast<shz_xmtrx_reg>(xf), value);
74 }
75
76 //! C++ wrapper around shz_xmtrx_read_row().
77 SHZ_FORCE_INLINE static vec4 read_row(unsigned int index) noexcept {
78 return shz_xmtrx_read_row(index);
79 }
80
81 //! C++ wrapper around shz_xmtrx_read_col().
82 SHZ_FORCE_INLINE static vec4 read_col(unsigned int index) noexcept {
83 return shz_xmtrx_read_col(index);
84 }
85
86 //! C++ wrapper around shz_xmtrx_write_row().
87 SHZ_FORCE_INLINE static void write_row(unsigned int index, vec4 vector) noexcept {
88 shz_xmtrx_write_row(index, vector);
89 }
90
91 //! C++ wrapper around shz_xmtrx_write_col().
92 SHZ_FORCE_INLINE static void write_col(unsigned int index, vec4 vector) noexcept {
93 shz_xmtrx_write_col(index, vector);
94 }
95
96 //! C++ wrapper around shz_xmtrx_swap_rows().
97 SHZ_FORCE_INLINE static void swap_rows(unsigned int index1, unsigned int index2) noexcept {
98 shz_xmtrx_swap_rows(index1, index2);
99 }
100
101 //! C++ wrapper around shz_xmtrx_swap_cols().
102 SHZ_FORCE_INLINE static void swap_cols(unsigned int index1, unsigned int index2) noexcept {
103 shz_xmtrx_swap_cols(index1, index2);
104 }
105
106//! @}
107
108/*! \name Loading
109 \brief Routines for loading XMTRX contents from memory.
110 @{
111*/
112
113 //! C++ wrapper around shz_xmtrx_load_4x4().
114 SHZ_FORCE_INLINE static void load(const shz_mat4x4_t& mat4) noexcept {
116 }
117
118 //! C++ wrapper around shz_xmtrx_load_unaligned_4x4().
119 SHZ_FORCE_INLINE static void load(const float cArray[16]) noexcept {
121 }
122
123 //! C++ wrapper around shz_xmtrx_load_unaligned_4x4().
124 SHZ_FORCE_INLINE static void load(std::array<float, 16> array) noexcept {
125 load(array.data());
126 }
127
128 //! C++ wrapper around shz_xmtrx_load_transpose_4x4().
129 SHZ_FORCE_INLINE static void load_transpose(const shz_mat4x4_t& mat4) noexcept {
131 }
132
133 //! C++ wrapper around shz_xmtrx_load_transpose_unaligned_4x4().
134 SHZ_FORCE_INLINE static void load_transpose(const float cArray[16]) noexcept {
136 }
137
138 //! C++ wrapper around shz_xmtrx_load_transpose_unaligned_4x4().
139 SHZ_FORCE_INLINE static void load_transpose(std::array<float, 16> array) noexcept {
140 load_transpose(array.data());
141 }
142
143 //! C++ wrapper around shz_xmtrx_load_wxyz_4x4().
144 SHZ_FORCE_INLINE static void load_wxyz(const shz_mat4x4_t& mat4) noexcept {
146 }
147
148 //! C++ wrapper around shz_xmtrx_load_cols_4x4().
149 SHZ_FORCE_INLINE static void load_cols(const shz_vec4_t& c1,
150 const shz_vec4_t& c2,
151 const shz_vec4_t& c3,
152 const shz_vec4_t& c4) noexcept {
153 shz_xmtrx_load_cols_4x4(&c1, &c2, &c3, &c4);
154 }
155
156 //! C++ wrapper around shz_xmtrx_load_rows_4x4().
157 SHZ_FORCE_INLINE static void load_rows(const shz_vec4_t& r1,
158 const shz_vec4_t& r2,
159 const shz_vec4_t& r3,
160 const shz_vec4_t& r4) noexcept {
161 shz_xmtrx_load_rows_4x4(&r1, &r2, &r3, &r4);
162 }
163
164 //! C++ wrapper around shz_xmtrx_load_3x4().
165 SHZ_FORCE_INLINE static void load(const shz_mat3x4_t& mat) noexcept {
167 }
168
169//! @}
170
171/*! \name Storing
172 \brief Routines for saving XMTRX contents to memory.
173 @{
174*/
175
176 //! C++ wrapper around shz_xmtrx_store_4x4().
177 SHZ_FORCE_INLINE static void store(shz_mat4x4_t* mat) noexcept {
179 }
180
181 //! C++ wrapper around shz_xmtrx_store_unaligned_4x4().
182 SHZ_FORCE_INLINE static void store(float cArray[16]) noexcept {
184 }
185
186 //! C++ wrapper around shz_xmtrx_store_unaligned_4x4().
187 SHZ_FORCE_INLINE static void store(std::array<float, 16>* array) noexcept {
189 }
190
191 //! C++ wrapper around shz_xmtrx_store_transpose_4x4().
192 SHZ_FORCE_INLINE static void store_transpose(shz_mat4x4_t* mat) noexcept {
194 }
195
196 //! C++ wrapper around shz_xmtrx_store_transpose_unaligned_4x4().
197 SHZ_FORCE_INLINE static void store_transpose(float cArray[16]) noexcept {
199 }
200
201 //! C++ wrapper around shz_xmtrx_store_transpose_unaligned_4x4().
202 SHZ_FORCE_INLINE static void store_transpose(std::array<float, 16>* array) noexcept {
203 store_transpose(array->data());
204 }
205
206 //! C++ wrapper around shz_xmtrx_store_3x4().
207 SHZ_FORCE_INLINE static void store(shz_mat3x4_t* mat) noexcept {
209 }
210
211//! @}
212
213/*! \name Initialization
214 \brief Routines used to initialize the entirety of XMTRX.
215 @{
216*/
217
218 //! C++ wrapper around shz_xmtrx_init_identity().
219 SHZ_FORCE_INLINE static void init_identity() noexcept {
221 }
222
223 //! C++ wrapper around shz_xmtrx_init_identity_safe().
224 SHZ_FORCE_INLINE static void init_identity_safe() noexcept {
226 }
227
228 //! C++ wrapper around shz_xmtrx_init_zero().
229 SHZ_FORCE_INLINE static void init_zero() noexcept {
231 }
232
233 //! C++ wrapper around shz_xmtrx_init_one().
234 SHZ_FORCE_INLINE static void init_one() noexcept {
236 }
237
238 //! C++ wrapper around shz_xmtrx_init_fill().
239 SHZ_FORCE_INLINE static void init_fill(float value) noexcept {
241 }
242
243 //! C++ wrapper around shz_xmtrx_init_translation().
244 SHZ_FORCE_INLINE static void init_translation(float x, float y, float z) noexcept {
246 }
247
248 //! C++ wrapper around shz_xmtrx_init_scale().
249 SHZ_FORCE_INLINE static void init_scale(float x, float y, float z) noexcept {
251 }
252
253 //! C++ wrapper around shz_xmtrx_init_rotation_x().
254 SHZ_FORCE_INLINE static void init_rotation_x(float x) noexcept {
256 }
257
258 //! C++ wrapper around shz_xmtrx_init_rotation_y().
259 SHZ_FORCE_INLINE static void init_rotation_y(float y) noexcept {
261 }
262
263 //! C++ wrapper around shz_xmtrx_init_rotation_z().
264 SHZ_FORCE_INLINE static void init_rotation_z(float z) noexcept {
266 }
267
268 //! C++ wrapper around shz_xmtrx_init_rotation_xyz().
269 SHZ_FORCE_INLINE static void init_rotation_xyz(float x, float y, float z) noexcept {
271 }
272
273 //! C++ wrapper around shz_xmtrx_init_rotation_zyx().
274 SHZ_FORCE_INLINE static void init_rotation_zyx(float z, float y, float x) noexcept {
276 }
277
278 //! C++ wrapper around shz_xmtrx_init_rotation_zxy().
279 SHZ_FORCE_INLINE static void init_rotation_zxy(float z, float x, float y) noexcept {
281 }
282
283 //! C++ wrapper around shz_xmtrx_init_rotation_yxz().
284 SHZ_FORCE_INLINE static void init_rotation_yxz(float y, float x, float z) noexcept {
286 }
287
288 //! C++ wrapper around shz_xmtrx_init_rotation().
289 SHZ_FORCE_INLINE static void init_rotation(float angle, float x, float y, float z) noexcept {
291 }
292
293 //! C++ wrapper around shz_xmtrx_init_diagonal().
294 SHZ_FORCE_INLINE static void init_diagonal(float x, float y, float z, float w) noexcept {
296 }
297
298 //! C++ wrapper around shz_xmtrx_init_upper_triangular().
299 SHZ_FORCE_INLINE static void init_upper_triangular(float col1, vec2 col2, vec3 col3, vec4 col4) noexcept {
300 shz_xmtrx_init_upper_triangular(col1, col2, col3, col4);
301 }
302
303 //! C++ wrapper around shz_xmtrx_init_lower_diagonal().
304 SHZ_FORCE_INLINE static void init_lower_triangular(vec4 col1, vec3 col2, vec2 col3, float col4) noexcept {
305 shz_xmtrx_init_lower_triangular(col1, col2, col3, col4);
306 }
307
308 //! C++ wrapper around shz_xmtrx_init_symmetric_skew().
309 SHZ_FORCE_INLINE static void init_symmetric_skew(float x, float y, float z) noexcept {
311 }
312
313 //! C++ wrapper around shz_xmtrx_init_outer_product().
314 SHZ_FORCE_INLINE static void init_outer_product(shz_vec4_t a, shz_vec4_t b) noexcept {
316 }
317
318 //! C++ wrapper around shz_xmtrx_init_screen().
319 SHZ_FORCE_INLINE static void init_screen(float width, float height) noexcept {
320 shz_xmtrx_init_screen(width, height);
321 }
322
323 //! C++ wrapper around shz_xmtrx_init_lookat().
324 SHZ_FORCE_INLINE static void init_lookat(vec3 eye, vec3 center, vec3 up) noexcept {
325 shz_xmtrx_init_lookat(eye, center, up);
326 }
327
328 //! C++ wrapper around shz_xmtrx_init_ortho().
329 SHZ_FORCE_INLINE static void init_ortho(float left, float right, float bottom, float top, float near, float far) noexcept {
330 shz_xmtrx_init_ortho(left, right, bottom, top, near, far);
331 }
332
333 //! C++ wrapper around shz_xmtrx_init_frustum().
334 SHZ_FORCE_INLINE static void init_frustum(float left, float right, float bottom, float top, float near, float far) noexcept {
335 shz_xmtrx_init_frustum(left, right, bottom, top, near, far);
336 }
337
338 //! C++ wrapper around shz_xmtrx_init_perspective().
339 SHZ_FORCE_INLINE static void init_perspective(float fov, float aspect, float near_z) noexcept {
340 shz_xmtrx_init_perspective(fov, aspect, near_z);
341 }
342
343 //! C++ wrapper around shz_xmtrx_init_rotation_quat().
344 SHZ_FORCE_INLINE static void init_rotation_quat(quat q) noexcept {
346 }
347
348 //! C++ wrapper around shz_xmtrx_init_permutation_wxyz().
349 SHZ_FORCE_INLINE static void init_permutation_wxyz() noexcept {
351 }
352
353 //! C++ wrapper around shz_xmtrx_init_permutation_yzwx().
354 SHZ_FORCE_INLINE static void init_permutation_yzwx() noexcept {
356 }
357
358//! @}
359
360/*! \name Apply Operation
361 \brief Updates only relevant values of XMTRX based on the given transform.
362 @{
363*/
364
365 //! C++ wrapper around shz_xmtrx_apply_4x4().
366 SHZ_FORCE_INLINE static void apply(const shz_mat4x4_t& mat4) noexcept {
368 }
369
370 //! C++ wrapper around shz_xmtrx_apply_unaligned_4x4().
371 SHZ_FORCE_INLINE static void apply(const float cArray[16]) noexcept {
373 }
374
375 //! C++ wrapper around shz_xmtrx_apply_unaligned_4x4().
376 SHZ_FORCE_INLINE static void apply(const std::array<float, 16> array) noexcept {
378 }
379
380 //! C++ wrapper around shz_xmtrx_apply_transpose_4x4().
381 SHZ_FORCE_INLINE static void apply_transpose(const shz_mat4x4_t& mat4) noexcept {
383 }
384
385 //! C++ wrapper around shz_xmtrx_apply_transpose_unaligned_4x4().
386 SHZ_FORCE_INLINE static void apply_transpose(const float cArray[16]) noexcept {
388 }
389
390 //! C++ wrapper around shz_xmtrx_apply_transpose_unaligned_4x4().
391 SHZ_FORCE_INLINE static void apply_transpose(const std::array<float, 16> array) noexcept {
393 }
394
395 //! C++ wrapper around shz_xmtrx_apply_reverse_4x4().
396 SHZ_FORCE_INLINE static void apply_reverse(const shz_mat4x4_t& mat4) noexcept {
398 }
399
400 //! C++ wrapper around shz_xmtrx_apply_reverse_unaligned_4x4().
401 SHZ_FORCE_INLINE static void apply_reverse(const float cArray[16]) noexcept {
403 }
404
405 //! C++ wrapper around shz_xmtrx_apply_reverse_unaligned_4x4().
406 SHZ_FORCE_INLINE static void apply_reverse(const std::array<float, 16> array) noexcept {
408 }
409
410 //! C++ wrapper around shz_xmtrx_apply_reverse_transpose_4x4().
411 SHZ_FORCE_INLINE static void apply_reverse_transpose(const shz_mat4x4_t& mat4) noexcept {
413 }
414
415 //! C++ wrapper around shz_xmtrx_apply_reverse_transpose_unaligned_4x4().
416 SHZ_FORCE_INLINE static void apply_reverse_transpose(const float cArray[16]) noexcept {
418 }
419
420 //! C++ wrapper around shz_xmtrx_apply_reverse_transpose_unaligned_4x4().
421 SHZ_FORCE_INLINE static void apply_reverse_transpose(const std::array<float, 16> array) noexcept {
423 }
424
425 //! C++ wrapper around shz_xmtrx_apply_3x4().
426 SHZ_FORCE_INLINE static void apply(const shz_mat3x4_t& mat) noexcept {
428 }
429
430 //! C++ wrapper around shz_xmtrx_apply_translation().
431 SHZ_FORCE_INLINE static void apply_translation(float x, float y, float z) noexcept {
433 }
434
435 //! C++ wrapper around shz_xmtrx_apply_scale().
436 SHZ_FORCE_INLINE static void apply_scale(float x, float y, float z) noexcept {
438 }
439
440 //! C++ wrapper around shz_xmtrx_apply_rotation_x().
441 SHZ_FORCE_INLINE static void apply_rotation_x(float x) noexcept {
443 }
444
445 //! C++ wrapper around shz_xmtrx_apply_rotation_y().
446 SHZ_FORCE_INLINE static void apply_rotation_y(float y) noexcept {
448 }
449
450 //! C++ wrapper around shz_xmtrx_apply_rotation_z().
451 SHZ_FORCE_INLINE static void apply_rotation_z(float z) noexcept {
453 }
454
455 //! C++ wrapper around shz_xmtrx_init_rotation_xyz().
456 SHZ_FORCE_INLINE static void apply_rotation_xyz(float x, float y, float z) noexcept {
458 }
459
460 //! C++ wrapper around shz_xmtrx_apply_rotation_zyx().
461 SHZ_FORCE_INLINE static void apply_rotation_zyx(float z, float y, float x) noexcept {
463 }
464
465 //! C++ wrapper around shz_xmtrx_apply_rotation_zxy().
466 SHZ_FORCE_INLINE static void apply_rotation_zxy(float z, float x, float y) noexcept {
468 }
469
470 //! C++ wrapper around shz_xmtrx_apply_rotation_yxz().
471 SHZ_FORCE_INLINE static void apply_rotation_yxz(float y, float x, float z) noexcept {
473 }
474
475 // C++ wrapper around shz_xmtrx_apply_rotation().
476 SHZ_FORCE_INLINE static void apply_rotation(float angle, float x, float y, float z) noexcept {
478 }
479
480 //! C++ wrapper around shz_xmtrx_apply_rotation_quat().
481 SHZ_FORCE_INLINE static void apply_rotation_quat(shz_quat_t quat) noexcept {
483 }
484
485 //! C++ wrapper around shz_xmtrx_apply_lookat().
486 SHZ_FORCE_INLINE static void apply_lookat(vec3 eye, vec3 center, vec3 up) noexcept {
487 shz_xmtrx_apply_lookat(eye, center, up);
488 }
489
490 //! C++ wrapper around shz_xmtrx_apply_ortho().
491 SHZ_FORCE_INLINE static void apply_ortho(float left, float right, float bottom, float top, float near, float far) noexcept {
492 shz_xmtrx_apply_ortho(left, right, bottom, top, near, far);
493 }
494
495 //! C++ wrapper around shz_xmtrx_apply_frustum().
496 SHZ_FORCE_INLINE static void apply_frustum(float left, float right, float bottom, float top, float near, float far) noexcept {
497 shz_xmtrx_apply_frustum(left, right, bottom, top, near, far);
498 }
499
500 //! C++ wrapper around shz_xmtrx_apply_perspective().
501 SHZ_FORCE_INLINE static void apply_perspective(float fov, float aspect, float near_z) noexcept {
502 shz_xmtrx_apply_perspective(fov, aspect, near_z);
503 }
504
505 //! C++ wrapper around shz_xmtrx_apply_symmetric_skew().
506 SHZ_FORCE_INLINE static void apply_symmetric_skew(float x, float y, float z) noexcept {
508 }
509
510 //! C++ wrapper around shz_xmtrx_apply_screen().
511 SHZ_FORCE_INLINE static void apply_screen(float width, float height) noexcept {
512 shz_xmtrx_apply_screen(width, height);
513 }
514
515 //! C++ wrapper around shz_xmtrx_apply_permutation_wxyz().
516 SHZ_FORCE_INLINE static void apply_permutation_wxyz() noexcept {
518 }
519
520 //! C++ wrapper around shz_xmtrx_apply_permutation_yzwx().
521 SHZ_FORCE_INLINE static void apply_permutation_yzwx() noexcept {
523 }
524
525 //! C++ wrapper around shz_xmtrx_apply_self().
526 SHZ_FORCE_INLINE static void apply_self() noexcept {
528 }
529
530//! @}
531
532/*! \name OpenGL Operations
533 \brief OpenGL-style matrix transformation operations.
534 @{
535*/
536
537 //! C++ wrapper around shz_xmtrx_translate().
538 SHZ_FORCE_INLINE static void translate(float x, float y, float z) noexcept {
540 }
541
542 //! C++ wrapper around shz_xmtrx_scale().
543 SHZ_FORCE_INLINE static void scale(float x, float y, float z) noexcept {
545 }
546
547 //! C++ wrapper around shz_xmtrx_rotate_x().
548 SHZ_FORCE_INLINE static void rotate_x(float radians) noexcept {
550 }
551
552 //! C++ wrapper around shz_xmtrx_rotate_x().
553 SHZ_FORCE_INLINE static void rotate_y(float radians) noexcept {
555 }
556
557 //! C++ wrapper around shz_xmtrx_rotate_x().
558 SHZ_FORCE_INLINE static void rotate_z(float radians) noexcept {
560 }
561
562 //! C++ wrapper around shz_xmtrx_rotate_xyz().
563 SHZ_FORCE_INLINE static void rotate_xyz(float x, float y, float z) noexcept {
565 }
566
567 //! C++ wrapper around shz_xmtrx_rotate_zyx().
568 SHZ_FORCE_INLINE static void rotate_zyx(float z, float y, float x) noexcept {
570 }
571
572 //! C++ wrapper around shz_xmtrx_rotate_zxy().
573 SHZ_FORCE_INLINE static void rotate_zxy(float z, float x, float y) noexcept {
575 }
576
577 //! C++ wrapper around shz_xmtrx_rotate_yxz().
578 SHZ_FORCE_INLINE static void rotate_yxz(float y, float x, float z) noexcept {
580 }
581
582 //! C++ wrapper around shz_xmtrx_rotate().
583 SHZ_FORCE_INLINE static void rotate(float radians, float x, float y, float z) noexcept {
584 shz_xmtrx_rotate(radians, x, y, z);
585 }
586
587//! @}
588
589/*! \name Compound Operations
590 \brief Multiple operations combined into one pipelined transaction.
591 @{
592*/
593
594 //! C++ wrapper around shz_xmtrx_load_apply_4x4().
595 SHZ_FORCE_INLINE static void load_apply(const shz_mat4x4_t& mat1, const shz_mat4x4_t& mat2) noexcept {
597 }
598
599 //! C++ wrapper around shz_xmtrx_load_apply_unaligned_4x4().
600 SHZ_FORCE_INLINE static void load_apply(const float matrix1[16], const float matrix2[16]) noexcept {
602 }
603
604 //! C++ wrapper around shz_xmtrx_load_apply_store_4x4().
605 SHZ_FORCE_INLINE static void load_apply_store(shz_mat4x4_t* dst, const shz_mat4x4_t& mat1, const shz_mat4x4_t& mat2) noexcept {
607 }
608
609 //! C++ wrapper around shz_xmtrx_load_apply_store_unaligned_4x4().
610 SHZ_FORCE_INLINE static void load_apply_store(float out[16], const float matrix1[16], const float matrix2[16]) noexcept {
612 }
613
614 //! C++ wrapper around shz_xmtrx_load_apply_store_3x4().
615 SHZ_FORCE_INLINE static void load_apply_store(shz_mat3x4_t* dst, const shz_mat3x4_t& mat1, const shz_mat3x4_t& mat2) noexcept {
617 }
618
619 //! C++ wrapper around shz_xmtrx_load_apply_store_3x3().
620 SHZ_FORCE_INLINE static void load_apply_store(shz_mat3x3_t* dst, const shz_mat3x3_t& mat1, const shz_mat3x3_t& mat2) noexcept {
622 }
623
624//! @}
625
626/*! \name Transformations
627 \brief Transforming vectors and points against XMTRX.
628 @{
629*/
630
631 //! C++ wrapper around shz_xmtrx_transform_vec4().
632 SHZ_FORCE_INLINE static vec4 transform(shz_vec4_t in) noexcept {
634 }
635
636 //! C++ wrapper around shz_xmtrx_transform_vec3().
637 SHZ_FORCE_INLINE static vec3 transform(shz_vec3_t in) noexcept {
639 }
640
641 //! C++ wrapper around shz_xmtrx_transform_vec2().
642 SHZ_FORCE_INLINE static vec2 transform(shz_vec2_t in) noexcept {
644 }
645
646 //! C++ wrapper around shz_xmtrx_transform_point3().
647 SHZ_FORCE_INLINE static vec3 transform_point(shz_vec3_t pt) noexcept {
649 }
650
651 //! C++ wrapper around shz_xmtrx_transform_point2().
652 SHZ_FORCE_INLINE static vec2 transform_point(shz_vec2_t pt) noexcept {
654 }
655
656//! @}
657
658/*! \name Setters
659 \brief Sets the values of related XMTRX components.
660 @{
661*/
662
663 //! C++ wrapper around shz_xmtrx_set_translation().
664 SHZ_FORCE_INLINE static void set_translation(float x, float y, float z) noexcept {
666 }
667
668//! @}
669
670/*! \name Miscellaneous
671 \brief Random operations and conversions on XMTRX.
672 @{
673*/
674
675 //! C++ wrapper around shz_xmtrx_add_4x4().
676 SHZ_FORCE_INLINE static void add(const shz_mat4x4_t& mat) noexcept {
678 }
679
680 //! C++ wrapper around shz_xmtrx_sub_4x4().
681 SHZ_FORCE_INLINE static void sub(const shz_mat4x4_t& mat) noexcept {
683 }
684
685 //! C++ wrapper around shz_xmtrx_add_diagonal().
686 SHZ_FORCE_INLINE static void add_diagonal(float x, float y, float z, float w) noexcept {
688 }
689
690 //! C++ wrapper around shz_xmtrx_add_symmetric_skew().
691 SHZ_FORCE_INLINE static void add_symmetric_skew(float x, float y, float z) noexcept {
693 }
694
695 //! C++ wrapper around shz_xmtrx_transpose().
696 SHZ_FORCE_INLINE static void transpose() noexcept {
698 }
699
700 //! C++ wrapper around shz_xmtrx_negate().
701 SHZ_FORCE_INLINE static void negate() noexcept {
703 }
704
705 //! C++ wrapper around shz_xmtrx_abs().
706 SHZ_FORCE_INLINE static void abs() noexcept {
708 }
709
710 //! C++ wrapper around shz_xmtrx_init_fft_weights().
711 SHZ_FORCE_INLINE static void init_fft_weights(float radians) noexcept {
713 }
714
715 //! C++ wrapper around shz_xmtrx_to_quat().
716 SHZ_FORCE_INLINE static quat to_quat() noexcept {
717 return shz_xmtrx_to_quat();
718 }
719
720 //! C++ wrapper around shz_xmtrx_determinant().
721 SHZ_FORCE_INLINE static float determinant() noexcept {
723 }
724
725 //! C++ wrapper around shz_xmtrx_invert().
726 SHZ_FORCE_INLINE static void invert() noexcept {
728 }
729
730//! @}
731
732};
733}
734
735#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_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_identity(void) SHZ_NOEXCEPT
Quickly initializes XMTRX to be a 4D 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_init_perspective(float fov, float aspect, float near_z) SHZ_NOEXCEPT
Initializes XMTRX to a perspective projection matrix.
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.
shz_vec3_t shz_xmtrx_transform_point3(shz_vec3_t pt) SHZ_NOEXCEPT
Returns the 3D point that is the result of transforming pt by XMTRX.
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.
shz_vec2_t shz_xmtrx_transform_point2(shz_vec2_t pt) SHZ_NOEXCEPT
Returns the 2D point that is the result of transforming pt by XMTRX.
void shz_xmtrx_init_ortho(float left, float right, float bottom, float top, float near, float far) SHZ_NOEXCEPT
Initializes XMTRX to an orthographic projection matrix, equivalent to glOrtho().
void shz_xmtrx_rotate_x(float radians) SHZ_NOEXCEPT
Multiplies and accumulates XMTRX by a 3D rotation matrix about the X axis.
shz_vec2_t shz_xmtrx_transform_vec2(shz_vec2_t vec) SHZ_NOEXCEPT
Returns the 2D vector that is the result of transforming vec by XMTRX.
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 given axis.
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:73
@ SHZ_XMTRX_XF9
FP register xf9.
Definition shz_xmtrx.h:74
@ SHZ_XMTRX_XF12
FP register xf12.
Definition shz_xmtrx.h:77
@ SHZ_XMTRX_XF11
FP register xf11.
Definition shz_xmtrx.h:76
@ SHZ_XMTRX_XF14
FP register xf14.
Definition shz_xmtrx.h:79
@ SHZ_XMTRX_XF3
FP register xf3.
Definition shz_xmtrx.h:68
@ SHZ_XMTRX_XF6
FP register xf6.
Definition shz_xmtrx.h:71
@ SHZ_XMTRX_XF4
FP register xf4.
Definition shz_xmtrx.h:69
@ SHZ_XMTRX_XF13
FP register xf13.
Definition shz_xmtrx.h:78
@ SHZ_XMTRX_XF10
FP register xf10.
Definition shz_xmtrx.h:75
@ SHZ_XMTRX_XF2
FP register xf2.
Definition shz_xmtrx.h:67
@ SHZ_XMTRX_XF0
FP register xf0.
Definition shz_xmtrx.h:65
@ SHZ_XMTRX_XF5
FP register xf5.
Definition shz_xmtrx.h:70
@ SHZ_XMTRX_XF7
FP register xf7.
Definition shz_xmtrx.h:72
@ SHZ_XMTRX_XF15
FP register xf15.
Definition shz_xmtrx.h:80
@ SHZ_XMTRX_XF1
FP register xf1.
Definition shz_xmtrx.h:66
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_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_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_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_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_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_apply_ortho(float left, float right, float bottom, float top, float near, float far) SHZ_NOEXCEPT
Applies a 2D orthographic projection matrix onto XMTRX, equivalent to glOrtho().
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_apply_frustum(float left, float right, float bottom, float top, float near, float far) SHZ_NOEXCEPT
Applies a frustum projection matrix onto XMTRX, equivalent to glFrustum().
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_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_init_identity_safe(void) SHZ_NOEXCEPT
Safely initializes XMTRX to be a 4D identity matrix.
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.
shz_vec4_t shz_xmtrx_transform_vec4(shz_vec4_t vec) SHZ_NOEXCEPT
Returns the 4D vector that is the result of transforming vec by XMTRX.
void shz_xmtrx_init_screen(float width, float height) SHZ_NOEXCEPT
Initializes XMTRX to the viewport matrix with the given dimensions.
void shz_xmtrx_init_outer_product(shz_vec4_t x, shz_vec4_t y) SHZ_NOEXCEPT
Initializes XMTRX to the 4D matrix resulting from taking the outer product of the two 4D vectors.
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.
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_fft_weights(float radians) SHZ_NOEXCEPT
Initializes XMTRX to the sin/cos weights used to multiply two samples within an FFT.
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_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_apply_perspective(float fov, float aspect, float near_z) SHZ_NOEXCEPT
Multiplies and accumulates the perspective matrix constructed from the given values onto XMTRX.
void shz_xmtrx_init_frustum(float left, float right, float bottom, float top, float near, float far) SHZ_NOEXCEPT
Initializes XMTRX to a frustum projection matrix, equivalent to glFrustum().
shz_vec3_t shz_xmtrx_transform_vec3(shz_vec3_t vec) SHZ_NOEXCEPT
Returns the 3D vector that is the result of transforming vec by XMTRX.
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_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:36
static vec4 read_row(unsigned int index) noexcept
C++ wrapper around shz_xmtrx_read_row().
Definition shz_xmtrx.hpp:77
static void apply_screen(float width, float height) noexcept
C++ wrapper around shz_xmtrx_apply_screen().
static void init_symmetric_skew(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_init_symmetric_skew().
static void init_frustum(float left, float right, float bottom, float top, float near, float far) noexcept
C++ wrapper around shz_xmtrx_init_frustum().
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_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:67
static void init_zero() noexcept
C++ wrapper around shz_xmtrx_init_zero().
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 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(reg xf, float value) noexcept
C++ wrapper around shz_xmtrx_write().
Definition shz_xmtrx.hpp:72
static void init_upper_triangular(float col1, vec2 col2, vec3 col3, vec4 col4) noexcept
C++ wrapper around shz_xmtrx_init_upper_triangular().
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(shz_vec2_t in) noexcept
C++ wrapper around shz_xmtrx_transform_vec2().
reg
FP back-bank registers comprising XMTRX.
Definition shz_xmtrx.hpp:39
@ XF9
FP register XF9.
Definition shz_xmtrx.hpp:49
@ XF11
FP register XF11.
Definition shz_xmtrx.hpp:51
@ XF10
FP register XF10.
Definition shz_xmtrx.hpp:50
@ XF4
FP register XF4.
Definition shz_xmtrx.hpp:44
@ XF15
FP register XF15.
Definition shz_xmtrx.hpp:55
@ XF7
FP register XF7.
Definition shz_xmtrx.hpp:47
@ XF13
FP register XF13.
Definition shz_xmtrx.hpp:53
@ XF0
FP register XF0.
Definition shz_xmtrx.hpp:40
@ XF8
FP register XF8.
Definition shz_xmtrx.hpp:48
@ XF1
FP register XF1.
Definition shz_xmtrx.hpp:41
@ XF12
FP register XF12.
Definition shz_xmtrx.hpp:52
@ XF6
FP register XF6.
Definition shz_xmtrx.hpp:46
@ XF3
FP register XF3.
Definition shz_xmtrx.hpp:43
@ XF14
FP register XF14.
Definition shz_xmtrx.hpp:54
@ XF5
FP register XF5.
Definition shz_xmtrx.hpp:45
@ XF2
FP register XF2.
Definition shz_xmtrx.hpp:42
static void init_fft_weights(float radians) noexcept
C++ wrapper around shz_xmtrx_init_fft_weights().
static void store_transpose(shz_mat4x4_t *mat) noexcept
C++ wrapper around shz_xmtrx_store_transpose_4x4().
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 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 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 apply_transpose(const std::array< float, 16 > array) noexcept
C++ wrapper around shz_xmtrx_apply_transpose_unaligned_4x4().
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 init_rotation_quat(quat q) noexcept
C++ wrapper around shz_xmtrx_init_rotation_quat().
static void set_translation(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_set_translation().
static vec2 transform_point(shz_vec2_t pt) noexcept
C++ wrapper around shz_xmtrx_transform_point2().
static void init_ortho(float left, float right, float bottom, float top, float near, float far) noexcept
C++ wrapper around shz_xmtrx_init_ortho().
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 apply_reverse(const std::array< float, 16 > array) noexcept
C++ wrapper around shz_xmtrx_apply_reverse_unaligned_4x4().
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 apply_frustum(float left, float right, float bottom, float top, float near, float far) noexcept
C++ wrapper around shz_xmtrx_apply_frustum().
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 void add(const shz_mat4x4_t &mat) noexcept
C++ wrapper around shz_xmtrx_add_4x4().
static void load(std::array< float, 16 > array) noexcept
C++ wrapper around shz_xmtrx_load_unaligned_4x4().
static void rotate(float radians, float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_rotate().
static void write_col(unsigned int index, vec4 vector) noexcept
C++ wrapper around shz_xmtrx_write_col().
Definition shz_xmtrx.hpp:92
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 apply(const std::array< float, 16 > array) noexcept
C++ wrapper around shz_xmtrx_apply_unaligned_4x4().
static void apply(const shz_mat4x4_t &mat4) noexcept
C++ wrapper around shz_xmtrx_apply_4x4().
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 init_perspective(float fov, float aspect, float near_z) noexcept
C++ wrapper around shz_xmtrx_init_perspective().
static void apply_rotation_zyx(float z, float y, float x) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_zyx().
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:82
static void init_lookat(vec3 eye, vec3 center, vec3 up) noexcept
C++ wrapper around shz_xmtrx_init_lookat().
static void swap_rows(unsigned int index1, unsigned int index2) noexcept
C++ wrapper around shz_xmtrx_swap_rows().
Definition shz_xmtrx.hpp:97
static void apply_rotation_quat(shz_quat_t quat) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_quat().
static void init_lower_triangular(vec4 col1, vec3 col2, vec2 col3, float col4) noexcept
C++ wrapper around shz_xmtrx_init_lower_diagonal().
static void store_transpose(std::array< float, 16 > *array) noexcept
C++ wrapper around shz_xmtrx_store_transpose_unaligned_4x4().
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 write_row(unsigned int index, vec4 vector) noexcept
C++ wrapper around shz_xmtrx_write_row().
Definition shz_xmtrx.hpp:87
static void load_transpose(const shz_mat4x4_t &mat4) noexcept
C++ wrapper around shz_xmtrx_load_transpose_4x4().
static void apply_rotation_z(float z) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_z().
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 apply_ortho(float left, float right, float bottom, float top, float near, float far) noexcept
C++ wrapper around shz_xmtrx_apply_ortho().
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 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_rotation_xyz(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_init_rotation_xyz().
static vec3 transform_point(shz_vec3_t 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 rotate_yxz(float y, float x, float z) noexcept
C++ wrapper around shz_xmtrx_rotate_yxz().
static void apply_lookat(vec3 eye, vec3 center, vec3 up) noexcept
C++ wrapper around shz_xmtrx_apply_lookat().
static void apply_rotation_y(float y) noexcept
C++ wrapper around shz_xmtrx_apply_rotation_y().
static float determinant() noexcept
C++ wrapper around shz_xmtrx_determinant().
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 apply_reverse_transpose(const std::array< float, 16 > array) noexcept
C++ wrapper around shz_xmtrx_apply_reverse_transpose_unaligned_4x4().
static vec3 transform(shz_vec3_t in) noexcept
C++ wrapper around shz_xmtrx_transform_vec3().
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 load_transpose(std::array< float, 16 > array) noexcept
C++ wrapper around shz_xmtrx_load_transpose_unaligned_4x4().
static void add_symmetric_skew(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_add_symmetric_skew().
static vec4 transform(shz_vec4_t in) noexcept
C++ wrapper around shz_xmtrx_transform_vec4().
static void apply_symmetric_skew(float x, float y, float z) noexcept
C++ wrapper around shz_xmtrx_apply_symmetric_skew().
static void apply_perspective(float fov, float aspect, float near_z) noexcept
C++ wrapper around shz_xmtrx_apply_perspective().
static void init_outer_product(shz_vec4_t a, shz_vec4_t b) noexcept
C++ wrapper around shz_xmtrx_init_outer_product().
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().