def SetupODE(self): # Create a world object self.world = ode.dWorld() self.world.setGravity(0, -9.81, 0) self.world.setERP(0.8) self.world.setCFM(1e-5) # Create a space object self.space = ode.CreateSimpleSpace() # Create a plane geom which prevent the objects from falling forever self.floor = ode.dPlane(space.id(), 0.0, 1.0, 0.0, 0.0) # A list with ODE bodies self.odebodies = [] # A joint group for the contact joints that are generated whenever # two bodies collide self.contactgroup = ode.dJointGroup()
contactCount = ode.dCollide(geom1, geom2) # Create contact joints world,contactgroup = args for c in contacts: c.setBounce(0.2) c.setMu(5000) j = ode.ContactJoint(world, contactgroup, c) j.attach(geom1.getBody(), geom2.getBody()) ###################################################################### # Create a world object world = ode.dWorld() world.setGravity( 0,-9.81,0 ) world.setERP(0.8) world.setCFM(1E-5) # Create a space object space = ode.CreateSimpleSpace() # Create a plane geom which prevent the objects from falling forever floor = ode.dPlane(space.id(), 0.0, 1.0, 0.0, 0.0) # A list with ODE bodies bodies = [] # A joint group for the contact joints that are generated whenever # two bodies collide