Skip to content

Commit

Permalink
remove _aabb2d_frustum
Browse files Browse the repository at this point in the history
  • Loading branch information
duarm committed Dec 6, 2023
1 parent c1d78d8 commit 2106f9e
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 84 deletions.
17 changes: 0 additions & 17 deletions docs/source/aabb2d.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ Functions:
#. :c:func:`glm_aabb2d_merge`
#. :c:func:`glm_aabb2d_crop`
#. :c:func:`glm_aabb2d_crop_until`
#. :c:func:`glm_aabb2d_frustum`
#. :c:func:`glm_aabb2d_invalidate`
#. :c:func:`glm_aabb2d_isvalid`
#. :c:func:`glm_aabb2d_size`
Expand Down Expand Up @@ -93,22 +92,6 @@ Functions documentation
| *[in]* **clampAabb** miniumum box
| *[out]* **dest** cropped bounding box
.. c:function:: bool glm_aabb2d_frustum(vec2 aabb[2], vec4 planes[6])
| check if AABB intersects with frustum planes
this could be useful for frustum culling using AABB.
OPTIMIZATION HINT:
if planes order is similar to LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR
then this method should run even faster because it would only use two
planes if object is not inside the two planes
fortunately cglm extracts planes as this order! just pass what you got!
Parameters:
| *[in]* **aabb** bounding box
| *[out]* **planes** frustum planes
.. c:function:: void glm_aabb2d_invalidate(vec2 aabb[2])
| invalidate AABB min and max values
Expand Down
32 changes: 0 additions & 32 deletions include/cglm/aabb2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,38 +121,6 @@ glm_aabb2d_crop_until(vec2 aabb[2],
glm_aabb2d_merge(clampAabb, dest, dest);
}

/*!
* @brief check if AABB intersects with frustum planes
*
* this could be useful for frustum culling using AABB.
*
* OPTIMIZATION HINT:
* if planes order is similar to LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR
* then this method should run even faster because it would only use two
* planes if object is not inside the two planes
* fortunately cglm extracts planes as this order! just pass what you got!
*
* @param[in] aabb bounding aabb
* @param[in] planes frustum planes
*/
CGLM_INLINE
bool
glm_aabb2d_frustum(vec2 aabb[2], vec4 planes[6]) {
float *p, dp;
int i;

for (i = 0; i < 6; i++) {
p = planes[i];
dp = p[0] * aabb[p[0] > 0.0f][0]
+ p[1] * aabb[p[1] > 0.0f][1];

if (dp < -p[3])
return false;
}

return true;
}

/*!
* @brief invalidate AABB min and max values
*
Expand Down
4 changes: 0 additions & 4 deletions include/cglm/call/aabb2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,6 @@ glmc_aabb2d_crop_until(vec2 aabb[2],
vec2 clampAabb[2],
vec2 dest[2]);

CGLM_EXPORT
bool
glmc_aabb2d_frustum(vec2 aabb[2], vec4 planes[6]);

CGLM_EXPORT
void
glmc_aabb2d_invalidate(vec2 aabb[2]);
Expand Down
25 changes: 0 additions & 25 deletions include/cglm/struct/aabb2d.h
Original file line number Diff line number Diff line change
Expand Up @@ -105,31 +105,6 @@ glms_aabb2d_(crop_until)(vec2s aabb[2],
glms_aabb2d_(merge)(clampAabb, dest, dest);
}

/*!
* @brief check if AABB intersects with frustum planes
*
* this could be useful for frustum culling using AABB.
*
* OPTIMIZATION HINT:
* if planes order is similar to LEFT, RIGHT, BOTTOM, TOP, NEAR, FAR
* then this method should run even faster because it would only use two
* planes if object is not inside the two planes
* fortunately cglm extracts planes as this order! just pass what you got!
*
* @param[in] aabb bounding box
* @param[in] planes frustum planes
*/
CGLM_INLINE
bool
glms_aabb2d_(frustum)(vec2s box[2], vec4s planes[6]) {
vec2 rawBox[2];
vec4 rawPlanes[6];

glms_vec2_(unpack)(rawBox, box, 2);
glms_vec4_(unpack)(rawPlanes, planes, 6);
return glm_aabb2d_frustum(rawBox, rawPlanes);
}

/*!
* @brief invalidate AABB min and max values
*
Expand Down
6 changes: 0 additions & 6 deletions src/aabb2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ glmc_aabb2d_crop_until(vec2 aabb[2],
glm_aabb2d_crop_until(aabb, cropAabb, clampAabb, dest);
}

CGLM_EXPORT
bool
glmc_aabb2d_frustum(vec2 aabb[2], vec4 planes[6]) {
return glm_aabb2d_frustum(aabb, planes);
}

CGLM_EXPORT
void
glmc_aabb2d_invalidate(vec2 aabb[2]) {
Expand Down

0 comments on commit 2106f9e

Please sign in to comment.