mirror of
https://github.com/recp/cglm.git
synced 2025-10-03 16:51:35 +00:00
remove _aabb2d_frustum
This commit is contained in:
@@ -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
|
||||
*
|
||||
|
@@ -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]);
|
||||
|
@@ -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
|
||||
*
|
||||
|
Reference in New Issue
Block a user