From: Dodo D. <dod...@go...> - 2009-04-22 04:19:32
|
hey i was running the tutorial 3 with python2.5.2 and noticed that there is a bug in the create_box function ... my little repair-hack is: * geom_cache = [] #hack* def create_box(world, space, density, lx, ly, lz): """Create a box body and its corresponding geom.""" # Create body body = ode.Body(world) M = ode.Mass() M.setBox(density, lx, ly, lz) body.setMass(M) # Set parameters for drawing the body body.shape = "box" body.boxsize = (lx, ly, lz) # Create a box geom for collision detection geom = ode.GeomBox(space, lengths=body.boxsize) geom.setBody(body) *geom_cache.append(geom) #hack* return body the problem is that the garbage collector frees the geom-objects after left from the function, which are neccessary for collision-detection. sincerely dodo |