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
reproduction case!
Ethan
--- pyode-collision-bug.py 2007-06-13 18:32:52.000000000 -0400
+++ pyode-collision-new.py 2007-06-13 18:40:41.000000000 -0400
@@ -337,8 +337,8 @@
geom.setPosition((x1,y1,0))
#print Rect(x1,y1,lx,ly) # this will error if units get too large
#x1,y1 = cameraOffset(x1,y1)
- p1 = x1,y1
- p2 = x1+lx,y1+ly
+ p1 = x1-lx/2,y1-ly/2
+ p2 = x1+lx/2,y1+ly/2
p3 = p1[0],p2[1]
p4 = p2[0],p1[1]
points = p1,p4,p2,p3
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Pyode-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/pyode-user