/docs/animation(kas).html

http://rgdengine.googlecode.com/ · HTML · 131 lines · 131 code · 0 blank · 0 comment · 0 complexity · 2c189d77547d518756725f9dcdebd0b7 MD5 · raw file

  1. <html>
  2. <head>
  3. <link rel="stylesheet" type="text/css" href="/styles/nopaste.css"/>
  4. </head>
  5. <div class="subpage" style="padding-bottom: 5px;">
  6. <div class="pasteinfo">
  7. Pasted by: korak<br clear="both"/>
  8. Language: C++<br clear="both"/>
  9. Description: anim controller<br clear="both"/>
  10. <a href="../results/t0P1cb12.nln.html">Remove line numbers</a><br clear="both"/>
  11. <a href="../results/t0P1cb12.txt">Download as Text</a><br clear="both"/>
  12. <a href="../results.html">Other recent pastes</a><br clear="both"/>
  13. <a href="../">Create new paste</a>
  14. </div>
  15. </div><table border="0" cellpadding="1" cellspacing="5">
  16. <tr>
  17. <td><pre class="code">1
  18. 2
  19. 3
  20. 4
  21. 5
  22. 6
  23. 7
  24. 8
  25. 9
  26. 10
  27. 11
  28. 12
  29. 13
  30. 14
  31. 15
  32. 16
  33. 17
  34. 18
  35. 19
  36. 20
  37. 21
  38. 22
  39. 23
  40. 24
  41. 25
  42. 26
  43. 27
  44. 28
  45. 29
  46. 30
  47. 31
  48. 32
  49. 33
  50. 34
  51. 35
  52. 36
  53. 37
  54. 38
  55. 39
  56. 40
  57. 41
  58. 42
  59. 43
  60. 44
  61. 45
  62. 46
  63. 47
  64. 48
  65. 49
  66. 50
  67. 51
  68. 52
  69. 53
  70. 54
  71. 55
  72. 56</pre></td>
  73. <td width="100%"><pre class="code">&nbsp;
  74. &lt;node name = <span class="literal">"Box01"</span>>
  75. &lt;animation> <span class="comment">// or &lt;animation file = "cube_anim.xml" />
  76. </span> &lt;key time=<span class="literal">"0"</span>>
  77. &lt;translation x=<span class="literal">"-20.579"</span> y=<span class="literal">"32.154"</span> z=<span class="literal">"0."</span> />
  78. &lt;rotation x=<span class="literal">"0."</span> y=<span class="literal">"0."</span> z=<span class="literal">"0."</span> />
  79. &lt;scale x=<span class="literal">"1."</span> y=<span class="literal">"1."</span> z=<span class="literal">"1."</span> />
  80. &lt;/key>
  81. &lt;key time=<span class="literal">"12960"</span>> <span class="comment">// vremya budet v sekundah
  82. </span> &lt;translation x=<span class="literal">"-33.04"</span> y=<span class="literal">"25.41"</span> z=<span class="literal">"0."</span> />
  83. &lt;rotation x=<span class="literal">"0."</span> y=<span class="literal">"0."</span> z=<span class="literal">"1.4516"</span> />
  84. <span class="comment">// scale not changed
  85. </span> &lt;/key>
  86. &lt;/animation>
  87. &lt;geometry name=<span class="literal">"Box01"</span> />
  88. &lt;/node>
  89. &nbsp;
  90. <span class="keyword">class </span>CFrameAnimationController
  91. {
  92. <span class="keyword">typedef</span> math::TInterpolator&lt;math::Vec3f> PositionInterpolyator;
  93. <span class="keyword">typedef</span> math::TInterpolator&lt;math::Vec3f> RotationInterpolyator;
  94. <span class="keyword">typedef</span> math::TInterpolator&lt;math::Vec3f> ScaleInterpolyator;
  95. <span class="keyword">public</span>:
  96. CFrameAnimationController(XmlNode* pXmlNode = 0, CFrame* pFrame = 0);
  97. <span class="keyword">virtual</span> ~CFrameAnimationController();
  98. &nbsp;
  99. <span class="keyword">void</span> load(XmlNode* pXmlNode);
  100. <span class="keyword">void</span> atachToFrame(CFrame* pFrame);
  101. &nbsp;
  102. <span class="keyword">void</span> setRate(<span class="keyword">float</span> rate);
  103. <span class="keyword">float</span> getRate();
  104. &nbsp;
  105. <span class="keyword">void</span> setAnimationTime(<span class="keyword">float</span> rate);
  106. <span class="keyword">float</span> getAnimationTime();
  107. &nbsp;
  108. <span class="keyword">void</span> update(<span class="keyword">float</span> dt);
  109. &nbsp;
  110. <span class="keyword">void</span> stop();
  111. <span class="keyword">void</span> pause();
  112. <span class="keyword">void</span> start();
  113. &nbsp;
  114. <span class="keyword">bool</span> isPlaing();
  115. <span class="keyword">bool</span> isPaused();
  116. &nbsp;
  117. PositionInterpolyator&amp; getPosInterpolyator();
  118. RotationInterpolyator&amp; getRotationInterpolyator();
  119. ScaleInterpolyator&amp; getScaleInterpolyator();
  120. &nbsp;
  121. <span class="keyword">private</span>:
  122. <span class="keyword">float</span> m_fAnimationTime;
  123. <span class="keyword">float</span> m_fAnimationRate;
  124. &nbsp;
  125. PositionInterpolyator m_PosInterpolyator;
  126. RotationInterpolyator m_RotationInterpolyator;
  127. ScaleInterpolyator m_ScaleInterpolyator;
  128. };</pre></td>
  129. </tr>
  130. </table>
  131. </html>