aboutsummaryrefslogtreecommitdiff
path: root/docs/doxygen/nel/a03556.html
blob: 8c23384276f31d9c075ff6eaa5924d0efae5df94 (plain)
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>NeL: CTrackKeyFramerBezier&lt; CKeyBezierQuat, CQuat &gt; class Reference</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<!-- Generated by Doxygen 1.3.6 -->
<div class="qindex">  <form class="search" action="search.php" method="get">
<a class="qindex" href="main.html">Main&nbsp;Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class&nbsp;Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical&nbsp;List</a> | <a class="qindex" href="annotated.html">Data&nbsp;Structures</a> | <a class="qindex" href="files.html">File&nbsp;List</a> | <a class="qindex" href="namespacemembers.html">Namespace&nbsp;Members</a> | <a class="qindex" href="functions.html">Data&nbsp;Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related&nbsp;Pages</a>  | <span class="search"><u>S</u>earch&nbsp;for&nbsp;<input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div>
<h1>CTrackKeyFramerBezier&lt; CKeyBezierQuat, CQuat &gt; Class Reference</h1><code>#include &lt;<a class="el" href="a06557.html">track_bezier.h</a>&gt;</code>
<p>
<hr><a name="_details"></a><h2>Detailed Description</h2>
ITrack implementation for Bezier Quaternion keyframer.<p>
<dl compact><dt><b>Author:</b></dt><dd>Lionel Berneguier <p>
Nevrax France </dd></dl>
<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl>

<p>

<p>
Definition at line <a class="el" href="a06557.html#l00131">131</a> of file <a class="el" href="a06557.html">track_bezier.h</a>.<table border=0 cellpadding=0 cellspacing=0>
<tr><td></td></tr>
<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual const IAnimatedValue &amp;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03556.html#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4a0">getValue</a> () const </td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">From ITrack.  <a href="#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4a0"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Protected Member Functions</h2></td></tr>
<tr><td colspan="2"><div class="groupHeader">From ITrackKeyFramer</div></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03556.html#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4z1000_0">compile</a> ()</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">compile (precalc).  <a href="#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4z1000_0"></a><br><br></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03556.html#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4z1000_1">evalKey</a> (const CKeyBezierQuat *previous, const CKeyBezierQuat *next, TAnimationTime datePrevious, TAnimationTime dateNext, TAnimationTime date)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">evalKey (runtime).  <a href="#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4z1000_1"></a><br><br></td></tr>
<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr>
<tr><td class="memItemLeft" nowrap align=right valign=top>CAnimatedValueBlendable&lt; CQuat &gt;&nbsp;</td><td class="memItemRight" valign=bottom><a class="el" href="a03556.html#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4r0">_Value</a></td></tr>

</table>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4z1000_0" doxytag="CTrackKeyFramerBezier< CKeyBezierQuat, CQuat >::compile" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual void <a class="el" href="a03552.html">CTrackKeyFramerBezier</a>&lt; CKeyBezierQuat, CQuat &gt;::compile </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap><code> [inline, protected, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
compile (precalc). 
<p>

