I can't get QueryAABB to work in PyBox2D. What am I doing wrong?
<p>I'm trying to detect if the mouse pointer is over a body so i can drag it but i'm getting the error below. I don't know if it's me or a bug in pybox2d but i've been at it for hours and the docs are ancient. </p>

<pre><code>&gt;&gt;&gt; from Box2D.b2 import *
&gt;&gt;&gt; w = world()
&gt;&gt;&gt; my_body = w.CreateDynamicBody(position=(1,1))
&gt;&gt;&gt; aabb = AABB()
&gt;&gt;&gt; aabb.lowerBound = (1-.001,1-.001)
&gt;&gt;&gt; aabb.upperBound = (1+.001,1+.001)
&gt;&gt;&gt; def callback(fixture):
...     shape = fixture.shape
...     p = (1,1)
...     if fixture.body.type != 0: # type 0 is static
...             if shape.TestPoint(fixture.body.transform,p):
...                     return False
...     return True
... 
&gt;&gt;&gt; w.QueryAABB(callback,aabb)
Traceback (most recent call last):
  File "&lt;stdin&gt;", line 1, in &lt;module&gt;
TypeError: in method 'b2World_QueryAABB', argument 2 of type 'b2QueryCallback *'
</code></pre>

<p>Obviously, I expect the query to return True (no shape detected, keep looking), because I haven't created a shape for the body but that doesn't explain the type error. Please help, thanks in advance!</p>

<p>silly me i figured it out. right there in the 'ancient' docs.</p>

<p><a href="https://github.com/pybox2d/pybox2d/wiki/manual#aabb-queries" rel="nofollow">https://github.com/pybox2d/pybox2d/wiki/manual#aabb-queries</a></p>

python python-3.x box2d