diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a03583.html | 890 |
1 files changed, 890 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03583.html b/docs/doxygen/nel/a03583.html new file mode 100644 index 00000000..69cefa86 --- /dev/null +++ b/docs/doxygen/nel/a03583.html @@ -0,0 +1,890 @@ +<!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: CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis > 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 Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Data Structures</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Data Fields</a> | <a class="qindex" href="globals.html">Globals</a> | <a class="qindex" href="pages.html">Related Pages</a> | <span class="search"><u>S</u>earch for <input class="search" type="text" name="query" value="" size="20" accesskey="s"/></span></form></div> +<h1>CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis > Class Reference</h1><code>#include <<a class="el" href="a06566.html">track_tcb.h</a>></code> +<p> +<p>Inheritance diagram for CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >: +<p><center><img src="a03583.png" usemap="#CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >_map" border="0" alt=""></center> +<map name="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >_map"> +<area href="a03471.html" alt="CTCBTools< CKeyT, T, TMapTimeCKey >" shape="rect" coords="0,0,374,24"> +</map> +<hr><a name="_details"></a><h2>Detailed Description</h2> +ITrack implementation for CQuat TCB keyframer.<p> +<dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <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="a06566.html#l00386">386</a> of file <a class="el" href="a06566.html">track_tcb.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 & </td><td class="memItemRight" valign=bottom><a class="el" href="a03583.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4a0">getValue</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">From ITrack. <a href="#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4a0"></a><br><br></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 </td><td class="memItemRight" valign=bottom><a class="el" href="a03583.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4z1015_0">compile</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">compile (precalc). <a href="#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4z1015_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a03583.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4z1015_1">evalKey</a> (const CKeyTCBQuat *previous, const CKeyTCBQuat *next, TAnimationTime datePrevious, TAnimationTime dateNext, TAnimationTime date)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">evalKey (runtime). <a href="#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4z1015_1"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TMapTimeCKey::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a03471.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4y0">TMapTimeCKeyIterator</a></td></tr> + +<tr><td colspan=2><br><h2>Private Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03471.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d0">compileTCBEase</a> (TMapTimeCKey &mapKey, bool loopMode)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">compute TCB ease information. <a href="#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03471.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d1">computeHermiteBasis</a> (float d, float hb[4])</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03471.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d2">computeTCBFactors</a> (const CKeyT &key, float timeBefore, float time, float timeAfter, float rangeDelta, bool firstKey, bool endKey, bool isLoop, float &ksm, float &ksp, float &kdm, float &kdp)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03583.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d3">computeTCBKey</a> (CKeyTCBQuat &keyBefore, CKeyTCBQuat &key, CKeyTCBQuat &keyAfter, float timeBefore, float time, float timeAfter, float rangeDelta, bool firstKey, bool endKey, bool isLoop)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>float </td><td class="memItemRight" valign=bottom><a class="el" href="a03471.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d4">ease</a> (const CKeyT *key, float d)</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>CAnimatedValueBlendable< CQuat > </td><td class="memItemRight" valign=bottom><a class="el" href="a03583.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4r0">_Value</a></td></tr> + +</table> +<hr><h2>Member Typedef Documentation</h2> +<a class="anchor" name="CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4y0" doxytag="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::TMapTimeCKeyIterator" ></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" colspan="4"> +template<class CKeyT, class T, class TMapTimeCKey> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> typedef TMapTimeCKey::iterator <a class="el" href="a03471.html">CTCBTools</a>< CKeyT, T, TMapTimeCKey >::TMapTimeCKeyIterator<code> [protected, inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06566.html#l00051">51</a> of file <a class="el" href="a06566.html">track_tcb.h</a>. </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4z1015_0" doxytag="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::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="a03581.html">CTrackKeyFramerTCB</a>< CKeyTCBQuat, <a class="el" href="a02195.html">NLMISC::CAngleAxis</a> >::compile </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +compile (precalc). +<p> + +<p> +Definition at line <a class="el" href="a06566.html#l00430">430</a> of file <a class="el" href="a06566.html">track_tcb.h</a>. +<p> +References <a class="el" href="a06566.html#l00056">CTCBTools< CKeyT, T, TMapTimeCKey >::compileTCBEase()</a>, <a class="el" href="a06566.html#l00326">CTrackKeyFramerTCB< CKeyT, T >::computeTCBKey()</a>, <a class="el" href="a05972.html#l00914">NLMISC::CMatrix::invert()</a>, <a class="el" href="a05972.html#l01170">NLMISC::CMatrix::normalize()</a>, <a class="el" href="a05972.html#l00209">NLMISC::CMatrix::setRot()</a>, and <a class="el" href="a05981.html#l00104">sint</a>. +<p> +<div class="fragment"><pre>00431 { +00432 ITrackKeyFramer<CKeyTCBQuat>::compile(); +00433 +00434 <span class="comment">// Ease Precompute.</span> +00435 <a class="code" href="a03471.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d0">compileTCBEase</a>(_MapKey, getLoopMode()); +00436 +00437 TMapTimeCKey::iterator it; +00438 TMapTimeCKey::iterator itNext; +00439 TMapTimeCKey::iterator itPrev; +00440 +00441 <span class="comment">// Compute absolute quaternions.</span> +00442 <span class="keywordflow">for</span> (it= _MapKey.begin();it!=_MapKey.end();) +00443 { +00444 <a class="code" href="a05363.html#a48">CKeyTCBQuat</a> &key= it->second; +00445 +00446 <span class="comment">// Compute Local AngleAxis.</span> +00447 <span class="keywordflow">if</span>(it!= _MapKey.begin()) +00448 { +00449 <a class="code" href="a02851.html">NLMISC::CMatrix</a> mat; +00450 mat.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1961_10">setRot</a>(itPrev->second.Quat); +00451 mat.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1967_0">invert</a>(); +00452 key.LocalAngleAxis.Axis= mat*key.Value.Axis; +00453 key.LocalAngleAxis.Angle= key.Value.Angle; +00454 } +00455 <span class="keywordflow">else</span> +00456 key.LocalAngleAxis= key.Value; +00457 +00458 +00459 key.LocalAngleAxis.Axis.<a class="code" href="a02851.html#NLMISC_1_1CMatrixz1967_2">normalize</a>(); +00460 <span class="comment">// make angle positive.</span> +00461 <span class="keywordflow">if</span>(key.LocalAngleAxis.Angle<0.f) +00462 { +00463 key.LocalAngleAxis.Axis= -key.LocalAngleAxis.Axis; +00464 key.LocalAngleAxis.Angle= -key.LocalAngleAxis.Angle; +00465 } +00466 +00467 <span class="comment">// relative quat</span> +00468 key.Quat.setAngleAxis(key.LocalAngleAxis); +00469 +00470 <span class="comment">// absolute quat</span> +00471 <span class="keywordflow">if</span> (it!= _MapKey.begin()) +00472 key.Quat = itPrev->second.Quat * key.Quat; +00473 +00474 <span class="comment">// next key.</span> +00475 itPrev= it; +00476 it++; +00477 } +00478 +00479 <span class="comment">// Tangents Precompute.</span> +00480 <a class="code" href="a04558.html#a14">sint</a> nKeys= _MapKey.size(); +00481 <span class="keywordflow">if</span>(nKeys<=1) +00482 <span class="keywordflow">return</span>; +00483 +00484 <span class="comment">// rangeDelta is the length of effective Range - length of LastKey-FirstKey.</span> +00485 <span class="comment">// NB: if RangeLock, rangeDelta==0.</span> +00486 <span class="keywordtype">float</span> rangeDelta; +00487 <span class="comment">// NB: _RangeDelta has just been compiled in ITrackKeyFramer<CKeyTCBQuat>::compile().</span> +00488 rangeDelta= getCompiledRangeDelta(); +00489 +00490 it= _MapKey.begin(); <span class="comment">// first key.</span> +00491 itNext= it; itNext++; <span class="comment">// second key.</span> +00492 itPrev= _MapKey.end(); itPrev--; <span class="comment">// last key.</span> +00493 +00494 <span class="comment">// Compute all keys.</span> +00495 <span class="keywordflow">for</span>(;it!=_MapKey.end();) +00496 { +00497 <span class="comment">// NB: we are the last key if itNext==_MapKey.begin().</span> +00498 <a class="code" href="a03583.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d3">computeTCBKey</a>(itPrev->second, it->second, itNext->second, +00499 itPrev->first, it->first, itNext->first, rangeDelta, it==_MapKey.begin(), itNext==_MapKey.begin(), getLoopMode()); +00500 +00501 <span class="comment">// Next key!!</span> +00502 itPrev= it; +00503 it++; +00504 itNext++; +00505 <span class="comment">// loop.</span> +00506 <span class="keywordflow">if</span>(itNext==_MapKey.end()) +00507 itNext= _MapKey.begin(); +00508 } +00509 +00510 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d0" doxytag="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::compileTCBEase" ></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" colspan="4"> +template<class CKeyT, class T, class TMapTimeCKey> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> void <a class="el" href="a03471.html">CTCBTools</a>< CKeyT, T, TMapTimeCKey >::compileTCBEase </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">TMapTimeCKey & </td> + <td class="mdname" nowrap> <em>mapKey</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>loopMode</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +compute TCB ease information. +<p> + +<p> +Definition at line <a class="el" href="a06566.html#l00056">56</a> of file <a class="el" href="a06566.html">track_tcb.h</a>. +<p> +Referenced by <a class="el" href="a06566.html#l00430">compile()</a>, and <a class="el" href="a06566.html#l00253">CTrackKeyFramerTCB< CKeyT, T >::compile()</a>. +<p> +<div class="fragment"><pre>00057 { +00058 <a class="code" href="a03471.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4y0">TMapTimeCKeyIterator</a> it= mapKey.begin(); +00059 <span class="keywordflow">for</span>(;it!=mapKey.end();it++) +00060 { +00061 <a class="code" href="a03471.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4y0">TMapTimeCKeyIterator</a> next= it; +00062 next++; +00063 +00064 <span class="comment">// loop mgt. must compute ease from last to first (usefull if _RangeLock is false).</span> +00065 <span class="keywordflow">if</span>(next==mapKey.end() && loopMode && mapKey.size()>1) +00066 next= mapKey.begin(); +00067 +00068 <span class="comment">// Ease Precompute.</span> +00069 <span class="comment">//=================</span> +00070 CKeyT &key= it->second; +00071 <span class="keywordflow">if</span>(next!=mapKey.end()) +00072 { +00073 <span class="keywordtype">float</span> e0= it->second.EaseFrom; +00074 <span class="keywordtype">float</span> e1= next->second.EaseTo; +00075 <span class="keywordtype">float</span> <a class="code" href="a04223.html#a626">s</a> = e0 + e1; +00076 +00077 <span class="comment">// "normalize".</span> +00078 <span class="keywordflow">if</span> (<a class="code" href="a04223.html#a626">s</a> > 1.0f) +00079 { +00080 e0 = e0/<a class="code" href="a04223.html#a626">s</a>; +00081 e1 = e1/<a class="code" href="a04223.html#a626">s</a>; +00082 } +00083 +00084 <span class="comment">// precalc ease factors.</span> +00085 key.Ease0= e0; +00086 key.Ease1= e1; +00087 key.EaseK= 1/(2.0f - e0 - e1); +00088 <span class="keywordflow">if</span>(e0) +00089 key.EaseKOverEase0= key.EaseK / e0; +00090 <span class="keywordflow">if</span>(e1) +00091 key.EaseKOverEase1= key.EaseK / e1; +00092 } +00093 <span class="keywordflow">else</span> +00094 { +00095 <span class="comment">// force ease() to just return d (see ease()).</span> +00096 key.EaseK = 0.5f; +00097 } +00098 +00099 } +00100 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d1" doxytag="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::computeHermiteBasis" ></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" colspan="4"> +template<class CKeyT, class T, class TMapTimeCKey> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> void <a class="el" href="a03471.html">CTCBTools</a>< CKeyT, T, TMapTimeCKey >::computeHermiteBasis </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname" nowrap> <em>d</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>hb</em>[4]</td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06566.html#l00121">121</a> of file <a class="el" href="a06566.html">track_tcb.h</a>. +<p> +Referenced by <a class="el" href="a06566.html#l00223">CTrackKeyFramerTCB< CKeyT, T >::evalKey()</a>. +<p> +<div class="fragment"><pre>00122 { +00123 <span class="keywordtype">float</span> d2,d3,a; +00124 +00125 d2 = d*d; +00126 d3 = d2*d; +00127 a = 3.0f*d2 - 2.0f*d3; +00128 hb[0] = 1.0f - a; +00129 hb[1] = a; +00130 hb[2] = d3 - 2.0f*d2 + d; +00131 hb[3] = d3 - d2; +00132 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d2" doxytag="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::computeTCBFactors" ></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" colspan="4"> +template<class CKeyT, class T, class TMapTimeCKey> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> void <a class="el" href="a03471.html">CTCBTools</a>< CKeyT, T, TMapTimeCKey >::computeTCBFactors </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const CKeyT & </td> + <td class="mdname" nowrap> <em>key</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>timeBefore</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>time</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>timeAfter</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>rangeDelta</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>firstKey</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>endKey</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>isLoop</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float & </td> + <td class="mdname" nowrap> <em>ksm</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float & </td> + <td class="mdname" nowrap> <em>ksp</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float & </td> + <td class="mdname" nowrap> <em>kdm</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float & </td> + <td class="mdname" nowrap> <em>kdp</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06566.html#l00136">136</a> of file <a class="el" href="a06566.html">track_tcb.h</a>. +<p> +Referenced by <a class="el" href="a06566.html#l00520">computeTCBKey()</a>, and <a class="el" href="a06566.html#l00326">CTrackKeyFramerTCB< CKeyT, T >::computeTCBKey()</a>. +<p> +<div class="fragment"><pre>00138 { +00139 <span class="keywordtype">float</span> fp,fn; +00140 +00141 <span class="keywordflow">if</span>(isLoop || (!firstKey && !endKey)) +00142 { +00143 <span class="keywordtype">float</span> dtm; +00144 <span class="comment">// Compute Time deltas.</span> +00145 <span class="keywordflow">if</span> (firstKey) +00146 { +00147 dtm = 0.5f * (rangeDelta + timeAfter - time); +00148 fp = rangeDelta / dtm; +00149 fn = (timeAfter - time) / dtm; +00150 } +00151 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (endKey) +00152 { +00153 dtm = 0.5f * (rangeDelta + time - timeBefore); +00154 fp = rangeDelta / dtm; +00155 fn = (time - timeBefore) / dtm; +00156 } +00157 <span class="keywordflow">else</span> +00158 { +00159 dtm = 0.5f * (timeAfter - timeBefore); +00160 fp = (time - timeBefore) / dtm; +00161 fn = (timeAfter - time) / dtm; +00162 } +00163 <span class="keywordtype">float</span> c= (<span class="keywordtype">float</span>)fabs( key.Continuity ); +00164 fp = fp + c - c * fp; +00165 fn = fn + c - c * fn; +00166 } +00167 <span class="keywordflow">else</span> +00168 { +00169 <span class="comment">// firstkey and lastkey of not loop track.</span> +00170 fp = 1.0f; +00171 fn = 1.0f; +00172 } +00173 +00174 <span class="comment">// Compute tangents factors.</span> +00175 <span class="keywordtype">float</span> tm,cm,cp,bm,bp,tmcm,tmcp; +00176 +00177 cm = 1.0f - key.Continuity; +00178 tm = 0.5f * ( 1.0f - key.Tension ); +00179 cp = 2.0f - cm; +00180 bm = 1.0f - key.Bias; +00181 bp = 2.0f - bm; +00182 tmcm = tm*cm; tmcp = tm*cp; +00183 +00184 <span class="comment">// tgts factors.</span> +00185 ksm = tmcm*bp*fp; ksp = tmcp*bm*fp; +00186 kdm = tmcp*bp*fn; kdp = tmcm*bm*fn; +00187 +00188 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d3" doxytag="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::computeTCBKey" ></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"> void <a class="el" href="a03581.html">CTrackKeyFramerTCB</a>< CKeyTCBQuat, <a class="el" href="a02195.html">NLMISC::CAngleAxis</a> >::computeTCBKey </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">CKeyTCBQuat & </td> + <td class="mdname" nowrap> <em>keyBefore</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>CKeyTCBQuat & </td> + <td class="mdname" nowrap> <em>key</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>CKeyTCBQuat & </td> + <td class="mdname" nowrap> <em>keyAfter</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>timeBefore</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>time</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>timeAfter</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>rangeDelta</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>firstKey</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>endKey</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>isLoop</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06566.html#l00520">520</a> of file <a class="el" href="a06566.html">track_tcb.h</a>. +<p> +References <a class="el" href="a06566.html#l00136">CTCBTools< CKeyT, T, TMapTimeCKey >::computeTCBFactors()</a>. +<p> +<div class="fragment"><pre>00522 { +00523 CQuat qp, qm; +00524 +00525 <span class="comment">// compute qm.</span> +00526 <span class="keywordflow">if</span> (!firstKey || isLoop) +00527 { +00528 <span class="keywordtype">float</span> angle= key.LocalAngleAxis.Angle; +00529 CVector &axis= key.LocalAngleAxis.Axis; +00530 +00531 <span class="keywordflow">if</span> (angle > 2*NLMISC::Pi- NLMISC::QuatEpsilon) +00532 { +00533 qm.set(axis.x, axis.y, axis.z, 0.0f); +00534 qm = qm.log(); +00535 } +00536 <span class="keywordflow">else</span> +00537 { +00538 CQuat qprev= keyBefore.Quat; +00539 qprev.makeClosest(key.Quat); +00540 qm = CQuat::lnDif(qprev, key.Quat); +00541 } +00542 } +00543 +00544 <span class="comment">// compute qp.</span> +00545 <span class="keywordflow">if</span> (!endKey || isLoop) +00546 { +00547 <span class="keywordtype">float</span> angle= keyAfter.LocalAngleAxis.Angle; +00548 CVector &axis= keyAfter.LocalAngleAxis.Axis; +00549 +00550 <span class="keywordflow">if</span> (angle > 2*NLMISC::Pi- NLMISC::QuatEpsilon) +00551 { +00552 qp.set(axis.x, axis.y, axis.z, 0.0f); +00553 qp = qp.log(); +00554 } +00555 <span class="keywordflow">else</span> +00556 { +00557 CQuat qnext= keyAfter.Quat; +00558 qnext.makeClosest(key.Quat); +00559 qp = CQuat::lnDif(key.Quat, qnext); +00560 } +00561 } +00562 +00563 <span class="comment">// not loop mgt.</span> +00564 <span class="keywordflow">if</span> (firstKey && !isLoop) +00565 qm = qp; +00566 <span class="keywordflow">if</span> (endKey && !isLoop) +00567 qp = qm; +00568 +00569 +00570 <span class="comment">// compute tangents factors.</span> +00571 <span class="keywordtype">float</span> ksm, ksp, kdm, kdp; +00572 <a class="code" href="a03471.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d2">computeTCBFactors</a>(key, timeBefore, time, timeAfter, rangeDelta, firstKey, endKey, isLoop, ksm,ksp,kdm,kdp); +00573 +00574 +00575 <span class="comment">// A/B.</span> +00576 CQuat qa, qb; +00577 qb= (qm * (1.0f-ksm) + qp * (-ksp) ) * 0.5f; +00578 qa= (qm * kdm + qp * (kdp-1.0f) ) * 0.5f; +00579 qa = qa.exp(); +00580 qb = qb.exp(); +00581 +00582 key.A = key.Quat * qa; +00583 key.B = key.Quat * qb; +00584 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d4" doxytag="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::ease" ></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" colspan="4"> +template<class CKeyT, class T, class TMapTimeCKey> </td> + </tr> + <tr> + <td class="md" nowrap valign="top"> float <a class="el" href="a03471.html">CTCBTools</a>< CKeyT, T, TMapTimeCKey >::ease </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const CKeyT * </td> + <td class="mdname" nowrap> <em>key</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>d</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, protected, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06566.html#l00103">103</a> of file <a class="el" href="a06566.html">track_tcb.h</a>. +<p> +Referenced by <a class="el" href="a06566.html#l00401">evalKey()</a>, and <a class="el" href="a06566.html#l00223">CTrackKeyFramerTCB< CKeyT, T >::evalKey()</a>. +<p> +<div class="fragment"><pre>00104 { +00105 <span class="keywordflow">if</span> (d==0.0f || d==1.0f) <span class="keywordflow">return</span> d; +00106 <span class="comment">// k==0.5f <=> e0+e1 == 0.</span> +00107 <span class="keywordflow">if</span> (key->EaseK == 0.5f) <span class="keywordflow">return</span> d; +00108 +00109 <span class="keywordflow">if</span> (d < key->Ease0) +00110 <span class="keywordflow">return</span> key->EaseKOverEase0 * d*d; +00111 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (d < 1.0f - key->Ease1) +00112 <span class="keywordflow">return</span> key->EaseK * (2.0f*d - key->Ease0); +00113 <span class="keywordflow">else</span> +00114 { +00115 d = 1.0f - d; +00116 <span class="keywordflow">return</span> 1.0f - key->EaseKOverEase1 * d*d; +00117 } +00118 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4z1015_1" doxytag="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::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="a03581.html">CTrackKeyFramerTCB</a>< CKeyTCBQuat, <a class="el" href="a02195.html">NLMISC::CAngleAxis</a> >::evalKey </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const CKeyTCBQuat * </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 CKeyTCBQuat * </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 </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 </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 </td> + <td class="mdname" nowrap> <em>date</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [inline, virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +evalKey (runtime). +<p> + +<p> +Definition at line <a class="el" href="a06566.html#l00401">401</a> of file <a class="el" href="a06566.html">track_tcb.h</a>. +<p> +References <a class="el" href="a05587.html#l00115">NLMISC::clamp()</a>, and <a class="el" href="a06566.html#l00103">CTCBTools< CKeyT, T, TMapTimeCKey >::ease()</a>. +<p> +<div class="fragment"><pre>00404 { +00405 <span class="keywordflow">if</span>(previous && next) +00406 { +00407 <span class="comment">// lerp from previous to cur.</span> +00408 date-= datePrevious; +00409 date*= previous->OODeltaTime; +00410 <a class="code" href="a05378.html#a374">NLMISC::clamp</a>(date, 0,1); +00411 +00412 <span class="comment">// ease.</span> +00413 date = <a class="code" href="a03471.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4d4">ease</a>(previous, date); +00414 +00415 <span class="comment">// quad slerp.</span> +00416 <a class="code" href="a03583.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4r0">_Value</a>.Value= CQuat::squadrev(next->LocalAngleAxis, previous->Quat, previous->A, next->B, next->Quat, date); +00417 } +00418 <span class="keywordflow">else</span> +00419 { +00420 <span class="keywordflow">if</span> (previous) +00421 <a class="code" href="a03583.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4r0">_Value</a>.Value= previous->Quat; +00422 <span class="keywordflow">else</span> +00423 <span class="keywordflow">if</span> (next) +00424 <a class="code" href="a03583.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4r0">_Value</a>.Value= next->Quat; +00425 } +00426 +00427 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4a0" doxytag="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::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& <a class="el" href="a03581.html">CTrackKeyFramerTCB</a>< CKeyTCBQuat, <a class="el" href="a02195.html">NLMISC::CAngleAxis</a> >::getValue </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </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> + + </td> + <td> + +<p> +From ITrack. +<p> + +<p> +Definition at line <a class="el" href="a06566.html#l00392">392</a> of file <a class="el" href="a06566.html">track_tcb.h</a>. +<p> +<div class="fragment"><pre>00393 { +00394 <span class="keywordflow">return</span> <a class="code" href="a03583.html#CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4r0">_Value</a>; +00395 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="CTrackKeyFramerTCB_3_01CKeyTCBQuat_00_01NLMISC_1_1CAngleAxis_01_4r0" doxytag="CTrackKeyFramerTCB< CKeyTCBQuat, NLMISC::CAngleAxis >::_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<CQuat> <a class="el" href="a03581.html">CTrackKeyFramerTCB</a>< CKeyTCBQuat, <a class="el" href="a02195.html">NLMISC::CAngleAxis</a> >::_Value<code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Definition at line <a class="el" href="a06566.html#l00517">517</a> of file <a class="el" href="a06566.html">track_tcb.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following file:<ul> +<li><a class="el" href="a06566.html">track_tcb.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> |