$Date: 2005/10/23 10:49:44 $
$Revision: 1.18 $
-- returns a collidable that collides with a certain position.
-- this can be useful, for getting a single collision with the mouse
-- the last in the list will be returned
-- counts the number of sets
-- a list of the collisions generated by check_for_collisions
-- if this is enabled (>0), the whole path from last_position to the current position
-- will be checked for a collision. This computations takes a lot of time, so if it
-- is not really necessary (if there are no such quick movements for example), don't
-- use it. An example of its usage is, that it prevents objects from flying through
-- walls or other thin items.
-- Performance: O(2^n)
-- the depth of bisection for search of intersection points of two collidable objects.
-- default is 0 (meaning just the final position of the collidables)
-- search_depth has to be greater than 0 in order to do movement_checks
-- all sets of collidables in the scene
-- draws all contained collidables on the screen, with clipping and zoom_factor
-- Add a_collidable to a certain set (takes the collidable and index as arguments)
-- adds all elements of collidable_list to the set
-- empties the set with index set_index
-- Removes a_collidable from any set containing it
-- removes a_collidable from a certain set
-- also draws the circumcircle of the collidable
-- sets the circumcircle color
-- This sets the clipping for the part to draw
-- The first argument is the top left corner of the screen.
-- for example if we want an object, that is situated at (5000, 1000), the
-- clipping should be moved to an appropriate position e.g. (4800, 800)
-- All objects outside of the clipping will not be displayed
-- sets the draw mode saved in filled
-- sets movement_check, see movement_check for more details
-- Performance for movement check: O(2^n)
-- Checks if any element collides with an other from another set
-- Saves the resulting collisions in the variable collisions
-- worst-case performance: O(n^2)
-- resets the cursors on sets_of_collidables
-- Apply action to every item in the collision detector.
-- Semantics not guaranteed if action changes the structure;
-- in such a case, apply iterator to clone of structure instead.
-- Is test true for all items?
-- returns true, if the collidable is in the detector
-- Performance: O(n)
This (2D) collision detector checks the added objects for collisions and generates a
list of all collisions (collisions: DS_LINKED_LIST[EM_COLLISION [G]]).
this is void, if no collision was found.
usage:
first specify, how many sets of collidables you would like to have added
A set of collidables is a list of collidable objects, that should not be checked for collisions with each
other, this may be useful, if for example there are objects, that do not move, compared to
each other, like compositions of collidables, or non-moving objects.
The number of sets may be increased and decreased later on.