VgaGames 3 - Collision-detection man-pages

[.. upper level ..]

VG3_coll_q_find()

Return all object-instances in a quadtree which collide with a moving object-instance.
SYNTAX
int VG3_coll_q_find(struct vg3_quadtree *qdtr, struct vg3_rect *rectfrom, struct vg3_rect *rectto, struct vg3_coll **pcoll)

FUNCTION PARAMETERS
qdtr Quadtree
rectfrom Begin position of the moving object-instance
rectto End position of the moving object-instance, or NULL
pcoll For returning allocated array with collision values of collided object-instances,
sorted by from near to far;
it returns NULL if no collision was found

RETURN VALUE
Returns number of collided object-instances in pcoll, or -1 on failure.

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

DESCRIPTION
Return for a moving object-instance, represented by two rectangles, all object-instances which collide with it. The returned list is sorted from the nearest to the farest object-instances. The returned list has to be checked until a collision is found valid, then this object-instance is used for the collision. The returned list has to be freed with a free().

SEE ALSO
VG3_coll_check()