|
Banjo API 0.0.1
C99 game development API
|


Go to the source code of this file.
Data Structures | |
| struct | bj_mat3x3 |
| struct | bj_mat3x2 |
| struct | bj_mat4x4 |
| struct | bj_mat4x3 |
Macros | |
| #define | BJ_M3(c, r) |
| #define | BJ_M32(c, r) |
| #define | BJ_M4(c, r) |
| #define | BJ_M43(c, r) |
Functions | |
| static void | bj_mat3_set_identity (struct bj_mat3x3 *restrict M) |
| static void | bj_mat3_copy (struct bj_mat3x3 *restrict dst, const struct bj_mat3x3 *restrict src) |
| static struct bj_vec3 | bj_mat3_row (const struct bj_mat3x3 *restrict M, int r) |
| static struct bj_vec3 | bj_mat3_col (const struct bj_mat3x3 *restrict M, int c) |
| static void | bj_mat3_transpose (struct bj_mat3x3 *restrict out, const struct bj_mat3x3 *restrict A) |
| static void | bj_mat3_add (struct bj_mat3x3 *restrict out, const struct bj_mat3x3 *restrict A, const struct bj_mat3x3 *restrict B) |
| static void | bj_mat3_sub (struct bj_mat3x3 *restrict out, const struct bj_mat3x3 *restrict A, const struct bj_mat3x3 *restrict B) |
| static void | bj_mat3_mul_scalar (struct bj_mat3x3 *restrict out, const struct bj_mat3x3 *restrict A, bj_real k) |
| static void | bj_mat3_mul (struct bj_mat3x3 *restrict out, const struct bj_mat3x3 *restrict A, const struct bj_mat3x3 *restrict B) |
| static struct bj_vec3 | bj_mat3_transform_vec3 (const struct bj_mat3x3 *restrict M, struct bj_vec3 v) |
| static struct bj_vec2 | bj_mat3_transform_point (const struct bj_mat3x3 *restrict M, struct bj_vec2 p) |
| static void | bj_mat3_set_translation (struct bj_mat3x3 *restrict M, bj_real tx, bj_real ty) |
| static void | bj_mat3_translate (struct bj_mat3x3 *restrict M, bj_real tx, bj_real ty) |
| static void | bj_mat3_set_scaling_xy (struct bj_mat3x3 *restrict M, bj_real sx, bj_real sy) |
| static void | bj_mat3_set_shear_xy (struct bj_mat3x3 *restrict M, bj_real shx, bj_real shy) |
| static void | bj_mat3_set_rotation_z (struct bj_mat3x3 *restrict M, bj_real angle) |
| static bj_real | bj_mat3_determinant (const struct bj_mat3x3 *restrict A) |
| static bj_bool | bj_mat3_invert (struct bj_mat3x3 *restrict out, const struct bj_mat3x3 *restrict A) |
| static void | bj_mat3_invert_unsafe (struct bj_mat3x3 *restrict out, const struct bj_mat3x3 *restrict A) |
| static void | bj_mat3_set_ortho (struct bj_mat3x3 *restrict M, bj_real l, bj_real r, bj_real b, bj_real t) |
| static void | bj_mat3_set_viewport (struct bj_mat3x3 *restrict M, bj_real x, bj_real y, bj_real w, bj_real h) |
| static void | bj_mat3x2_set_identity (struct bj_mat3x2 *restrict M) |
| static void | bj_mat3x2_set_translation (struct bj_mat3x2 *restrict M, bj_real tx, bj_real ty) |
| static void | bj_mat3x2_set_scaling_xy (struct bj_mat3x2 *restrict M, bj_real sx, bj_real sy) |
| static void | bj_mat3x2_set_rotation_z (struct bj_mat3x2 *restrict M, bj_real angle) |
| static void | bj_mat3x2_mul (struct bj_mat3x2 *restrict out, const struct bj_mat3x2 *restrict A, const struct bj_mat3x2 *restrict B) |
| static struct bj_vec2 | bj_mat3x2_transform_point (const struct bj_mat3x2 *restrict M, struct bj_vec2 p) |
| static struct bj_vec2 | bj_mat3x2_transform_dir (const struct bj_mat3x2 *restrict M, struct bj_vec2 v) |
| static void | bj_mat3_from_mat3x2 (struct bj_mat3x3 *restrict M, const struct bj_mat3x2 *restrict A) |
| static void | bj_mat3x2_from_mat3 (struct bj_mat3x2 *restrict M, const struct bj_mat3x3 *restrict A) |
| static void | bj_mat4_set_identity (struct bj_mat4x4 *restrict M) |
| static void | bj_mat4_copy (struct bj_mat4x4 *restrict dst, const struct bj_mat4x4 *restrict src) |
| static struct bj_vec4 | bj_mat4_row (const struct bj_mat4x4 *restrict M, int r) |
| static struct bj_vec4 | bj_mat4_col (const struct bj_mat4x4 *restrict M, int c) |
| static void | bj_mat4_transpose (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict A) |
| static void | bj_mat4_add (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict A, const struct bj_mat4x4 *restrict B) |
| static void | bj_mat4_sub (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict A, const struct bj_mat4x4 *restrict B) |
| static void | bj_mat4_mul_scalar (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict A, bj_real k) |
| static void | bj_mat4_scale_axes (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict A, bj_real sx, bj_real sy, bj_real sz) |
| static void | bj_mat4_mul (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict A, const struct bj_mat4x4 *restrict B) |
| static struct bj_vec4 | bj_mat4_transform_vec4 (const struct bj_mat4x4 *restrict M, struct bj_vec4 v) |
| static void | bj_mat4_set_translation (struct bj_mat4x4 *restrict M, bj_real x, bj_real y, bj_real z) |
| static void | bj_mat4_translate (struct bj_mat4x4 *restrict M, bj_real x, bj_real y, bj_real z) |
| static void | bj_mat4_set_outer_product (struct bj_mat4x4 *restrict out, struct bj_vec3 a, struct bj_vec3 b) |
| static void | bj_mat4_rotate_axis_andle (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict M, struct bj_vec3 axis, bj_real angle) |
| static void | bj_mat4_rotate_x (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict M, bj_real a) |
| static void | bj_mat4_rotate_y (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict M, bj_real a) |
| static void | bj_mat4_rotate_z (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict M, bj_real a) |
| static void | bj_mat4_rotate_arcball (struct bj_mat4x4 *restrict R, const struct bj_mat4x4 *restrict M, struct bj_vec2 a, struct bj_vec2 b, bj_real s) |
| static bj_bool | bj_mat4_invert (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict M) |
| static void | bj_mat4_invert_unsafe (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict M) |
| static void | bj_mat4_orthonormalize (struct bj_mat4x4 *restrict out, const struct bj_mat4x4 *restrict A) |
| static void | bj_mat4_set_frustum (struct bj_mat4x4 *restrict M, bj_real l, bj_real r, bj_real b, bj_real t, bj_real n, bj_real f) |
| static void | bj_mat4_set_ortho (struct bj_mat4x4 *restrict M, bj_real l, bj_real r, bj_real b, bj_real t, bj_real n, bj_real f) |
| static void | bj_mat4_set_perspective (struct bj_mat4x4 *restrict M, bj_real y_fov, bj_real aspect, bj_real n, bj_real f) |
| static void | bj_mat4_set_viewport (struct bj_mat4x4 *restrict M, bj_real x, bj_real y, bj_real w, bj_real h) |
| static void | bj_mat4_set_lookat (struct bj_mat4x4 *restrict M, struct bj_vec3 eye, struct bj_vec3 center, struct bj_vec3 up) |
| static void | bj_mat4x3_set_identity (struct bj_mat4x3 *restrict M) |
| static void | bj_mat4x3_set_translation (struct bj_mat4x3 *restrict M, bj_real tx, bj_real ty, bj_real tz) |
| static void | bj_mat4x3_set_scaling_xyz (struct bj_mat4x3 *restrict M, bj_real sx, bj_real sy, bj_real sz) |
| static void | bj_mat4x3_set_rotation_x (struct bj_mat4x3 *restrict M, bj_real a) |
| static void | bj_mat4x3_set_rotation_y (struct bj_mat4x3 *restrict M, bj_real a) |
| static void | bj_mat4x3_set_rotation_z (struct bj_mat4x3 *restrict M, bj_real a) |
| static void | bj_mat4x3_mul (struct bj_mat4x3 *restrict out, const struct bj_mat4x3 *restrict A, const struct bj_mat4x3 *restrict B) |
| static struct bj_vec3 | bj_mat4x3_transform_point (const struct bj_mat4x3 *restrict M, struct bj_vec3 p) |
| static struct bj_vec3 | bj_mat4x3_transform_dir (const struct bj_mat4x3 *restrict M, struct bj_vec3 v) |
| static void | bj_mat4_from_mat4x3 (struct bj_mat4x4 *restrict M, const struct bj_mat4x3 *restrict A) |
| static void | bj_mat4x3_from_mat4 (struct bj_mat4x3 *restrict M, const struct bj_mat4x4 *restrict A) |
C99 math shim with bj_real precision type and scalar utilities.
Column-major storage: elements are addressed as m[col][row].
Matrix utilities for 2D and 3D transforms using bj_real and bj_vec*.
Vectors are treated as column vectors and are multiplied on the right: res = M * v.
Provides creation, copy, transpose, arithmetic, products, inversion, orthonormalization, and common projection/viewport helpers for 3×3, 3×2, 4×4, 4×3.