A reimplementation of Mario Kart Wii's physics engine in C++
Loading...
Searching...
No Matches
AnmObj.cc
1#include "AnmObj.hh"
2
3#include <cmath>
4
5namespace Kinoko::Abstract::g3d {
6
8f32 PlayPolicy_Onetime(f32 /*start*/, f32 /*end*/, f32 frame) {
9 return frame;
10}
11
13f32 PlayPolicy_Loop(f32 start, f32 end, f32 frame) {
14 ASSERT(end > start);
15
16 f32 length = end - start;
17
18 if (frame >= 0.0f) {
19 return ::fmodf(frame, length);
20 }
21
22 f32 offset = ::fmodf(frame + length, length);
23
24 return offset >= 0.0f ? offset : offset + length;
25}
26
27f32 FrameCtrl::s_baseUpdateRate = 1.0f;
28
29} // namespace Kinoko::Abstract::g3d