When creating a world in Box2D you have the option to enable bodies to sleep (no simulation is done on them if they come to rest). Why isn’t sleeping the default option? What disadvantages does it have?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
In my experience, at least in other physics engines, sleeping when coming to rest is the default behavior. The main reason I can think of not to have bodies sleep is that once they are sleeping they will only be woken by a collision. That is, if you were to remove whatever is under the sleeping object, it would not fall, but rather remain frozen in the air until something collides with it and causes it to respond to gravity again.