Dayz Explorer  1.24.157551 (v105080)
Dayz Code Explorer by Zeroy
rotator.c
Go to the documentation of this file.
1 // -----------------------------------------------------------
2 class Rotator
3 {
4  reference float speed;
5 
6  protected Widget m_root;
7  protected ref AnimatorTimer m_anim;
8 
9  // -----------------------------------------------------------
10  void Rotator()
11  {
12  m_anim = new AnimatorTimer();
13  }
14 
15  // -----------------------------------------------------------
16  protected void Update()
17  {
18  if (m_root)
19  {
20  m_root.SetRotation(0, 0, m_anim.GetTargetValue() * Math.RAD2DEG);
21  }
22  }
23 
24  // -----------------------------------------------------------
25  void OnWidgetScriptInit(Widget w)
26  {
27  m_root = w;
28  m_anim.AnimateLoop(speed);
29  }
30 };
Widget
Definition: enwidgets.c:189
Rotator
Definition: rotator.c:2
Math
Definition: enmath.c:6
AnimatorTimer
Definition: tools.c:748