dynamic physics objects not sleeping?

I’m trying to optimize my game for lower-end hardware and find that the number of physics objects seems to radically affect the framerate on lower end iOS devices. Using “hybrid” display modeI noticed that nearly all the dynamic objects in my world are not sleeping, ever. This seems like a pretty major bug in the physics engine, affecting performance.

Objects will sit on the ground doing nothing but never sleep. I thought perhaps the mere fact of touching the ground was preventing them from sleeping BUT there are a couple objects that do sleep while at rest on the ground. Other objects won’t sleep until they are hit by another physics object. But most objects won’t sleep at all, even if they are previously whacked.

Has anyone noticed this, or figured out how to get resting objects to sleep? I tried setting all objects’ bounce to 0, and played around with gravity, but nothing I did had any affect. Is this a known bug? I know physics improvements are on the roadmap, but it would be really great to know what some of the known limitations and bugs in the current physics system are so I don’t end up spending days trying to improve performance to no avail.

[import]uid: 9422 topic_id: 11957 reply_id: 311957[/import]

I’ll revise what I said above slightly. Gravity does affect one of my objects ability to sleep. I have one object hanging from a chain of objects using joints (like a ball on a chain). If I set physics.setGravity (0, 9) the ball and chain never sleep. If I set physics.setGravity (0, 8) or less, the ball and chain sleep!

This is really weird and unintuitive behavior. To my eye the objects are at rest no matter what the gravity is set to. And why should gravity make any difference on whether resting objects sleep or not?

Walter, any idea what’s going on here?
[import]uid: 9422 topic_id: 11957 reply_id: 43593[/import]