Unwanted deceleration

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Peter Prins
Posts: 54
Joined: Fri Mar 11, 2011 11:44 pm

Unwanted deceleration

Post 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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Unwanted deceleration

Post 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.
Peter Prins
Posts: 54
Joined: Fri Mar 11, 2011 11:44 pm

Re: Unwanted deceleration

Post by Peter Prins »

Alright, thanks for the info.
Peter Prins
Posts: 54
Joined: Fri Mar 11, 2011 11:44 pm

Re: Unwanted deceleration

Post 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.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Unwanted deceleration

Post 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.
Post Reply