MCPcopy Create free account
hub / github.com/MyGUI/mygui / inertionalMoveFunction

Function inertionalMoveFunction

MyGUIEngine/src/MyGUI_ActionController.cpp:39–55  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37 }
38
39 void inertionalMoveFunction(
40 const IntCoord& _startRect,
41 const IntCoord& _destRect,
42 IntCoord& _result,
43 float _current_time)
44 {
45#ifdef M_PI
46 #undef M_PI
47#endif
48 const float M_PI = 3.141593f;
49 float k = std::sin(M_PI * _current_time - M_PI / 2.0f);
50 if (k < 0)
51 k = (-std::pow(-k, 0.7f) + 1) / 2;
52 else
53 k = (std::pow(k, 0.7f) + 1) / 2;
54 linearMoveFunction(_startRect, _destRect, _result, k);
55 }
56
57} // namespace MyGUI

Callers

nothing calls this directly

Calls 1

linearMoveFunctionFunction · 0.85

Tested by

no test coverage detected