/docs/animation(kas).html
http://rgdengine.googlecode.com/ · HTML · 131 lines · 131 code · 0 blank · 0 comment · 0 complexity · 2c189d77547d518756725f9dcdebd0b7 MD5 · raw file
- <html>
- <head>
- <link rel="stylesheet" type="text/css" href="/styles/nopaste.css"/>
- </head>
- <div class="subpage" style="padding-bottom: 5px;">
- <div class="pasteinfo">
- Pasted by: korak<br clear="both"/>
- Language: C++<br clear="both"/>
- Description: anim controller<br clear="both"/>
- <a href="../results/t0P1cb12.nln.html">Remove line numbers</a><br clear="both"/>
- <a href="../results/t0P1cb12.txt">Download as Text</a><br clear="both"/>
- <a href="../results.html">Other recent pastes</a><br clear="both"/>
- <a href="../">Create new paste</a>
- </div>
- </div><table border="0" cellpadding="1" cellspacing="5">
- <tr>
- <td><pre class="code">1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 11
- 12
- 13
- 14
- 15
- 16
- 17
- 18
- 19
- 20
- 21
- 22
- 23
- 24
- 25
- 26
- 27
- 28
- 29
- 30
- 31
- 32
- 33
- 34
- 35
- 36
- 37
- 38
- 39
- 40
- 41
- 42
- 43
- 44
- 45
- 46
- 47
- 48
- 49
- 50
- 51
- 52
- 53
- 54
- 55
- 56</pre></td>
- <td width="100%"><pre class="code">
- <node name = <span class="literal">"Box01"</span>>
- <animation> <span class="comment">// or <animation file = "cube_anim.xml" />
- </span> <key time=<span class="literal">"0"</span>>
- <translation x=<span class="literal">"-20.579"</span> y=<span class="literal">"32.154"</span> z=<span class="literal">"0."</span> />
- <rotation x=<span class="literal">"0."</span> y=<span class="literal">"0."</span> z=<span class="literal">"0."</span> />
- <scale x=<span class="literal">"1."</span> y=<span class="literal">"1."</span> z=<span class="literal">"1."</span> />
- </key>
- <key time=<span class="literal">"12960"</span>> <span class="comment">// vremya budet v sekundah
- </span> <translation x=<span class="literal">"-33.04"</span> y=<span class="literal">"25.41"</span> z=<span class="literal">"0."</span> />
- <rotation x=<span class="literal">"0."</span> y=<span class="literal">"0."</span> z=<span class="literal">"1.4516"</span> />
- <span class="comment">// scale not changed
- </span> </key>
- </animation>
- <geometry name=<span class="literal">"Box01"</span> />
- </node>
-
- <span class="keyword">class </span>CFrameAnimationController
- {
- <span class="keyword">typedef</span> math::TInterpolator<math::Vec3f> PositionInterpolyator;
- <span class="keyword">typedef</span> math::TInterpolator<math::Vec3f> RotationInterpolyator;
- <span class="keyword">typedef</span> math::TInterpolator<math::Vec3f> ScaleInterpolyator;
- <span class="keyword">public</span>:
- CFrameAnimationController(XmlNode* pXmlNode = 0, CFrame* pFrame = 0);
- <span class="keyword">virtual</span> ~CFrameAnimationController();
-
- <span class="keyword">void</span> load(XmlNode* pXmlNode);
- <span class="keyword">void</span> atachToFrame(CFrame* pFrame);
-
- <span class="keyword">void</span> setRate(<span class="keyword">float</span> rate);
- <span class="keyword">float</span> getRate();
-
- <span class="keyword">void</span> setAnimationTime(<span class="keyword">float</span> rate);
- <span class="keyword">float</span> getAnimationTime();
-
- <span class="keyword">void</span> update(<span class="keyword">float</span> dt);
-
- <span class="keyword">void</span> stop();
- <span class="keyword">void</span> pause();
- <span class="keyword">void</span> start();
-
- <span class="keyword">bool</span> isPlaing();
- <span class="keyword">bool</span> isPaused();
-
- PositionInterpolyator& getPosInterpolyator();
- RotationInterpolyator& getRotationInterpolyator();
- ScaleInterpolyator& getScaleInterpolyator();
-
- <span class="keyword">private</span>:
- <span class="keyword">float</span> m_fAnimationTime;
- <span class="keyword">float</span> m_fAnimationRate;
-
- PositionInterpolyator m_PosInterpolyator;
- RotationInterpolyator m_RotationInterpolyator;
- ScaleInterpolyator m_ScaleInterpolyator;
- };</pre></td>
- </tr>
- </table>
- </html>