ScriptSpot

Forum topic · General Scripting

Max speed of an object.

By JokerMartini · 2011-05-31

Description

I'm looking to find the max speed of an object in a scene. I figured I would just compare the position of the objects transform from frame to frame. But from there how would i find the max speed throughout the duration of the animation?

Comments (2)

great.

JokerMartini · 2011-05-31

Thank you Garp for the quick response to my question.
This is exactly what I was looking for.
I'll end up converting it to calculate the speed based on world units.
Thanks
JokerMartini

Something like:

Garp · 2011-05-31

max_speed =
  amax (for t=animationRange.start+1 to animationRange.end collect
    distance (at time t $.pos) (at time (t-1) $.pos)) * frameRate