I think I've found a problem with collision detection. Attached is a
slightly modified version of the script I posted yesterday. When you
run it, you'll see two circles to the left and right and a square in
Gravity will cause the two circles to fall downward, but the square
has no body, and only serves to detect collisions. When a circle
contacts the square, it will turn blue.
As you can see, even those the circles never visibly come in contact
with the square, PyODE is still registering collisions with the left
circle. It's almost like PyODE thinks the square is positioned at
(0,0), even though geombox.getPosition() confirms it's positioned in
the center of the screen.
At first I thought this was a problem with my PyGame drawing routine,
but I can't find any errors. Can anyone else confirm problems with
PyODE detecting collisions with bodiless geoms? Is there any way to
Sorry Chris for the duplicate mail..
Chris Spencer wrote:
> As you can see, even those the circles never visibly come in contact
> with the square, PyODE is still registering collisions with the left
> circle. It's almost like PyODE thinks the square is positioned at
> (0,0), even though geombox.getPosition() confirms it's positioned in
> the center of the screen.
When I run this script, I get a huge amount of output, including a
huge number of lines like this:
Exception exceptions.ValueError: 'Non-placeable geoms do not have a
position.' in 'ode.collide_callback' ignored
However, I think I understand what you did wrong. Your error is "in"
the pygame drawing code. The position of a geom is always the center
of that geom. You got this right for your circles, but wrong for your
boxes. Attached is a patch which should draw boxes correctly.
There's 400 lines of source here. In the future, please give a simpler
Get latest updates about Open Source Projects, Conferences and News.