| Trees | Indices | Toggle frames |
|---|
Implements the CollisionManager interface based on the scheme known as spatial hashing.
The idea behind is to divide the space in rectangles with a given width and height, and have a table telling which objects overlaps each rectangle.
Later, when the question 'which know objects has such and such spatial relation with <some object>' arrives, only the objects in rectangles overlaping <some object> (or nearby ones) needs to be examined for the condition.
Look at CollisionManager for other class and methods documentation.
|
__init__(self,
xmin,
xmax,
ymin,
ymax,
cell_width,
cell_height)
Cell width and height have impact on performance.
|
|
| add(self, obj) | |
| remove_tricky(self, obj) | |
| clear(self) | |
| they_collide(self, obj1, obj2) | |
| objs_colliding(self, obj) | |
| iter_colliding(self, obj) | |
| any_near(self, obj, near_distance) | |
| objs_near(self, obj, near_distance) | |
| objs_near_wdistance(self, obj, near_distance) | |
| ranked_objs_near(self, obj, near_distance) | |
| iter_all_collisions(self) | |
| knows(self, obj) | |
| known_objs(self) | |
| objs_touching_point(self, x, y) | |
| objs_into_box(self, minx, maxx, miny, maxy) |
| Trees | Indices | Toggle frames |
|---|
| Generated by Epydoc 3.0beta1 on Wed Oct 26 10:00:13 2011 | http://epydoc.sourceforge.net |