MCPcopy Create free account
hub / github.com/REGoth-project/REGoth / getRootNodeVelocityTotal

Method getRootNodeVelocityTotal

src/components/AnimHandler.cpp:359–374  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

357}
358
359Math::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

Callers

nothing calls this directly

Calls 1

getAnimationDataMethod · 0.80

Tested by

no test coverage detected