Easiest way to get acceleration on an Entity
Posted: Fri Feb 03, 2012 8:04 am
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
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
