diff --git a/docs/source/aabb2d.rst b/docs/source/aabb2d.rst index 4bdf278..d7ecdbb 100644 --- a/docs/source/aabb2d.rst +++ b/docs/source/aabb2d.rst @@ -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` @@ -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 diff --git a/include/cglm/aabb2d.h b/include/cglm/aabb2d.h index c88d72b..cfb3480 100644 --- a/include/cglm/aabb2d.h +++ b/include/cglm/aabb2d.h @@ -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 * diff --git a/include/cglm/call/aabb2d.h b/include/cglm/call/aabb2d.h index 7e384fd..3cc0593 100644 --- a/include/cglm/call/aabb2d.h +++ b/include/cglm/call/aabb2d.h @@ -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]); diff --git a/include/cglm/struct/aabb2d.h b/include/cglm/struct/aabb2d.h index b2b4d3c..091e3a1 100644 --- a/include/cglm/struct/aabb2d.h +++ b/include/cglm/struct/aabb2d.h @@ -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 * diff --git a/src/aabb2d.c b/src/aabb2d.c index 8cd3957..80a3ee0 100644 --- a/src/aabb2d.c +++ b/src/aabb2d.c @@ -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]) {