VgaGames 3 - Collision-detection man-pages

[.. upper level ..]

VG3_coll_q_new()

Create an empty quadtree for collision detection.
SYNTAX
struct vg3_quadtree * VG3_coll_q_new(struct vg3_rect *rect, int max_rect, int max_level)

FUNCTION PARAMETERS
rect Rectangle which the quadtree shall cover,
normally the elements x and y are 0, and w and h give the size
max_rect number of objects in a (sub-)quadtree before a new sub-quadtree is created, or 0 = use default
max_level highest number of nested sub-quadtrees, or 0 = use default

RETURN VALUE
Returns a pointer to the created quadtree or NULL on failure.

ERRORS
On error VG3_errmsg() returns: EINVAL - error in argument ENOMEM - cannot get memory

DESCRIPTION
Create a new empty quadtree for collision detection and return pointer to it. A quadtree should cover the whole background of the game, that is it must have the size of the background, on which all objects are located.

SEE ALSO
VG3_coll_q_free() VG3_coll_q_tag()