I create it here:
Code: Select all
def createLine():
radius = randrange(1,5)
mass = 10.0
body = pm.Body(mass, 10000)
body.position = randrange(0,640), randrange(0,400)
shape = pm.Segment(body, (randrange(-200,-10), 0), (randrange(10,200), 0.0), radius)
space.add(body, shape)
Code: Select all
if isinstance(shape, pm.Segment):
print shape.radius
Think a solution is presented here: http://www.slembcke.net/forums/viewtopi ... dius#p1223 , but I don't understand it: "cast your shape to (cpSegmentShape*) to get access to cpVect a, b, n and cpFloat r (thickness)", what's "casting a shape"?