Anpheus
03-30-2005, 16:41
I was unable to get Borland Delphi to work so, I have an idea for a module:
Region Module-
Enables area-based functions to be called when entities of certain types have entered the region.
flags for region_complement, region_union, region_change
a - Following arguments represent pairs of two vertices
b - Following arguments represent ids
c - Take complement of input value region(s) (Inverted/complement regions cannot (easily) be used with Union or Intersection, so either it can error with this flag or return false/0.)
flags for region_add:
a - Option to call function each frame is within the region.
b - Option to call function every frame a player enters or leaves.
Natives-
region_add(id, const function[], Float:vertex_a[3], Float:vertex_b[3], flags[] = "")
region_destroy(id)
region_union(id, flags[] = "", ...)
region_intersection(id, flags[] = "", ...)
region_complement(id, flags[] = "", ...)
region_exists(id)
region_change(id, flags[] = "", ...)
region_shape(id) //Returns one of the two constants.
region_vertices(id, Float:vertex_a[3], Float:vertex_b[3])
region_size(id, Float:size[3]) //Returns the product of x y and z as well.
region_origin(id, Float:origin[3])
Constants-
enum { //Shape values
REGION_OCTAHEDRON //Cubic, the 'inside' is considered to be bounded by a finite space between pairs of planes on the x, y, and z axis.
REGION_INVERTED //Anything 'outside' the area bounded by the planes between the defined vertices area is considered in the cube.
}
enum { //Status values
ENTITY_REG_IN = 1<<0 //Applies while an entity is in the region
ENTITY_REG_ENTER = 1<<1 //Applies
ENTITY_REG_LEAVE = 1<<2 //Used
}
Region forward arguments: id, status
Update: Added region_intersection. region_union would be more difficult to implement so I don't believe it would be a requirement.
Region Module-
Enables area-based functions to be called when entities of certain types have entered the region.
flags for region_complement, region_union, region_change
a - Following arguments represent pairs of two vertices
b - Following arguments represent ids
c - Take complement of input value region(s) (Inverted/complement regions cannot (easily) be used with Union or Intersection, so either it can error with this flag or return false/0.)
flags for region_add:
a - Option to call function each frame is within the region.
b - Option to call function every frame a player enters or leaves.
Natives-
region_add(id, const function[], Float:vertex_a[3], Float:vertex_b[3], flags[] = "")
region_destroy(id)
region_union(id, flags[] = "", ...)
region_intersection(id, flags[] = "", ...)
region_complement(id, flags[] = "", ...)
region_exists(id)
region_change(id, flags[] = "", ...)
region_shape(id) //Returns one of the two constants.
region_vertices(id, Float:vertex_a[3], Float:vertex_b[3])
region_size(id, Float:size[3]) //Returns the product of x y and z as well.
region_origin(id, Float:origin[3])
Constants-
enum { //Shape values
REGION_OCTAHEDRON //Cubic, the 'inside' is considered to be bounded by a finite space between pairs of planes on the x, y, and z axis.
REGION_INVERTED //Anything 'outside' the area bounded by the planes between the defined vertices area is considered in the cube.
}
enum { //Status values
ENTITY_REG_IN = 1<<0 //Applies while an entity is in the region
ENTITY_REG_ENTER = 1<<1 //Applies
ENTITY_REG_LEAVE = 1<<2 //Used
}
Region forward arguments: id, status
Update: Added region_intersection. region_union would be more difficult to implement so I don't believe it would be a requirement.