Banjo API 0.0.1
C99 game development API
|
Go to the source code of this file.
Typedefs | |
typedef bj_real | bj_vec2[2] |
typedef bj_real | bj_vec3[3] |
typedef bj_real | bj_vec4[4] |
Functions | |
static void | bj_vec2_set (bj_vec2 res, bj_real a, bj_real b) |
static void | bj_vec2_zero (bj_vec2 res) |
static void | bj_vec2_apply (bj_vec2 res, const bj_vec2 a, bj_real(*f)(bj_real)) |
static void | bj_vec2_add (bj_vec2 res, const bj_vec2 lhs, const bj_vec2 rhs) |
static void | bj_vec2_add_scaled (bj_vec2 res, const bj_vec2 a, const bj_vec2 b, bj_real s) |
static void | bj_vec2_sub (bj_vec2 res, const bj_vec2 lhs, const bj_vec2 rhs) |
static void | bj_vec2_scale (bj_vec2 res, const bj_vec2 v, bj_real s) |
static void | bj_vec2_scale_each (bj_vec2 res, const bj_vec2 v, const bj_vec2 s) |
static bj_real | bj_vec2_dot (const bj_vec2 a, const bj_vec2 b) |
static bj_real | bj_vec2_cross (const bj_vec2 a, const bj_vec2 b) |
static bj_real | bj_vec2_len (const bj_vec2 v) |
static void | bj_vec2_set_len (bj_vec2 res, const bj_vec2 v, bj_real target_len) |
static bj_real | bj_vec2_dist_squared (const bj_vec2 a, const bj_vec2 b) |
static bj_real | bj_vec2_dist (const bj_vec2 a, const bj_vec2 b) |
static void | bj_vec2_normalize (bj_vec2 res, const bj_vec2 v) |
static void | bj_vec2_min (bj_vec2 res, const bj_vec2 a, const bj_vec2 b) |
static void | bj_vec2_max (bj_vec2 res, const bj_vec2 a, const bj_vec2 b) |
static void | bj_vec2_copy (bj_vec2 res, const bj_vec2 src) |
static void | bj_vec3_set (bj_vec3 res, bj_real a, bj_real b, bj_real c) |
static void | bj_vec3_zero (bj_vec3 res) |
static void | bj_vec3_apply (bj_vec3 res, const bj_vec3 a, bj_real(*f)(bj_real)) |
static void | bj_vec3_add (bj_vec3 res, const bj_vec3 lhs, const bj_vec3 rhs) |
static void | bj_vec3_add_scaled (bj_vec3 res, const bj_vec3 a, const bj_vec3 b, bj_real s) |
static void | bj_vec3_sub (bj_vec3 res, const bj_vec3 lhs, const bj_vec3 rhs) |
static void | bj_vec3_scale (bj_vec3 res, const bj_vec3 v, bj_real s) |
static bj_real | bj_vec3_dot (const bj_vec3 a, const bj_vec3 b) |
static bj_real | bj_vec3_len (const bj_vec3 v) |
static void | bj_vec3_set_len (bj_vec3 res, const bj_vec3 v, bj_real target_len) |
static bj_real | bj_vec3_dist_squared (const bj_vec3 a, const bj_vec3 b) |
static bj_real | bj_vec3_dist (const bj_vec3 a, const bj_vec3 b) |
static void | bj_vec3_normalize (bj_vec3 res, const bj_vec3 v) |
static void | bj_vec3_min (bj_vec3 res, const bj_vec3 a, const bj_vec3 b) |
static void | bj_vec3_max (bj_vec3 res, const bj_vec3 a, const bj_vec3 b) |
static void | bj_vec3_copy (bj_vec3 res, const bj_vec3 src) |
static void | bj_vec3_cross (bj_vec3 res, const bj_vec3 l, const bj_vec3 r) |
static void | bj_vec3_reflect (bj_vec3 res, const bj_vec3 v, const bj_vec3 n) |
static void | bj_vec4_set (bj_vec4 res, bj_real a, bj_real b, bj_real c, bj_real d) |
static void | bj_vec4_apply (bj_vec4 res, const bj_vec4 a, bj_real(*f)(bj_real)) |
static void | bj_vec4_add (bj_vec4 res, const bj_vec4 lhs, const bj_vec4 rhs) |
static void | bj_vec4_add_scaled (bj_vec4 res, const bj_vec4 a, const bj_vec4 b, bj_real s) |
static void | bj_vec4_sub (bj_vec4 res, const bj_vec4 lhs, const bj_vec4 rhs) |
static void | bj_vec4_scale (bj_vec4 res, const bj_vec4 v, bj_real s) |
static bj_real | bj_vec4_dot (const bj_vec4 a, const bj_vec4 b) |
static bj_real | bj_vec4_len (const bj_vec4 v) |
static void | bj_vec4_normalize (bj_vec4 res, const bj_vec4 v) |
static void | bj_vec4_min (bj_vec4 res, const bj_vec4 a, const bj_vec4 b) |
static void | bj_vec4_max (bj_vec4 res, const bj_vec4 a, const bj_vec4 b) |
static void | bj_vec4_copy (bj_vec4 res, const bj_vec4 src) |
static void | bj_vec4_cross (bj_vec4 res, const bj_vec4 l, const bj_vec4 r) |
static void | bj_vec4_reflect (bj_vec4 res, const bj_vec4 v, const bj_vec4 n) |
vector manipulation API
Provides simple, inline operations (set, add, sub, scale, dot, length, normalize, min/max, copy, cross, reflect) on fixed-size vectors.
Vector utilities for 2D, 3D, and 4D using bj_real
.
All functions are header-only and suitable for high-performance code.