From 7e6a4632561fa2d2f9e427010ec04b70e701cdae Mon Sep 17 00:00:00 2001 From: duarm Date: Mon, 19 Feb 2024 14:38:05 -0300 Subject: [PATCH] call api --- include/cglm/aabb2d.h | 3 ++- include/cglm/call/aabb2d.h | 6 +++++- src/aabb2d.c | 10 ++++++++-- 3 files changed, 15 insertions(+), 4 deletions(-) diff --git a/include/cglm/aabb2d.h b/include/cglm/aabb2d.h index ad9bbd704..6a133ffd9 100644 --- a/include/cglm/aabb2d.h +++ b/include/cglm/aabb2d.h @@ -169,9 +169,10 @@ glm_aabb2d_diagonal(vec2 aabb[2]) { } /*! - * @brief distance between of min and max + * @brief size of aabb * * @param[in] aabb bounding aabb + * @param[out] dest size */ CGLM_INLINE void diff --git a/include/cglm/call/aabb2d.h b/include/cglm/call/aabb2d.h index 6eace3280..fc8ddf36d 100644 --- a/include/cglm/call/aabb2d.h +++ b/include/cglm/call/aabb2d.h @@ -50,7 +50,11 @@ glmc_aabb2d_isvalid(vec2 aabb[2]); CGLM_EXPORT float -glmc_aabb2d_size(vec2 aabb[2]); +glmc_aabb2d_diagonal(vec2 aabb[2]); + +CGLM_EXPORT +void +glmc_aabb2d_size(vec2 aabb[2], vec2 dest); CGLM_EXPORT float diff --git a/src/aabb2d.c b/src/aabb2d.c index 80a3ee050..cc651b4d9 100644 --- a/src/aabb2d.c +++ b/src/aabb2d.c @@ -55,8 +55,14 @@ glmc_aabb2d_isvalid(vec2 aabb[2]) { CGLM_EXPORT float -glmc_aabb2d_size(vec2 aabb[2]) { - return glm_aabb2d_size(aabb); +glmc_aabb2d_diagonal(vec2 aabb[2]) { + return glm_aabb2d_diagonal(aabb); +} + +CGLM_EXPORT +void +glmc_aabb2d_size(vec2 aabb[2], vec2 dest) { + return glm_aabb2d_size(aabb, dest); } CGLM_EXPORT