Page 1 of 1
Unwanted deceleration
Posted: Tue Mar 20, 2012 12:34 pm
by Peter Prins
Hello,
I've made an Entity with LinearDampening set to 0 and ActivityInformation.IsAlwaysActive set to true. However when the object is moving at a very low velocity (at .2 units per second) The object starts to bleed velocity. The velocity approaches zero but never completely reaches it.
Re: Unwanted deceleration
Posted: Tue Mar 20, 2012 7:04 pm
by Norbo
That's caused by the deactivation system attempting to stabilize the simulation. It saps energy out of slow-moving objects to pull them into complete deactivation faster. It's active by default even for always-active objects for consistency in behavior, but it can be disabled by setting the entity.ActivityInformation.AllowStabilization = false.
It can also be disabled across the board by setting the Space.DeactivationManager.UseStabilization = false.
Re: Unwanted deceleration
Posted: Tue Mar 20, 2012 8:35 pm
by Peter Prins
Alright, thanks for the info.
Re: Unwanted deceleration
Posted: Wed Mar 21, 2012 10:18 pm
by Peter Prins
Since I want None of my entities to be deactivated I've been looking for a way to turn of the Deactivation manager completely. Setting Enabled to false seems to stop Simulation Islands from falling apart when Entities leave each-other's vicinity. I thought of setting MaximumDeactivationAttemptsPerFrame to zero, but looking at the code it seems to me that this would stop Orphaned Simulation Islands from being removed.
Re: Unwanted deceleration
Posted: Wed Mar 21, 2012 10:23 pm
by Norbo
The easiest option is to set IsAlwaysActive to true for all the objects. Conceptually, the simulation islands would become unnecessary, but disabling them completely in practice is probably more work than it's worth.