Body activationControl and force of gravity

When there are no collisions and only gravity on a pendulum, I’m seeing some unexpected sleep behavior. This easily-editable playground shows the effects.

Neither applying a zero force nor setting ActivationControl seems to wake up a physicsBody.

The original forum thread where this started.

The playground also shows that an engine gravity value of zero vector is different than a small non-zero value (e.g. -0.01).

The expected outcome is that with engine gravity and without applyForce, ActivationControl should result in all balls aligned after settling.

Also, it would be very useful if a tolerance could be specified for sleep/activation. It might be useful for each body to allow a different tolerance.

1 Like

so, if I sum it up correctly, you want a way to set a speed/torque threshold value for setting bodies to sleep?

1 Like

Yes. My idea was to set it to something just below “shimmering” where a body would go to sleep when the imposed velocity is not visible. However, that’s complicated by whether there are constraints and when exactly the threshold is applied. My current thought is that the threshold needs to be applied after constraints and, perhaps to each resultant orthogonal vector.I’ll need more experiments to hone my recommendation, because if applied prior to constraints on the entire force, gravity (as a constant) will always (or never) be thresholded.

It’s also complicated by varying resolutions. But I woudn’t expect automatic accomodation of resolution. Though if possible, that would be awesome.

You may already know enough to apply the recommendation to obtain the expected and performant effect?

1 Like