new abs functions for vec2, ivec2, ivec3, ivec4

This commit is contained in:
duarm
2022-11-18 14:28:39 -03:00
parent 8cfc98d283
commit a0f01c5ed1
17 changed files with 177 additions and 1 deletions

View File

@@ -579,6 +579,20 @@ TEST_IMPL(GLM_PREFIX, vec2_clamp) {
TEST_SUCCESS
}
TEST_IMPL(GLM_PREFIX, vec2_abs) {
vec2 v1 = {2, -3}, v2 = {-12, -31};
vec2 v3, v4;
vec2 v5 = {2, 3}, v6 = {12, 31};
GLM(vec2_abs)(v1, v3);
GLM(vec2_abs)(v2, v4);
ASSERTIFY(test_assert_vec2_eq(v3, v5))
ASSERTIFY(test_assert_vec2_eq(v4, v6))
TEST_SUCCESS
}
TEST_IMPL(GLM_PREFIX, vec2_lerp) {
vec2 v1 = {-100.0f, -200.0f};
vec2 v2 = {100.0f, 200.0f};