What can awake sleeping bodies without presence of constraints? #139
-
Hello! I have another question again, this time I ran into a strange problem with my integration, I'm not too sure if it's a corner case or not, but I'd like to better understand what could be going on. I have a number of kinematic bodies (a single Box that's a singular child of a Compound) that are densely overlapping each other and pretty large (hundreds of units). They are not being changed at all from my end, they have no velocity and their pose isn't being changed. They're configured with BodyActivity description with 0.1f threshold and just 2 timesteps before they sleep. I've also verified following:
There's constantly around 63-64 active bodies (in the ActiveSet), Every frame some of them seem to sleep, but then another gets woken up again. It seems like it's a self perpetuating cycle, that prevents all of them from going to sleep, despite nothing changing externally. I'm trying to understand what's going on. Why don't they all go to sleep? Since no contacts are allowed to be generated, what could be waking them up? I've read up some of the info on Activity management here: I don't have best understanding of what exactly it does right now, but from what I can glean, is it possible they end up waking up because they become part of another island that is awake? Any insights into what might be going on would definitely be appreciated. In this case, I plan on actually making them Statics instead, but I'm a bit confused by this behavior, but I'm trying to understand how things work under the hood so I avoid any performance gotcha's and such. If it helps I can see if I can replicate this with the Demo project, if you'd like to do some testing, but I thought I'd ask first! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 3 replies
-
Islands are defined by the constraint connectivity graph, so in order for the bodies to be awoken by some other active bodies, there would need to be a constraint connecting them. With no contact constraints, it would have to be through non-contact constraints (e.g. BallSocket). Apart from constraints, the only thing that wakes bodies up is calling functions which directly or indirectly wake them up. Anything that bottoms out calling the
If I'm not mistaken, that's an exhaustive list as of 2.3.0/2.4.0. The unifying idea is that simulation modifications which would likely change what should be considered 'sleeping' should wake involved bodies up so that they can respond to the change. (And also it's sometimes just way simpler to do the involved bookkeeping when you know the involved bodies are active.) |
Beta Was this translation helpful? Give feedback.
Islands are defined by the constraint connectivity graph, so in order for the bodies to be awoken by some other active bodies, there would need to be a constraint connecting them. With no contact constraints, it would have to be through non-contact constraints (e.g. BallSocket).
Apart from constraints, the only thing that wakes bodies up is calling functions which directly or indirectly wake them up. Anything that bottoms out calling the
IslandAwakener
functionsAwakenBody
,AwakenConstraint
,AwakenSet
, orAwakenSets
.AwakenConstraint
is triggered when removing a constraint or callingApplyDescription
on a constraint. It will only wake bodies that are involved in the same island, so bodies…