import ODE as ode

NUM= 10			## number of boxes
SIDE = 0.2		## side length of a box
MASS= 1.0		## mass of a box
RADIUS =0.1732	## sphere radius


## dynamics and collision objects

body=[]
box=[]
joint = []
for i in range(NUM):
    body.append(ode.dBody() )
    box.append(ode.dBox() )
    joint.append (ode.dBallJoint() )
contactgroup= ode.dJointGroup()
space = ode.dSimpleSpace(None)
world = ode.dWorld()

## this is called by space.collide when two objects in space are
## potentially colliding.

def nearCallback (data, o1, o2):

  ## exit without doing anything if the two bodies are connected by a joint
  b1 = ode.dGeomGetBody(o1)
  b2 = ode.dGeomGetBody(o2)
  if b1 and b2 and ode.dAreConnected (b1,b2):
    return