view_check(VIEW* view, VECTOR* vMin, VECTOR* vMax)
Checks if a given bounding box intersects a view frustum. For testing a mere position, give the same vector for vMin and vMax. A7.86
Parameters:
view - VIEW* pointer.
vMin - bounding box minimum coordinate.
vMin - bounding box maximum coordinate.
Returns:
0 - Box is fully outside the view frustum.
1 - Box is partially inside the view frustum.
2 - Box is fully inside the view frustum.
Speed:
Medium.
Example:
VECTOR vMin,vMax;
vec_set(vMin,my.x);
vec_set(vMax,my.x);
vec_add(vMin,my.min_x);
vec_add(vMax,my.max_x);
if(view_check(camera,vMin,vMax))
printf("Entity in view frustum!");
See also:
VIEW, view_to_light, region_check
► latest
version online