region_check(STRING* name, VECTOR* vMin, VECTOR* vMax)
Checks if a given bounding box lies within a certain region.
Parameters:
name - region name, STRING* or char*.
vMin - bounding box minimum coordinate.
vMin - bounding box maximum coordinate.
Returns:
0 - box is fully outside the region.
1 - box is partially inside the region.
2 - box is fully inside the region.
Speed:
Medium.
Remarks:
- Different regions can have the same name. In that case, region_check checks all regions with the given name.
- For testing a mere position, give the same vector for vMin and vMax.
- Regions can be placed in WED by clicking Add Region, or created with region_create.
Edition:
A8
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(region_check("trigger_01",vMin,vMax))
printf("Entity in region!");
See also:
view_check, region_set, region_find, region_create,
region_get
► latest version online