region_set(STRING* name, var mode)

Disables or enables all branches of the ABT resp. BSP tree that are contained in the region with the given name. This is like punching a rectangular hole into the view frustum, thus clipping away all objects inside that region. It can be used f.i. for disabling the rendering of objects inside a building as long as the camera is outside or the doors are closed.


name - region name, STRING* or char*.
mode - 0: no clipping (default), 1: clip away objects that are mostly inside the region, 2: clip away objects that are fully inside the region.
In the future, further modes can be used for triggering events etc.


0 if the region was not found, otherwise nonzero.





A8  P 


region_set("reg_001",1); // clips away all regions with the name "reg_001"

See also:

path_set, region_check, region_create, region_find, region_get

► latest version online