Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disadvantages of sleeping bodies in Box2D

Tags:

c++

box2d

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?

like image 775
Paul Manta Avatar asked Nov 18 '11 10:11

Paul Manta


1 Answers

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.

like image 92
nonVirtualThunk Avatar answered Sep 18 '22 21:09

nonVirtualThunk