Banjo API 0.0.1
C99 game development API
|
Go to the source code of this file.
Macros | |
#define | bj_quat_add bj_vec4_add |
#define | bj_quat_sub bj_vec4_sub |
#define | bj_quat_norm bj_vec4_normalize |
#define | bj_quat_scale bj_vec4_scale |
#define | bj_quat_dot bj_vec4_dot |
Typedefs | |
typedef bj_real | bj_quat[4] |
Functions | |
static void | bj_quat_identity (bj_quat q) |
static void | bj_quat_mul (bj_quat res, const bj_quat p, const bj_quat q) |
static void | bj_quat_conjugate (bj_quat res, const bj_quat q) |
static void | bj_quat_rotation (bj_quat res, bj_real angle, const bj_vec3 axis) |
static void | bj_quat_mul_vec3 (bj_vec3 res, const bj_quat q, const bj_vec3 v) |
static void | bj_mat4_from_quat (bj_mat4 res, const bj_quat q) |
static void | bj_mat4_rotate_from_quat (bj_mat4 R, const bj_mat4 M, const bj_quat q) |
static void | bj_quat_from_mat4 (bj_quat q, const bj_mat4 M) |
Quaternion manipulation API.
Quaternions are stored as a 4-tuple where the vector part is (x,y,z) and scalar part is w.
Quaternion utilities using bj_real
with {x
,y,z,w} layout.
The functions here support identity, multiplication, conjugation, axis-angle creation, rotating vectors, and conversions to/from 4×4 rotation matrices.