vec: add addadd, subadd and muladd helpers

This commit is contained in:
Recep Aslantas
2018-04-13 15:46:43 +03:00
parent d841f8809d
commit c05f58a169
10 changed files with 286 additions and 2 deletions

View File

@@ -109,4 +109,18 @@ test_vec4(void **state) {
glm_vec4_scale(v1, 0.8, v1);
glm_vec4_scale_as(v, 0.8, v);
test_assert_vec4_eq(v1, v);
/* addadd, subadd, muladd */
glm_vec4_one(v);
glm_vec4_addadd(GLM_VEC4_ONE, GLM_VEC4_ONE, v);
assert_true(glmc_vec4_eq_eps(v, 3));
glm_vec4_subadd(GLM_VEC4_ONE, GLM_VEC4_ZERO, v);
assert_true(glmc_vec4_eq_eps(v, 4));
glm_vec4_broadcast(2, v1);
glm_vec4_broadcast(3, v2);
glm_vec4_muladd(v1, v2, v);
assert_true(glmc_vec4_eq_eps(v, 10));
}