How should I set a single callback which would trigger when there is no motion in the Space of Nape, when each body "goes to sleep"? I couldn't find any proper solution for this, but I guess this is a must-have for a physics engine. Thank you.
Asked
Active
Viewed 157 times
1 Answers
2
You could check space.liveBodies.length
on tick (wherever you're calling space.step()
).
When it reaches 0
, then all bodies are sleeping.

Marcela
- 3,728
- 1
- 15
- 21
-
This is excactly what I was looking for! Thank you! – momijigari Sep 10 '14 at 08:39