| 357 | } |
| 358 | |
| 359 | Math::float3 AnimHandler::getRootNodeVelocityTotal() |
| 360 | { |
| 361 | Animations::Animation* anim = getActiveAnimationPtr(); |
| 362 | if (!anim) |
| 363 | return Math::float3(0, 0, 0); |
| 364 | |
| 365 | // Get length of the animation in seconds |
| 366 | Animations::AnimationData& anim_data = m_pWorld->getAnimationLibrary().getAnimationData(anim->m_Data); |
| 367 | float length = anim->m_FrameCount / (anim->m_FpsRate * m_SpeedMultiplier); |
| 368 | |
| 369 | size_t numFrames = anim->m_FrameCount; |
| 370 | Math::float3 start = getRootNodePositionAt(0); |
| 371 | Math::float3 end = getRootNodePositionAt(numFrames - 1); |
| 372 | |
| 373 | return (end - start) / length; |
| 374 | } |
| 375 | |
| 376 | /** |
| 377 | * @brief Draws the skeleton of the animation |
nothing calls this directly
no test coverage detected