<p>
Definition at line <a class="el" href="a06557.html#l00172">172</a> of file <a class="el" href="a06557.html">track_bezier.h</a>.
<p>
References <a class="el" href="a05646.html#l00993">r</a>, and <a class="el" href="a05981.html#l00104">sint</a>.
<p>
<div class="fragment"><pre>00173         {
00174                 ITrackKeyFramer&lt;CKeyBezierQuat&gt;::compile();
00175 
00176                 <span class="comment">// makeclosest quaternions, Tangents Precompute.</span>
00177                 <a class="code" href="a04558.html#a14">sint</a>    nKeys= _MapKey.size();
00178                 <span class="keywordflow">if</span>(nKeys&lt;=1)
00179                         <span class="keywordflow">return</span>;
00180 
00181                 TMapTimeCKey::iterator  it;
00182                 TMapTimeCKey::iterator  itNext;
00183                 TMapTimeCKey::iterator  itPrev;
00184 
00185                 it= _MapKey.begin();                            <span class="comment">// first key.</span>
00186                 itNext= it;     itNext++;                               <span class="comment">// second key.</span>
00187                 itPrev= _MapKey.end();                          <span class="comment">// end key.</span>
00188 
00189                 <span class="comment">// Compute all keys.</span>
00190                 <span class="keywordflow">for</span>(;it!=_MapKey.end();)
00191                 {
00192 
00193                         <a class="code" href="a05363.html#a51">CKeyBezierQuat</a>  &amp;key= it-&gt;second;
00194                         CQuat   &amp;cur= key.Value;
00195 
00196                         <span class="keywordflow">if</span>(itPrev!= _MapKey.end())
00197                         {
00198                                 cur.makeClosest(itPrev-&gt;second.Value);
00199                         }
00200 
00201                         CQuat   prev, next;
00202 
00203                         <span class="comment">// compute prev / next.</span>
00204                         <span class="keywordflow">if</span>(itPrev!= _MapKey.end())
00205                                 prev= itPrev-&gt;second.Value;
00206                         <span class="keywordflow">else</span>
00207                                 prev= itNext-&gt;second.Value;
00208                         <span class="keywordflow">if</span>(itNext!= _MapKey.end())
00209                                 next= itNext-&gt;second.Value;
00210                         <span class="keywordflow">else</span>
00211                                 next= itPrev-&gt;second.Value;
00212 
00213                         <span class="comment">// Compute A.</span>
00214                         CQuat qm,qp,<a class="code" href="a04223.html#a628">r</a>;
00215 
00216                         qm = CQuat::lnDif(cur, prev);
00217                         qp = CQuat::lnDif(cur, next);
00218                         <a class="code" href="a04223.html#a628">r</a> = -.25f*(qm+qp);
00219                         key.A= cur*(<a class="code" href="a04223.html#a628">r</a>.exp());
00220 
00221                         <span class="comment">// Next key!!</span>
00222                         itPrev= it;
00223                         it++;
00224 
00225                         <span class="keywordflow">if</span>(itNext!= _MapKey.end())
00226                                 itNext++;
00227                 }
00228 
00229         }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4z1000_1" doxytag="CTrackKeyFramerBezier< CKeyBezierQuat, CQuat >::evalKey" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual void <a class="el" href="a03552.html">CTrackKeyFramerBezier</a>&lt; CKeyBezierQuat, CQuat &gt;::evalKey </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="md" nowrap valign="top">const CKeyBezierQuat *&nbsp;</td>
          <td class="mdname" nowrap> <em>previous</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>const CKeyBezierQuat *&nbsp;</td>
          <td class="mdname" nowrap> <em>next</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>TAnimationTime&nbsp;</td>
          <td class="mdname" nowrap> <em>datePrevious</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>TAnimationTime&nbsp;</td>
          <td class="mdname" nowrap> <em>dateNext</em>, </td>
        </tr>
        <tr>
          <td class="md" nowrap align="right"></td>
          <td></td>
          <td class="md" nowrap>TAnimationTime&nbsp;</td>
          <td class="mdname" nowrap> <em>date</em></td>
        </tr>
        <tr>
          <td></td>
          <td class="md">)&nbsp;</td>
          <td class="md" colspan="2"><code> [inline, protected, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
evalKey (runtime). 
<p>

<p>
Definition at line <a class="el" href="a06557.html#l00147">147</a> of file <a class="el" href="a06557.html">track_bezier.h</a>.
<p>
References <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>.
<p>
<div class="fragment"><pre>00150         {
00151                 <span class="keywordflow">if</span>(previous &amp;&amp; next)
00152                 {
00153                         <span class="comment">// lerp from previous to cur.</span>
00154                         date-= datePrevious;
00155                         date*= previous-&gt;OODeltaTime;
00156                         <a class="code" href="a05378.html#a374">NLMISC::clamp</a>(date, 0,1);
00157 
00158                         <span class="comment">// quad slerp.</span>
00159                         <a class="code" href="a03556.html#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4r0">_Value</a>.Value = CQuat::squad(previous-&gt;Value, previous-&gt;A, next-&gt;A, next-&gt;Value, date);  
00160                 }
00161                 <span class="keywordflow">else</span>
00162                 {
00163                         <span class="keywordflow">if</span> (previous)
00164                                 <a class="code" href="a05363.html#a540">copyToValue</a>(<a class="code" href="a03556.html#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4r0">_Value</a>.Value, previous-&gt;Value);
00165                         <span class="keywordflow">else</span>
00166                                 <span class="keywordflow">if</span> (next)
00167                                         <a class="code" href="a05363.html#a540">copyToValue</a>(<a class="code" href="a03556.html#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4r0">_Value</a>.Value, next-&gt;Value);
00168                 }
00169         }
</pre></div>    </td>
  </tr>
</table>
<a class="anchor" name="CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4a0" doxytag="CTrackKeyFramerBezier< CKeyBezierQuat, CQuat >::getValue" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> virtual const IAnimatedValue&amp; <a class="el" href="a03552.html">CTrackKeyFramerBezier</a>&lt; CKeyBezierQuat, CQuat &gt;::getValue </td>
          <td class="md" valign="top">(&nbsp;</td>
          <td class="mdname1" valign="top" nowrap>          </td>
          <td class="md" valign="top">&nbsp;)&nbsp;</td>
          <td class="md" nowrap> const<code> [inline, virtual]</code></td>
        </tr>

      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>
From ITrack. 
<p>

<p>
Definition at line <a class="el" href="a06557.html#l00136">136</a> of file <a class="el" href="a06557.html">track_bezier.h</a>.
<p>
<div class="fragment"><pre>00137         {
00138                 <span class="keywordflow">return</span> <a class="code" href="a03556.html#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4r0">_Value</a>;
00139         }
</pre></div>    </td>
  </tr>
</table>
<hr><h2>Field Documentation</h2>
<a class="anchor" name="CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4r0" doxytag="CTrackKeyFramerBezier< CKeyBezierQuat, CQuat >::_Value" ></a><p>
<table class="mdTable" width="100%" cellpadding="2" cellspacing="0">
  <tr>
    <td class="mdRow">
      <table cellpadding="0" cellspacing="0" border="0">
        <tr>
          <td class="md" nowrap valign="top"> CAnimatedValueBlendable&lt;CQuat&gt; <a class="el" href="a03552.html">CTrackKeyFramerBezier</a>&lt; CKeyBezierQuat, CQuat &gt;::<a class="el" href="a03556.html#CTrackKeyFramerBezier_3_01CKeyBezierQuat_00_01CQuat_01_4r0">_Value</a><code> [private]</code>
      </table>
    </td>
  </tr>
</table>
<table cellspacing=5 cellpadding=0 border=0>
  <tr>
    <td>
      &nbsp;
    </td>
    <td>

<p>

<p>
Definition at line <a class="el" href="a06557.html#l00234">234</a> of file <a class="el" href="a06557.html">track_bezier.h</a>.    </td>
  </tr>
</table>
<hr>The documentation for this class was generated from the following file:<ul>
<li><a class="el" href="a06557.html">track_bezier.h</a></ul>
<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:43:54 2004 for NeL by
<a href="http://www.doxygen.org/index.html">
<img src="doxygen.png" alt="doxygen" align="middle" border=0 > 
</a>1.3.6 </small></address>
</body>
</html>