I am using pymunk to simulate bodies moving. Because I want the bodies to move in a certain way I am setting their positions every time point (I know that this is not recommended for Chipmunk/Pymunk). Doing this gives me good results for individual bodies moving, but the problem is that when I do this the bodies seem to not be able to detect collisions anymore and they just pass through each other instead of colliding. I have tried making the time step smaller, but that doesn't seem to be helping. Does anyone have any tips for how I could fix this, or is this inescapable given I am setting the positions every time point?
Thanks.
Edited to show example code:
So I'm setting the position and angle like so every time step:
body.position = (body.position[0] + speed*cos(body.angle)*dt + (random term), \
body.position[1] + speed*sin(body.angle)*dt + (random term))
body.angle = body.angle + body.angular_velocity*dt + (random term)
I want to be able to do this because I have rectangular bodies and this code allows the rectangles to move along their long axes, and it works great for just one body, but when I have multiple bodies I also want collisions to work and this seems to make them not work at all (or if they're working, they're working very badly).