Changing environment drag settings?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Spankenstein
Posts: 249
Joined: Wed Nov 17, 2010 1:49 pm

Changing environment drag settings?

Post by Spankenstein »

If I fling an object around at zero gravity then it will eventually come to a stop.

Is there a property that I can use to increase/decrease environment drag for all objects?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Changing environment drag settings?

Post by Norbo »

Not all objects at once, but all entities have their own LinearDamping/AngularDamping setting.
Spankenstein
Posts: 249
Joined: Wed Nov 17, 2010 1:49 pm

Re: Changing environment drag settings?

Post by Spankenstein »

I've set all objects to 0 for both LinearDamping & AngularDamping but they are still slowing down. Do I have to change their coefficient of restitution to 1 as well?

Is there anything else I will have to take into consideration for them to keep the same speed at which they were initially given and never slow down?
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Changing environment drag settings?

Post by Norbo »

Do I have to change their coefficient of restitution to 1 as well?
If objects are colliding a bunch, then yes.
Is there anything else I will have to take into consideration for them to keep the same speed at which they were initially given and never slow down?
If the objects are moving slower than a configurable velocity threshold, then they will be slowed by the deactivation system. This can be turned off by setting the Space.DeactivationManager.UseStabilization to false. Individual entity.ActivityInformation.AllowStabilization properties can also be used to only turn it off for some entities.

Collisions will introduce complexity which is hard to track. Speeds will change over time due to the collisions, but the energy should be roughly conserved if the coefficient of restitution is 1. The total measured energy of the system will likely change over time with continued collisions either a bit up or a bit down, but it should be close enough that it doesn't matter for almost all simulations.
Spankenstein
Posts: 249
Joined: Wed Nov 17, 2010 1:49 pm

Re: Changing environment drag settings?

Post by Spankenstein »

Wonderful stuff. Thanks :)
Post Reply