Пример #1
0
 def static_point_query(self, point, func, data=None):
     """Query the space for collisions between a point and the static 
     shapes in the space. Call the callback function when a colliosion is 
     found.
     
     :Parameters:
         point : (x,y) or `Vec2d`
             Define where to check for collision in the space.
         func : ``func(shape, data)``
             The callback function.
         shape : `Shape`
             The colliding shape
         data : any
             Data argument sent to the point_query function
     """       
     f = self._get_query_cf(func, data)
     cp.cpSpaceStaticShapePointQuery(self._space, point, f, None)
Пример #2
0
 def point_query(self, point, func, data=None):
     """Query the space for collisions between a point and its shapes 
     (both static and nonstatic shapes)
     
     :Parameters:    
         point : (x,y) or `Vec2d`
             Define where to check for collision in the space.
         func : ``func(shape, data)``
             Called when a collision is found
         shape : `Shape`
             The colliding shape
         data : any
             Data argument sent to the point_query function
     """       
     f = self._get_query_cf(func, data)
     cp.cpSpaceShapePointQuery(self._space, point, f, None)
     cp.cpSpaceStaticShapePointQuery(self._space, point, f, None)