Easiest way to get acceleration on an Entity

Discuss any questions about BEPUphysics or problems encountered.
Post Reply
Abuzer
Posts: 20
Joined: Thu Jan 19, 2012 4:12 pm

Easiest way to get acceleration on an Entity

Post by Abuzer »

Hi,

So I want to get the current acceleration on an Entity. In my case, this is not meant to be fed back into the physics system but merely for some HUD-element-like purpose (i.e. informational data), so accuracy was not as important.

Since BEPU doesn't seem to provide acceleration directly (does it?), I hacked my own cryptic solution where I store off the previous MotionState from the previous frame, and look at the linear velocity differences using the old and current old and divide it by the time spent per frame. While this works, I couldn't help but think to myself that there must be an easier and more trivial way to get this piece of info.

I'm all ears :)
Norbo
Site Admin
Posts: 4929
Joined: Tue Jul 04, 2006 4:45 am

Re: Easiest way to get acceleration on an Entity

Post by Norbo »

Since BEPU doesn't seem to provide acceleration directly (does it?), I hacked my own cryptic solution where I store off the previous MotionState from the previous frame, and look at the linear velocity differences using the old and current old and divide it by the time spent per frame. While this works, I couldn't help but think to myself that there must be an easier and more trivial way to get this piece of info.
Pretty much everything works on the velocity/impulse level. For example, gravity is just a series of small impulses. Since there's no concept of traditional 'acceleration' used anywhere, that approach is the easiest/most correct one :)
Post Reply