From: Ethan Glasser-C. <gla...@us...> - 2007-06-16 06:50:16
|
Update of /cvsroot/pyode/pyode/examples In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv915/examples Modified Files: tutorial3.py Log Message: Reapply weakref patch after finding bug in tutorial3.py. Index: tutorial3.py =================================================================== RCS file: /cvsroot/pyode/pyode/examples/tutorial3.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** tutorial3.py 16 Dec 2005 17:06:48 -0000 1.2 --- tutorial3.py 16 Jun 2007 06:50:11 -0000 1.3 *************** *** 94,98 **** geom.setBody(body) ! return body # drop_object --- 94,98 ---- geom.setBody(body) ! return body, geom # drop_object *************** *** 100,106 **** """Drop an object into the scene.""" ! global bodies, counter, objcount ! body = create_box(world, space, 1000, 1.0,0.2,0.2) body.setPosition( (random.gauss(0,0.1),3.0,random.gauss(0,0.1)) ) theta = random.uniform(0,2*pi) --- 100,106 ---- """Drop an object into the scene.""" ! global bodies, geom, counter, objcount ! body, geom = create_box(world, space, 1000, 1.0,0.2,0.2) body.setPosition( (random.gauss(0,0.1),3.0,random.gauss(0,0.1)) ) theta = random.uniform(0,2*pi) *************** *** 109,112 **** --- 109,113 ---- body.setRotation([ct, 0., -st, 0., 1., 0., st, 0., ct]) bodies.append(body) + geoms.append(geom) counter=0 objcount+=1 *************** *** 198,201 **** --- 199,205 ---- bodies = [] + # The geoms for each of the bodies + geoms = [] + # A joint group for the contact joints that are generated whenever # two bodies collide |