diff options
author | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
---|---|---|
committer | neodarz <neodarz@neodarz.net> | 2018-08-11 20:21:34 +0200 |
commit | 0ea5fc66924303d1bf73ba283a383e2aadee02f2 (patch) | |
tree | 2568e71a7ccc44ec23b8bb3f0ff97fb6bf2ed709 /docs/doxygen/nel/a02798.html | |
download | nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.tar.xz nevrax-website-self-hostable-0ea5fc66924303d1bf73ba283a383e2aadee02f2.zip |
Initial commit
Diffstat (limited to 'docs/doxygen/nel/a02798.html')
-rw-r--r-- | docs/doxygen/nel/a02798.html | 633 |
1 files changed, 633 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02798.html b/docs/doxygen/nel/a02798.html new file mode 100644 index 00000000..5b3945d3 --- /dev/null +++ b/docs/doxygen/nel/a02798.html @@ -0,0 +1,633 @@ +<!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: NL3D::CLodCharacterBuilder 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>NL3D::CLodCharacterBuilder Class Reference</h1><code>#include <<a class="el" href="a05932.html">lod_character_builder.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A tool class used to build a <a class="el" href="a02801.html">CLodCharacterShape</a> Use it by first calling <a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuildera3">setShape()</a>, then add animations to it, and finally get result with getLodShape <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2002 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a05932.html#l00049">49</a> of file <a class="el" href="a05932.html">lod_character_builder.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>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuildera0">addAnim</a> (const char *animName, <a class="el" href="a02205.html">CAnimation</a> *animation, float frameRate)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuildera1">CLodCharacterBuilder</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NL3D_1_1CLodCharacterBuildera1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a02801.html">CLodCharacterShape</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuildera2">getLodShape</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">return the lod shape in its current state. <a href="#NL3D_1_1CLodCharacterBuildera2"></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="a02798.html#NL3D_1_1CLodCharacterBuildera3">setShape</a> (const std::string &name, <a class="el" href="a03402.html">CSkeletonShape</a> *skeletonShape, <a class="el" href="a02808.html">CLodCharacterShapeBuild</a> *lodBuild)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuildera4">~CLodCharacterBuilder</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="a02798.html#NL3D_1_1CLodCharacterBuilderd0">applySkin</a> (<a class="el" href="a03399.html">CSkeletonModel</a> *skeleton, <a class="el" href="a03128.html">CVector</a> *dstVertices)</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a04558.html#a15">uint</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuilderr0">_BoneRemap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02808.html">CLodCharacterShapeBuild</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuilderr1">_LodBuild</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02801.html">CLodCharacterShape</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuilderr2">_LodCharacterShape</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03408.html">NLMISC::CSmartPtr</a>< <a class="el" href="a03402.html">CSkeletonShape</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuilderr3">_SkeletonShape</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03348.html">CScene</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a></td></tr> + +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NL3D_1_1CLodCharacterBuildera1" doxytag="NL3D::CLodCharacterBuilder::CLodCharacterBuilder" ></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"> NL3D::CLodCharacterBuilder::CLodCharacterBuilder </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Constructor. +<p> + +<p> +Definition at line <a class="el" href="a05931.html#l00045">45</a> of file <a class="el" href="a05931.html">lod_character_builder.cpp</a>. +<p> +References <a class="el" href="a05932.html#l00083">_LodBuild</a>, <a class="el" href="a05932.html#l00082">_SkeletonShape</a>, and <a class="el" href="a05932.html#l00087">_TmpScene</a>. +<p> +<div class="fragment"><pre>00046 { +00047 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr3">_SkeletonShape</a>= NULL; +00048 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr1">_LodBuild</a>= NULL; +00049 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a>= NULL; +00050 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CLodCharacterBuildera4" doxytag="NL3D::CLodCharacterBuilder::~CLodCharacterBuilder" ></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"> NL3D::CLodCharacterBuilder::~<a class="el" href="a02798.html">CLodCharacterBuilder</a> </td> + <td class="md" valign="top">( </td> + <td class="mdname1" valign="top" nowrap> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap></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="a05931.html#l00052">52</a> of file <a class="el" href="a05931.html">lod_character_builder.cpp</a>. +<p> +References <a class="el" href="a05932.html#l00087">_TmpScene</a>, and <a class="el" href="a06348.html#l00194">NL3D::CScene::release()</a>. +<p> +<div class="fragment"><pre>00053 { +00054 <span class="comment">// release the scene</span> +00055 <span class="keywordflow">if</span>(<a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a>) +00056 { +00057 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a>->release(); +00058 <span class="keyword">delete</span> <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a>; +00059 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a>= NULL; +00060 } +00061 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NL3D_1_1CLodCharacterBuildera0" doxytag="NL3D::CLodCharacterBuilder::addAnim" ></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 NL3D::CLodCharacterBuilder::addAnim </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const char * </td> + <td class="mdname" nowrap> <em>animName</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02205.html">CAnimation</a> * </td> + <td class="mdname" nowrap> <em>animation</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>frameRate</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +add an animation to the process <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>animName</em> </td><td>is the name of the animation, used as a key to receover animations in the <a class="el" href="a02801.html">CLodCharacterShape</a> built </td></tr> + <tr><td valign=top><em>animation</em> </td><td>is the animation to bake/over sample. NB: the animation is deleted at the end of addAnim </td></tr> + <tr><td valign=top><em>frameRate</em> </td><td>is the desired overSampling rate. eg: 20 frame per second.</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05931.html#l00111">111</a> of file <a class="el" href="a05931.html">lod_character_builder.cpp</a>. +<p> +References <a class="el" href="a05932.html#l00080">_LodCharacterShape</a>, <a class="el" href="a05932.html#l00082">_SkeletonShape</a>, <a class="el" href="a05932.html#l00087">_TmpScene</a>, <a class="el" href="a05937.html#l00411">NL3D::CLodCharacterShape::addAnim()</a>, <a class="el" href="a05449.html#l00061">NL3D::CAnimationSet::addAnimation()</a>, <a class="el" href="a05938.html#l00142">NL3D::CLodCharacterShape::CAnimBuild::AnimLength</a>, <a class="el" href="a05931.html#l00199">applySkin()</a>, <a class="el" href="a05449.html#l00104">NL3D::CAnimationSet::build()</a>, <a class="el" href="a06393.html#l00807">NL3D::CSkeletonModel::computeAllBones()</a>, <a class="el" href="a06348.html#l01053">NL3D::CScene::deleteModel()</a>, <a class="el" href="a05543.html#l00154">NL3D::CChannelMixer::eval()</a>, <a class="el" href="a05450.html#l00083">NL3D::CAnimationSet::getAnimationIdByName()</a>, <a class="el" href="a05443.html#l00157">NL3D::CAnimation::getEndTime()</a>, <a class="el" href="a05938.html#l00184">NL3D::CLodCharacterShape::getNumVertices()</a>, <a class="el" href="a05938.html#l00145">NL3D::CLodCharacterShape::CAnimBuild::Keys</a>, <a class="el" href="a05484.html#l00038">min</a>, <a class="el" href="a05938.html#l00138">NL3D::CLodCharacterShape::CAnimBuild::Name</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05938.html#l00140">NL3D::CLodCharacterShape::CAnimBuild::NumKeys</a>, <a class="el" href="a06393.html#l00061">NL3D::CSkeletonModel::registerToChannelMixer()</a>, <a class="el" href="a05543.html#l00063">NL3D::CChannelMixer::setAnimationSet()</a>, <a class="el" href="a05543.html#l00449">NL3D::CChannelMixer::setSlotAnimation()</a>, <a class="el" href="a05544.html#l00345">NL3D::CChannelMixer::setSlotTime()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00102">uint64</a>. +<p> +<div class="fragment"><pre>00112 { +00113 <a class="code" href="a04199.html#a6">nlassert</a>(frameRate>0); +00114 <a class="code" href="a04199.html#a6">nlassert</a>(animation); +00115 +00116 <span class="comment">/* Create a Scene, a skeletonModel, an animation set, and a channel mixer to play the animation</span> +00117 <span class="comment"> NB: no render is made and no driver is created. The scene is just here for correct creation of the skeleton</span> +00118 <span class="comment"> Yoyo: This is a tricky way, but I found it the easier one...</span> +00119 <span class="comment"> */</span> +00120 +00121 <span class="comment">// Create Components necesssary to play the animation</span> +00122 <span class="comment">//==========================</span> +00123 +00124 <span class="comment">// create an animationSet, and a channelMixer.</span> +00125 <span class="comment">//--------------</span> +00126 <span class="comment">// build an animation set with the only one animation. This animation will be deleted with the animationSet</span> +00127 CAnimationSet *tmpAnimationSet= <span class="keyword">new</span> CAnimationSet; +00128 tmpAnimationSet->addAnimation(animName, animation); +00129 tmpAnimationSet->build(); +00130 <span class="comment">// Build a channelMixer.</span> +00131 CChannelMixer *tmpChannelMixer= <span class="keyword">new</span> CChannelMixer; +00132 tmpChannelMixer->setAnimationSet(tmpAnimationSet); +00133 +00134 +00135 <span class="comment">// create a skeleton Model for animation</span> +00136 <span class="comment">//---------------</span> +00137 CSkeletonModel *skeleton= (CSkeletonModel*)<a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr3">_SkeletonShape</a>->createInstance(*_TmpScene); +00138 <span class="comment">// and skeleton it with animation</span> +00139 skeleton->registerToChannelMixer(tmpChannelMixer, <span class="stringliteral">""</span>); +00140 <span class="comment">// activate the anim</span> +00141 <a class="code" href="a04558.html#a15">uint</a> animID = tmpAnimationSet->getAnimationIdByName(animName); +00142 <a class="code" href="a04199.html#a6">nlassert</a>(animID != CAnimationSet::NotFound); +00143 tmpChannelMixer->setSlotAnimation(0, animID); +00144 +00145 +00146 <span class="comment">// Build Dst Animation basics.</span> +00147 <span class="comment">//--------------</span> +00148 CLodCharacterShape::CAnimBuild dstAnim; +00149 dstAnim.Name= animName; +00150 dstAnim.AnimLength= animation->getEndTime(); +00151 dstAnim.NumKeys= (<a class="code" href="a04558.html#a15">uint</a>)ceil(dstAnim.AnimLength * frameRate); +00152 dstAnim.NumKeys= max(1U, dstAnim.NumKeys); +00153 <span class="comment">// resize array.</span> +00154 dstAnim.Keys.resize(<a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr2">_LodCharacterShape</a>.getNumVertices() * dstAnim.NumKeys); +00155 +00156 +00157 <span class="comment">// Bake the animation</span> +00158 <span class="comment">//==========================</span> +00159 <span class="keywordtype">double</span> time=0; +00160 <span class="keywordtype">double</span> dt= 1.0/(<span class="keywordtype">double</span>)frameRate; +00161 <a class="code" href="a04558.html#a13">uint64</a> evalDetaiDate= 0; +00162 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<dstAnim.NumKeys; i++, time+= dt) +00163 { +00164 <span class="comment">// clamp the time</span> +00165 time= <a class="code" href="a04061.html#a0">min</a>(time, (<span class="keywordtype">double</span>)dstAnim.AnimLength); +00166 +00167 <span class="comment">// setup the channelMixer time</span> +00168 tmpChannelMixer->setSlotTime(0, (<span class="keywordtype">float</span>)time); +00169 +00170 <span class="comment">// Eval the channelMixer, both global and detail</span> +00171 tmpChannelMixer->eval(<span class="keyword">false</span>); +00172 tmpChannelMixer->eval(<span class="keyword">true</span>, evalDetaiDate++); +00173 +00174 <span class="comment">// Use the skeleton model to compute bone skin matrix, supposing an identity skeleton worldMatrix</span> +00175 skeleton->computeAllBones(CMatrix::Identity); +00176 +00177 <span class="comment">// apply the skinning from the current skeleton state</span> +00178 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderd0">applySkin</a>(skeleton, &dstAnim.Keys[i*<a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr2">_LodCharacterShape</a>.getNumVertices()]); +00179 } +00180 +00181 +00182 <span class="comment">// Add the animation to the lod</span> +00183 <span class="comment">//==========================</span> +00184 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr2">_LodCharacterShape</a>.addAnim(dstAnim); +00185 +00186 +00187 <span class="comment">// Delete</span> +00188 <span class="comment">//==========================</span> +00189 <span class="comment">// release the skeleton</span> +00190 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a>->deleteModel(skeleton); +00191 <span class="comment">// delete the channelMixer</span> +00192 <span class="keyword">delete</span> tmpChannelMixer; +00193 <span class="comment">// delete the animationSet</span> +00194 <span class="keyword">delete</span> tmpAnimationSet; +00195 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CLodCharacterBuilderd0" doxytag="NL3D::CLodCharacterBuilder::applySkin" ></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 NL3D::CLodCharacterBuilder::applySkin </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03399.html">CSkeletonModel</a> * </td> + <td class="mdname" nowrap> <em>skeleton</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03128.html">CVector</a> * </td> + <td class="mdname" nowrap> <em>dstVertices</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [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="a05931.html#l00199">199</a> of file <a class="el" href="a05931.html">lod_character_builder.cpp</a>. +<p> +References <a class="el" href="a05932.html#l00084">_BoneRemap</a>, <a class="el" href="a05932.html#l00083">_LodBuild</a>, <a class="el" href="a06394.html#l00098">NL3D::CSkeletonModel::Bones</a>, <a class="el" href="a05990.html#l00116">NL3D::CMesh::CSkinWeight::MatrixId</a>, <a class="el" href="a05990.html#l00063">NL3D_MESH_SKINNING_MAX_MATRIX</a>, <a class="el" href="a05938.html#l00080">NL3D::CLodCharacterShapeBuild::SkinWeights</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05938.html#l00077">NL3D::CLodCharacterShapeBuild::Vertices</a>, and <a class="el" href="a05990.html#l00118">NL3D::CMesh::CSkinWeight::Weights</a>. +<p> +Referenced by <a class="el" href="a05931.html#l00111">addAnim()</a>. +<p> +<div class="fragment"><pre>00200 { +00201 <a class="code" href="a04558.html#a15">uint</a> numVerts= <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr1">_LodBuild</a>->Vertices.size(); +00202 +00203 <span class="comment">// for all vertices.</span> +00204 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<numVerts; i++) +00205 { +00206 CMesh::CSkinWeight &skinWgt= <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr1">_LodBuild</a>->SkinWeights[i]; +00207 CVector &srcVert= <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr1">_LodBuild</a>->Vertices[i]; +00208 CVector &dstVert= dstVertices[i]; +00209 dstVert= CVector::Null; +00210 <span class="comment">// parse all Weights, and add influence.</span> +00211 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> j=0; j<<a class="code" href="a04567.html#a0">NL3D_MESH_SKINNING_MAX_MATRIX</a>; j++) +00212 { +00213 <span class="keywordtype">float</span> wgt= skinWgt.Weights[j]; +00214 +00215 <span class="keywordflow">if</span>(wgt==0) +00216 { +00217 <span class="comment">// this should not happen, at least weight 0 should have an influence.</span> +00218 <span class="keywordflow">if</span>(j==0) +00219 dstVert= srcVert; +00220 <span class="comment">// no more influence for this vertex.</span> +00221 <span class="keywordflow">break</span>; +00222 } +00223 <span class="keywordflow">else</span> +00224 { +00225 <span class="comment">// Get the skeleton bone to read.</span> +00226 <a class="code" href="a04558.html#a15">uint</a> boneId= <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr0">_BoneRemap</a>[skinWgt.MatrixId[j]]; +00227 <span class="comment">// Get the computed matrix from the skeleton.</span> +00228 <span class="keyword">const</span> CMatrix &boneMat= skeleton->Bones[boneId].getBoneSkinMatrix(); +00229 <span class="comment">// Add the influence of this bone.</span> +00230 dstVert+= (boneMat * srcVert) * wgt; +00231 } +00232 } +00233 } +00234 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CLodCharacterBuildera2" doxytag="NL3D::CLodCharacterBuilder::getLodShape" ></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"> const <a class="el" href="a02801.html">CLodCharacterShape</a>& NL3D::CLodCharacterBuilder::getLodShape </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]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return the lod shape in its current state. +<p> + +<p> +Definition at line <a class="el" href="a05932.html#l00075">75</a> of file <a class="el" href="a05932.html">lod_character_builder.h</a>. +<p> +References <a class="el" href="a05932.html#l00080">_LodCharacterShape</a>. +<p> +<div class="fragment"><pre>00075 {<span class="keywordflow">return</span> <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr2">_LodCharacterShape</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CLodCharacterBuildera3" doxytag="NL3D::CLodCharacterBuilder::setShape" ></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 NL3D::CLodCharacterBuilder::setShape </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::string & </td> + <td class="mdname" nowrap> <em>name</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03402.html">CSkeletonShape</a> * </td> + <td class="mdname" nowrap> <em>skeletonShape</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02808.html">CLodCharacterShapeBuild</a> * </td> + <td class="mdname" nowrap> <em>lodBuild</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +init process with the Mesh and the SkeletonShape to use. NB: nlWarnings may occurs if don't find bones used by lodBuild, in the skeletonShape. In this case, root bone 0 of the skeleton shape is used.<p> +<dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>name</em> </td><td>is the name to give to the shape </td></tr> + <tr><td valign=top><em>skeletonShape</em> </td><td>the skeleton used for animation. Ptr is handled by the builder as a smartPtr. </td></tr> + <tr><td valign=top><em>lodBuild</em> </td><td>the mesh information. Ptr is hold by the builder, but not deleted</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05931.html#l00064">64</a> of file <a class="el" href="a05931.html">lod_character_builder.cpp</a>. +<p> +References <a class="el" href="a05932.html#l00084">_BoneRemap</a>, <a class="el" href="a05932.html#l00083">_LodBuild</a>, <a class="el" href="a05932.html#l00080">_LodCharacterShape</a>, <a class="el" href="a05932.html#l00082">_SkeletonShape</a>, <a class="el" href="a05932.html#l00087">_TmpScene</a>, <a class="el" href="a05937.html#l00337">NL3D::CLodCharacterShape::buildMesh()</a>, <a class="el" href="a06348.html#l00249">NL3D::CScene::initDefaultRoots()</a>, <a class="el" href="a06348.html#l00277">NL3D::CScene::initQuadGridClipManager()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05981.html#l00099">sint32</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +<div class="fragment"><pre>00065 { +00066 <a class="code" href="a04199.html#a6">nlassert</a>(skeletonShape); +00067 <a class="code" href="a04199.html#a6">nlassert</a>(lodBuild); +00068 +00069 <span class="comment">// SmartPtr the skeleton Shape (NB: important because skeletonModel use it)</span> +00070 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr3">_SkeletonShape</a>= skeletonShape; +00071 <span class="comment">// a std ptr.</span> +00072 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr1">_LodBuild</a>= lodBuild; +00073 +00074 <span class="comment">// Remap bone, with help of lodBuild and skeleton names.</span> +00075 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr0">_BoneRemap</a>.resize(lodBuild->BonesNames.size()); +00076 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<<a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr0">_BoneRemap</a>.size(); i++) +00077 { +00078 <span class="keyword">const</span> std::string &boneName= lodBuild->BonesNames[i]; +00079 <a class="code" href="a04558.html#a10">sint32</a> boneId= <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr3">_SkeletonShape</a>->getBoneIdByName(boneName); +00080 <span class="comment">// If not found</span> +00081 <span class="keywordflow">if</span>(boneId<0) +00082 { +00083 <a class="code" href="a04199.html#a2">nlwarning</a>(<span class="stringliteral">"Not found a bone in the skeleton Shape: %s"</span>, boneName.c_str()); +00084 <span class="comment">// use root bone.</span> +00085 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr0">_BoneRemap</a>[i]= 0; +00086 } +00087 <span class="keywordflow">else</span> +00088 <span class="comment">// remap</span> +00089 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr0">_BoneRemap</a>[i]= boneId; +00090 } +00091 +00092 <span class="comment">// build basics</span> +00093 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr2">_LodCharacterShape</a>.buildMesh(name, *_LodBuild); +00094 +00095 <span class="comment">// Build a scene, for addAnim purpose</span> +00096 <span class="keywordflow">if</span>(!<a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a>) +00097 { +00098 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a>= <span class="keyword">new</span> CScene(<span class="keyword">false</span>); +00099 <span class="comment">// Must init Statics for scene (because use it in addAnim). NB: never mind if done twice.</span> +00100 CScene::registerBasics(); +00101 <span class="comment">// init default Roots.</span> +00102 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a>->initDefaultRoots(); +00103 <span class="comment">// Don't Set driver/viewport</span> +00104 <span class="comment">// init QuadGridClipManager</span> +00105 <a class="code" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">_TmpScene</a>->initQuadGridClipManager (); +00106 } +00107 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NL3D_1_1CLodCharacterBuilderr0" doxytag="NL3D::CLodCharacterBuilder::_BoneRemap" ></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"> std::vector<<a class="el" href="a04558.html#a15">uint</a>> <a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuilderr0">NL3D::CLodCharacterBuilder::_BoneRemap</a><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="a05932.html#l00084">84</a> of file <a class="el" href="a05932.html">lod_character_builder.h</a>. +<p> +Referenced by <a class="el" href="a05931.html#l00199">applySkin()</a>, and <a class="el" href="a05931.html#l00064">setShape()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CLodCharacterBuilderr1" doxytag="NL3D::CLodCharacterBuilder::_LodBuild" ></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"> <a class="el" href="a02808.html">CLodCharacterShapeBuild</a>* <a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuilderr1">NL3D::CLodCharacterBuilder::_LodBuild</a><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="a05932.html#l00083">83</a> of file <a class="el" href="a05932.html">lod_character_builder.h</a>. +<p> +Referenced by <a class="el" href="a05931.html#l00199">applySkin()</a>, <a class="el" href="a05931.html#l00045">CLodCharacterBuilder()</a>, and <a class="el" href="a05931.html#l00064">setShape()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CLodCharacterBuilderr2" doxytag="NL3D::CLodCharacterBuilder::_LodCharacterShape" ></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"> <a class="el" href="a02801.html">CLodCharacterShape</a> <a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuilderr2">NL3D::CLodCharacterBuilder::_LodCharacterShape</a><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="a05932.html#l00080">80</a> of file <a class="el" href="a05932.html">lod_character_builder.h</a>. +<p> +Referenced by <a class="el" href="a05931.html#l00111">addAnim()</a>, <a class="el" href="a05932.html#l00075">getLodShape()</a>, and <a class="el" href="a05931.html#l00064">setShape()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CLodCharacterBuilderr3" doxytag="NL3D::CLodCharacterBuilder::_SkeletonShape" ></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"> <a class="el" href="a03408.html">NLMISC::CSmartPtr</a><<a class="el" href="a03402.html">CSkeletonShape</a>> <a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuilderr3">NL3D::CLodCharacterBuilder::_SkeletonShape</a><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="a05932.html#l00082">82</a> of file <a class="el" href="a05932.html">lod_character_builder.h</a>. +<p> +Referenced by <a class="el" href="a05931.html#l00111">addAnim()</a>, <a class="el" href="a05931.html#l00045">CLodCharacterBuilder()</a>, and <a class="el" href="a05931.html#l00064">setShape()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CLodCharacterBuilderr4" doxytag="NL3D::CLodCharacterBuilder::_TmpScene" ></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"> <a class="el" href="a03348.html">CScene</a>* <a class="el" href="a02798.html#NL3D_1_1CLodCharacterBuilderr4">NL3D::CLodCharacterBuilder::_TmpScene</a><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="a05932.html#l00087">87</a> of file <a class="el" href="a05932.html">lod_character_builder.h</a>. +<p> +Referenced by <a class="el" href="a05931.html#l00111">addAnim()</a>, <a class="el" href="a05931.html#l00045">CLodCharacterBuilder()</a>, <a class="el" href="a05931.html#l00064">setShape()</a>, and <a class="el" href="a05931.html#l00052">~CLodCharacterBuilder()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05932.html">lod_character_builder.h</a><li><a class="el" href="a05931.html">lod_character_builder.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:49:47 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> |