mirror of
https://github.com/recp/cglm.git
synced 2025-12-24 20:34:58 +00:00
aabb: center of AABB helper
* it is just wrapper of vec_center but it saves to access min and max values of AABB
This commit is contained in:
@@ -200,4 +200,16 @@ glm_aabb_radius(vec3 box[2]) {
|
||||
return glm_aabb_size(box) * 0.5f;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief computes center point of AABB
|
||||
*
|
||||
* @param[in] box bounding box
|
||||
* @param[out] dest center of bounding box
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_aabb_center(vec3 box[2], vec3 dest) {
|
||||
glm_vec_center(box[0], box[1], dest);
|
||||
}
|
||||
|
||||
#endif /* cglm_box_h */
|
||||
|
||||
@@ -51,6 +51,11 @@ glmc_aabb_size(vec3 box[2]);
|
||||
CGLM_EXPORT
|
||||
float
|
||||
glmc_aabb_radius(vec3 box[2]);
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_aabb_center(vec3 box[2], vec3 dest);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user