| 3599 | } |
| 3600 | |
| 3601 | void SetNodeFlipbookCursor(HScene scene, HNode node, float cursor) |
| 3602 | { |
| 3603 | InternalNode* n = GetNode(scene, node); |
| 3604 | |
| 3605 | cursor = dmMath::Clamp(cursor, 0.0f, 1.0f); |
| 3606 | n->m_Node.m_FlipbookAnimPosition = cursor; |
| 3607 | if (n->m_Node.m_FlipbookAnimHash) { |
| 3608 | Animation* anim = GetComponentAnimation(scene, node, &n->m_Node.m_FlipbookAnimPosition); |
| 3609 | if (anim) { |
| 3610 | |
| 3611 | if (anim->m_Playback == PLAYBACK_ONCE_BACKWARD || anim->m_Playback == PLAYBACK_LOOP_BACKWARD) |
| 3612 | { |
| 3613 | cursor = 1.0f - cursor; |
| 3614 | } else if (anim->m_Playback == PLAYBACK_ONCE_PINGPONG || anim->m_Playback == PLAYBACK_LOOP_PINGPONG) { |
| 3615 | cursor /= 2.0f; |
| 3616 | } |
| 3617 | |
| 3618 | anim->m_Elapsed = cursor * anim->m_Duration; |
| 3619 | } |
| 3620 | } |
| 3621 | } |
| 3622 | |
| 3623 | float GetNodeFlipbookPlaybackRate(HScene scene, HNode node) |
| 3624 | { |
no test coverage detected