meiyunyang / chipmunk-physics

Automatically exported from code.google.com/p/chipmunk-physics
MIT License
0 stars 0 forks source link

Solver doesn't solve colliding objects that occupy the same exact space #26

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create two identical colliding shapes
2. Put them at the same exact location in space
3. Run the simulation

What is the expected output? What do you see instead?
I might expect the solver to randomly pick a direction to move each object that 
is on top of the other by say...a pixel, then the solver works correctly.

What version of the product are you using? On what operating system?
Came with cocos2d-iphone 0.99.4

Please provide any additional information below.
This physics engine is freakin awesome.

Original issue reported on code.google.com by mikehane...@gmail.com on 8 Oct 2010 at 8:08

GoogleCodeExporter commented 8 years ago
Looks like this only happens to circle shapes. I changed it so they always 
separate left/right.

I could change it so that it generates a semi-random normal based on the shape 
ids, but I want the behavior to be deterministic at least. As this is already a 
strange edge case, I don't feel bad doing a simple left/right behaviour. If you 
want the objects to separate randomly, give their starting positions a random 
offset.

Original comment by slemb...@gmail.com on 8 Oct 2010 at 2:48

GoogleCodeExporter commented 8 years ago

Original comment by slemb...@gmail.com on 8 Oct 2010 at 2:48