shachi/include/shachi/sh4math.h
(251 lines)
- C99 header implementing SPECTRE Spec 2
- Types:
sh_mat4_t[4][4] aligned(8),
sh_vec4_t[4] aligned(8), sh_vec3_t[3]
aligned(8)
- KOS passthrough inlines:
sh_rsqrt→frsqrt,
sh_sqrt→fsqrt, sh_rcp→1/x,
sh_sin→fsin, sh_cos→fcos,
sh_sincos→fsincos, sh_sincosr→fsincosr,
sh_fipr→fipr,
sh_length_sqr4→fipr_magnitude_sqr,
sh_bump_pack→pvr_pack_bump
- XMTRX matrix ops:
sh_mat_load/store/identity/apply/multiply,
sh_transform_pt, sh_transform_pt4,
sh_transform_normal, sh_transform_batch
- Vec3:
sh_vec3_dot, sh_vec3_length_sqr,
sh_vec3_length, sh_vec3_normalize,
sh_vec3_cross, sh_vec3_lerp,
sh_vec4_lerp
- Batch:
sh_perspective_divide,
sh_perspective_divide_n,
sh_normalize_batch
- Matrix builders:
sh_perspective,
sh_look_at, sh_scale,
sh_translate, sh_rot_x/y/z