Angular velocity seems to reduce even with Damping at zero?

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
instinkt
Posts: 2
Joined: Sun Mar 05, 2017 3:32 am

Angular velocity seems to reduce even with Damping at zero?

Post by instinkt »

I'm trying to simulate the pitching/rolling of a spaceship by using Entity.AngularMomentum += (some vec) which kind of works, but unless the momentum is sufficiently high, the angular velocity seems to fall back down again to zero. I would like to very slowly roll my ships around so I just constantly get a small amount of rotation and then it stops.

I've set the AngularDamping to zero and I've also tried scaling the LocalInertiaTensor but that basically just seems to have the effect of scaling the mass which is not the effect I am after.

I'm not sure what I'm missing here. Does the type of entity matter? I'm using a convex hull generated from a set of vertices in the model.

Any help would be appreciated. Thanks
instinkt
Posts: 2
Joined: Sun Mar 05, 2017 3:32 am

Re: Angular velocity seems to reduce even with Damping at zero?

Post by instinkt »

And soon after I post this I think I found the answer. Even with Damping at 0 there is a stabilization step that is happening that stops slow moving objects. Setting DeactivationManager's VelocityLowerLimit to 0 solved my issues. Although I'm not sure how safe that is? Also it seems like you might want to use different lower values for linear vs angular velocities?

For now I'll leave it at 0 or a very low value, because I plan on having very slow moving objects but any suggestions/better solutions would be appreciated.

Thanks again.
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Angular velocity seems to reduce even with Damping at zero?

Post by Norbo »

You can specifically turn off stabilization for the specific entity by setting entity.ActivityInformation.AllowStabilization to false or across the board by setting Space.DeactivationManager.UseStabilization to false. Doing this still allows objects to still go to sleep if their velocities are low enough, but they won't encounter the damping effect.

For space-ish games, the value of deactivation is a little questionable- it requires the object to be stationary in an absolute frame of reference which might not really exist in gameplay. You might want to disable both stabilization and deactivation (entity.ActivityInformation.IsAlwaysActive = true on top of disabling stabilization) just to stop the freeze effect which might look weird in the context of spaceships. Unless you've got many hundreds or thousands of such ships that tend to be stationary, performance probably won't suffer.
Post Reply