diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a02878.html | 5263 |
1 files changed, 5263 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a02878.html b/docs/doxygen/nel/a02878.html new file mode 100644 index 00000000..631f409c --- /dev/null +++ b/docs/doxygen/nel/a02878.html @@ -0,0 +1,5263 @@ +<!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::CMeshGeom 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::CMeshGeom Class Reference</h1><code>#include <<a class="el" href="a05990.html">mesh.h</a>></code> +<p> +<p>Inheritance diagram for NL3D::CMeshGeom: +<p><center><img src="a02878.png" usemap="#NL3D::CMeshGeom_map" border="0" alt=""></center> +<map name="NL3D::CMeshGeom_map"> +<area href="a02879.html" alt="NL3D::IMeshGeom" shape="rect" coords="0,112,131,136"> +<area href="a02867.html" alt="NLMISC::IStreamable" shape="rect" coords="0,56,131,80"> +<area href="a02540.html" alt="NLMISC::IClassable" shape="rect" coords="0,0,131,24"> +</map> +<hr><a name="_details"></a><h2>Detailed Description</h2> +A mesh geometry. Skinning support: support only palette skinning. <dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2000 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00335">335</a> of file <a class="el" href="a05990.html">mesh.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Mesh Block Render Implementation</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0">TMBRSupport</a> { <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy3">MBROk</a> = 1, +<a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy4">MBRSortPerMaterial</a> = 2, +<a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a> = 4 + }</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">setuped at compileRunTime. <a href="#NL3D_1_1CMeshGeomz421_0">More...</a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a7">uint8</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">setuped at compileRunTime. <a href="#NL3D_1_1CMeshGeomz421_1"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Skinning</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_0">TSkinType</a> { <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy5">SkinPosOnly</a> = 0, +<a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy6">SkinWithNormal</a>, +<a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy7">SkinWithTgSpace</a> + }</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_1">applySkin</a> (<a class="el" href="a03399.html">CSkeletonModel</a> *skeleton)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_2">bkupOriginalSkinVertices</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_3">buildBoneUsageVer3</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_4">buildSkin</a> (<a class="el" href="a02864.html">CMesh::CMeshBuild</a> &m, std::vector< <a class="el" href="a02883.html">CFaceTmp</a> > &tmpFaces)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_5">computeSkinMatrixes</a> (<a class="el" href="a03399.html">CSkeletonModel</a> *skeleton, <a class="el" href="a02852.html">CMatrix3x4</a> *matrixes, <a class="el" href="a02884.html">CMatrixBlock</a> *prevBlock, <a class="el" href="a02884.html">CMatrixBlock</a> &curBlock)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_6">computeSoftwarePointSkinning</a> (<a class="el" href="a02852.html">CMatrix3x4</a> *matrixes, <a class="el" href="a03128.html">CVector</a> *srcVector, <a class="el" href="a03038.html">CPaletteSkin</a> *srcPal, float *srcWgt, <a class="el" href="a03128.html">CVector</a> *dstVector)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_7">computeSoftwareVectorSkinning</a> (<a class="el" href="a02852.html">CMatrix3x4</a> *matrixes, <a class="el" href="a03128.html">CVector</a> *srcVector, <a class="el" href="a03038.html">CPaletteSkin</a> *srcPal, float *srcWgt, <a class="el" href="a03128.html">CVector</a> *dstVector)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_8">flagSkinVerticesForMatrixBlock</a> (<a class="el" href="a04558.html#a7">uint8</a> *skinFlags, <a class="el" href="a02884.html">CMatrixBlock</a> &mb)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_9">restoreOriginalSkinVertices</a> ()</td></tr> + +<tr><td colspan=2><br><h2>VBufferHard mgt.</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz419_0">updateVertexBufferHard</a> (<a class="el" href="a02434.html">IDriver</a> *drv)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">update the VertexBufferHard if NULL (ie not created or deleted by driver) or if VertexBufferDirty. <a href="#NL3D_1_1CMeshGeomz419_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03321.html">CRefPtr</a>< <a class="el" href="a02434.html">IDriver</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz419_1">_Driver</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">This is the driver used to setup the vbuffer hard. error if a mesh has not the same driver in his life. <a href="#NL3D_1_1CMeshGeomz419_1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03321.html">CRefPtr</a>< <a class="el" href="a03694.html">IVertexBufferHard</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The only one VBufferHard of the mesh. NULL by default. <a href="#NL3D_1_1CMeshGeomz419_2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz419_3">_VertexBufferHardDirty</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">This tells if the VBuffer has changed since the last time or not. <a href="#NL3D_1_1CMeshGeomz419_3"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Public Types</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>enum </td><td class="memItemRight" valign=bottom><a class="el" href="a02879.html#NL3D_1_1IMeshGeomw5">TRenderFlag</a> { <br> + <a class="el" href="a02879.html#NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw2">RenderOpaqueMaterial</a> = 1, +<a class="el" href="a02879.html#NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw4">RenderTransparentMaterial</a> = 2, +<a class="el" href="a02879.html#NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw3">RenderPassOpaque</a> = 4, +<a class="el" href="a02879.html#NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw1">RenderGlobalAlpha</a> = 8, +<br> + <a class="el" href="a02879.html#NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw0">RenderGADisableZWrite</a> = 16 +<br> + }</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Render Flags, used in render. <a href="#NL3D_1_1IMeshGeomw5">More...</a><br><br></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="a02878.html#NL3D_1_1CMeshGeoma0">applyMaterialRemap</a> (const std::vector< <a class="el" href="a04558.html#a14">sint</a> > &remap)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">change materials Ids (called from <a class="el" href="a02857.html#NL3D_1_1CMesha11">CMesh::optimizeMaterialUsage()</a>) <a href="#NL3D_1_1CMeshGeoma0"></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="a02878.html#NL3D_1_1CMeshGeoma1">build</a> (<a class="el" href="a02864.html">CMesh::CMeshBuild</a> &mbuild, <a class="el" href="a04558.html#a15">uint</a> numMaxMaterial)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Build a meshGeom. <a href="#NL3D_1_1CMeshGeoma1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeoma2">CMeshGeom</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Constructor. <a href="#NL3D_1_1CMeshGeoma2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual std::string </td><td class="memItemRight" valign=bottom><a class="el" href="a02540.html#NL3D_1_1ITrackKeyFramer_3_01CKeyVector_01_4a6">getClassName</a> ()=0</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeoma4">hasMeshVertexProgram</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">True if this mesh has a vertexProgram. <a href="#NL3D_1_1CMeshGeoma4"></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="a02878.html#NL3D_1_1CMeshGeoma5">renderSimpleWithMaterial</a> (<a class="el" href="a02434.html">IDriver</a> *drv, const <a class="el" href="a02851.html">CMatrix</a> &worldMatrix, <a class="el" href="a02839.html">CMaterial</a> &mat)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeoma6">setBlendShapes</a> (std::vector< <a class="el" href="a02273.html">CBlendShape</a> > &bs)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeoma7">~CMeshGeom</a> ()</td></tr> + +<tr><td colspan="2"><div class="groupHeader">Mesh Block Render Implementation</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_0">activeInstance</a> (<a class="el" href="a02887.html">CMeshGeomRenderContext</a> &rdrCtx, <a class="el" href="a02873.html">CMeshBaseInstance</a> *inst, float polygonCount, void *vbDst)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_1">beginMesh</a> (<a class="el" href="a02887.html">CMeshGeomRenderContext</a> &rdrCtx)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_2">computeMeshVBHeap</a> (void *dst, <a class="el" href="a04558.html#a15">uint</a> indexStart)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_3">endMesh</a> (<a class="el" href="a02887.html">CMeshGeomRenderContext</a> &rdrCtx)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_4">getNumRdrPassesForInstance</a> (<a class="el" href="a02873.html">CMeshBaseInstance</a> *inst) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual <a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_5">getNumRdrPassesForMesh</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_6">getVBHeapInfo</a> (<a class="el" href="a04558.html#a15">uint</a> &vertexFormat, <a class="el" href="a04558.html#a15">uint</a> &numVertices)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_7">renderPass</a> (<a class="el" href="a02887.html">CMeshGeomRenderContext</a> &rdrCtx, <a class="el" href="a02873.html">CMeshBaseInstance</a> *inst, float polygonCount, <a class="el" href="a04558.html#a15">uint</a> rdrPass)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_8">sortPerMaterial</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_9">supportMeshBlockRendering</a> () const </td></tr> + +<tr><td colspan="2"><div class="groupHeader">From IMeshGeom</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz411_0">clip</a> (const std::vector< <a class="el" href="a03082.html">CPlane</a> > &pyramid, const <a class="el" href="a02851.html">CMatrix</a> &worldMatrix)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">clip this mesh <a href="#NL3D_1_1CMeshGeomz411_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>virtual float </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz411_1">getNumTriangles</a> (float distance)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">clip this mesh <a href="#NL3D_1_1CMeshGeomz411_1"></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="a02878.html#NL3D_1_1CMeshGeomz411_2">initInstance</a> (<a class="el" href="a02873.html">CMeshBaseInstance</a> *mbi)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Init instance info. <a href="#NL3D_1_1CMeshGeomz411_2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz411_3">NLMISC_DECLARE_CLASS</a> (<a class="el" href="a02878.html">CMeshGeom</a>)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">clip this mesh <a href="#NL3D_1_1CMeshGeomz411_3"></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="a02878.html#NL3D_1_1CMeshGeomz411_4">profileSceneRender</a> (<a class="el" href="a03325.html">CRenderTrav</a> *rdrTrav, <a class="el" href="a02537.html">CTransformShape</a> *trans, float polygonCount, <a class="el" href="a04558.html#a11">uint32</a> rdrFlags)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">clip this mesh <a href="#NL3D_1_1CMeshGeomz411_4"></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="a02878.html#NL3D_1_1CMeshGeomz411_5">render</a> (<a class="el" href="a02434.html">IDriver</a> *drv, <a class="el" href="a02537.html">CTransformShape</a> *trans, float polygonCount, <a class="el" href="a04558.html#a11">uint32</a> rdrFlags, float globalAlpha)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz411_5">render()</a> this mesh in a driver. <a href="#NL3D_1_1CMeshGeomz411_5"></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="a02878.html#NL3D_1_1CMeshGeomz411_6">renderSkin</a> (<a class="el" href="a02537.html">CTransformShape</a> *trans, float alphaMRM)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight"><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz411_5">render()</a> this mesh as a skin <a href="#NL3D_1_1CMeshGeomz411_6"></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="a02878.html#NL3D_1_1CMeshGeomz411_7">serial</a> (<a class="el" href="a02270.html">NLMISC::IStream</a> &f) throw (NLMISC::EStream)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">serial this mesh. <a href="#NL3D_1_1CMeshGeomz411_7"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Skinning Behavior</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz415_0">computeBonesId</a> (<a class="el" href="a03399.html">CSkeletonModel</a> *skeleton)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Compute skinning id. <a href="#NL3D_1_1CMeshGeomz415_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const std::vector< <a class="el" href="a04558.html#a10">sint32</a> > & </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz415_1">getSkinBoneUsage</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">return array of bones used by the skin. computeBonesId must has been called before. <a href="#NL3D_1_1CMeshGeomz415_1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz415_2">isSkinned</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Return true if the mesh is skinned, else return false. <a href="#NL3D_1_1CMeshGeomz415_2"></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="a02878.html#NL3D_1_1CMeshGeomz415_3">updateSkeletonUsage</a> (<a class="el" href="a03399.html">CSkeletonModel</a> *sm, bool increment)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">update Skeleton Usage. increment or decrement. computeBonesId must has been called before. <a href="#NL3D_1_1CMeshGeomz415_3"></a><br><br></td></tr> +<tr><td colspan="2"><div class="groupHeader">Geometry accessors</div></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a02157.html">NLMISC::CAABBoxExt</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz413_0">getBoundingBox</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">get the extended axis aligned bounding box of the mesh <a href="#NL3D_1_1CMeshGeomz413_0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz413_1">getNbBlendShapes</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">get the number of BlendShapes <a href="#NL3D_1_1CMeshGeomz413_1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz413_2">getNbMatrixBlock</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">get the number of matrix block <a href="#NL3D_1_1CMeshGeomz413_2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a15">uint</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz413_3">getNbRdrPass</a> (<a class="el" href="a04558.html#a15">uint</a> matrixBlockIndex) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a04558.html#a11">uint32</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz413_4">getRdrPassMaterial</a> (<a class="el" href="a04558.html#a15">uint</a> matrixBlockIndex, <a class="el" href="a04558.html#a15">uint</a> renderingPassIndex) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a03105.html">CPrimitiveBlock</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz413_5">getRdrPassPrimitiveBlock</a> (<a class="el" href="a04558.html#a15">uint</a> matrixBlockIndex, <a class="el" href="a04558.html#a15">uint</a> renderingPassIndex) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>const <a class="el" href="a03692.html">CVertexBuffer</a> & </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomz413_6">getVertexBuffer</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">get the vertex buffer used by the mesh <a href="#NL3D_1_1CMeshGeomz413_6"></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 TBoneMap::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomy0">ItBoneMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef TCornerSet::iterator </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomy1">ItCornerSet</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::map< <a class="el" href="a04558.html#a15">uint</a>, <a class="el" href="a02880.html">CBoneTmp</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomy8">TBoneMap</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>typedef std::set< <a class="el" href="a02882.html">CCornerTmp</a> *,<br> + <a class="el" href="a02881.html">CCornerPred</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomy9">TCornerSet</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="a02878.html#NL3D_1_1CMeshGeomd0">compileRunTime</a> ()</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomd1">findVBId</a> (<a class="el" href="a02878.html#NL3D_1_1CMeshGeomy9">TCornerSet</a> &corners, const <a class="el" href="a02882.html">CCornerTmp</a> *corn, <a class="el" href="a04558.html#a14">sint</a> &currentVBIndex, const <a class="el" href="a03128.html">CVector</a> &vert, const <a class="el" href="a02864.html">CMesh::CMeshBuild</a> &mb)</td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomd2">optimizeTriangleOrder</a> ()</td></tr> + +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02157.html">NLMISC::CAABBoxExt</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr0">_BBox</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">For clipping. <a href="#NL3D_1_1CMeshGeomr0"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr1">_BoneIdComputed</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">This boolean is true if the bones id have been passed in the skeleton. <a href="#NL3D_1_1CMeshGeomr1"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr2">_BoneIdExtended</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">true if the _BonesIdExt have been computed (for bone Usage). <a href="#NL3D_1_1CMeshGeomr2"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a04558.html#a10">sint32</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr3">_BonesId</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">This array give the index in the skeleton of the local bones used. computed at first computeBoneId(). <a href="#NL3D_1_1CMeshGeomr3"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a04558.html#a10">sint32</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr4">_BonesIdExt</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Same as _BonesId but with parent of bones added. (used for bone usage). <a href="#NL3D_1_1CMeshGeomr4"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< std::string > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr5">_BonesName</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">This array give the name of the local bones used. <a href="#NL3D_1_1CMeshGeomr5"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a02884.html">CMatrixBlock</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The matrix blocks. <a href="#NL3D_1_1CMeshGeomr6"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02890.html">CMeshMorpher</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</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="a02916.html">IMeshVertexProgram</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a03128.html">CVector</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr9">_OriginalSkinNormals</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr10">_OriginalSkinRestored</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">This tells if the mesh VBuffer has coorect BindPos vertices. <a href="#NL3D_1_1CMeshGeomr10"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a03128.html">CVector</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr11">_OriginalSkinVertices</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>std::vector< <a class="el" href="a03128.html">CVector</a> > </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr12">_OriginalTGSpace</a></td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr13">_PreciseClipping</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Estimate if we must do a Precise clipping (ie with bboxes). <a href="#NL3D_1_1CMeshGeomr13"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">This tells if the mesh is correctly skinned. <a href="#NL3D_1_1CMeshGeomr14"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03692.html">CVertexBuffer</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">VBuffer of the mesh (potentially modified by the mesh morpher and skinning). <a href="#NL3D_1_1CMeshGeomr15"></a><br><br></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a03692.html">CVertexBuffer</a> </td><td class="memItemRight" valign=bottom><a class="el" href="a02878.html#NL3D_1_1CMeshGeomr16">_VBufferOri</a></td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">The original VBuffer of the mesh used only if there are blend shapes. <a href="#NL3D_1_1CMeshGeomr16"></a><br><br></td></tr> +</table> +<hr><h2>Member Typedef Documentation</h2> +<a class="anchor" name="NL3D_1_1CMeshGeomy0" doxytag="NL3D::CMeshGeom::ItBoneMap" ></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"> typedef TBoneMap::iterator <a class="el" href="a02878.html#NL3D_1_1CMeshGeomy0">NL3D::CMeshGeom::ItBoneMap</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="a05990.html#l00606">606</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01105">buildSkin()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomy1" doxytag="NL3D::CMeshGeom::ItCornerSet" ></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"> typedef TCornerSet::iterator <a class="el" href="a02878.html#NL3D_1_1CMeshGeomy1">NL3D::CMeshGeom::ItCornerSet</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="a05990.html#l00730">730</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05990.html#l00733">findVBId()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomy8" doxytag="NL3D::CMeshGeom::TBoneMap" ></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"> typedef std::map<<a class="el" href="a04558.html#a15">uint</a>, <a class="el" href="a02880.html">CBoneTmp</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomy8">NL3D::CMeshGeom::TBoneMap</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Just for build process. A map of Bone. +<p> +Definition at line <a class="el" href="a05990.html#l00605">605</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01105">buildSkin()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomy9" doxytag="NL3D::CMeshGeom::TCornerSet" ></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"> typedef std::set<<a class="el" href="a02882.html">CCornerTmp</a>*, <a class="el" href="a02881.html">CCornerPred</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomy9">NL3D::CMeshGeom::TCornerSet</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="a05990.html#l00729">729</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00172">build()</a>, and <a class="el" href="a05990.html#l00733">findVBId()</a>. </td> + </tr> +</table> +<hr><h2>Member Enumeration Documentation</h2> +<a class="anchor" name="NL3D_1_1CMeshGeomz421_0" doxytag="NL3D::CMeshGeom::TMBRSupport" ></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"> enum <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0">NL3D::CMeshGeom::TMBRSupport</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +setuped at compileRunTime. +<p> +<dl compact><dt><b>Enumeration values: </b></dt><dd> +<table border=0 cellspacing=2 cellpadding=0> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy3" doxytag="MBROk" ></a>MBROk</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy4" doxytag="MBRSortPerMaterial" ></a>MBRSortPerMaterial</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2" doxytag="MBRCurrentUseVP" ></a>MBRCurrentUseVP</em> </td><td> +</td></tr> +</table> +</dl> + +<p> +Definition at line <a class="el" href="a05990.html#l00698">698</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +<div class="fragment"><pre>00699 { +00700 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy3">MBROk</a>= 1, +00701 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy4">MBRSortPerMaterial</a>= 2, +00702 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a>= 4, +00703 }; +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1IMeshGeomw5" doxytag="NL3D::CMeshGeom::TRenderFlag" ></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"> enum <a class="el" href="a02879.html#NL3D_1_1IMeshGeomw5">NL3D::IMeshGeom::TRenderFlag</a><code> [inherited]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Render Flags, used in render. +<p> +<dl compact><dt><b>Enumeration values: </b></dt><dd> +<table border=0 cellspacing=2 cellpadding=0> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw2" doxytag="RenderOpaqueMaterial" ></a>RenderOpaqueMaterial</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw4" doxytag="RenderTransparentMaterial" ></a>RenderTransparentMaterial</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw3" doxytag="RenderPassOpaque" ></a>RenderPassOpaque</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw1" doxytag="RenderGlobalAlpha" ></a>RenderGlobalAlpha</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw0" doxytag="RenderGADisableZWrite" ></a>RenderGADisableZWrite</em> </td><td> +</td></tr> +</table> +</dl> + +<p> +Definition at line <a class="el" href="a06000.html#l00082">82</a> of file <a class="el" href="a06000.html">mesh_geom.h</a>. +<p> +<div class="fragment"><pre>00083 { +00084 <a class="code" href="a02879.html#NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw2">RenderOpaqueMaterial</a>= 1, <span class="comment">// set when the mesh geom must render opaque material</span> +00085 <a class="code" href="a02879.html#NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw4">RenderTransparentMaterial</a>= 2, <span class="comment">// set when the mesh geom must render transparent material</span> +00086 <a class="code" href="a02879.html#NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw3">RenderPassOpaque</a>=4, <span class="comment">// set when the current traversal rdrPass is the opaque pass</span> +00087 <a class="code" href="a02879.html#NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw1">RenderGlobalAlpha</a>= 8, <span class="comment">// set when the caller wants to draw material with global alpha</span> +00088 <a class="code" href="a02879.html#NL3D_1_1IMeshGeomw5NL3D_1_1IMeshGeomw0">RenderGADisableZWrite</a>= 16, <span class="comment">// only when globalAlpha is used. set if must disable ZWrite</span> +00089 }; +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz423_0" doxytag="NL3D::CMeshGeom::TSkinType" ></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"> enum <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_0">NL3D::CMeshGeom::TSkinType</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +<dl compact><dt><b>Enumeration values: </b></dt><dd> +<table border=0 cellspacing=2 cellpadding=0> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy5" doxytag="SkinPosOnly" ></a>SkinPosOnly</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy6" doxytag="SkinWithNormal" ></a>SkinWithNormal</em> </td><td> +</td></tr> +<tr><td valign=top><em><a class="anchor" name="NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy7" doxytag="SkinWithTgSpace" ></a>SkinWithTgSpace</em> </td><td> +</td></tr> +</table> +</dl> + +<p> +Definition at line <a class="el" href="a05990.html#l00799">799</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01715">applySkin()</a>. +<p> +<div class="fragment"><pre>00799 {<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy5">SkinPosOnly</a>=0, <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy6">SkinWithNormal</a>, <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy7">SkinWithTgSpace</a>}; +</pre></div> </td> + </tr> +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NL3D_1_1CMeshGeoma2" doxytag="NL3D::CMeshGeom::CMeshGeom" ></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::CMeshGeom::CMeshGeom </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="a05989.html#l00123">123</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00669">_BoneIdComputed</a>, <a class="el" href="a05990.html#l00671">_BoneIdExtended</a>, <a class="el" href="a05990.html#l00712">_MeshMorpher</a>, <a class="el" href="a05990.html#l00666">_OriginalSkinRestored</a>, <a class="el" href="a05990.html#l00709">_PreciseClipping</a>, <a class="el" href="a05990.html#l00664">_Skinned</a>, and <a class="el" href="a05990.html#l00688">_VertexBufferHardDirty</a>. +<p> +<div class="fragment"><pre>00124 { +00125 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>= <span class="keyword">false</span>; +00126 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr10">_OriginalSkinRestored</a>= <span class="keyword">true</span>; +00127 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_3">_VertexBufferHardDirty</a>= <span class="keyword">true</span>; +00128 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a> = <span class="keyword">new</span> CMeshMorpher; +00129 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr1">_BoneIdComputed</a> = <span class="keyword">false</span>; +00130 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr2">_BoneIdExtended</a>= <span class="keyword">false</span>; +00131 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr13">_PreciseClipping</a>= <span class="keyword">false</span>; +00132 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeoma7" doxytag="NL3D::CMeshGeom::~CMeshGeom" ></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::CMeshGeom::~<a class="el" href="a02878.html">CMeshGeom</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><code> [virtual]</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="a05989.html#l00136">136</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00712">_MeshMorpher</a>, <a class="el" href="a05990.html#l00684">_VertexBufferHard</a>, and <a class="el" href="a05622.html#l00290">nlassert</a>. +<p> +<div class="fragment"><pre>00137 { +00138 <span class="comment">// test (refptr) if the object still exist in memory.</span> +00139 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>!=NULL) +00140 { +00141 <span class="comment">// A vbufferhard should still exist only if driver still exist.</span> +00142 <a class="code" href="a04199.html#a6">nlassert</a>(_Driver!=NULL); +00143 +00144 <span class="comment">// delete it from driver.</span> +00145 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_1">_Driver</a>->deleteVertexBufferHard(_VertexBufferHard); +00146 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>= NULL; +00147 } +00148 <span class="keyword">delete</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>; +00149 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NL3D_1_1CMeshGeomz417_0" doxytag="NL3D::CMeshGeom::activeInstance" ></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::CMeshGeom::activeInstance </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02887.html">CMeshGeomRenderContext</a> & </td> + <td class="mdname" nowrap> <em>rdrCtx</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02873.html">CMeshBaseInstance</a> * </td> + <td class="mdname" nowrap> <em>inst</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>polygonCount</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>void * </td> + <td class="mdname" nowrap> <em>vbDst</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The framework call this method any time a change of instance occurs. +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_0">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l02058">2058</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>, <a class="el" href="a05990.html#l00705">_SupportMBRFlags</a>, <a class="el" href="a06570.html#l00105">NL3D::CTransformShape::changeLightSetup()</a>, <a class="el" href="a06000.html#l00062">NL3D::CMeshGeomRenderContext::Driver</a>, <a class="el" href="a06569.html#l00299">NL3D::CTransform::getWorldMatrix()</a>, <a class="el" href="a05972.html#l01090">NLMISC::CMatrix::inverted()</a>, <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a>, <a class="el" href="a06000.html#l00064">NL3D::CMeshGeomRenderContext::RenderTrav</a>, <a class="el" href="a06000.html#l00063">NL3D::CMeshGeomRenderContext::Scene</a>, and <a class="el" href="a02434.html#NL3D_1_1IDrivera68">NL3D::IDriver::setupModelMatrix()</a>. +<p> +<div class="fragment"><pre>02059 { +02060 <span class="comment">// setup instance matrix</span> +02061 rdrCtx.Driver->setupModelMatrix(inst->getWorldMatrix()); +02062 +02063 <span class="comment">// setupLighting.</span> +02064 inst->changeLightSetup(rdrCtx.RenderTrav); +02065 +02066 <span class="comment">// MeshVertexProgram ?</span> +02067 <span class="keywordflow">if</span>( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a> & <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a> ) +02068 { +02069 CMatrix invertedObjectMatrix; +02070 invertedObjectMatrix = inst->getWorldMatrix().inverted(); +02071 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->beginMBRInstance(rdrCtx.Driver, rdrCtx.Scene, inst, invertedObjectMatrix); +02072 } +02073 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeoma0" doxytag="NL3D::CMeshGeom::applyMaterialRemap" ></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::CMeshGeom::applyMaterialRemap </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::vector< <a class="el" href="a04558.html#a14">sint</a> > & </td> + <td class="mdname1" valign="top" nowrap> <em>remap</em> </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> +change materials Ids (called from <a class="el" href="a02857.html#NL3D_1_1CMesha11">CMesh::optimizeMaterialUsage()</a>) +<p> + +<p> +Definition at line <a class="el" href="a05989.html#l00458">458</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05990.html#l00393">getNbMatrixBlock()</a>, <a class="el" href="a05990.html#l00398">getNbRdrPass()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02316">NL3D::CMesh::optimizeMaterialUsage()</a>. +<p> +<div class="fragment"><pre>00459 { +00460 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> mb=0;mb<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz413_2">getNbMatrixBlock</a>();mb++) +00461 { +00462 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> rp=0;rp<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz413_3">getNbRdrPass</a>(mb);rp++) +00463 { +00464 <span class="comment">// remap</span> +00465 <a class="code" href="a04558.html#a11">uint32</a> &matId= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb].RdrPass[rp].MaterialId; +00466 <a class="code" href="a04199.html#a6">nlassert</a>(remap[matId]>=0); +00467 matId= remap[matId]; +00468 } +00469 } +00470 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz423_1" doxytag="NL3D::CMeshGeom::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::CMeshGeom::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="mdname1" valign="top" nowrap> <em>skeleton</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><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="a05989.html#l01715">1715</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05990.html#l00652">_OriginalSkinNormals</a>, <a class="el" href="a05990.html#l00666">_OriginalSkinRestored</a>, <a class="el" href="a05990.html#l00651">_OriginalSkinVertices</a>, <a class="el" href="a05990.html#l00653">_OriginalTGSpace</a>, <a class="el" href="a05989.html#l01914">computeSkinMatrixes()</a>, <a class="el" href="a05989.html#l01870">computeSoftwarePointSkinning()</a>, <a class="el" href="a05989.html#l01892">computeSoftwareVectorSkinning()</a>, <a class="el" href="a05989.html#l01836">flagSkinVerticesForMatrixBlock()</a>, <a class="el" href="a06710.html#l00449">NL3D::CVertexBuffer::getNormalCoordPointer()</a>, <a class="el" href="a06710.html#l00976">NL3D::CVertexBuffer::getNumTexCoordUsed()</a>, <a class="el" href="a06710.html#l00529">NL3D::CVertexBuffer::getPaletteSkinPointer()</a>, <a class="el" href="a06710.html#l00497">NL3D::CVertexBuffer::getTexCoordPointer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a06711.html#l00473">NL3D::CVertexBuffer::getVertexSize()</a>, <a class="el" href="a06710.html#l00513">NL3D::CVertexBuffer::getWeightPointer()</a>, <a class="el" href="a06711.html#l00089">NL3D::CPaletteSkin::MatrixId</a>, <a class="el" href="a05989.html#l01708">NL3D_SOFTSKIN_VCOMPUTED</a>, <a class="el" href="a05989.html#l01707">NL3D_SOFTSKIN_VMUSTCOMPUTE</a>, <a class="el" href="a05989.html#l01706">NL3D_SOFTSKIN_VNEEDCOMPUTE</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05646.html#l00645">size</a>, <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy5">SkinPosOnly</a>, <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy6">SkinWithNormal</a>, <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy7">SkinWithTgSpace</a>, <a class="el" href="a05990.html#l00799">TSkinType</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00788">renderSkin()</a>. +<p> +<div class="fragment"><pre>01716 { +01717 <span class="comment">// init.</span> +01718 <span class="comment">//===================</span> +01719 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr11">_OriginalSkinVertices</a>.empty()) +01720 <span class="keywordflow">return</span>; +01721 +01722 <span class="comment">// Use correct skinning</span> +01723 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_0">TSkinType</a> skinType; +01724 <span class="keywordflow">if</span>( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr9">_OriginalSkinNormals</a>.empty() ) +01725 skinType= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy5">SkinPosOnly</a>; +01726 <span class="keywordflow">else</span> <span class="keywordflow">if</span>( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr12">_OriginalTGSpace</a>.empty() ) +01727 skinType= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy6">SkinWithNormal</a>; +01728 <span class="keywordflow">else</span> +01729 skinType= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_0NL3D_1_1CMeshGeomy7">SkinWithTgSpace</a>; +01730 +01731 <span class="comment">// Get VB src/dst info/ptrs.</span> +01732 <a class="code" href="a04558.html#a15">uint</a> numVertices= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr11">_OriginalSkinVertices</a>.size(); +01733 <a class="code" href="a04558.html#a15">uint</a> dstStride= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexSize(); +01734 <span class="comment">// Get dst TgSpace.</span> +01735 <a class="code" href="a04558.html#a15">uint</a> tgSpaceStage = 0; +01736 <span class="keywordflow">if</span>( skinType>= SkinWithTgSpace) +01737 { +01738 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumTexCoordUsed() > 0); +01739 tgSpaceStage= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumTexCoordUsed() - 1; +01740 } +01741 +01742 <span class="comment">// Mark all vertices flag to not computed.</span> +01743 <span class="keyword">static</span> vector<uint8> skinFlags; +01744 skinFlags.resize(numVertices); +01745 <span class="comment">// reset all flags</span> +01746 memset(&skinFlags[0], NL3D_SOFTSKIN_VNEEDCOMPUTE, numVertices ); +01747 +01748 +01749 <span class="comment">// For all MatrixBlocks</span> +01750 <span class="comment">//===================</span> +01751 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> mb= 0; mb<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size();mb++) +01752 { +01753 <span class="comment">// compute matrixes for this block.</span> +01754 <span class="keyword">static</span> CMatrix3x4 matrixes[IDriver::MaxModelMatrix]; +01755 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_5">computeSkinMatrixes</a>(skeleton, matrixes, mb==0?NULL:&_MatrixBlocks[mb-1], _MatrixBlocks[mb]); +01756 +01757 <span class="comment">// check what vertex to skin for this PB.</span> +01758 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_8">flagSkinVerticesForMatrixBlock</a>(&skinFlags[0], _MatrixBlocks[mb]); +01759 +01760 <span class="comment">// Get VB src/dst ptrs.</span> +01761 <a class="code" href="a04558.html#a7">uint8</a> *pFlag= &skinFlags[0]; +01762 CVector *srcVector= &<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr11">_OriginalSkinVertices</a>[0]; +01763 <a class="code" href="a04558.html#a7">uint8</a> *srcPal= (<a class="code" href="a04558.html#a7">uint8</a>*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getPaletteSkinPointer(0); +01764 <a class="code" href="a04558.html#a7">uint8</a> *srcWgt= (<a class="code" href="a04558.html#a7">uint8</a>*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getWeightPointer(0); +01765 <a class="code" href="a04558.html#a7">uint8</a> *dstVector= (<a class="code" href="a04558.html#a7">uint8</a>*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexCoordPointer(0); +01766 <span class="comment">// Normal.</span> +01767 CVector *srcNormal= NULL; +01768 <a class="code" href="a04558.html#a7">uint8</a> *dstNormal= NULL; +01769 <span class="keywordflow">if</span>(skinType>=SkinWithNormal) +01770 { +01771 srcNormal= &<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr9">_OriginalSkinNormals</a>[0]; +01772 dstNormal= (<a class="code" href="a04558.html#a7">uint8</a>*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNormalCoordPointer(0); +01773 } +01774 <span class="comment">// TgSpace.</span> +01775 CVector *srcTgSpace= NULL; +01776 <a class="code" href="a04558.html#a7">uint8</a> *dstTgSpace= NULL; +01777 <span class="keywordflow">if</span>(skinType>=SkinWithTgSpace) +01778 { +01779 srcTgSpace= &<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr12">_OriginalTGSpace</a>[0]; +01780 dstTgSpace= (<a class="code" href="a04558.html#a7">uint8</a>*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getTexCoordPointer(0, tgSpaceStage); +01781 } +01782 +01783 +01784 <span class="comment">// For all vertices that need to be computed.</span> +01785 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a587">size</a>= numVertices; +01786 <span class="keywordflow">for</span>(;<a class="code" href="a04223.html#a587">size</a>>0;<a class="code" href="a04223.html#a587">size</a>--) +01787 { +01788 <span class="comment">// If we must compute this vertex.</span> +01789 <span class="keywordflow">if</span>(*pFlag==<a class="code" href="a04566.html#a1">NL3D_SOFTSKIN_VMUSTCOMPUTE</a>) +01790 { +01791 <span class="comment">// Flag this vertex as computed.</span> +01792 *pFlag=<a class="code" href="a04566.html#a2">NL3D_SOFTSKIN_VCOMPUTED</a>; +01793 +01794 CPaletteSkin *psPal= (CPaletteSkin*)srcPal; +01795 +01796 <span class="comment">// checks indices.</span> +01797 <a class="code" href="a04199.html#a6">nlassert</a>(psPal->MatrixId[0]<IDriver::MaxModelMatrix); +01798 <a class="code" href="a04199.html#a6">nlassert</a>(psPal->MatrixId[1]<IDriver::MaxModelMatrix); +01799 <a class="code" href="a04199.html#a6">nlassert</a>(psPal->MatrixId[2]<IDriver::MaxModelMatrix); +01800 <a class="code" href="a04199.html#a6">nlassert</a>(psPal->MatrixId[3]<IDriver::MaxModelMatrix); +01801 +01802 <span class="comment">// compute vertex part.</span> +01803 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_6">computeSoftwarePointSkinning</a>(matrixes, srcVector, psPal, (<span class="keywordtype">float</span>*)srcWgt, (CVector*)dstVector); +01804 +01805 <span class="comment">// compute normal part.</span> +01806 <span class="keywordflow">if</span>(skinType>=SkinWithNormal) +01807 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_7">computeSoftwareVectorSkinning</a>(matrixes, srcNormal, psPal, (<span class="keywordtype">float</span>*)srcWgt, (CVector*)dstNormal); +01808 +01809 <span class="comment">// compute tg part.</span> +01810 <span class="keywordflow">if</span>(skinType>=SkinWithTgSpace) +01811 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_7">computeSoftwareVectorSkinning</a>(matrixes, srcTgSpace, psPal, (<span class="keywordtype">float</span>*)srcWgt, (CVector*)dstTgSpace); +01812 } +01813 +01814 <span class="comment">// inc flags.</span> +01815 pFlag++; +01816 <span class="comment">// inc src (all whatever skin type used...)</span> +01817 srcVector++; +01818 srcNormal++; +01819 srcTgSpace++; +01820 <span class="comment">// inc paletteSkin and dst (all whatever skin type used...)</span> +01821 srcPal+= dstStride; +01822 srcWgt+= dstStride; +01823 dstVector+= dstStride; +01824 dstNormal+= dstStride; +01825 dstTgSpace+= dstStride; +01826 } +01827 } +01828 +01829 +01830 <span class="comment">// dirt</span> +01831 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr10">_OriginalSkinRestored</a>= <span class="keyword">false</span>; +01832 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz417_1" doxytag="NL3D::CMeshGeom::beginMesh" ></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::CMeshGeom::beginMesh </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02887.html">CMeshGeomRenderContext</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>rdrCtx</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The framework call this method when he will render instances of this meshGeom soon. +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_1">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l02021">2021</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>, <a class="el" href="a05990.html#l00705">_SupportMBRFlags</a>, <a class="el" href="a05990.html#l00684">_VertexBufferHard</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera2">NL3D::IDriver::activeVertexBuffer()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera3">NL3D::IDriver::activeVertexBufferHard()</a>, <a class="el" href="a06000.html#l00062">NL3D::CMeshGeomRenderContext::Driver</a>, <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a06000.html#l00066">NL3D::CMeshGeomRenderContext::RenderThroughVBHeap</a>, <a class="el" href="a06000.html#l00063">NL3D::CMeshGeomRenderContext::Scene</a>, and <a class="el" href="a05989.html#l00523">updateVertexBufferHard()</a>. +<p> +<div class="fragment"><pre>02022 { +02023 <span class="keywordflow">if</span>(rdrCtx.RenderThroughVBHeap) +02024 { +02025 <span class="comment">// Don't setup VB in this case, since use the VBHeap setuped one.</span> +02026 <span class="comment">// NB: no VertexProgram test since VBHeap not possible with it...</span> +02027 <a class="code" href="a04199.html#a6">nlassert</a>( (_SupportMBRFlags & MBRCurrentUseVP)==0 ); +02028 } +02029 <span class="keywordflow">else</span> +02030 { +02031 <span class="comment">// update the VBufferHard (create/delete), to maybe render in AGP memory.</span> +02032 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_0">updateVertexBufferHard</a> ( rdrCtx.Driver ); +02033 +02034 <span class="comment">// use MeshVertexProgram effect?</span> +02035 <span class="keywordflow">if</span>( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a> != NULL && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->isMBRVpOk(rdrCtx.Driver) ) +02036 { +02037 <span class="comment">// Ok will use it.</span> +02038 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a>|= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a>; +02039 <span class="comment">// Before VB activation</span> +02040 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->beginMBRMesh(rdrCtx.Driver, rdrCtx.Scene ); +02041 } +02042 +02043 +02044 <span class="comment">// if VB Hard is here, use it.</span> +02045 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a> != NULL) +02046 { +02047 <span class="comment">// active VB Hard.</span> +02048 rdrCtx.Driver->activeVertexBufferHard(_VertexBufferHard); +02049 } +02050 <span class="keywordflow">else</span> +02051 { +02052 <span class="comment">// active VB. SoftwareSkinning: reset flags for skinning.</span> +02053 rdrCtx.Driver->activeVertexBuffer(_VBuffer); +02054 } +02055 } +02056 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz423_2" doxytag="NL3D::CMeshGeom::bkupOriginalSkinVertices" ></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::CMeshGeom::bkupOriginalSkinVertices </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> [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="a05989.html#l01615">1615</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>, <a class="el" href="a05990.html#l00652">_OriginalSkinNormals</a>, <a class="el" href="a05990.html#l00651">_OriginalSkinVertices</a>, <a class="el" href="a05990.html#l00653">_OriginalTGSpace</a>, <a class="el" href="a05990.html#l00664">_Skinned</a>, <a class="el" href="a06710.html#l00449">NL3D::CVertexBuffer::getNormalCoordPointer()</a>, <a class="el" href="a06710.html#l00976">NL3D::CVertexBuffer::getNumTexCoordUsed()</a>, <a class="el" href="a06711.html#l00453">NL3D::CVertexBuffer::getNumVertices()</a>, <a class="el" href="a06710.html#l00497">NL3D::CVertexBuffer::getTexCoordPointer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a06711.html#l00319">NL3D::CVertexBuffer::getVertexFormat()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01062">compileRunTime()</a>. +<p> +<div class="fragment"><pre>01616 { +01617 <a class="code" href="a04199.html#a6">nlassert</a>(_Skinned); +01618 +01619 <span class="comment">// reset</span> +01620 <a class="code" href="a05378.html#a381">contReset</a>(_OriginalSkinVertices); +01621 <a class="code" href="a05378.html#a381">contReset</a>(_OriginalSkinNormals); +01622 <a class="code" href="a05378.html#a381">contReset</a>(_OriginalTGSpace); +01623 +01624 <span class="comment">// get num of vertices</span> +01625 <a class="code" href="a04558.html#a15">uint</a> numVertices= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumVertices(); +01626 +01627 <span class="comment">// Copy VBuffer content into Original vertices normals.</span> +01628 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexFormat() & CVertexBuffer::PositionFlag) +01629 { +01630 <span class="comment">// copy vertices from VBuffer. (NB: unusefull geomorphed vertices are still copied, but doesn't matter).</span> +01631 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr11">_OriginalSkinVertices</a>.resize(numVertices); +01632 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<numVertices;i++) +01633 { +01634 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr11">_OriginalSkinVertices</a>[i]= *(CVector*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexCoordPointer(i); +01635 } +01636 } +01637 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexFormat() & CVertexBuffer::NormalFlag) +01638 { +01639 <span class="comment">// copy normals from VBuffer. (NB: unusefull geomorphed normals are still copied, but doesn't matter).</span> +01640 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr9">_OriginalSkinNormals</a>.resize(numVertices); +01641 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<numVertices;i++) +01642 { +01643 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr9">_OriginalSkinNormals</a>[i]= *(CVector*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNormalCoordPointer(i); +01644 } +01645 } +01646 +01647 <span class="comment">// is there tangent space added ?</span> +01648 <span class="keywordflow">if</span> (<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a> && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->needTangentSpace()) +01649 { +01650 <span class="comment">// yes, backup it</span> +01651 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumTexCoordUsed() > 0); +01652 <a class="code" href="a04558.html#a15">uint</a> tgSpaceStage = <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumTexCoordUsed() - 1; +01653 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr12">_OriginalTGSpace</a>.resize(numVertices); +01654 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<numVertices;i++) +01655 { +01656 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr12">_OriginalTGSpace</a>[i]= *(CVector*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getTexCoordPointer(i, tgSpaceStage); +01657 } +01658 } +01659 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeoma1" doxytag="NL3D::CMeshGeom::build" ></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::CMeshGeom::build </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02864.html">CMesh::CMeshBuild</a> & </td> + <td class="mdname" nowrap> <em>m</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>numMaxMaterial</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> +Build a meshGeom. +<p> +0. First, make bbox.<p> +1. If skinning, group by matrix Block the vertices.<p> +2. Then, for all faces, resolve continuities, building VBuffer.<p> +3. build the RdrPass material.<p> +4. Then, for all faces, build the RdrPass PBlock.<p> +5. Remove empty RdrPasses.<p> +6. Misc.<p> +7. Compact bones id and build bones name array. +<p> +If all texture coordinates are of dimension 2, we can setup the flags as before. If this isn't the case, we must setup a custom format<p> +<dl compact><dt><b><a class="el" href="todo.html#_todo000017">Todo:</a></b></dt><dd>yoyo: TODO_OPTIMIZE: it should be interesting to sort the materials, depending on their attributes. But must change next loop too...</dd></dl> + +<p> +Definition at line <a class="el" href="a05989.html#l00172">172</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00669">_BoneIdComputed</a>, <a class="el" href="a05990.html#l00671">_BoneIdExtended</a>, <a class="el" href="a05990.html#l00674">_BonesName</a>, <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05990.html#l00712">_MeshMorpher</a>, <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>, <a class="el" href="a05990.html#l00664">_Skinned</a>, <a class="el" href="a05990.html#l00688">_VertexBufferHardDirty</a>, <a class="el" href="a06710.html#l00338">NL3D::CVertexBuffer::addValueEx()</a>, <a class="el" href="a05990.html#l00196">NL3D::CMesh::CMeshBuild::BlendShapes</a>, <a class="el" href="a06004.html#l00077">NL3D::CMeshMorpher::BlendShapes</a>, <a class="el" href="a05990.html#l00190">NL3D::CMesh::CMeshBuild::BonesNames</a>, <a class="el" href="a05989.html#l01105">buildSkin()</a>, <a class="el" href="a06710.html#l00271">NL3D::CVertexBuffer::clearValueEx()</a>, <a class="el" href="a05989.html#l01062">compileRunTime()</a>, <a class="el" href="a05990.html#l00613">NL3D::CMeshGeom::CFaceTmp::Corner</a>, <a class="el" href="a05990.html#l00193">NL3D::CMesh::CMeshBuild::Faces</a>, <a class="el" href="a05990.html#l00733">findVBId()</a>, <a class="el" href="a06710.html#l00369">NL3D::CVertexBuffer::initEx()</a>, <a class="el" href="a05989.html#l00058">NL3D::makeBBox()</a>, <a class="el" href="a05990.html#l00614">NL3D::CMeshGeom::CFaceTmp::MaterialId</a>, <a class="el" href="a05646.html#l00243">matrix</a>, <a class="el" href="a05990.html#l00616">NL3D::CMeshGeom::CFaceTmp::MatrixBlockId</a>, <a class="el" href="a05990.html#l00512">NL3D::CMeshGeom::CMatrixBlock::MatrixId</a>, <a class="el" href="a05990.html#l00202">NL3D::CMesh::CMeshBuild::MeshVertexProgram</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05990.html#l00180">NL3D::CMesh::CMeshBuild::NumCoords</a>, <a class="el" href="a05990.html#l00514">NL3D::CMeshGeom::CMatrixBlock::NumMatrix</a>, <a class="el" href="a05989.html#l00153">optimizeTriangleOrder()</a>, <a class="el" href="a06710.html#l00401">NL3D::CVertexBuffer::reserve()</a>, <a class="el" href="a05385.html#l00181">NLMISC::CAABBoxExt::setCenter()</a>, <a class="el" href="a06710.html#l00409">NL3D::CVertexBuffer::setNumVertices()</a>, <a class="el" href="a05385.html#l00183">NLMISC::CAABBoxExt::setSize()</a>, <a class="el" href="a06711.html#l00505">NL3D::CVertexBuffer::setUVRouting()</a>, <a class="el" href="a06710.html#l00169">NL3D::CVertexBuffer::setVertexFormat()</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05990.html#l00187">NL3D::CMesh::CMeshBuild::SkinWeights</a>, <a class="el" href="a05990.html#l00729">TCornerSet</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, <a class="el" href="a05990.html#l00181">NL3D::CMesh::CMeshBuild::UVRouting</a>, <a class="el" href="a05990.html#l00550">NL3D::CMeshGeom::CCornerTmp::VBId</a>, <a class="el" href="a05990.html#l00087">NL3D::CMesh::CCorner::Vertex</a>, <a class="el" href="a05990.html#l00179">NL3D::CMesh::CMeshBuild::VertexFlags</a>, <a class="el" href="a05990.html#l00184">NL3D::CMesh::CMeshBuild::Vertices</a>, and <a class="el" href="a05990.html#l00199">NL3D::CMesh::CMeshBuild::VertLink</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02305">NL3D::CMesh::build()</a>. +<p> +<div class="fragment"><pre>00173 { +00174 <a class="code" href="a04558.html#a14">sint</a> i; +00175 +00176 <span class="comment">// Dirt the VBuffer.</span> +00177 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_3">_VertexBufferHardDirty</a>= <span class="keyword">true</span>; +00178 +00179 <span class="comment">// Empty geometry?</span> +00180 <span class="keywordflow">if</span>(m.Vertices.size()==0 || m.Faces.size()==0) +00181 { +00182 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setNumVertices(0); +00183 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.reserve(0); +00184 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.clear(); +00185 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr0">_BBox</a>.<a class="code" href="a02157.html#NLMISC_1_1CAABBoxExtz1910_1">setCenter</a>(CVector::Null); +00186 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr0">_BBox</a>.<a class="code" href="a02157.html#NLMISC_1_1CAABBoxExtz1910_4">setSize</a>(CVector::Null); +00187 <span class="keywordflow">return</span>; +00188 } +00189 <a class="code" href="a04199.html#a6">nlassert</a>(numMaxMaterial>0); +00190 +00191 <span class="comment">// Copy the UV routing table</span> +00192 <span class="keywordflow">for</span> (i=0; i<CVertexBuffer::MaxStage; i++) +00193 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setUVRouting (i, m.UVRouting[i]); +00194 +00196 <span class="comment">//======================</span> +00197 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr0">_BBox</a>= <a class="code" href="a05363.html#a431">makeBBox</a>(m.Vertices); +00198 +00199 +00201 <span class="comment">//================================================</span> +00202 +00203 <span class="comment">// First, copy Face array.</span> +00204 vector<CFaceTmp> tmpFaces; +00205 tmpFaces.resize(m.Faces.size()); +00206 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)tmpFaces.size();i++) +00207 tmpFaces[i]= m.Faces[i]; +00208 +00209 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>= ((m.VertexFlags & CVertexBuffer::PaletteSkinFlag)==CVertexBuffer::PaletteSkinFlag); +00210 <span class="comment">// Skinning is OK only if SkinWeights are of same size as vertices.</span> +00211 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a> && (m.Vertices.size()==m.SkinWeights.size()); +00212 +00213 <span class="comment">// If skinning is KO, remove the Skin option.</span> +00214 <a class="code" href="a04558.html#a15">uint</a> vbFlags= m.VertexFlags; +00215 <span class="keywordflow">if</span>(!<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>) +00216 vbFlags&= ~CVertexBuffer::PaletteSkinFlag; +00217 <span class="comment">// Force presence of vertex.</span> +00218 vbFlags|= CVertexBuffer::PositionFlag; +00219 +00220 +00221 <span class="comment">// If the mesh is not skinned, we have just 1 _MatrixBlocks.</span> +00222 <span class="keywordflow">if</span>(!<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>) +00223 { +00224 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.resize(1); +00225 <span class="comment">// For each faces, assign it to the matrix block 0.</span> +00226 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)tmpFaces.size();i++) +00227 tmpFaces[i].MatrixBlockId= 0; +00228 } +00229 <span class="comment">// Else We must group/compute the matrixs blocks.</span> +00230 <span class="keywordflow">else</span> +00231 { +00232 <span class="comment">// reset matrix blocks.</span> +00233 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.clear(); +00234 <span class="comment">// build matrix blocks, and link faces to good matrix blocks.</span> +00235 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_4">buildSkin</a>(m, tmpFaces); +00236 } +00237 +00238 +00240 <span class="comment">//================================================</span> +00241 <span class="comment">// Setup VB.</span> +00242 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setNumVertices(0); +00243 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.reserve(0); +00244 +00245 <span class="keywordtype">bool</span> useFormatExt = <span class="keyword">false</span>; +00249 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> k = 0; k < CVertexBuffer::MaxStage; ++k) +00250 { +00251 <span class="keywordflow">if</span> ( +00252 (vbFlags & (CVertexBuffer::TexCoord0Flag << k)) +00253 && m.NumCoords[k] != 2) +00254 { +00255 useFormatExt = <span class="keyword">true</span>; +00256 <span class="keywordflow">break</span>; +00257 } +00258 } +00259 +00260 <span class="keywordflow">if</span> (!useFormatExt) +00261 { +00262 <span class="comment">// setup standard format</span> +00263 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setVertexFormat(vbFlags); +00264 } +00265 <span class="keywordflow">else</span> <span class="comment">// setup extended format</span> +00266 { +00267 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.clearValueEx(); +00268 <span class="keywordflow">if</span> (vbFlags & CVertexBuffer::PositionFlag) <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.addValueEx(CVertexBuffer::Position, CVertexBuffer::Float3); +00269 <span class="keywordflow">if</span> (vbFlags & CVertexBuffer::NormalFlag) <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.addValueEx(CVertexBuffer::Normal, CVertexBuffer::Float3); +00270 <span class="keywordflow">if</span> (vbFlags & CVertexBuffer::PrimaryColorFlag) <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.addValueEx(CVertexBuffer::PrimaryColor, CVertexBuffer::UChar4); +00271 <span class="keywordflow">if</span> (vbFlags & CVertexBuffer::SecondaryColorFlag) <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.addValueEx(CVertexBuffer::SecondaryColor, CVertexBuffer::UChar4); +00272 <span class="keywordflow">if</span> (vbFlags & CVertexBuffer::WeightFlag) <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.addValueEx(CVertexBuffer::Weight, CVertexBuffer::Float4); +00273 <span class="keywordflow">if</span> (vbFlags & CVertexBuffer::PaletteSkinFlag) <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.addValueEx(CVertexBuffer::PaletteSkin, CVertexBuffer::UChar4); +00274 <span class="keywordflow">if</span> (vbFlags & CVertexBuffer::FogFlag) <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.addValueEx(CVertexBuffer::Fog, CVertexBuffer::Float1); +00275 +00276 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> k = 0; k < CVertexBuffer::MaxStage; ++k) +00277 { +00278 <span class="keywordflow">if</span> (vbFlags & (CVertexBuffer::TexCoord0Flag << k)) +00279 { +00280 <span class="keywordflow">switch</span>(m.NumCoords[k]) +00281 { +00282 <span class="keywordflow">case</span> 2: +00283 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.addValueEx((CVertexBuffer::TValue) (CVertexBuffer::TexCoord0 + k), CVertexBuffer::Float2); +00284 <span class="keywordflow">break</span>; +00285 <span class="keywordflow">case</span> 3: +00286 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.addValueEx((CVertexBuffer::TValue) (CVertexBuffer::TexCoord0 + k), CVertexBuffer::Float3); +00287 <span class="keywordflow">break</span>; +00288 <span class="keywordflow">default</span>: +00289 <a class="code" href="a04199.html#a6">nlassert</a>(0); +00290 <span class="keywordflow">break</span>; +00291 } +00292 } +00293 } +00294 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.initEx(); +00295 } +00296 +00297 <span class="comment">// Set local flags for corner comparison.</span> +00298 CCornerTmp::Flags= vbFlags; +00299 <span class="comment">// Setup locals.</span> +00300 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomy9">TCornerSet</a> corners; +00301 <span class="keyword">const</span> CFaceTmp *pFace= &(*tmpFaces.begin()); +00302 <a class="code" href="a04558.html#a11">uint32</a> nFaceMB = 0; +00303 <a class="code" href="a04558.html#a14">sint</a> N= tmpFaces.size(); +00304 <a class="code" href="a04558.html#a14">sint</a> currentVBIndex=0; +00305 +00306 m.VertLink.clear (); +00307 +00308 <span class="comment">// process each face, building up the VB.</span> +00309 <span class="keywordflow">for</span>(;N>0;N--, pFace++) +00310 { +00311 <a class="code" href="a04558.html#a14">sint</a> v0= pFace->Corner[0].Vertex; +00312 <a class="code" href="a04558.html#a14">sint</a> v1= pFace->Corner[1].Vertex; +00313 <a class="code" href="a04558.html#a14">sint</a> v2= pFace->Corner[2].Vertex; +00314 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomd1">findVBId</a>(corners, &pFace->Corner[0], currentVBIndex, m.Vertices[v0], m); +00315 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomd1">findVBId</a>(corners, &pFace->Corner[1], currentVBIndex, m.Vertices[v1], m); +00316 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomd1">findVBId</a>(corners, &pFace->Corner[2], currentVBIndex, m.Vertices[v2], m); +00317 CMesh::CVertLink vl1(nFaceMB, 0, pFace->Corner[0].VBId); +00318 CMesh::CVertLink vl2(nFaceMB, 1, pFace->Corner[1].VBId); +00319 CMesh::CVertLink vl3(nFaceMB, 2, pFace->Corner[2].VBId); +00320 m.VertLink.push_back(vl1); +00321 m.VertLink.push_back(vl2); +00322 m.VertLink.push_back(vl3); +00323 ++nFaceMB; +00324 } +00325 +00326 +00328 <span class="comment">//================================</span> +00329 <a class="code" href="a04558.html#a15">uint</a> mb; +00330 +00331 <span class="comment">// For each _MatrixBlocks, point on those materials.</span> +00332 <span class="keywordflow">for</span>(mb= 0;mb<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size();mb++) +00333 { +00334 <span class="comment">// Build RdrPass ids.</span> +00335 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb].RdrPass.resize (numMaxMaterial); +00336 +00338 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb].RdrPass.size(); i++) +00339 { +00340 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb].RdrPass[i].MaterialId= i; +00341 } +00342 } +00343 +00344 +00346 <span class="comment">//===================================================</span> +00347 pFace= &(*tmpFaces.begin()); +00348 N= tmpFaces.size(); +00349 <span class="keywordflow">for</span>(;N>0;N--, pFace++) +00350 { +00351 <a class="code" href="a04558.html#a14">sint</a> mbId= pFace->MatrixBlockId; +00352 <a class="code" href="a04199.html#a6">nlassert</a>(mbId>=0 && mbId<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size()); +00353 <span class="comment">// Insert the face in good MatrixBlock/RdrPass.</span> +00354 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mbId].RdrPass[pFace->MaterialId].PBlock.addTri(pFace->Corner[0].VBId, pFace->Corner[1].VBId, pFace->Corner[2].VBId); +00355 } +00356 +00357 +00359 <span class="comment">//============================</span> +00360 <span class="keywordflow">for</span>(mb= 0;mb<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size();mb++) +00361 { +00362 <span class="comment">// NB: slow process (erase from a vector). Doens't matter since made at build.</span> +00363 vector<CRdrPass>::iterator itPass; +00364 <span class="keywordflow">for</span>( itPass=<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb].RdrPass.begin(); itPass!=_MatrixBlocks[mb].RdrPass.end(); ) +00365 { +00366 <span class="comment">// If this pass is empty, remove it.</span> +00367 <span class="keywordflow">if</span>( itPass->PBlock.getNumTri()==0 ) +00368 itPass= _MatrixBlocks[mb].RdrPass.erase(itPass); +00369 <span class="keywordflow">else</span> +00370 itPass++; +00371 } +00372 } +00373 +00375 <span class="comment">//============================</span> +00376 <span class="comment">// BShapes</span> +00377 this-><a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->BlendShapes = m.BlendShapes; +00378 +00379 <span class="comment">// sort triangles for better cache use.</span> +00380 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomd2">optimizeTriangleOrder</a>(); +00381 +00382 <span class="comment">// SmartPtr Copy VertexProgram effect.</span> +00383 this-><a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>= m.MeshVertexProgram; +00384 +00386 <span class="comment">//================================================= </span> +00387 +00388 <span class="comment">// If skinned</span> +00389 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>) +00390 { +00391 <span class="comment">// Reserve some space</span> +00392 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr5">_BonesName</a>.reserve (m.BonesNames.size ()); +00393 +00394 <span class="comment">// Current local bone</span> +00395 <a class="code" href="a04558.html#a15">uint</a> currentBone = 0; +00396 +00397 <span class="comment">// For each matrix block</span> +00398 <a class="code" href="a04558.html#a15">uint</a> matrixBlock; +00399 <span class="keywordflow">for</span> (matrixBlock=0; matrixBlock<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size(); matrixBlock++) +00400 { +00401 <span class="comment">// Ref on the matrix block</span> +00402 CMatrixBlock &mb = <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[matrixBlock]; +00403 +00404 <span class="comment">// Remap the skeleton index in model index</span> +00405 std::map<uint, uint> remap; +00406 +00407 <span class="comment">// For each matrix</span> +00408 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a578">matrix</a>; +00409 <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a578">matrix</a>=0; <a class="code" href="a04223.html#a578">matrix</a><mb.NumMatrix; <a class="code" href="a04223.html#a578">matrix</a>++) +00410 { +00411 <span class="comment">// Get bone id in the skeleton</span> +00412 std::map<uint, uint>::iterator ite = remap.find (mb.MatrixId[matrix]); +00413 +00414 <span class="comment">// Not found</span> +00415 <span class="keywordflow">if</span> (ite == remap.end()) +00416 { +00417 <span class="comment">// Insert it</span> +00418 remap.insert (std::map<uint, uint>::value_type (mb.MatrixId[matrix], currentBone)); +00419 +00420 <span class="comment">// Check the matrix id</span> +00421 <a class="code" href="a04199.html#a6">nlassert</a> (mb.MatrixId[matrix] < m.BonesNames.size()); +00422 +00423 <span class="comment">// Set the bone name</span> +00424 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr5">_BonesName</a>.push_back (m.BonesNames[mb.MatrixId[matrix]]); +00425 +00426 <span class="comment">// Set the id in local</span> +00427 mb.MatrixId[<a class="code" href="a04223.html#a578">matrix</a>] = currentBone++; +00428 } +00429 <span class="keywordflow">else</span> +00430 { +00431 <span class="comment">// Set the id in local</span> +00432 mb.MatrixId[<a class="code" href="a04223.html#a578">matrix</a>] = ite->second; +00433 } +00434 } +00435 } +00436 +00437 <span class="comment">// Bone id in local</span> +00438 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr1">_BoneIdComputed</a> = <span class="keyword">false</span>; +00439 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr2">_BoneIdExtended</a> = <span class="keyword">false</span>; +00440 } +00441 +00442 +00443 <span class="comment">// End!!</span> +00444 <span class="comment">// Some runtime not serialized compilation</span> +00445 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomd0">compileRunTime</a>(); +00446 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz423_3" doxytag="NL3D::CMeshGeom::buildBoneUsageVer3" ></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::CMeshGeom::buildBoneUsageVer3 </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> [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="a05989.html#l01549">1549</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00676">_BonesId</a>, <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05990.html#l00664">_Skinned</a>, <a class="el" href="a05646.html#l00243">matrix</a>, <a class="el" href="a05990.html#l00512">NL3D::CMeshGeom::CMatrixBlock::MatrixId</a>, <a class="el" href="a05990.html#l00514">NL3D::CMeshGeom::CMatrixBlock::NumMatrix</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +<div class="fragment"><pre>01550 { +01551 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>) +01552 { +01553 <span class="comment">// parse all matrixBlocks, couting MaxBoneId used.</span> +01554 <a class="code" href="a04558.html#a11">uint32</a> maxBoneId= 0; +01555 <span class="comment">// For each matrix block</span> +01556 <a class="code" href="a04558.html#a15">uint</a> matrixBlock; +01557 <span class="keywordflow">for</span> (matrixBlock=0; matrixBlock<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size(); matrixBlock++) +01558 { +01559 CMatrixBlock &mb = <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[matrixBlock]; +01560 <span class="comment">// For each matrix</span> +01561 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a578">matrix</a>=0; <a class="code" href="a04223.html#a578">matrix</a><mb.NumMatrix; <a class="code" href="a04223.html#a578">matrix</a>++) +01562 { +01563 maxBoneId= max(mb.MatrixId[matrix], maxBoneId); +01564 } +01565 } +01566 +01567 <span class="comment">// alloc an array of maxBoneId+1, reset to 0.</span> +01568 std::vector<uint8> boneUsage; +01569 boneUsage.resize(maxBoneId+1, 0); +01570 +01571 <span class="comment">// reparse all matrixBlocks, counting usage for each bone.</span> +01572 <span class="keywordflow">for</span> (matrixBlock=0; matrixBlock<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size(); matrixBlock++) +01573 { +01574 CMatrixBlock &mb = <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[matrixBlock]; +01575 <span class="comment">// For each matrix</span> +01576 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a578">matrix</a>=0; <a class="code" href="a04223.html#a578">matrix</a><mb.NumMatrix; <a class="code" href="a04223.html#a578">matrix</a>++) +01577 { +01578 <span class="comment">// mark this bone as used.</span> +01579 boneUsage[mb.MatrixId[<a class="code" href="a04223.html#a578">matrix</a>]]= 1; +01580 } +01581 } +01582 +01583 <span class="comment">// For each bone used</span> +01584 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr3">_BonesId</a>.clear(); +01585 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<boneUsage.size();i++) +01586 { +01587 <span class="comment">// if the bone is used by the mesh, add it to BoneId.</span> +01588 <span class="keywordflow">if</span>(boneUsage[i]) +01589 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr3">_BonesId</a>.push_back(i); +01590 } +01591 } +01592 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz423_4" doxytag="NL3D::CMeshGeom::buildSkin" ></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::CMeshGeom::buildSkin </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02864.html">CMesh::CMeshBuild</a> & </td> + <td class="mdname" nowrap> <em>m</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a02883.html">CFaceTmp</a> > & </td> + <td class="mdname" nowrap> <em>tmpFaces</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="a05989.html#l01105">1105</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05990.html#l00613">NL3D::CMeshGeom::CFaceTmp::Corner</a>, <a class="el" href="a05989.html#l01415">NL3D::CMeshGeom::CMatrixBlock::getMatrixIdLocation()</a>, <a class="el" href="a05990.html#l00591">NL3D::CMeshGeom::CBoneTmp::Inserted</a>, <a class="el" href="a05990.html#l00606">ItBoneMap</a>, <a class="el" href="a05990.html#l00616">NL3D::CMeshGeom::CFaceTmp::MatrixBlockId</a>, <a class="el" href="a06711.html#l00089">NL3D::CPaletteSkin::MatrixId</a>, <a class="el" href="a05990.html#l00512">NL3D::CMeshGeom::CMatrixBlock::MatrixId</a>, <a class="el" href="a05990.html#l00116">NL3D::CMesh::CSkinWeight::MatrixId</a>, <a class="el" href="a05990.html#l00593">NL3D::CMeshGeom::CBoneTmp::MatrixIdInMB</a>, <a class="el" href="a05990.html#l00063">NL3D_MESH_SKINNING_MAX_MATRIX</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05990.html#l00514">NL3D::CMeshGeom::CMatrixBlock::NumMatrix</a>, <a class="el" href="a05990.html#l00544">NL3D::CMeshGeom::CCornerTmp::Palette</a>, <a class="el" href="a05990.html#l00589">NL3D::CMeshGeom::CBoneTmp::RefCount</a>, <a class="el" href="a05990.html#l00643">NL3D::CMeshGeom::CMatrixBlockRemap::Remap</a>, <a class="el" href="a05981.html#l00104">sint</a>, <a class="el" href="a05990.html#l00187">NL3D::CMesh::CMeshBuild::SkinWeights</a>, <a class="el" href="a05990.html#l00605">TBoneMap</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a05990.html#l00087">NL3D::CMesh::CCorner::Vertex</a>, <a class="el" href="a05990.html#l00545">NL3D::CMeshGeom::CCornerTmp::Weights</a>, and <a class="el" href="a05990.html#l00118">NL3D::CMesh::CSkinWeight::Weights</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00172">build()</a>. +<p> +<div class="fragment"><pre>01106 { +01107 <a class="code" href="a04558.html#a14">sint</a> i,j,k; +01108 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomy8">TBoneMap</a> remainingBones; +01109 <a class="code" href="a03889.html">list<uint></a> remainingFaces; +01110 +01111 +01112 <span class="comment">// 0. normalize SkinWeights: for all weights at 0, copy the matrixId from 0th matrix => no random/bad use of matrix.</span> +01113 <span class="comment">//================================</span> +01114 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)m.SkinWeights.size();i++) +01115 { +01116 CMesh::CSkinWeight &sw= m.SkinWeights[i]; +01117 +01118 <span class="comment">// 0th weight must not be 0.</span> +01119 <a class="code" href="a04199.html#a6">nlassert</a>(sw.Weights[0]!=0); +01120 +01121 <span class="comment">// Begin at 1, tests all other weights.</span> +01122 <span class="keywordflow">for</span>(j=1;j<<a class="code" href="a04567.html#a0">NL3D_MESH_SKINNING_MAX_MATRIX</a>;j++) +01123 { +01124 <span class="comment">// We don't use this entry??</span> +01125 <span class="keywordflow">if</span>(sw.Weights[j]==0) +01126 { +01127 <span class="comment">// Setup MatrixId so that this vertex do no use more matrix than it really wants.</span> +01128 sw.MatrixId[j]= sw.MatrixId[0]; +01129 } +01130 } +01131 } +01132 +01133 +01134 <span class="comment">// 1. build the list of used/remaining bones, in ascending order. (so we use the depth-first topolgy of hierarchy).</span> +01135 <span class="comment">//================================</span> +01136 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)tmpFaces.size();i++) +01137 { +01138 CFaceTmp &face= tmpFaces[i]; +01139 +01140 <span class="keywordflow">for</span>(j=0;j<3;j++) +01141 { +01142 CMesh::CSkinWeight &sw= m.SkinWeights[face.Corner[j].Vertex]; +01143 <span class="keywordflow">for</span>(k=0;k<<a class="code" href="a04567.html#a0">NL3D_MESH_SKINNING_MAX_MATRIX</a>;k++) +01144 { +01145 <span class="comment">// insert (if not already here) the used bone in the set.</span> +01146 <span class="comment">// and insert his refcount. (NB: ctor() init it to 0 :) ).</span> +01147 remainingBones[sw.MatrixId[k]].RefCount++; +01148 } +01149 } +01150 } +01151 +01152 +01153 <span class="comment">// 2. Create the list of un-inserted faces.</span> +01154 <span class="comment">//================================</span> +01155 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)tmpFaces.size();i++) +01156 { +01157 remainingFaces.push_back(i); +01158 } +01159 +01160 +01161 +01162 <span class="comment">// 3. Create as many Blocks as necessary.</span> +01163 <span class="comment">//================================</span> +01164 <span class="comment">// Which bones a face use (up to 12).</span> +01165 vector<uint> boneUse; +01166 boneUse.reserve(NL3D_MESH_SKINNING_MAX_MATRIX*3); +01167 +01168 <span class="comment">// While still exist faces.</span> +01169 <span class="keywordflow">while</span>(!remainingFaces.empty()) +01170 { +01171 <span class="comment">// create a new matrix block.</span> +01172 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.push_back(CMatrixBlock()); +01173 CMatrixBlock &matrixBlock= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[_MatrixBlocks.size()-1]; +01174 matrixBlock.NumMatrix=0; +01175 +01176 <span class="comment">// a. reset remainingBones as not inserted in the current matrixBlock.</span> +01177 <span class="comment">//============================</span> +01178 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomy0">ItBoneMap</a> itBone; +01179 <span class="keywordflow">for</span>(itBone= remainingBones.begin();itBone!=remainingBones.end();itBone++) +01180 { +01181 itBone->second.Inserted= <span class="keyword">false</span>; +01182 } +01183 +01184 +01185 <span class="comment">// b. while still exist bones, try to insert faces which use them in matrixBlock.</span> +01186 <span class="comment">//============================</span> +01187 <span class="keywordflow">while</span>(!remainingBones.empty()) +01188 { +01189 <span class="comment">// get the first bone from the map. (remind: depth-first order).</span> +01190 <a class="code" href="a04558.html#a15">uint</a> currentBoneId= remainingBones.begin()->first; +01191 +01192 <span class="comment">// If no more faces in the remainingFace list use this bone, remove it, and continue.</span> +01193 <span class="keywordflow">if</span>(remainingBones.begin()->second.RefCount==0) +01194 { +01195 remainingBones.erase(remainingBones.begin()); +01196 <span class="keywordflow">continue</span>; +01197 } +01198 +01199 <span class="comment">// this is a marker, to know if a face insertion will occurs.</span> +01200 <span class="keywordtype">bool</span> faceAdded= <span class="keyword">false</span>; +01201 +01202 <span class="comment">// traverse all faces, trying to insert them in current MatrixBlock processed.</span> +01203 <a class="code" href="a03889.html">list<uint></a>::iterator itFace; +01204 <span class="keywordflow">for</span>(itFace= remainingFaces.begin(); itFace!=remainingFaces.end();) +01205 { +01206 <span class="keywordtype">bool</span> useCurrentBoneId; +01207 <a class="code" href="a04558.html#a15">uint</a> newBoneAdded; +01208 +01209 <span class="comment">// i/ Get info on current face.</span> +01210 <span class="comment">//-----------------------------</span> +01211 +01212 <span class="comment">// build which bones this face use.</span> +01213 tmpFaces[*itFace].buildBoneUse(boneUse, m.SkinWeights); +01214 +01215 <span class="comment">// test if this face use the currentBoneId.</span> +01216 useCurrentBoneId= <span class="keyword">false</span>; +01217 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)boneUse.size();i++) +01218 { +01219 <span class="comment">// if this face use the currentBoneId</span> +01220 <span class="keywordflow">if</span>(boneUse[i]==currentBoneId) +01221 { +01222 useCurrentBoneId= <span class="keyword">true</span>; +01223 <span class="keywordflow">break</span>; +01224 } +01225 } +01226 <span class="comment">// compute how many bones that are not in the current matrixblock this face use.</span> +01227 newBoneAdded=0; +01228 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)boneUse.size();i++) +01229 { +01230 <span class="comment">// if this bone is not inserted in the current matrix block, inform it.</span> +01231 <span class="keywordflow">if</span>(!remainingBones[boneUse[i]].Inserted) +01232 newBoneAdded++; +01233 } +01234 +01235 +01236 <span class="comment">// ii/ insert/reject face.</span> +01237 <span class="comment">//------------------------</span> +01238 +01239 <span class="comment">// If this face do not add any more bone, we can insert it into the current matrixblock.</span> +01240 <span class="comment">// If it use the currentBoneId, and do not explode max count, we allow insert it too in the current matrixblock.</span> +01241 <span class="keywordflow">if</span>( newBoneAdded==0 || +01242 (useCurrentBoneId && newBoneAdded+matrixBlock.NumMatrix < IDriver::MaxModelMatrix) ) +01243 { +01244 <span class="comment">// Insert this face in the current matrix block</span> +01245 +01246 CFaceTmp &face= tmpFaces[*itFace]; +01247 +01248 <span class="comment">// for all vertices of this face.</span> +01249 <span class="keywordflow">for</span>(j=0;j<3;j++) +01250 { +01251 CMesh::CSkinWeight &sw= m.SkinWeights[face.Corner[j].Vertex]; +01252 +01253 <span class="comment">// for each corner weight (4)</span> +01254 <span class="keywordflow">for</span>(k=0;k<<a class="code" href="a04567.html#a0">NL3D_MESH_SKINNING_MAX_MATRIX</a>;k++) +01255 { +01256 <span class="comment">// get the global boneId this corner weight use.</span> +01257 <a class="code" href="a04558.html#a15">uint</a> boneId= sw.MatrixId[k]; +01258 <span class="comment">// get the CBoneTmp this corner weight use.</span> +01259 CBoneTmp &bone= remainingBones[boneId]; +01260 +01261 <span class="comment">// decRef the bone .</span> +01262 bone.RefCount--; +01263 +01264 <span class="comment">// Is this bone already inserted in the MatrixBlock ?</span> +01265 <span class="keywordflow">if</span>( !bone.Inserted ) +01266 { +01267 <span class="comment">// No, insert it.</span> +01268 bone.Inserted= <span class="keyword">true</span>; +01269 <span class="comment">// link it to the MatrixId in the current matrixBlock.</span> +01270 bone.MatrixIdInMB= matrixBlock.NumMatrix; +01271 +01272 <span class="comment">// modify the matrixBlock</span> +01273 matrixBlock.MatrixId[matrixBlock.NumMatrix]= boneId; +01274 <span class="comment">// increment the number of matrix in the matrixBlock.</span> +01275 matrixBlock.NumMatrix++; +01276 } +01277 +01278 <span class="comment">// Copy Weight info for this Corner.</span> +01279 <span class="comment">// Set what matrix in the current matrix block this corner use.</span> +01280 face.Corner[j].Palette.MatrixId[k]= bone.MatrixIdInMB; +01281 <span class="comment">// Set weight.</span> +01282 face.Corner[j].Weights[k]= sw.Weights[k]; +01283 } +01284 } +01285 +01286 <span class="comment">// to Which matrixblock this face is inserted.</span> +01287 face.MatrixBlockId= _MatrixBlocks.size()-1; +01288 +01289 <span class="comment">// remove the face from remain face list.</span> +01290 itFace= remainingFaces.erase(itFace); +01291 +01292 <span class="comment">// inform the algorithm that a face has been added.</span> +01293 faceAdded= <span class="keyword">true</span>; +01294 } +01295 <span class="keywordflow">else</span> +01296 { +01297 <span class="comment">// do not append this face to the current matrix block, skip to the next</span> +01298 itFace++; +01299 } +01300 } +01301 +01302 <span class="comment">// If no faces have been added during this pass, we are blocked, and either the MatrixBlock may be full,</span> +01303 <span class="comment">// or there is no more face. So quit this block and process a new one.</span> +01304 <span class="keywordflow">if</span>(!faceAdded) +01305 <span class="keywordflow">break</span>; +01306 } +01307 +01308 } +01309 <span class="comment">// NB: at the end of this loop, remainingBones may not be empty(), but all remainingBones should have RefCount==0.</span> +01310 +01311 +01312 +01313 <span class="comment">// 4. Re-order matrix use in MatrixBlocks, for minimum matrix change between MatrixBlocks.</span> +01314 <span class="comment">//================================</span> +01315 vector<CMatrixBlockRemap> blockRemaps; +01316 blockRemaps.resize(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size()); +01317 +01318 +01319 <span class="comment">// For all MatrixBlocks > first, try to "mirror" bones from previous.</span> +01320 <span class="keywordflow">for</span>(i=1;i<(<a class="code" href="a04558.html#a14">sint</a>)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size();i++) +01321 { +01322 CMatrixBlock &mBlock= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[i]; +01323 CMatrixBlock &mPrevBlock= _MatrixBlocks[i-1]; +01324 CMatrixBlockRemap &remap= blockRemaps[i]; +01325 +01326 <span class="comment">// First bkup the bone ids in remap table.</span> +01327 <span class="keywordflow">for</span>(j=0;j<(<a class="code" href="a04558.html#a14">sint</a>)mBlock.NumMatrix;j++) +01328 { +01329 remap.Remap[j]= mBlock.MatrixId[j]; +01330 } +01331 +01332 <span class="comment">// For all ids of this blocks, try to mirror them.</span> +01333 <span class="keywordflow">for</span>(j=0;j<(<a class="code" href="a04558.html#a14">sint</a>)mBlock.NumMatrix;j++) +01334 { +01335 <span class="comment">// get the location of this bone in the prev bone.</span> +01336 <a class="code" href="a04558.html#a14">sint</a> idLoc= mPrevBlock.getMatrixIdLocation(mBlock.MatrixId[j]); +01337 <span class="comment">// If not found, or if bigger than current array, fails (cant be mirrored).</span> +01338 <span class="comment">// Or if already mirrored.</span> +01339 <span class="keywordflow">if</span>(idLoc==-1 || idLoc>=(<a class="code" href="a04558.html#a14">sint</a>)mBlock.NumMatrix || idLoc==j) +01340 { +01341 <span class="comment">// next id.</span> +01342 j++; +01343 } +01344 <span class="keywordflow">else</span> +01345 { +01346 <span class="comment">// puts me on my mirrored location. and swap with the current one at this mirrored location.</span> +01347 swap(mBlock.MatrixId[j], mBlock.MatrixId[idLoc]); +01348 <span class="comment">// mBlock.MatrixId[j] is now a candidate for mirror.</span> +01349 } +01350 } +01351 +01352 <span class="comment">// Then build the Remap table, to re-order faces matrixId which use this matrix block.</span> +01353 <span class="keywordflow">for</span>(j=0;j<(<a class="code" href="a04558.html#a14">sint</a>)mBlock.NumMatrix;j++) +01354 { +01355 <span class="comment">// get the boneid which was at this position j before.</span> +01356 <a class="code" href="a04558.html#a15">uint</a> boneId= remap.Remap[j]; +01357 <span class="comment">// search his new position, and store the result in the remap table.</span> +01358 remap.Remap[j]= mBlock.getMatrixIdLocation(boneId); +01359 } +01360 +01361 <span class="comment">// NB: this matrixBlock is re-ordered. next matrixBlock use this state.</span> +01362 } +01363 +01364 +01365 <span class="comment">// For all faces/corners/weights, remap MatrixIds.</span> +01366 <span class="keywordflow">for</span>(i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)tmpFaces.size();i++) +01367 { +01368 CFaceTmp &face= tmpFaces[i]; +01369 <span class="comment">// do it but for matrixblock0.</span> +01370 <span class="keywordflow">if</span>(face.MatrixBlockId!=0) +01371 { +01372 CMatrixBlockRemap &remap= blockRemaps[face.MatrixBlockId]; +01373 <span class="comment">// For all corners.</span> +01374 <span class="keywordflow">for</span>(j=0;j<3;j++) +01375 { +01376 <span class="keywordflow">for</span>(k=0;k<<a class="code" href="a04567.html#a0">NL3D_MESH_SKINNING_MAX_MATRIX</a>;k++) +01377 { +01378 <a class="code" href="a04558.html#a15">uint</a> oldId= face.Corner[j].Palette.MatrixId[k]; +01379 face.Corner[j].Palette.MatrixId[k]= (<a class="code" href="a04558.html#a7">uint8</a>)remap.Remap[oldId]; +01380 } +01381 } +01382 } +01383 } +01384 +01385 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz411_0" doxytag="NL3D::CMeshGeom::clip" ></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"> bool NL3D::CMeshGeom::clip </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">const std::vector< <a class="el" href="a03082.html">CPlane</a> > & </td> + <td class="mdname" nowrap> <em>pyramid</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname" nowrap> <em>worldMatrix</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +clip this mesh +<p> + +<p> +Reimplemented from <a class="el" href="a02879.html#NL3D_1_1IMeshGeoma0">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l00482">482</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00709">_PreciseClipping</a>, <a class="el" href="a05504.html#l00088">NLMISC::CBSphere::applyTransform()</a>, <a class="el" href="a05505.html#l00048">NLMISC::CBSphere::Center</a>, <a class="el" href="a05384.html#l00319">NLMISC::CAABBoxExt::clipBack()</a>, <a class="el" href="a05385.html#l00199">NLMISC::CAABBoxExt::getCenter()</a>, <a class="el" href="a05385.html#l00204">NLMISC::CAABBoxExt::getRadius()</a>, <a class="el" href="a06172.html#l00068">NLMISC::CPlane::normalize()</a>, <a class="el" href="a05505.html#l00049">NLMISC::CBSphere::Radius</a>, and <a class="el" href="a05981.html#l00104">sint</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02379">NL3D::CMesh::clip()</a>. +<p> +<div class="fragment"><pre>00483 { +00484 <span class="comment">// Speed Clip: clip just the sphere.</span> +00485 <a class="code" href="a02291.html">CBSphere</a> localSphere(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr0">_BBox</a>.<a class="code" href="a02157.html#NLMISC_1_1CAABBoxExtz1912_1">getCenter</a>(), <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr0">_BBox</a>.<a class="code" href="a02157.html#NLMISC_1_1CAABBoxExtz1912_5">getRadius</a>()); +00486 <a class="code" href="a02291.html">CBSphere</a> worldSphere; +00487 +00488 <span class="comment">// transform the sphere in WorldMatrix (with nearly good scale info).</span> +00489 localSphere.<a class="code" href="a02291.html#NLMISC_1_1CBSpherez1929_0">applyTransform</a>(worldMatrix, worldSphere); +00490 +00491 <span class="comment">// if out of only plane, entirely out.</span> +00492 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a14">sint</a> i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)pyramid.size();i++) +00493 { +00494 <span class="comment">// We are sure that pyramid has normalized plane normals.</span> +00495 <span class="comment">// if SpherMax OUT return false.</span> +00496 <span class="keywordtype">float</span> d= pyramid[i]*worldSphere.<a class="code" href="a02291.html#NLMISC_1_1CBSphereo0">Center</a>; +00497 <span class="keywordflow">if</span>(d>worldSphere.<a class="code" href="a02291.html#NLMISC_1_1CBSphereo1">Radius</a>) +00498 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00499 } +00500 +00501 <span class="comment">// test if must do a precise clip, according to mesh size.</span> +00502 <span class="keywordflow">if</span>( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr13">_PreciseClipping</a> ) +00503 { +00504 CPlane localPlane; +00505 +00506 <span class="comment">// if out of only plane, entirely out.</span> +00507 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a14">sint</a> i=0;i<(<a class="code" href="a04558.html#a14">sint</a>)pyramid.size();i++) +00508 { +00509 <span class="comment">// Transform the pyramid in Object space.</span> +00510 localPlane= pyramid[i]*worldMatrix; +00511 <span class="comment">// localPlane must be normalized, because worldMatrix mya have a scale.</span> +00512 localPlane.normalize(); +00513 <span class="comment">// if the box is not partially inside the plane, quit</span> +00514 <span class="keywordflow">if</span>( !<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr0">_BBox</a>.<a class="code" href="a02157.html#NLMISC_1_1CAABBoxExtz1914_0">clipBack</a>(localPlane) ) +00515 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00516 } +00517 } +00518 +00519 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00520 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomd0" doxytag="NL3D::CMeshGeom::compileRunTime" ></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::CMeshGeom::compileRunTime </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> [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="a05989.html#l01062">1062</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05990.html#l00712">_MeshMorpher</a>, <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>, <a class="el" href="a05990.html#l00709">_PreciseClipping</a>, <a class="el" href="a05990.html#l00664">_Skinned</a>, <a class="el" href="a05990.html#l00705">_SupportMBRFlags</a>, <a class="el" href="a05989.html#l01615">bkupOriginalSkinVertices()</a>, <a class="el" href="a06004.html#l00077">NL3D::CMeshMorpher::BlendShapes</a>, <a class="el" href="a05385.html#l00204">NLMISC::CAABBoxExt::getRadius()</a>, <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy3">MBROk</a>, <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy4">MBRSortPerMaterial</a>, and <a class="el" href="a05990.html#l00066">NL3D_MESH_PRECISE_CLIP_THRESHOLD</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00172">build()</a>, and <a class="el" href="a05989.html#l00449">setBlendShapes()</a>. +<p> +<div class="fragment"><pre>01063 { +01064 <span class="comment">// if skinned, prepare skinning</span> +01065 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>) +01066 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_2">bkupOriginalSkinVertices</a>(); +01067 +01068 <span class="comment">// Do precise clipping for big object??</span> +01069 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr13">_PreciseClipping</a>= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr0">_BBox</a>.<a class="code" href="a02157.html#NLMISC_1_1CAABBoxExtz1912_5">getRadius</a>() >= <a class="code" href="a04567.html#a1">NL3D_MESH_PRECISE_CLIP_THRESHOLD</a>; +01070 +01071 <span class="comment">// Support MeshBlockRendering only if not skinned/meshMorphed.</span> +01072 <span class="keywordtype">bool</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz417_9">supportMeshBlockRendering</a>= !<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a> && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->BlendShapes.size()==0; +01073 +01074 <span class="comment">// true only if one matrix block, and at least one rdrPass.</span> +01075 supportMeshBlockRendering= supportMeshBlockRendering && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size()==1 && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[0].RdrPass.size()>0; +01076 <span class="keywordflow">if</span> (supportMeshBlockRendering && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>) +01077 { +01078 supportMeshBlockRendering = supportMeshBlockRendering && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->supportMeshBlockRendering(); +01079 } +01080 +01081 <span class="comment">// TestYoyo</span> +01082 <span class="comment">//supportMeshBlockRendering= false;</span> +01083 +01084 <span class="comment">// support MeshVertexProgram, but no material sorting...</span> +01085 <span class="keywordtype">bool</span> supportMBRPerMaterial= supportMeshBlockRendering && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>==NULL; +01086 +01087 +01088 <span class="comment">// setup flags</span> +01089 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a>= 0; +01090 <span class="keywordflow">if</span>(supportMeshBlockRendering) +01091 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a>|= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy3">MBROk</a>; +01092 <span class="keywordflow">if</span>(supportMBRPerMaterial) +01093 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a>|= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy4">MBRSortPerMaterial</a>; +01094 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz415_0" doxytag="NL3D::CMeshGeom::computeBonesId" ></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::CMeshGeom::computeBonesId </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03399.html">CSkeletonModel</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>skeleton</em> </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> +Compute skinning id. +<p> + +<p> +Definition at line <a class="el" href="a05989.html#l01456">1456</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00669">_BoneIdComputed</a>, <a class="el" href="a05990.html#l00671">_BoneIdExtended</a>, <a class="el" href="a05990.html#l00676">_BonesId</a>, <a class="el" href="a05990.html#l00678">_BonesIdExt</a>, <a class="el" href="a05990.html#l00674">_BonesName</a>, <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a06394.html#l00098">NL3D::CSkeletonModel::Bones</a>, <a class="el" href="a06393.html#l00237">NL3D::CSkeletonModel::flagBoneAndParents()</a>, <a class="el" href="a06393.html#l00629">NL3D::CSkeletonModel::getBoneIdByName()</a>, <a class="el" href="a05646.html#l00243">matrix</a>, <a class="el" href="a05990.html#l00512">NL3D::CMeshGeom::CMatrixBlock::MatrixId</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05622.html#l00135">nlwarning</a>, <a class="el" href="a05990.html#l00514">NL3D::CMeshGeom::CMatrixBlock::NumMatrix</a>, <a class="el" href="a05981.html#l00099">sint32</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02468">NL3D::CMesh::computeBonesId()</a>. +<p> +<div class="fragment"><pre>01457 { +01458 <span class="comment">// Already computed ?</span> +01459 <span class="keywordflow">if</span> (!<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr1">_BoneIdComputed</a>) +01460 { +01461 <span class="comment">// Get a pointer on the skeleton</span> +01462 <a class="code" href="a04199.html#a6">nlassert</a> (skeleton); +01463 <span class="keywordflow">if</span> (skeleton) +01464 { +01465 <span class="comment">// Resize boneId to the good size.</span> +01466 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr3">_BonesId</a>.resize(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr5">_BonesName</a>.size()); +01467 +01468 <span class="comment">// For each matrix block</span> +01469 <a class="code" href="a04558.html#a15">uint</a> matrixBlock; +01470 <span class="keywordflow">for</span> (matrixBlock=0; matrixBlock<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size(); matrixBlock++) +01471 { +01472 <span class="comment">// Ref on the matrix block</span> +01473 CMatrixBlock &mb = <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[matrixBlock]; +01474 +01475 <span class="comment">// For each matrix</span> +01476 <a class="code" href="a04558.html#a15">uint</a> <a class="code" href="a04223.html#a578">matrix</a>; +01477 <span class="keywordflow">for</span> (<a class="code" href="a04223.html#a578">matrix</a>=0; <a class="code" href="a04223.html#a578">matrix</a><mb.NumMatrix; <a class="code" href="a04223.html#a578">matrix</a>++) +01478 { +01479 <span class="comment">// Get bone id in the skeleton</span> +01480 <a class="code" href="a04199.html#a6">nlassert</a> (mb.MatrixId[matrix]<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr5">_BonesName</a>.size()); +01481 <a class="code" href="a04558.html#a10">sint32</a> boneId = skeleton->getBoneIdByName (_BonesName[mb.MatrixId[matrix]]); +01482 +01483 <span class="comment">// Setup the _BoneId.</span> +01484 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr3">_BonesId</a>[mb.MatrixId[<a class="code" href="a04223.html#a578">matrix</a>]]= boneId; +01485 +01486 <span class="comment">// Bones found ?</span> +01487 <span class="keywordflow">if</span> (boneId != -1) +01488 { +01489 <span class="comment">// Set the bone id</span> +01490 mb.MatrixId[<a class="code" href="a04223.html#a578">matrix</a>] = (<a class="code" href="a04558.html#a11">uint32</a>)boneId; +01491 } +01492 <span class="keywordflow">else</span> +01493 { +01494 <span class="comment">// Put id 0</span> +01495 mb.MatrixId[<a class="code" href="a04223.html#a578">matrix</a>] = 0; +01496 +01497 <span class="comment">// Error</span> +01498 <a class="code" href="a04199.html#a2">nlwarning</a> (<span class="stringliteral">"Bone %s not found in the skeleton."</span>, _BonesName[mb.MatrixId[matrix]].c_str()); +01499 } +01500 } +01501 } +01502 +01503 <span class="comment">// Computed</span> +01504 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr1">_BoneIdComputed</a> = <span class="keyword">true</span>; +01505 } +01506 } +01507 +01508 <span class="comment">// Already extended ?</span> +01509 <span class="keywordflow">if</span> (!<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr2">_BoneIdExtended</a>) +01510 { +01511 <a class="code" href="a04199.html#a6">nlassert</a> (skeleton); +01512 <span class="keywordflow">if</span> (skeleton) +01513 { +01514 <span class="comment">// the total bone Usage of the mesh.</span> +01515 vector<bool> boneUsage; +01516 boneUsage.resize(skeleton->Bones.size(), <span class="keyword">false</span>); +01517 +01518 <span class="comment">// for all Bones marked as valid.</span> +01519 <a class="code" href="a04558.html#a15">uint</a> i; +01520 <span class="keywordflow">for</span>(i=0; i<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr3">_BonesId</a>.size(); i++) +01521 { +01522 <span class="comment">// if not a valid boneId, skip it.</span> +01523 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr3">_BonesId</a>[i]<0) +01524 <span class="keywordflow">continue</span>; +01525 +01526 <span class="comment">// mark him and his father in boneUsage.</span> +01527 skeleton->flagBoneAndParents(_BonesId[i], boneUsage); +01528 } +01529 +01530 <span class="comment">// fill _BonesIdExt with bones of _BonesId and their parents.</span> +01531 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr4">_BonesIdExt</a>.clear(); +01532 <span class="keywordflow">for</span>(i=0; i<boneUsage.size();i++) +01533 { +01534 <span class="comment">// if the bone is used by the mesh, add it to BoneIdExt.</span> +01535 <span class="keywordflow">if</span>(boneUsage[i]) +01536 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr4">_BonesIdExt</a>.push_back(i); +01537 } +01538 +01539 } +01540 +01541 <span class="comment">// Extended</span> +01542 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr2">_BoneIdExtended</a>= <span class="keyword">true</span>; +01543 } +01544 +01545 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz417_2" doxytag="NL3D::CMeshGeom::computeMeshVBHeap" ></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::CMeshGeom::computeMeshVBHeap </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">void * </td> + <td class="mdname" nowrap> <em>dst</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>indexStart</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +When the framework succes to allocate a VBHeap space, it call this method to fill this space and compute shifted Primitive block. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>the</em> </td><td>dest VertexBuffer. NB: start to fill at dst[0] </td></tr> + <tr><td valign=top><em>indexStart</em> </td><td>used to shift primitive block.</td></tr> + </table> +</dl> + +<p> +Reimplemented from <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_2">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l02133">2133</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a06197.html#l00038">NL3D::CPrimitiveBlock::getLinePointer()</a>, <a class="el" href="a06198.html#l00087">NL3D::CPrimitiveBlock::getNumLine()</a>, <a class="el" href="a06198.html#l00141">NL3D::CPrimitiveBlock::getNumQuad()</a>, <a class="el" href="a06198.html#l00108">NL3D::CPrimitiveBlock::getNumTri()</a>, <a class="el" href="a06711.html#l00453">NL3D::CVertexBuffer::getNumVertices()</a>, <a class="el" href="a06197.html#l00149">NL3D::CPrimitiveBlock::getQuadPointer()</a>, <a class="el" href="a06197.html#l00091">NL3D::CPrimitiveBlock::getTriPointer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a06711.html#l00473">NL3D::CVertexBuffer::getVertexSize()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05990.html#l00516">NL3D::CMeshGeom::CMatrixBlock::RdrPass</a>, <a class="el" href="a06197.html#l00061">NL3D::CPrimitiveBlock::setNumLine()</a>, <a class="el" href="a06197.html#l00180">NL3D::CPrimitiveBlock::setNumQuad()</a>, <a class="el" href="a06197.html#l00114">NL3D::CPrimitiveBlock::setNumTri()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +<div class="fragment"><pre>02134 { +02135 <span class="comment">// Fill dst with Buffer content.</span> +02136 memcpy(dst, <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexCoordPointer(), <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumVertices()*<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexSize() ); +02137 +02138 <span class="comment">// NB: only 1 MB is possible ...</span> +02139 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size()==1); +02140 CMatrixBlock &mBlock= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[0]; +02141 <span class="comment">// For all rdrPass.</span> +02142 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i<mBlock.RdrPass.size();i++) +02143 { +02144 <span class="comment">// shift the PB</span> +02145 CPrimitiveBlock &srcPb= mBlock.RdrPass[i].PBlock; +02146 CPrimitiveBlock &dstPb= mBlock.RdrPass[i].VBHeapPBlock; +02147 <a class="code" href="a04558.html#a15">uint</a> j; +02148 +02149 <span class="comment">// Lines.</span> +02150 dstPb.setNumLine(srcPb.getNumLine()); +02151 <a class="code" href="a04558.html#a11">uint32</a> *srcLinePtr= srcPb.getLinePointer(); +02152 <a class="code" href="a04558.html#a11">uint32</a> *dstLinePtr= dstPb.getLinePointer(); +02153 <span class="keywordflow">for</span>(j=0; j<dstPb.getNumLine()*2;j++) +02154 { +02155 dstLinePtr[j]= srcLinePtr[j]+indexStart; +02156 } +02157 <span class="comment">// Tris.</span> +02158 dstPb.setNumTri(srcPb.getNumTri()); +02159 <a class="code" href="a04558.html#a11">uint32</a> *srcTriPtr= srcPb.getTriPointer(); +02160 <a class="code" href="a04558.html#a11">uint32</a> *dstTriPtr= dstPb.getTriPointer(); +02161 <span class="keywordflow">for</span>(j=0; j<dstPb.getNumTri()*3;j++) +02162 { +02163 dstTriPtr[j]= srcTriPtr[j]+indexStart; +02164 } +02165 <span class="comment">// Quads.</span> +02166 dstPb.setNumQuad(srcPb.getNumQuad()); +02167 <a class="code" href="a04558.html#a11">uint32</a> *srcQuadPtr= srcPb.getQuadPointer(); +02168 <a class="code" href="a04558.html#a11">uint32</a> *dstQuadPtr= dstPb.getQuadPointer(); +02169 <span class="keywordflow">for</span>(j=0; j<dstPb.getNumQuad()*4;j++) +02170 { +02171 dstQuadPtr[j]= srcQuadPtr[j]+indexStart; +02172 } +02173 } +02174 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz423_5" doxytag="NL3D::CMeshGeom::computeSkinMatrixes" ></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::CMeshGeom::computeSkinMatrixes </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="a02852.html">CMatrix3x4</a> * </td> + <td class="mdname" nowrap> <em>matrixes</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02884.html">CMatrixBlock</a> * </td> + <td class="mdname" nowrap> <em>prevBlock</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02884.html">CMatrixBlock</a> & </td> + <td class="mdname" nowrap> <em>curBlock</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="a05989.html#l01914">1914</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a06393.html#l00487">NL3D::CSkeletonModel::getActiveBoneSkinMatrix()</a>, <a class="el" href="a05990.html#l00512">NL3D::CMeshGeom::CMatrixBlock::MatrixId</a>, <a class="el" href="a05990.html#l00514">NL3D::CMeshGeom::CMatrixBlock::NumMatrix</a>, <a class="el" href="a05975.html#l00059">NL3D::CMatrix3x4::set()</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01715">applySkin()</a>. +<p> +<div class="fragment"><pre>01915 { +01916 <span class="comment">// For all matrix of this mBlock.</span> +01917 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> idMat=0;idMat<mBlock.NumMatrix;idMat++) +01918 { +01919 <a class="code" href="a04558.html#a15">uint</a> curBoneId= mBlock.MatrixId[idMat]; +01920 +01921 <span class="comment">// If same matrix binded as previous block, no need to bind!!</span> +01922 <span class="keywordflow">if</span>(prevBlock && idMat<prevBlock->NumMatrix && prevBlock->MatrixId[idMat]== curBoneId) +01923 <span class="keywordflow">continue</span>; +01924 +01925 <span class="comment">// Else, we must setup the matrix </span> +01926 matrixes[idMat].set(skeleton->getActiveBoneSkinMatrix(curBoneId)); +01927 } +01928 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz423_6" doxytag="NL3D::CMeshGeom::computeSoftwarePointSkinning" ></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::CMeshGeom::computeSoftwarePointSkinning </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02852.html">CMatrix3x4</a> * </td> + <td class="mdname" nowrap> <em>matrixes</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>srcVector</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03038.html">CPaletteSkin</a> * </td> + <td class="mdname" nowrap> <em>srcPal</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float * </td> + <td class="mdname" nowrap> <em>srcWgt</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>dstVector</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="a05989.html#l01870">1870</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a06711.html#l00089">NL3D::CPaletteSkin::MatrixId</a>, <a class="el" href="a05975.html#l00108">NL3D::CMatrix3x4::mulAddPoint()</a>, and <a class="el" href="a05975.html#l00076">NL3D::CMatrix3x4::mulSetPoint()</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01715">applySkin()</a>. +<p> +<div class="fragment"><pre>01871 { +01872 CMatrix3x4 *pMat; +01873 +01874 <span class="comment">// \todo yoyo: TODO_OPTIMIZE: SSE verion...</span> +01875 +01876 <span class="comment">// 0th matrix influence.</span> +01877 pMat= matrixes + srcPal->MatrixId[0]; +01878 pMat->mulSetPoint(*srcVec, srcWgt[0], *pDst); +01879 <span class="comment">// 1th matrix influence.</span> +01880 pMat= matrixes + srcPal->MatrixId[1]; +01881 pMat->mulAddPoint(*srcVec, srcWgt[1], *pDst); +01882 <span class="comment">// 2th matrix influence.</span> +01883 pMat= matrixes + srcPal->MatrixId[2]; +01884 pMat->mulAddPoint(*srcVec, srcWgt[2], *pDst); +01885 <span class="comment">// 3th matrix influence.</span> +01886 pMat= matrixes + srcPal->MatrixId[3]; +01887 pMat->mulAddPoint(*srcVec, srcWgt[3], *pDst); +01888 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz423_7" doxytag="NL3D::CMeshGeom::computeSoftwareVectorSkinning" ></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::CMeshGeom::computeSoftwareVectorSkinning </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02852.html">CMatrix3x4</a> * </td> + <td class="mdname" nowrap> <em>matrixes</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>srcVector</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a03038.html">CPaletteSkin</a> * </td> + <td class="mdname" nowrap> <em>srcPal</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float * </td> + <td class="mdname" nowrap> <em>srcWgt</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>dstVector</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="a05989.html#l01892">1892</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a06711.html#l00089">NL3D::CPaletteSkin::MatrixId</a>, <a class="el" href="a05975.html#l00101">NL3D::CMatrix3x4::mulAddVector()</a>, and <a class="el" href="a05975.html#l00069">NL3D::CMatrix3x4::mulSetVector()</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01715">applySkin()</a>. +<p> +<div class="fragment"><pre>01893 { +01894 CMatrix3x4 *pMat; +01895 +01896 <span class="comment">// \todo yoyo: TODO_OPTIMIZE: SSE verion...</span> +01897 +01898 <span class="comment">// 0th matrix influence.</span> +01899 pMat= matrixes + srcPal->MatrixId[0]; +01900 pMat->mulSetVector(*srcVec, srcWgt[0], *pDst); +01901 <span class="comment">// 1th matrix influence.</span> +01902 pMat= matrixes + srcPal->MatrixId[1]; +01903 pMat->mulAddVector(*srcVec, srcWgt[1], *pDst); +01904 <span class="comment">// 2th matrix influence.</span> +01905 pMat= matrixes + srcPal->MatrixId[2]; +01906 pMat->mulAddVector(*srcVec, srcWgt[2], *pDst); +01907 <span class="comment">// 3th matrix influence.</span> +01908 pMat= matrixes + srcPal->MatrixId[3]; +01909 pMat->mulAddVector(*srcVec, srcWgt[3], *pDst); +01910 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz417_3" doxytag="NL3D::CMeshGeom::endMesh" ></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::CMeshGeom::endMesh </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02887.html">CMeshGeomRenderContext</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>rdrCtx</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The framework call this method when it has done with this meshGeom +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_3">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l02100">2100</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>, <a class="el" href="a05990.html#l00705">_SupportMBRFlags</a>, <a class="el" href="a06000.html#l00062">NL3D::CMeshGeomRenderContext::Driver</a>, and <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a>. +<p> +<div class="fragment"><pre>02101 { +02102 <span class="comment">// MeshVertexProgram ?</span> +02103 <span class="keywordflow">if</span>( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a> & <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a> ) +02104 { +02105 <span class="comment">// End Mesh</span> +02106 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->endMBRMesh( rdrCtx.Driver ); +02107 +02108 <span class="comment">// and remove Current Flag.</span> +02109 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a>&= ~<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a>; +02110 } +02111 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomd1" doxytag="NL3D::CMeshGeom::findVBId" ></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::CMeshGeom::findVBId </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02878.html#NL3D_1_1CMeshGeomy9">TCornerSet</a> & </td> + <td class="mdname" nowrap> <em>corners</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02882.html">CCornerTmp</a> * </td> + <td class="mdname" nowrap> <em>corn</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a14">sint</a> & </td> + <td class="mdname" nowrap> <em>currentVBIndex</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a03128.html">CVector</a> & </td> + <td class="mdname" nowrap> <em>vert</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02864.html">CMesh::CMeshBuild</a> & </td> + <td class="mdname" nowrap> <em>mb</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="a05990.html#l00733">733</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +References <a class="el" href="a05990.html#l00730">ItCornerSet</a>, <a class="el" href="a05990.html#l00063">NL3D_MESH_SKINNING_MAX_MATRIX</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05990.html#l00180">NL3D::CMesh::CMeshBuild::NumCoords</a>, <a class="el" href="a06711.html#l00568">NL3D::CVertexBuffer::setColor()</a>, <a class="el" href="a06711.html#l00554">NL3D::CVertexBuffer::setNormalCoord()</a>, <a class="el" href="a06710.html#l00409">NL3D::CVertexBuffer::setNumVertices()</a>, <a class="el" href="a06711.html#l00653">NL3D::CVertexBuffer::setPaletteSkin()</a>, <a class="el" href="a06711.html#l00584">NL3D::CVertexBuffer::setSpecular()</a>, <a class="el" href="a06711.html#l00600">NL3D::CVertexBuffer::setTexCoord()</a>, <a class="el" href="a06711.html#l00795">NL3D::CVertexBuffer::setValueFloat3Ex()</a>, <a class="el" href="a06711.html#l00524">NL3D::CVertexBuffer::setVertexCoord()</a>, <a class="el" href="a06711.html#l00637">NL3D::CVertexBuffer::setWeight()</a>, <a class="el" href="a05981.html#l00104">sint</a>, and <a class="el" href="a05990.html#l00729">TCornerSet</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00172">build()</a>. +<p> +<div class="fragment"><pre>00734 { +00735 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomy1">ItCornerSet</a> it= corners.find(const_cast<CCornerTmp *>(corn)); +00736 <span class="keywordflow">if</span>(it!=corners.end()) +00737 corn->VBId= (*it)->VBId; +00738 <span class="keywordflow">else</span> +00739 { +00740 <span class="comment">// Add corner to the set to not insert same corner two times.</span> +00741 corners.insert (const_cast<CCornerTmp *>(corn)); +00742 <a class="code" href="a04558.html#a14">sint</a> i; +00743 corn->VBId= currentVBIndex++; +00744 <span class="comment">// Fill the VBuffer.</span> +00745 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setNumVertices(currentVBIndex); +00746 <a class="code" href="a04558.html#a14">sint</a> <span class="keywordtype">id</span>= currentVBIndex-1; +00747 <span class="comment">// XYZ.</span> +00748 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setVertexCoord(<span class="keywordtype">id</span>, vert); +00749 <span class="comment">// Normal</span> +00750 <span class="keywordflow">if</span>(CCornerTmp::Flags & CVertexBuffer::NormalFlag) +00751 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setNormalCoord(<span class="keywordtype">id</span>, corn->Normal); +00752 <span class="comment">// Uvws.</span> +00753 <span class="keywordflow">for</span>(i=0;i<CVertexBuffer::MaxStage;i++) +00754 { +00755 <span class="keywordflow">if</span>(CCornerTmp::Flags & (CVertexBuffer::TexCoord0Flag<<i)) +00756 { +00757 <span class="keywordflow">switch</span>(mb.NumCoords[i]) +00758 { +00759 <span class="keywordflow">case</span> 2: +00760 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setTexCoord(<span class="keywordtype">id</span>, i, corn->Uvws[i].U, corn->Uvws[i].V); +00761 <span class="keywordflow">break</span>; +00762 <span class="keywordflow">case</span> 3: +00763 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setValueFloat3Ex((CVertexBuffer::TValue) (CVertexBuffer::TexCoord0 + i), <span class="keywordtype">id</span>, corn->Uvws[i].U, corn->Uvws[i].V, corn->Uvws[i].W); +00764 <span class="keywordflow">break</span>; +00765 <span class="keywordflow">default</span>: <span class="comment">// not supported</span> +00766 <a class="code" href="a04199.html#a6">nlassert</a>(0); +00767 <span class="keywordflow">break</span>; +00768 } +00769 } +00770 } +00771 <span class="comment">// Color.</span> +00772 <span class="keywordflow">if</span>(CCornerTmp::Flags & CVertexBuffer::PrimaryColorFlag) +00773 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setColor(<span class="keywordtype">id</span>, corn->Color); +00774 <span class="comment">// Specular.</span> +00775 <span class="keywordflow">if</span>(CCornerTmp::Flags & CVertexBuffer::SecondaryColorFlag) +00776 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setSpecular(<span class="keywordtype">id</span>, corn->Specular); +00777 +00778 <span class="comment">// setup palette skinning.</span> +00779 <span class="keywordflow">if</span> ((CCornerTmp::Flags & CVertexBuffer::PaletteSkinFlag)==CVertexBuffer::PaletteSkinFlag) +00780 { +00781 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setPaletteSkin(<span class="keywordtype">id</span>, corn->Palette); +00782 <span class="keywordflow">for</span>(i=0;i<<a class="code" href="a04567.html#a0">NL3D_MESH_SKINNING_MAX_MATRIX</a>;i++) +00783 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.setWeight(<span class="keywordtype">id</span>, i, corn->Weights[i]); +00784 } +00785 } +00786 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz423_8" doxytag="NL3D::CMeshGeom::flagSkinVerticesForMatrixBlock" ></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::CMeshGeom::flagSkinVerticesForMatrixBlock </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a7">uint8</a> * </td> + <td class="mdname" nowrap> <em>skinFlags</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02884.html">CMatrixBlock</a> & </td> + <td class="mdname" nowrap> <em>mb</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="a05989.html#l01836">1836</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a06197.html#l00038">NL3D::CPrimitiveBlock::getLinePointer()</a>, <a class="el" href="a06198.html#l00087">NL3D::CPrimitiveBlock::getNumLine()</a>, <a class="el" href="a06198.html#l00141">NL3D::CPrimitiveBlock::getNumQuad()</a>, <a class="el" href="a06198.html#l00108">NL3D::CPrimitiveBlock::getNumTri()</a>, <a class="el" href="a06197.html#l00149">NL3D::CPrimitiveBlock::getQuadPointer()</a>, <a class="el" href="a06197.html#l00091">NL3D::CPrimitiveBlock::getTriPointer()</a>, <a class="el" href="a05989.html#l01707">NL3D_SOFTSKIN_VMUSTCOMPUTE</a>, <a class="el" href="a05990.html#l00516">NL3D::CMeshGeom::CMatrixBlock::RdrPass</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, and <a class="el" href="a05981.html#l00096">uint8</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01715">applySkin()</a>. +<p> +<div class="fragment"><pre>01837 { +01838 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<mb.RdrPass.size(); i++) +01839 { +01840 CPrimitiveBlock &PB= mb.RdrPass[i].PBlock; +01841 +01842 <a class="code" href="a04558.html#a11">uint32</a> *pIndex; +01843 <a class="code" href="a04558.html#a15">uint</a> nIndex; +01844 +01845 <span class="comment">// This may be better to flags in 2 pass (first traverse primitives, then test vertices).</span> +01846 <span class="comment">// Better sol for BTB..., because number of tests are divided by 6 (for triangles).</span> +01847 +01848 <span class="comment">// for all prims, indicate which vertex we must compute.</span> +01849 <span class="comment">// nothing if not already computed (ie 0), because 0&1==0.</span> +01850 <span class="comment">// Lines.</span> +01851 pIndex= (<a class="code" href="a04558.html#a11">uint32</a>*)PB.getLinePointer(); +01852 nIndex= PB.getNumLine()*2; +01853 <span class="keywordflow">for</span>(;nIndex>0;nIndex--, pIndex++) +01854 skinFlags[*pIndex]&= <a class="code" href="a04566.html#a1">NL3D_SOFTSKIN_VMUSTCOMPUTE</a>; +01855 <span class="comment">// Tris.</span> +01856 pIndex= (<a class="code" href="a04558.html#a11">uint32</a>*)PB.getTriPointer(); +01857 nIndex= PB.getNumTri()*3; +01858 <span class="keywordflow">for</span>(;nIndex>0;nIndex--, pIndex++) +01859 skinFlags[*pIndex]&= <a class="code" href="a04566.html#a1">NL3D_SOFTSKIN_VMUSTCOMPUTE</a>; +01860 <span class="comment">// Quads.</span> +01861 pIndex= (<a class="code" href="a04558.html#a11">uint32</a>*)PB.getQuadPointer(); +01862 nIndex= PB.getNumQuad()*4; +01863 <span class="keywordflow">for</span>(;nIndex>0;nIndex--, pIndex++) +01864 skinFlags[*pIndex]&= <a class="code" href="a04566.html#a1">NL3D_SOFTSKIN_VMUSTCOMPUTE</a>; +01865 } +01866 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz413_0" doxytag="NL3D::CMeshGeom::getBoundingBox" ></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="a02157.html">NLMISC::CAABBoxExt</a>& NL3D::CMeshGeom::getBoundingBox </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> +get the extended axis aligned bounding box of the mesh +<p> + +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz455_0">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05990.html#l00384">384</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02427">NL3D::CMesh::getBoundingBox()</a>. +<p> +<div class="fragment"><pre>00385 { +00386 <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr0">_BBox</a>; +00387 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1ITrackKeyFramer_3_01CKeyVector_01_4a6" doxytag="NL3D::CMeshGeom::getClassName" ></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 std::string NLMISC::IClassable::getClassName </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> [pure virtual, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> + +<p> +Implemented in <a class="el" href="a02995.html#NLAIAGENT_1_1CNumericIndexz1699_0">NLAIAGENT::CNumericIndex</a>, <a class="el" href="a02145.html#NLAIAGENT_1_1VectorTypez1764_0">NLAIC::IPointerGestion</a>, <a class="el" href="a02650.html#NLAIC_1_1CIdentTypez1766_0">NLAIC::CIdentType</a>, and <a class="el" href="a02241.html#CAutomataDescz1896_0">CAutomataDesc</a>. +<p> +Referenced by <a class="el" href="a05549.html#l00091">NLMISC::CClassRegistry::checkObject()</a>, and <a class="el" href="a06525.html#l00039">NL3D::GetTextureSize()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz413_1" doxytag="NL3D::CMeshGeom::getNbBlendShapes" ></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="a04558.html#a15">uint</a> NL3D::CMeshGeom::getNbBlendShapes </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> +get the number of BlendShapes +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00419">419</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +References <a class="el" href="a05990.html#l00712">_MeshMorpher</a>, <a class="el" href="a06004.html#l00077">NL3D::CMeshMorpher::BlendShapes</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +<div class="fragment"><pre>00419 { <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>) <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->BlendShapes.size(); } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz413_2" doxytag="NL3D::CMeshGeom::getNbMatrixBlock" ></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="a04558.html#a15">uint</a> NL3D::CMeshGeom::getNbMatrixBlock </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> +get the number of matrix block +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00393">393</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06768.html#l01717">NL3D::CZoneLighter::addTriangles()</a>, <a class="el" href="a05824.html#l00179">NL3D::CInstanceLighter::addTriangles()</a>, <a class="el" href="a05989.html#l00458">applyMaterialRemap()</a>, <a class="el" href="a05567.html#l00070">NL3D::CCoarseMeshBuild::buildBitmap()</a>, <a class="el" href="a06016.html#l00765">NL3D::CMeshMultiLod::compileCoarseMeshes()</a>, <a class="el" href="a06626.html#l00053">NL3D::UShape::getMeshTriangles()</a>, <a class="el" href="a05989.html#l02437">NL3D::CMesh::getNbMatrixBlock()</a>, and <a class="el" href="a05567.html#l00430">NL3D::CCoarseMeshBuild::remapCoordinates()</a>. +<p> +<div class="fragment"><pre>00393 { <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size() ; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz413_3" doxytag="NL3D::CMeshGeom::getNbRdrPass" ></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="a04558.html#a15">uint</a> NL3D::CMeshGeom::getNbRdrPass </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname1" valign="top" nowrap> <em>matrixBlockIndex</em> </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> +get the number of rendering pass for a given matrix block <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>matrixBlockIndex</em> </td><td>the index of the matrix block the rendering passes belong to</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05990.html#l00398">398</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06768.html#l01717">NL3D::CZoneLighter::addTriangles()</a>, <a class="el" href="a05824.html#l00179">NL3D::CInstanceLighter::addTriangles()</a>, <a class="el" href="a05989.html#l00458">applyMaterialRemap()</a>, <a class="el" href="a05567.html#l00070">NL3D::CCoarseMeshBuild::buildBitmap()</a>, <a class="el" href="a06016.html#l00765">NL3D::CMeshMultiLod::compileCoarseMeshes()</a>, <a class="el" href="a06626.html#l00053">NL3D::UShape::getMeshTriangles()</a>, <a class="el" href="a05989.html#l02442">NL3D::CMesh::getNbRdrPass()</a>, and <a class="el" href="a05567.html#l00430">NL3D::CCoarseMeshBuild::remapCoordinates()</a>. +<p> +<div class="fragment"><pre>00398 { <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[matrixBlockIndex].RdrPass.size() ; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz417_4" doxytag="NL3D::CMeshGeom::getNumRdrPassesForInstance" ></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="a04558.html#a15">uint</a> NL3D::CMeshGeom::getNumRdrPassesForInstance </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02873.html">CMeshBaseInstance</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>inst</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> const<code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return the number of renderPasses for this instance. Called after activateInstance() Used only if <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_8">sortPerMaterial()</a>) is false +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_4">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l02016">2016</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +<div class="fragment"><pre>02017 { +02018 <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[0].RdrPass.size(); +02019 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz417_5" doxytag="NL3D::CMeshGeom::getNumRdrPassesForMesh" ></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="a04558.html#a15">uint</a> NL3D::CMeshGeom::getNumRdrPassesForMesh </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> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +return the number of renderPasses for this mesh. Used only if <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz417_8">sortPerMaterial()</a>) is true +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_5">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l02011">2011</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +<div class="fragment"><pre>02012 { +02013 <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[0].RdrPass.size(); +02014 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz411_1" doxytag="NL3D::CMeshGeom::getNumTriangles" ></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"> float NL3D::CMeshGeom::getNumTriangles </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">float </td> + <td class="mdname1" valign="top" nowrap> <em>distance</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +clip this mesh +<p> + +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz455_1">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l01429">1429</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a06198.html#l00160">NL3D::CPrimitiveBlock::getNumTriangles()</a>, <a class="el" href="a05990.html#l00490">NL3D::CMeshGeom::CRdrPass::PBlock</a>, <a class="el" href="a05990.html#l00516">NL3D::CMeshGeom::CMatrixBlock::RdrPass</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +<div class="fragment"><pre>01430 { +01431 <span class="comment">// Sum of triangles</span> +01432 <a class="code" href="a04558.html#a11">uint32</a> triCount=0; +01433 +01434 <span class="comment">// For each matrix block</span> +01435 <a class="code" href="a04558.html#a15">uint</a> mbCount=<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size(); +01436 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> mb=0; mb<mbCount; mb++) +01437 { +01438 CMatrixBlock &block=<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb]; +01439 +01440 <span class="comment">// Count of primitive block</span> +01441 <a class="code" href="a04558.html#a15">uint</a> pCount=block.RdrPass.size(); +01442 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> pb=0; pb<pCount; pb++) +01443 { +01444 <span class="comment">// Ref on the primitive block</span> +01445 CRdrPass &pass=block.RdrPass[pb]; +01446 +01447 <span class="comment">// Sum tri</span> +01448 triCount+=pass.PBlock.getNumTriangles (); +01449 } +01450 } +01451 <span class="keywordflow">return</span> (<span class="keywordtype">float</span>)triCount; +01452 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz413_4" doxytag="NL3D::CMeshGeom::getRdrPassMaterial" ></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="a04558.html#a11">uint32</a> NL3D::CMeshGeom::getRdrPassMaterial </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>matrixBlockIndex</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>renderingPassIndex</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +get the material ID associated with a rendering pass of a matrix block <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>matrixBlockIndex</em> </td><td>the index of the matrix block the renderin pass belong to </td></tr> + <tr><td valign=top><em>renderingPassIndex</em> </td><td>the index of the rendering pass in the matrix block</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05990.html#l00413">413</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +Referenced by <a class="el" href="a06768.html#l01717">NL3D::CZoneLighter::addTriangles()</a>, <a class="el" href="a05567.html#l00070">NL3D::CCoarseMeshBuild::buildBitmap()</a>, <a class="el" href="a05989.html#l02452">NL3D::CMesh::getRdrPassMaterial()</a>, and <a class="el" href="a05567.html#l00430">NL3D::CCoarseMeshBuild::remapCoordinates()</a>. +<p> +<div class="fragment"><pre>00414 { +00415 <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[matrixBlockIndex].RdrPass[renderingPassIndex].MaterialId ; +00416 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz413_5" doxytag="NL3D::CMeshGeom::getRdrPassPrimitiveBlock" ></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="a03105.html">CPrimitiveBlock</a>& NL3D::CMeshGeom::getRdrPassPrimitiveBlock </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>matrixBlockIndex</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>renderingPassIndex</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const<code> [inline]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +get the primitive block associated with a rendering pass of a matrix block <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>matrixBlockIndex</em> </td><td>the index of the matrix block the renderin pass belong to </td></tr> + <tr><td valign=top><em>renderingPassIndex</em> </td><td>the index of the rendering pass in the matrix block</td></tr> + </table> +</dl> + +<p> +Definition at line <a class="el" href="a05990.html#l00404">404</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06768.html#l01717">NL3D::CZoneLighter::addTriangles()</a>, <a class="el" href="a05824.html#l00179">NL3D::CInstanceLighter::addTriangles()</a>, <a class="el" href="a06016.html#l00765">NL3D::CMeshMultiLod::compileCoarseMeshes()</a>, <a class="el" href="a06626.html#l00053">NL3D::UShape::getMeshTriangles()</a>, <a class="el" href="a05989.html#l02447">NL3D::CMesh::getRdrPassPrimitiveBlock()</a>, and <a class="el" href="a05567.html#l00430">NL3D::CCoarseMeshBuild::remapCoordinates()</a>. +<p> +<div class="fragment"><pre>00405 { +00406 <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[matrixBlockIndex].RdrPass[renderingPassIndex].PBlock ; +00407 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz415_1" doxytag="NL3D::CMeshGeom::getSkinBoneUsage" ></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 std::vector<<a class="el" href="a04558.html#a10">sint32</a>>& NL3D::CMeshGeom::getSkinBoneUsage </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 array of bones used by the skin. computeBonesId must has been called before. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00440">440</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +References <a class="el" href="a05990.html#l00676">_BonesId</a>. +<p> +Referenced by <a class="el" href="a06001.html#l00099">NL3D::CMeshInstance::getSkinBoneUsage()</a>. +<p> +<div class="fragment"><pre>00440 {<span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr3">_BonesId</a>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz417_6" doxytag="NL3D::CMeshGeom::getVBHeapInfo" ></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"> bool NL3D::CMeshGeom::getVBHeapInfo </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a04558.html#a15">uint</a> & </td> + <td class="mdname" nowrap> <em>vertexFormat</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> & </td> + <td class="mdname" nowrap> <em>numVertices</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The framework call this method to know if the mesh can fit in VBHeap. if yes, deriver must return mesh vertexFormat and num of vertices. +<p> +Reimplemented from <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_6">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l02114">2114</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>, <a class="el" href="a05990.html#l00705">_SupportMBRFlags</a>, <a class="el" href="a06711.html#l00453">NL3D::CVertexBuffer::getNumVertices()</a>, <a class="el" href="a06711.html#l00319">NL3D::CVertexBuffer::getVertexFormat()</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +<div class="fragment"><pre>02115 { +02116 <span class="comment">// CMeshGeom support VBHeap rendering, assuming supportMeshBlockRendering is true.</span> +02117 <span class="keywordflow">if</span>( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a> ) +02118 <span class="comment">/* Yoyo: If VertexProgram, DON'T SUPPORT!! because VB need to be activated AFTER meshVP activation</span> +02119 <span class="comment"> NB: still possible with complex code to do it (sort per VP type (with or not)...), but tests in Ryzom</span> +02120 <span class="comment"> shows that VBHeap is not really important (not so much different shapes...)</span> +02121 <span class="comment"> */</span> +02122 <span class="keywordflow">if</span>( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>==NULL ) +02123 { +02124 vertexFormat= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexFormat(); +02125 numVertices= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumVertices(); +02126 <span class="keywordflow">return</span> <span class="keyword">true</span>; +02127 } +02128 +02129 <span class="keywordflow">return</span> <span class="keyword">false</span>; +02130 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz413_6" doxytag="NL3D::CMeshGeom::getVertexBuffer" ></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="a03692.html">CVertexBuffer</a>& NL3D::CMeshGeom::getVertexBuffer </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> +get the vertex buffer used by the mesh +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00390">390</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a06768.html#l01717">NL3D::CZoneLighter::addTriangles()</a>, <a class="el" href="a05824.html#l00179">NL3D::CInstanceLighter::addTriangles()</a>, <a class="el" href="a06626.html#l00053">NL3D::UShape::getMeshTriangles()</a>, <a class="el" href="a05989.html#l02432">NL3D::CMesh::getVertexBuffer()</a>, <a class="el" href="a06016.html#l00740">NL3D::CMeshMultiLod::instanciateCoarseMeshSpace()</a>, <a class="el" href="a05567.html#l00430">NL3D::CCoarseMeshBuild::remapCoordinates()</a>, <a class="el" href="a06016.html#l00496">NL3D::CMeshMultiLod::renderCoarseMesh()</a>, <a class="el" href="a06018.html#l00280">NL3D::CMeshMultiLodInstance::setPosCoarseMesh()</a>, and <a class="el" href="a06018.html#l00249">NL3D::CMeshMultiLodInstance::setUVCoarseMesh()</a>. +<p> +<div class="fragment"><pre>00390 { <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a> ; } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeoma4" doxytag="NL3D::CMeshGeom::hasMeshVertexProgram" ></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 bool NL3D::CMeshGeom::hasMeshVertexProgram </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> +True if this mesh has a vertexProgram. +<p> + +<p> +Reimplemented from <a class="el" href="a02879.html#NL3D_1_1IMeshGeoma2">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05990.html#l00478">478</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +References <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>. +<p> +Referenced by <a class="el" href="a06001.html#l00144">NL3D::CMeshInstance::initRenderFilterType()</a>. +<p> +<div class="fragment"><pre>00478 {<span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>!=NULL;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz411_2" doxytag="NL3D::CMeshGeom::initInstance" ></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::CMeshGeom::initInstance </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02873.html">CMeshBaseInstance</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>mbi</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Init instance info. +<p> + +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeoma4">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l00474">474</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02357">NL3D::CMesh::createInstance()</a>. +<p> +<div class="fragment"><pre>00475 { +00476 <span class="comment">// init the instance with _MeshVertexProgram infos</span> +00477 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>) +00478 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->initInstance(mbi); +00479 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1IMeshGeomz457_7" doxytag="NL3D::CMeshGeom::isActiveInstanceNeedVBFill" ></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 bool NL3D::IMeshGeom::isActiveInstanceNeedVBFill </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, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Return true if the meshGeom has to Fill some Vertices at <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_0">activeInstance()</a> time if VBHeap enabled at this time, then vbDst in activeInstance(,,,vbDst) will contains the vb to write to. +<p> +Reimplemented in <a class="el" href="a02892.html#NL3D_1_1CMeshMRMGeomz475_7">NL3D::CMeshMRMGeom</a>. +<p> +Definition at line <a class="el" href="a06000.html#l00212">212</a> of file <a class="el" href="a06000.html">mesh_geom.h</a>. +<p> +Referenced by <a class="el" href="a05997.html#l00177">NL3D::CMeshBlockManager::render()</a>. +<p> +<div class="fragment"><pre>00212 {<span class="keywordflow">return</span> <span class="keyword">false</span>;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1IMeshGeomz457_8" doxytag="NL3D::CMeshGeom::isMeshInVBHeap" ></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"> bool NL3D::IMeshGeom::isMeshInVBHeap </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, inherited]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Return true if the meshGeom has to Fill some Vertices at <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_0">activeInstance()</a> time if VBHeap enabled at this time, then vbDst in activeInstance(,,,vbDst) will contains the vb to write to. +<p> +Definition at line <a class="el" href="a06000.html#l00215">215</a> of file <a class="el" href="a06000.html">mesh_geom.h</a>. +<p> +References <a class="el" href="a06000.html#l00233">NL3D::IMeshGeom::_MeshVBHeapId</a>. +<p> +Referenced by <a class="el" href="a06005.html#l02600">NL3D::CMeshMRMGeom::profileSceneRender()</a>, and <a class="el" href="a05989.html#l01932">profileSceneRender()</a>. +<p> +<div class="fragment"><pre>00215 {<span class="keywordflow">return</span> _MeshVBHeapId!=0;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz415_2" doxytag="NL3D::CMeshGeom::isSkinned" ></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"> bool NL3D::CMeshGeom::isSkinned </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 true if the mesh is skinned, else return false. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00428">428</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +References <a class="el" href="a05990.html#l00664">_Skinned</a>. +<p> +Referenced by <a class="el" href="a06001.html#l00113">NL3D::CMeshInstance::isSkinnable()</a>. +<p> +<div class="fragment"><pre>00429 { +00430 <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>; +00431 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz411_3" doxytag="NL3D::CMeshGeom::NLMISC_DECLARE_CLASS" ></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::CMeshGeom::NLMISC_DECLARE_CLASS </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02878.html">CMeshGeom</a> </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> +clip this mesh +<p> + </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomd2" doxytag="NL3D::CMeshGeom::optimizeTriangleOrder" ></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::CMeshGeom::optimizeTriangleOrder </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> [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="a05989.html#l00153">153</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a06473.html#l00196">NL3D::CStripifier::optimizeTriangles()</a>, <a class="el" href="a05990.html#l00490">NL3D::CMeshGeom::CRdrPass::PBlock</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00172">build()</a>. +<p> +<div class="fragment"><pre>00154 { +00155 CStripifier stripifier; +00156 +00157 <span class="comment">// for all rdrpass of all matrix blocks.</span> +00158 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> mb= 0;mb<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size();mb++) +00159 { +00160 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> rp=0; rp<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb].RdrPass.size(); rp++ ) +00161 { +00162 <span class="comment">// stripify list of triangles of this pass.</span> +00163 CRdrPass &pass= _MatrixBlocks[mb].RdrPass[rp]; +00164 stripifier.optimizeTriangles(pass.PBlock, pass.PBlock); +00165 } +00166 } +00167 +00168 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz411_4" doxytag="NL3D::CMeshGeom::profileSceneRender" ></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::CMeshGeom::profileSceneRender </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a03325.html">CRenderTrav</a> * </td> + <td class="mdname" nowrap> <em>rdrTrav</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02537.html">CTransformShape</a> * </td> + <td class="mdname" nowrap> <em>trans</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>polygonCount</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a> </td> + <td class="mdname" nowrap> <em>rdrFlags</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +clip this mesh +<p> + +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeoma5">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l01932">1932</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05990.html#l00684">_VertexBufferHard</a>, <a class="el" href="a06349.html#l00531">NL3D::CScene::BenchRes</a>, <a class="el" href="a06198.html#l00108">NL3D::CPrimitiveBlock::getNumTri()</a>, <a class="el" href="a06711.html#l00319">NL3D::CVertexBuffer::getVertexFormat()</a>, <a class="el" href="a06349.html#l00533">NL3D::CScene::incrementProfileTriVBFormat()</a>, <a class="el" href="a06000.html#l00215">NL3D::IMeshGeom::isMeshInVBHeap()</a>, <a class="el" href="a05990.html#l00488">NL3D::CMeshGeom::CRdrPass::MaterialId</a>, <a class="el" href="a05994.html#l00075">NL3D::CMeshBaseInstance::Materials</a>, <a class="el" href="a06625.html#l00491">NL3D::UScene::CBenchResults::MeshProfileTriVBFormat</a>, <a class="el" href="a06625.html#l00493">NL3D::UScene::CBenchResults::NumMeshRdrBlock</a>, <a class="el" href="a06625.html#l00494">NL3D::UScene::CBenchResults::NumMeshRdrBlockWithVBHeap</a>, <a class="el" href="a06625.html#l00492">NL3D::UScene::CBenchResults::NumMeshRdrNormal</a>, <a class="el" href="a06625.html#l00496">NL3D::UScene::CBenchResults::NumMeshTriRdrBlock</a>, <a class="el" href="a06625.html#l00497">NL3D::UScene::CBenchResults::NumMeshTriRdrBlockWithVBHeap</a>, <a class="el" href="a06625.html#l00495">NL3D::UScene::CBenchResults::NumMeshTriRdrNormal</a>, <a class="el" href="a06625.html#l00505">NL3D::UScene::CBenchResults::NumMeshVBufferHard</a>, <a class="el" href="a06625.html#l00504">NL3D::UScene::CBenchResults::NumMeshVBufferStd</a>, <a class="el" href="a05990.html#l00490">NL3D::CMeshGeom::CRdrPass::PBlock</a>, <a class="el" href="a05990.html#l00516">NL3D::CMeshGeom::CMatrixBlock::RdrPass</a>, <a class="el" href="a06583.html#l00055">NL3D::CTraversal::Scene</a>, <a class="el" href="a05989.html#l02000">supportMeshBlockRendering()</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05981.html#l00100">uint32</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02497">NL3D::CMesh::profileSceneRender()</a>. +<p> +<div class="fragment"><pre>01933 { +01934 <span class="comment">// get the mesh instance.</span> +01935 CMeshBaseInstance *mi= safe_cast<CMeshBaseInstance*>(trans); +01936 +01937 <span class="comment">// For all _MatrixBlocks</span> +01938 <a class="code" href="a04558.html#a15">uint</a> triCount= 0; +01939 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> mb=0;mb<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size();mb++) +01940 { +01941 CMatrixBlock &mBlock= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb]; +01942 +01943 <span class="comment">// Profile all pass.</span> +01944 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0;i<mBlock.RdrPass.size();i++) +01945 { +01946 CRdrPass &rdrPass= mBlock.RdrPass[i]; +01947 <span class="comment">// Profile with the Materials of the MeshInstance.</span> +01948 <span class="keywordflow">if</span> ( ( (mi->Materials[rdrPass.MaterialId].getBlend() == <span class="keyword">false</span>) && (rdrFlags & IMeshGeom::RenderOpaqueMaterial) ) || +01949 ( (mi->Materials[rdrPass.MaterialId].getBlend() == <span class="keyword">true</span>) && (rdrFlags & IMeshGeom::RenderTransparentMaterial) ) ) +01950 { +01951 triCount+= rdrPass.PBlock.getNumTri(); +01952 } +01953 } +01954 } +01955 +01956 <span class="comment">// Profile</span> +01957 <span class="keywordflow">if</span>(triCount) +01958 { +01959 <span class="comment">// tri per VBFormat</span> +01960 rdrTrav->Scene->incrementProfileTriVBFormat(rdrTrav->Scene->BenchRes.MeshProfileTriVBFormat, +01961 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexFormat(), triCount); +01962 +01963 <span class="comment">// VBHard</span> +01964 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>) +01965 rdrTrav->Scene->BenchRes.NumMeshVBufferHard++; +01966 <span class="keywordflow">else</span> +01967 rdrTrav->Scene->BenchRes.NumMeshVBufferStd++; +01968 +01969 <span class="comment">// rendered in BlockRendering, only if not transparent pass (known it if RenderTransparentMaterial is set)</span> +01970 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz417_9">supportMeshBlockRendering</a>() && (rdrFlags & IMeshGeom::RenderTransparentMaterial)==0 ) +01971 { +01972 <span class="keywordflow">if</span>(<a class="code" href="a02879.html#NL3D_1_1IMeshGeomz457_8">isMeshInVBHeap</a>()) +01973 { +01974 rdrTrav->Scene->BenchRes.NumMeshRdrBlockWithVBHeap++; +01975 rdrTrav->Scene->BenchRes.NumMeshTriRdrBlockWithVBHeap+= triCount; +01976 } +01977 <span class="keywordflow">else</span> +01978 { +01979 rdrTrav->Scene->BenchRes.NumMeshRdrBlock++; +01980 rdrTrav->Scene->BenchRes.NumMeshTriRdrBlock+= triCount; +01981 } +01982 } +01983 <span class="keywordflow">else</span> +01984 { +01985 rdrTrav->Scene->BenchRes.NumMeshRdrNormal++; +01986 rdrTrav->Scene->BenchRes.NumMeshTriRdrNormal+= triCount; +01987 } +01988 } +01989 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz411_5" doxytag="NL3D::CMeshGeom::render" ></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::CMeshGeom::render </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02434.html">IDriver</a> * </td> + <td class="mdname" nowrap> <em>drv</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02537.html">CTransformShape</a> * </td> + <td class="mdname" nowrap> <em>trans</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>polygonCount</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a11">uint32</a> </td> + <td class="mdname" nowrap> <em>rdrFlags</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>globalAlpha</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +<a class="el" href="a02878.html#NL3D_1_1CMeshGeomz411_5">render()</a> this mesh in a driver. +<p> + +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeoma6">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l00598">598</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05990.html#l00712">_MeshMorpher</a>, <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>, <a class="el" href="a05990.html#l00652">_OriginalSkinNormals</a>, <a class="el" href="a05990.html#l00666">_OriginalSkinRestored</a>, <a class="el" href="a05990.html#l00651">_OriginalSkinVertices</a>, <a class="el" href="a05990.html#l00653">_OriginalTGSpace</a>, <a class="el" href="a05990.html#l00664">_Skinned</a>, <a class="el" href="a05990.html#l00658">_VBufferOri</a>, <a class="el" href="a05990.html#l00684">_VertexBufferHard</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera2">NL3D::IDriver::activeVertexBuffer()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera3">NL3D::IDriver::activeVertexBufferHard()</a>, <a class="el" href="a06004.html#l00077">NL3D::CMeshMorpher::BlendShapes</a>, <a class="el" href="a06583.html#l00079">NL3D::CTravCameraScene::CamPos</a>, <a class="el" href="a05994.html#l00129">NL3D::CMeshBaseInstance::getBlendShapeFactors()</a>, <a class="el" href="a06569.html#l00105">NL3D::CTransform::getOwnerScene()</a>, <a class="el" href="a06349.html#l00479">NL3D::CScene::getRenderTrav()</a>, <a class="el" href="a06569.html#l00205">NL3D::CTransform::getSkeletonModel()</a>, <a class="el" href="a06569.html#l00299">NL3D::CTransform::getWorldMatrix()</a>, <a class="el" href="a05788.html#l00056">H_AUTO</a>, <a class="el" href="a06003.html#l00073">NL3D::CMeshMorpher::init()</a>, <a class="el" href="a06003.html#l00082">NL3D::CMeshMorpher::initSkinned()</a>, <a class="el" href="a05972.html#l01090">NLMISC::CMatrix::inverted()</a>, <a class="el" href="a06569.html#l00423">NL3D::CTransform::isSkinned()</a>, <a class="el" href="a05990.html#l00488">NL3D::CMeshGeom::CRdrPass::MaterialId</a>, <a class="el" href="a05994.html#l00075">NL3D::CMeshBaseInstance::Materials</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05701.html#l00125">NLMISC::OptFastFloor()</a>, <a class="el" href="a05990.html#l00490">NL3D::CMeshGeom::CRdrPass::PBlock</a>, <a class="el" href="a05995.html#l00037">NL3D::CMeshBlender::prepareRenderForGlobalAlpha()</a>, <a class="el" href="a05990.html#l00516">NL3D::CMeshGeom::CMatrixBlock::RdrPass</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera51">NL3D::IDriver::render()</a>, <a class="el" href="a05989.html#l01663">restoreOriginalSkinVertices()</a>, <a class="el" href="a05995.html#l00099">NL3D::CMeshBlender::restoreRender()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera68">NL3D::IDriver::setupModelMatrix()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a05981.html#l00100">uint32</a>, <a class="el" href="a05981.html#l00096">uint8</a>, <a class="el" href="a06003.html#l00103">NL3D::CMeshMorpher::update()</a>, <a class="el" href="a06003.html#l00236">NL3D::CMeshMorpher::updateSkinned()</a>, and <a class="el" href="a05989.html#l00523">updateVertexBufferHard()</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02386">NL3D::CMesh::render()</a>. +<p> +<div class="fragment"><pre>00599 { +00600 <a class="code" href="a04199.html#a6">nlassert</a>(drv); +00601 <span class="comment">// get the mesh instance.</span> +00602 CMeshBaseInstance *mi= safe_cast<CMeshBaseInstance*>(trans); +00603 <span class="comment">// get a ptr on scene</span> +00604 CScene *ownerScene= mi->getOwnerScene(); +00605 <span class="comment">// get a ptr on renderTrav</span> +00606 CRenderTrav *renderTrav= &ownerScene->getRenderTrav(); +00607 +00608 <span class="comment">// update the VBufferHard (create/delete), to maybe render in AGP memory.</span> +00609 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_0">updateVertexBufferHard</a> (drv); +00610 <span class="comment">/* currentVBHard is NULL if must disable it temporarily</span> +00611 <span class="comment"> For now, never disable it, but switch of VBHard may be VERY EXPENSIVE if NV_vertex_array_range2 is not</span> +00612 <span class="comment"> supported (old drivers).</span> +00613 <span class="comment"> */</span> +00614 IVertexBufferHard *currentVBHard= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>; +00615 +00616 +00617 <span class="comment">// get the skeleton model to which I am binded (else NULL).</span> +00618 CSkeletonModel *skeleton; +00619 skeleton= mi->getSkeletonModel(); +00620 <span class="comment">// The mesh must not be skinned for render()</span> +00621 <a class="code" href="a04199.html#a6">nlassert</a>(!(_Skinned && mi->isSkinned() && skeleton)); +00622 <span class="keywordtype">bool</span> bMorphApplied = <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->BlendShapes.size() > 0; +00623 <span class="keywordtype">bool</span> useTangentSpace = <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a> && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->needTangentSpace(); +00624 +00625 +00626 <span class="comment">// Profiling</span> +00627 <span class="comment">//===========</span> +00628 <a class="code" href="a04365.html#a4">H_AUTO</a>( NL3D_MeshGeom_RenderNormal ); +00629 +00630 +00631 <span class="comment">// Morphing</span> +00632 <span class="comment">// ========</span> +00633 <span class="keywordflow">if</span> (bMorphApplied) +00634 { +00635 <span class="comment">// If _Skinned (NB: the skin is not applied) and if lod.OriginalSkinRestored, then restoreOriginalSkinPart is</span> +00636 <span class="comment">// not called but mush morpher write changed vertices into VBHard so its ok. The unchanged vertices</span> +00637 <span class="comment">// are written in the preceding call to restoreOriginalSkinPart.</span> +00638 <span class="keywordflow">if</span> (<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>) +00639 { +00640 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->initSkinned(&_VBufferOri, +00641 &_VBuffer, +00642 currentVBHard, +00643 useTangentSpace, +00644 &_OriginalSkinVertices, +00645 &_OriginalSkinNormals, +00646 useTangentSpace ? &_OriginalTGSpace : NULL, +00647 <span class="keyword">false</span> ); +00648 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->updateSkinned (mi->getBlendShapeFactors()); +00649 } +00650 <span class="keywordflow">else</span> <span class="comment">// Not even skinned so we have to do all the stuff</span> +00651 { +00652 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->init(&_VBufferOri, +00653 &_VBuffer, +00654 currentVBHard, +00655 useTangentSpace); +00656 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->update (mi->getBlendShapeFactors()); +00657 } +00658 } +00659 +00660 +00661 <span class="comment">// Skinning</span> +00662 <span class="comment">// ========</span> +00663 +00664 <span class="comment">// else setup instance matrix</span> +00665 drv->setupModelMatrix(trans->getWorldMatrix()); +00666 +00667 +00668 <span class="comment">// since instance skin is invalid but mesh is skinned , we must copy vertices/normals from original vertices.</span> +00669 <span class="keywordflow">if</span> (<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a>) +00670 { +00671 <span class="comment">// do it for this Lod only, and if cache say it is necessary.</span> +00672 <span class="keywordflow">if</span> (!<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr10">_OriginalSkinRestored</a>) +00673 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_9">restoreOriginalSkinVertices</a>(); +00674 } +00675 +00676 +00677 <span class="comment">// Setup meshVertexProgram</span> +00678 <span class="comment">//===========</span> +00679 +00680 <span class="comment">// use MeshVertexProgram effect?</span> +00681 <span class="keywordtype">bool</span> useMeshVP= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a> != NULL; +00682 <span class="keywordflow">if</span>( useMeshVP ) +00683 { +00684 CMatrix invertedObjectMatrix; +00685 invertedObjectMatrix = trans->getWorldMatrix().inverted(); +00686 <span class="comment">// really ok if success to begin VP</span> +00687 useMeshVP= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->begin(drv, ownerScene, mi, invertedObjectMatrix, renderTrav->CamPos); +00688 } +00689 +00690 +00691 <span class="comment">// Render the mesh.</span> +00692 <span class="comment">//===========</span> +00693 <span class="comment">// active VB.</span> +00694 <span class="keywordflow">if</span>(currentVBHard != NULL) +00695 drv->activeVertexBufferHard(currentVBHard); +00696 <span class="keywordflow">else</span> +00697 drv->activeVertexBuffer(_VBuffer); +00698 +00699 +00700 <span class="comment">// Global alpha used ?</span> +00701 <a class="code" href="a04558.html#a11">uint32</a> globalAlphaUsed= rdrFlags & IMeshGeom::RenderGlobalAlpha; +00702 <a class="code" href="a04558.html#a7">uint8</a> globalAlphaInt=(<a class="code" href="a04558.html#a7">uint8</a>)<a class="code" href="a05378.html#a397">NLMISC::OptFastFloor</a>(globalAlpha*255); +00703 +00704 +00705 <span class="comment">// For all _MatrixBlocks</span> +00706 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> mb=0;mb<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size();mb++) +00707 { +00708 CMatrixBlock &mBlock= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb]; +00709 <span class="keywordflow">if</span>(mBlock.RdrPass.size()==0) +00710 <span class="keywordflow">continue</span>; +00711 +00712 <span class="comment">// Global alpha ?</span> +00713 <span class="keywordflow">if</span> (globalAlphaUsed) +00714 { +00715 <span class="keywordtype">bool</span> gaDisableZWrite= (rdrFlags & IMeshGeom::RenderGADisableZWrite)?<span class="keyword">true</span>:<span class="keyword">false</span>; +00716 +00717 <span class="comment">// Render all pass.</span> +00718 <span class="keywordflow">for</span> (<a class="code" href="a04558.html#a15">uint</a> i=0;i<mBlock.RdrPass.size();i++) +00719 { +00720 CRdrPass &rdrPass= mBlock.RdrPass[i]; +00721 <span class="comment">// Render with the Materials of the MeshInstance.</span> +00722 <span class="keywordflow">if</span> ( ( (mi->Materials[rdrPass.MaterialId].getBlend() == <span class="keyword">false</span>) && (rdrFlags & IMeshGeom::RenderOpaqueMaterial) ) || +00723 ( (mi->Materials[rdrPass.MaterialId].getBlend() == <span class="keyword">true</span>) && (rdrFlags & IMeshGeom::RenderTransparentMaterial) ) ) +00724 { +00725 <span class="comment">// CMaterial Ref</span> +00726 CMaterial &material=mi->Materials[rdrPass.MaterialId]; +00727 +00728 <span class="comment">// Use a MeshBlender to modify material and driver.</span> +00729 CMeshBlender blender; +00730 blender.prepareRenderForGlobalAlpha(material, drv, globalAlpha, globalAlphaInt, gaDisableZWrite); +00731 +00732 <span class="comment">// Setup VP material</span> +00733 <span class="keywordflow">if</span> (useMeshVP) +00734 { +00735 <span class="keywordflow">if</span>(currentVBHard) +00736 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->setupForMaterial(material, drv, ownerScene, currentVBHard); +00737 <span class="keywordflow">else</span> +00738 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->setupForMaterial(material, drv, ownerScene, &_VBuffer); +00739 } +00740 +00741 <span class="comment">// Render</span> +00742 drv->render(rdrPass.PBlock, material); +00743 +00744 <span class="comment">// Resetup material/driver</span> +00745 blender.restoreRender(material, drv, gaDisableZWrite); +00746 } +00747 } +00748 } +00749 <span class="keywordflow">else</span> +00750 { +00751 <span class="comment">// Render all pass.</span> +00752 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i<mBlock.RdrPass.size();i++) +00753 { +00754 CRdrPass &rdrPass= mBlock.RdrPass[i]; +00755 <span class="comment">// Render with the Materials of the MeshInstance.</span> +00756 <span class="keywordflow">if</span>( ( (mi->Materials[rdrPass.MaterialId].getBlend() == <span class="keyword">false</span>) && (rdrFlags & IMeshGeom::RenderOpaqueMaterial) ) || +00757 ( (mi->Materials[rdrPass.MaterialId].getBlend() == <span class="keyword">true</span>) && (rdrFlags & IMeshGeom::RenderTransparentMaterial) ) ) +00758 { +00759 <span class="comment">// CMaterial Ref</span> +00760 CMaterial &material=mi->Materials[rdrPass.MaterialId]; +00761 +00762 <span class="comment">// Setup VP material</span> +00763 <span class="keywordflow">if</span> (useMeshVP) +00764 { +00765 <span class="keywordflow">if</span>(currentVBHard) +00766 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->setupForMaterial(material, drv, ownerScene, currentVBHard); +00767 <span class="keywordflow">else</span> +00768 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->setupForMaterial(material, drv, ownerScene, &_VBuffer); +00769 } +00770 +00771 <span class="comment">// render primitives</span> +00772 drv->render(rdrPass.PBlock, material); +00773 } +00774 } +00775 } +00776 } +00777 +00778 <span class="comment">// End VertexProgram effect</span> +00779 <span class="keywordflow">if</span>(useMeshVP) +00780 { +00781 <span class="comment">// Apply it.</span> +00782 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->end(drv); +00783 } +00784 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz417_7" doxytag="NL3D::CMeshGeom::renderPass" ></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::CMeshGeom::renderPass </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02887.html">CMeshGeomRenderContext</a> & </td> + <td class="mdname" nowrap> <em>rdrCtx</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02873.html">CMeshBaseInstance</a> * </td> + <td class="mdname" nowrap> <em>inst</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>polygonCount</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a04558.html#a15">uint</a> </td> + <td class="mdname" nowrap> <em>rdrPass</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The framework call this method to render the current renderPass, with the current instance NB: if the material is blended, DON'T render it!! +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_9">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l02075">2075</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05990.html#l00705">_SupportMBRFlags</a>, <a class="el" href="a06329.html#l00653">NL3D::CRenderTrav::changeVPLightSetupMaterial()</a>, <a class="el" href="a06000.html#l00062">NL3D::CMeshGeomRenderContext::Driver</a>, <a class="el" href="a05990.html#l00488">NL3D::CMeshGeom::CRdrPass::MaterialId</a>, <a class="el" href="a05994.html#l00075">NL3D::CMeshBaseInstance::Materials</a>, <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a>, <a class="el" href="a05990.html#l00490">NL3D::CMeshGeom::CRdrPass::PBlock</a>, <a class="el" href="a05990.html#l00516">NL3D::CMeshGeom::CMatrixBlock::RdrPass</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera51">NL3D::IDriver::render()</a>, <a class="el" href="a06000.html#l00066">NL3D::CMeshGeomRenderContext::RenderThroughVBHeap</a>, <a class="el" href="a06000.html#l00064">NL3D::CMeshGeomRenderContext::RenderTrav</a>, <a class="el" href="a05981.html#l00105">uint</a>, and <a class="el" href="a05990.html#l00493">NL3D::CMeshGeom::CRdrPass::VBHeapPBlock</a>. +<p> +<div class="fragment"><pre>02076 { +02077 CMatrixBlock &mBlock= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[0]; +02078 +02079 CRdrPass &rdrPass= mBlock.RdrPass[rdrPassId]; +02080 <span class="comment">// Render with the Materials of the MeshInstance, only if not blended.</span> +02081 <span class="keywordflow">if</span>( ( (mi->Materials[rdrPass.MaterialId].getBlend() == <span class="keyword">false</span>) ) ) +02082 { +02083 CMaterial &material= mi->Materials[rdrPass.MaterialId]; +02084 +02085 <span class="comment">// MeshVertexProgram ?</span> +02086 <span class="keywordflow">if</span>( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a> & <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy2">MBRCurrentUseVP</a> ) +02087 { +02088 rdrCtx.RenderTrav->changeVPLightSetupMaterial(material, <span class="keyword">false</span>); +02089 } +02090 +02091 <span class="keywordflow">if</span>(rdrCtx.RenderThroughVBHeap) +02092 <span class="comment">// render shifted primitives</span> +02093 rdrCtx.Driver->render(rdrPass.VBHeapPBlock, material); +02094 <span class="keywordflow">else</span> +02095 <span class="comment">// render primitives</span> +02096 rdrCtx.Driver->render(rdrPass.PBlock, material); +02097 } +02098 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeoma5" doxytag="NL3D::CMeshGeom::renderSimpleWithMaterial" ></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::CMeshGeom::renderSimpleWithMaterial </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02434.html">IDriver</a> * </td> + <td class="mdname" nowrap> <em>drv</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>const <a class="el" href="a02851.html">CMatrix</a> & </td> + <td class="mdname" nowrap> <em>worldMatrix</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap><a class="el" href="a02839.html">CMaterial</a> & </td> + <td class="mdname" nowrap> <em>mat</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> +render the mesh geometry with a single material. Render is said "Simple" because no special features are used:<ul> +<li>mesh is rendered without VertexProgram (if it has one).</li><li>mesh is rendered without Skinning.</li><li>mesh is rendered without use of VertexBufferHard.</li><li>mesh is rendered without MeshMorpher.</li><li>.....</li></ul> + +<p> +Definition at line <a class="el" href="a05989.html#l00915">915</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera2">NL3D::IDriver::activeVertexBuffer()</a>, <a class="el" href="a05788.html#l00056">H_AUTO</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05990.html#l00490">NL3D::CMeshGeom::CRdrPass::PBlock</a>, <a class="el" href="a05990.html#l00516">NL3D::CMeshGeom::CMatrixBlock::RdrPass</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera51">NL3D::IDriver::render()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera68">NL3D::IDriver::setupModelMatrix()</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a06016.html#l00446">NL3D::CMeshMultiLod::renderMeshGeom()</a>. +<p> +<div class="fragment"><pre>00916 { +00917 <a class="code" href="a04365.html#a4">H_AUTO</a>( NL3D_MeshGeom_RenderSimpleWithMaterial ); +00918 +00919 <a class="code" href="a04199.html#a6">nlassert</a>(drv); +00920 +00921 <span class="comment">// setup matrix</span> +00922 drv->setupModelMatrix(worldMatrix); +00923 +00924 <span class="comment">// Active simple VB.</span> +00925 drv->activeVertexBuffer(_VBuffer); +00926 +00927 <span class="comment">// For all _MatrixBlocks</span> +00928 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> mb=0;mb<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size();mb++) +00929 { +00930 CMatrixBlock &mBlock= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb]; +00931 <span class="keywordflow">if</span>(mBlock.RdrPass.size()==0) +00932 <span class="keywordflow">continue</span>; +00933 +00934 <span class="comment">// Render all pass.</span> +00935 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i<mBlock.RdrPass.size();i++) +00936 { +00937 CRdrPass &rdrPass= mBlock.RdrPass[i]; +00938 +00939 <span class="comment">// render primitives</span> +00940 drv->render(rdrPass.PBlock, mat); +00941 } +00942 } +00943 +00944 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz411_6" doxytag="NL3D::CMeshGeom::renderSkin" ></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::CMeshGeom::renderSkin </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02537.html">CTransformShape</a> * </td> + <td class="mdname" nowrap> <em>trans</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>float </td> + <td class="mdname" nowrap> <em>alphaMRM</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"><code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +<a class="el" href="a02878.html#NL3D_1_1CMeshGeomz411_5">render()</a> this mesh as a skin +<p> + +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeoma7">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l00788">788</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00660">_MatrixBlocks</a>, <a class="el" href="a05990.html#l00712">_MeshMorpher</a>, <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>, <a class="el" href="a05990.html#l00652">_OriginalSkinNormals</a>, <a class="el" href="a05990.html#l00651">_OriginalSkinVertices</a>, <a class="el" href="a05990.html#l00653">_OriginalTGSpace</a>, <a class="el" href="a05990.html#l00664">_Skinned</a>, <a class="el" href="a05990.html#l00658">_VBufferOri</a>, <a class="el" href="a05990.html#l00684">_VertexBufferHard</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera2">NL3D::IDriver::activeVertexBuffer()</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera3">NL3D::IDriver::activeVertexBufferHard()</a>, <a class="el" href="a05989.html#l01715">applySkin()</a>, <a class="el" href="a06004.html#l00077">NL3D::CMeshMorpher::BlendShapes</a>, <a class="el" href="a06583.html#l00079">NL3D::CTravCameraScene::CamPos</a>, <a class="el" href="a05994.html#l00129">NL3D::CMeshBaseInstance::getBlendShapeFactors()</a>, <a class="el" href="a06330.html#l00133">NL3D::CRenderTrav::getDriver()</a>, <a class="el" href="a06569.html#l00105">NL3D::CTransform::getOwnerScene()</a>, <a class="el" href="a06349.html#l00479">NL3D::CScene::getRenderTrav()</a>, <a class="el" href="a06569.html#l00205">NL3D::CTransform::getSkeletonModel()</a>, <a class="el" href="a06569.html#l00299">NL3D::CTransform::getWorldMatrix()</a>, <a class="el" href="a05788.html#l00056">H_AUTO</a>, <a class="el" href="a06003.html#l00082">NL3D::CMeshMorpher::initSkinned()</a>, <a class="el" href="a05972.html#l01090">NLMISC::CMatrix::inverted()</a>, <a class="el" href="a06569.html#l00423">NL3D::CTransform::isSkinned()</a>, <a class="el" href="a05990.html#l00488">NL3D::CMeshGeom::CRdrPass::MaterialId</a>, <a class="el" href="a05994.html#l00075">NL3D::CMeshBaseInstance::Materials</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a05990.html#l00490">NL3D::CMeshGeom::CRdrPass::PBlock</a>, <a class="el" href="a05990.html#l00516">NL3D::CMeshGeom::CMatrixBlock::RdrPass</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera51">NL3D::IDriver::render()</a>, <a class="el" href="a05981.html#l00105">uint</a>, <a class="el" href="a06003.html#l00236">NL3D::CMeshMorpher::updateSkinned()</a>, and <a class="el" href="a05989.html#l00523">updateVertexBufferHard()</a>. +<p> +Referenced by <a class="el" href="a06001.html#l00127">NL3D::CMeshInstance::renderSkin()</a>. +<p> +<div class="fragment"><pre>00789 { +00790 <span class="comment">// get the mesh instance.</span> +00791 CMeshBaseInstance *mi= safe_cast<CMeshBaseInstance*>(trans); +00792 <span class="comment">// get a ptr on scene</span> +00793 CScene *ownerScene= mi->getOwnerScene(); +00794 <span class="comment">// get a ptr on renderTrav</span> +00795 CRenderTrav *renderTrav= &ownerScene->getRenderTrav(); +00796 <span class="comment">// get a ptr on the driver</span> +00797 IDriver *drv= renderTrav->getDriver(); +00798 <a class="code" href="a04199.html#a6">nlassert</a>(drv); +00799 +00800 +00801 <span class="comment">// update the VBufferHard (create/delete), to maybe render in AGP memory.</span> +00802 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_0">updateVertexBufferHard</a> (drv); +00803 <span class="comment">/* currentVBHard is NULL if must disable it temporarily</span> +00804 <span class="comment"> For now, never disable it, but switch of VBHard may be VERY EXPENSIVE if NV_vertex_array_range2 is not</span> +00805 <span class="comment"> supported (old drivers).</span> +00806 <span class="comment"> */</span> +00807 IVertexBufferHard *currentVBHard= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>; +00808 +00809 +00810 <span class="comment">// get the skeleton model to which I am binded (else NULL).</span> +00811 CSkeletonModel *skeleton; +00812 skeleton= mi->getSkeletonModel(); +00813 <span class="comment">// must be skinned for renderSkin()</span> +00814 <a class="code" href="a04199.html#a6">nlassert</a>(_Skinned && mi->isSkinned() && skeleton); +00815 <span class="keywordtype">bool</span> bMorphApplied = <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->BlendShapes.size() > 0; +00816 <span class="keywordtype">bool</span> useTangentSpace = <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a> && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->needTangentSpace(); +00817 +00818 +00819 <span class="comment">// Profiling</span> +00820 <span class="comment">//===========</span> +00821 <a class="code" href="a04365.html#a4">H_AUTO</a>( NL3D_MeshGeom_RenderSkinned ); +00822 +00823 +00824 <span class="comment">// Morphing</span> +00825 <span class="comment">// ========</span> +00826 <span class="keywordflow">if</span> (bMorphApplied) +00827 { +00828 <span class="comment">// Since Skinned we must update original skin vertices and normals because skinning use it</span> +00829 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->initSkinned(&_VBufferOri, +00830 &_VBuffer, +00831 currentVBHard, +00832 useTangentSpace, +00833 &_OriginalSkinVertices, +00834 &_OriginalSkinNormals, +00835 useTangentSpace ? &_OriginalTGSpace : NULL, +00836 <span class="keyword">true</span> ); +00837 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->updateSkinned (mi->getBlendShapeFactors()); +00838 } +00839 +00840 +00841 <span class="comment">// Skinning</span> +00842 <span class="comment">// ========</span> +00843 +00844 <span class="comment">// NB: the skeleton matrix has already been setuped by CSkeletonModel</span> +00845 <span class="comment">// NB: the normalize flag has already been setuped by CSkeletonModel</span> +00846 +00847 +00848 <span class="comment">// apply the skinning: _VBuffer is modified.</span> +00849 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_1">applySkin</a>(skeleton); +00850 +00851 +00852 <span class="comment">// Setup meshVertexProgram</span> +00853 <span class="comment">//===========</span> +00854 +00855 <span class="comment">// use MeshVertexProgram effect?</span> +00856 <span class="keywordtype">bool</span> useMeshVP= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a> != NULL; +00857 <span class="keywordflow">if</span>( useMeshVP ) +00858 { +00859 CMatrix invertedObjectMatrix; +00860 invertedObjectMatrix = skeleton->getWorldMatrix().inverted(); +00861 <span class="comment">// really ok if success to begin VP</span> +00862 useMeshVP= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->begin(drv, ownerScene, mi, invertedObjectMatrix, renderTrav->CamPos); +00863 } +00864 +00865 +00866 <span class="comment">// Render the mesh.</span> +00867 <span class="comment">//===========</span> +00868 <span class="comment">// active VB.</span> +00869 <span class="keywordflow">if</span>(currentVBHard != NULL) +00870 drv->activeVertexBufferHard(currentVBHard); +00871 <span class="keywordflow">else</span> +00872 drv->activeVertexBuffer(_VBuffer); +00873 +00874 +00875 <span class="comment">// For all _MatrixBlocks</span> +00876 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> mb=0;mb<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>.size();mb++) +00877 { +00878 CMatrixBlock &mBlock= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr6">_MatrixBlocks</a>[mb]; +00879 <span class="keywordflow">if</span>(mBlock.RdrPass.size()==0) +00880 <span class="keywordflow">continue</span>; +00881 +00882 <span class="comment">// Render all pass.</span> +00883 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0;i<mBlock.RdrPass.size();i++) +00884 { +00885 CRdrPass &rdrPass= mBlock.RdrPass[i]; +00886 +00887 <span class="comment">// CMaterial Ref</span> +00888 CMaterial &material=mi->Materials[rdrPass.MaterialId]; +00889 +00890 <span class="comment">// Setup VP material</span> +00891 <span class="keywordflow">if</span> (useMeshVP) +00892 { +00893 <span class="keywordflow">if</span>(currentVBHard) +00894 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->setupForMaterial(material, drv, ownerScene, currentVBHard); +00895 <span class="keywordflow">else</span> +00896 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->setupForMaterial(material, drv, ownerScene, &_VBuffer); +00897 } +00898 +00899 <span class="comment">// render primitives</span> +00900 drv->render(rdrPass.PBlock, material); +00901 } +00902 } +00903 +00904 <span class="comment">// End VertexProgram effect</span> +00905 <span class="keywordflow">if</span>(useMeshVP) +00906 { +00907 <span class="comment">// Apply it.</span> +00908 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->end(drv); +00909 } +00910 +00911 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz423_9" doxytag="NL3D::CMeshGeom::restoreOriginalSkinVertices" ></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::CMeshGeom::restoreOriginalSkinVertices </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> [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="a05989.html#l01663">1663</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00716">_MeshVertexProgram</a>, <a class="el" href="a05990.html#l00652">_OriginalSkinNormals</a>, <a class="el" href="a05990.html#l00666">_OriginalSkinRestored</a>, <a class="el" href="a05990.html#l00651">_OriginalSkinVertices</a>, <a class="el" href="a05990.html#l00653">_OriginalTGSpace</a>, <a class="el" href="a05990.html#l00664">_Skinned</a>, <a class="el" href="a06710.html#l00449">NL3D::CVertexBuffer::getNormalCoordPointer()</a>, <a class="el" href="a06710.html#l00976">NL3D::CVertexBuffer::getNumTexCoordUsed()</a>, <a class="el" href="a06711.html#l00453">NL3D::CVertexBuffer::getNumVertices()</a>, <a class="el" href="a06710.html#l00497">NL3D::CVertexBuffer::getTexCoordPointer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a06711.html#l00319">NL3D::CVertexBuffer::getVertexFormat()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00598">render()</a>. +<p> +<div class="fragment"><pre>01664 { +01665 <a class="code" href="a04199.html#a6">nlassert</a>(_Skinned); +01666 +01667 <span class="comment">// get num of vertices</span> +01668 <a class="code" href="a04558.html#a15">uint</a> numVertices= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumVertices(); +01669 +01670 <span class="comment">// Copy VBuffer content into Original vertices normals.</span> +01671 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexFormat() & CVertexBuffer::PositionFlag) +01672 { +01673 <span class="comment">// copy vertices from VBuffer. (NB: unusefull geomorphed vertices are still copied, but doesn't matter).</span> +01674 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<numVertices;i++) +01675 { +01676 *(CVector*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexCoordPointer(i)= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr11">_OriginalSkinVertices</a>[i]; +01677 } +01678 } +01679 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexFormat() & CVertexBuffer::NormalFlag) +01680 { +01681 <span class="comment">// copy normals from VBuffer. (NB: unusefull geomorphed normals are still copied, but doesn't matter).</span> +01682 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<numVertices;i++) +01683 { +01684 *(CVector*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNormalCoordPointer(i)= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr9">_OriginalSkinNormals</a>[i]; +01685 } +01686 } +01687 <span class="keywordflow">if</span> (<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a> && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>->needTangentSpace()) +01688 { +01689 <a class="code" href="a04558.html#a15">uint</a> numTexCoords = <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumTexCoordUsed(); +01690 <a class="code" href="a04199.html#a6">nlassert</a>(numTexCoords >= 2); +01691 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr12">_OriginalTGSpace</a>.size() == numVertices); +01692 <span class="comment">// copy tangent space vectors</span> +01693 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i = 0; i < numVertices; ++i) +01694 { +01695 *(CVector*)<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getTexCoordPointer(i, numTexCoords - 1)= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr12">_OriginalTGSpace</a>[i]; +01696 } +01697 } +01698 +01699 <span class="comment">// cleared</span> +01700 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr10">_OriginalSkinRestored</a>= <span class="keyword">true</span>; +01701 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz411_7" doxytag="NL3D::CMeshGeom::serial" ></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::CMeshGeom::serial </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02270.html">NLMISC::IStream</a> & </td> + <td class="mdname1" valign="top" nowrap> <em>f</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap> throw (<a class="el" href="a03781.html">NLMISC::EStream</a>)<code> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +serial this mesh. +<p> + +<p> +Implements <a class="el" href="a02867.html#NL3D_1_1ITrackDefaulta6">NLMISC::IStreamable</a>. +<p> +Definition at line <a class="el" href="a05989.html#l00948">948</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05622.html#l00290">nlassert</a>, and <a class="el" href="a05981.html#l00104">sint</a>. +<p> +<div class="fragment"><pre>00949 { +00950 <span class="comment">/*</span> +00951 <span class="comment"> Version 4:</span> +00952 <span class="comment"> - BonesName.</span> +00953 <span class="comment"> Version 3:</span> +00954 <span class="comment"> - MeshVertexProgram.</span> +00955 <span class="comment"> Version 2:</span> +00956 <span class="comment"> - precompute of triangle order. (nothing more to load).</span> +00957 <span class="comment"> Version 1:</span> +00958 <span class="comment"> - added blend shapes</span> +00959 <span class="comment"> Version 0:</span> +00960 <span class="comment"> - separate serialisation CMesh / CMeshGeom.</span> +00961 <span class="comment"> */</span> +00962 <a class="code" href="a04558.html#a14">sint</a> ver = f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_8">serialVersion</a> (4); +00963 +00964 +00965 <span class="comment">// must have good original Skinned Vertex before writing.</span> +00966 <span class="keywordflow">if</span>( !f.<a class="code" href="a02270.html#NLMISC_1_1IStreama0">isReading</a>() && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a> && !<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr10">_OriginalSkinRestored</a> ) +00967 { +00968 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_9">restoreOriginalSkinVertices</a>(); +00969 } +00970 +00971 +00972 <span class="comment">// Version 4+: Array of bone name</span> +00973 <span class="keywordflow">if</span> (ver >= 4) +00974 { +00975 f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2033_9">serialCont</a> (_BonesName); +00976 } +00977 +00978 <span class="keywordflow">if</span> (f.<a class="code" href="a02270.html#NLMISC_1_1IStreama0">isReading</a>()) +00979 { +00980 <span class="comment">// Version3-: Bones index are in skeleton model id list</span> +00981 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr1">_BoneIdComputed</a> = (ver < 4); +00982 <span class="comment">// In all case, must recompute usage of parents.</span> +00983 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr2">_BoneIdExtended</a>= <span class="keyword">false</span>; +00984 } +00985 <span class="keywordflow">else</span> +00986 { +00987 <span class="comment">// Warning, if you have skinned this shape, you can't write it anymore because skinning id have been changed! </span> +00988 <a class="code" href="a04199.html#a6">nlassert</a> (_BoneIdComputed==<span class="keyword">false</span>); +00989 } +00990 +00991 <span class="comment">// Version3+: MeshVertexProgram.</span> +00992 <span class="keywordflow">if</span> (ver >= 3) +00993 { +00994 IMeshVertexProgram *mvp= NULL; +00995 <span class="keywordflow">if</span>(f.<a class="code" href="a02270.html#NLMISC_1_1IStreama0">isReading</a>()) +00996 { +00997 f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_6">serialPolyPtr</a>(mvp); +00998 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>= mvp; +00999 } +01000 <span class="keywordflow">else</span> +01001 { +01002 mvp= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>; +01003 f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2035_6">serialPolyPtr</a>(mvp); +01004 } +01005 } +01006 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(f.<a class="code" href="a02270.html#NLMISC_1_1IStreama0">isReading</a>()) +01007 { +01008 <span class="comment">// release vp</span> +01009 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr8">_MeshVertexProgram</a>= NULL; +01010 } +01011 +01012 <span class="comment">// TestYoyo</span> +01013 <span class="comment">//_MeshVertexProgram= NULL;</span> +01014 +01015 <span class="comment">// Version1+: _MeshMorpher.</span> +01016 <span class="keywordflow">if</span> (ver >= 1) +01017 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a> (*_MeshMorpher); +01018 +01019 <span class="comment">// serial geometry.</span> +01020 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a> (_VBuffer); +01021 f.<a class="code" href="a02270.html#NLMISC_1_1IStreamz2033_9">serialCont</a> (_MatrixBlocks); +01022 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a> (_BBox); +01023 f.<a class="code" href="a02270.html#NLMISC_1_1IStreama5">serial</a> (_Skinned); +01024 +01025 +01026 <span class="comment">// If _VertexBuffer changed, flag the VertexBufferHard.</span> +01027 <span class="keywordflow">if</span>(f.<a class="code" href="a02270.html#NLMISC_1_1IStreama0">isReading</a>()) +01028 { +01029 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_3">_VertexBufferHardDirty</a> = <span class="keyword">true</span>; +01030 +01031 <span class="comment">// if >= version 2, reorder of triangles is precomputed, else compute it now.</span> +01032 <span class="keywordflow">if</span>(ver < 2 ) +01033 { +01034 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomd2">optimizeTriangleOrder</a>(); +01035 } +01036 } +01037 +01038 <span class="comment">// Skinning: If Version < 4, _BonesName are not present, must compute _BonesId from localId</span> +01039 <span class="comment">// Else it is computed at first computeBonesId().</span> +01040 <span class="keywordflow">if</span>(ver < 4) +01041 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz423_3">buildBoneUsageVer3</a>(); +01042 +01043 <span class="comment">// TestYoyo</span> +01044 <span class="comment">//_MeshVertexProgram= NULL;</span> +01045 <span class="comment">/*{</span> +01046 <span class="comment"> uint numTris= 0;</span> +01047 <span class="comment"> for(uint i=0;i<_MatrixBlocks.size();i++)</span> +01048 <span class="comment"> {</span> +01049 <span class="comment"> for(uint j=0;j<_MatrixBlocks[i].RdrPass.size();j++)</span> +01050 <span class="comment"> numTris+= _MatrixBlocks[i].RdrPass[j].PBlock.getNumTri();</span> +01051 <span class="comment"> }</span> +01052 <span class="comment"> nlinfo("YOYO: %d Vertices. %d Triangles.", _VBuffer.getNumVertices(), numTris);</span> +01053 <span class="comment"> }*/</span> +01054 +01055 <span class="comment">// Some runtime not serialized compilation</span> +01056 <span class="keywordflow">if</span>(f.<a class="code" href="a02270.html#NLMISC_1_1IStreama0">isReading</a>()) +01057 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomd0">compileRunTime</a>(); +01058 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeoma6" doxytag="NL3D::CMeshGeom::setBlendShapes" ></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::CMeshGeom::setBlendShapes </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">std::vector< <a class="el" href="a02273.html">CBlendShape</a> > & </td> + <td class="mdname1" valign="top" nowrap> <em>bs</em> </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="a05989.html#l00449">449</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00712">_MeshMorpher</a>, <a class="el" href="a06004.html#l00077">NL3D::CMeshMorpher::BlendShapes</a>, and <a class="el" href="a05989.html#l01062">compileRunTime()</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02340">NL3D::CMesh::setBlendShapes()</a>. +<p> +<div class="fragment"><pre>00450 { +00451 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->BlendShapes = bs; +00452 <span class="comment">// must update some RunTime parameters</span> +00453 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomd0">compileRunTime</a>(); +00454 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz417_8" doxytag="NL3D::CMeshGeom::sortPerMaterial" ></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"> bool NL3D::CMeshGeom::sortPerMaterial </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> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +true if the sort criterion must be by material. Else, sort per instance. +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_10">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l02006">2006</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00705">_SupportMBRFlags</a>, and <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy4">MBRSortPerMaterial</a>. +<p> +<div class="fragment"><pre>02007 { +02008 <span class="keywordflow">return</span> (<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a> & <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_0NL3D_1_1CMeshGeomy4">MBRSortPerMaterial</a>)!=0; +02009 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz417_9" doxytag="NL3D::CMeshGeom::supportMeshBlockRendering" ></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"> bool NL3D::CMeshGeom::supportMeshBlockRendering </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> [virtual]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +true if this meshGeom support meshBlock rendering. return false if skinned/meshMorphed. +<p> +Implements <a class="el" href="a02879.html#NL3D_1_1IMeshGeomz457_11">NL3D::IMeshGeom</a>. +<p> +Definition at line <a class="el" href="a05989.html#l02000">2000</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00705">_SupportMBRFlags</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01932">profileSceneRender()</a>, and <a class="el" href="a05989.html#l02483">NL3D::CMesh::supportMeshBlockRendering()</a>. +<p> +<div class="fragment"><pre>02001 { +02002 <span class="keywordflow">return</span> <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz421_1">_SupportMBRFlags</a>!=0; +02003 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz415_3" doxytag="NL3D::CMeshGeom::updateSkeletonUsage" ></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::CMeshGeom::updateSkeletonUsage </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>sm</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>bool </td> + <td class="mdname" nowrap> <em>increment</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> +update Skeleton Usage. increment or decrement. computeBonesId must has been called before. +<p> + +<p> +Definition at line <a class="el" href="a05989.html#l01596">1596</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00678">_BonesIdExt</a>, <a class="el" href="a06394.html#l00098">NL3D::CSkeletonModel::Bones</a>, <a class="el" href="a06393.html#l00213">NL3D::CSkeletonModel::decBoneUsage()</a>, <a class="el" href="a06393.html#l00189">NL3D::CSkeletonModel::incBoneUsage()</a>, <a class="el" href="a05622.html#l00154">nlerror</a>, and <a class="el" href="a05981.html#l00105">uint</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02476">NL3D::CMesh::updateSkeletonUsage()</a>. +<p> +<div class="fragment"><pre>01597 { +01598 <span class="comment">// For all Bones used by this mesh.</span> +01599 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> i=0; i<<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr4">_BonesIdExt</a>.size();i++) +01600 { +01601 <a class="code" href="a04558.html#a15">uint</a> boneId= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr4">_BonesIdExt</a>[i]; +01602 <span class="comment">// Some explicit Error.</span> +01603 <span class="keywordflow">if</span>(boneId>=sm->Bones.size()) +01604 <a class="code" href="a04199.html#a3">nlerror</a>(<span class="stringliteral">" Skin is incompatible with Skeleton: tries to use bone %d"</span>, boneId); +01605 <span class="comment">// increment or decrement not Forced, because CMeshGeom use getActiveBoneSkinMatrix().</span> +01606 <span class="keywordflow">if</span>(increment) +01607 sm->incBoneUsage(boneId, CSkeletonModel::UsageNormal); +01608 <span class="keywordflow">else</span> +01609 sm->decBoneUsage(boneId, CSkeletonModel::UsageNormal); +01610 } +01611 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz419_0" doxytag="NL3D::CMeshGeom::updateVertexBufferHard" ></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::CMeshGeom::updateVertexBufferHard </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top"><a class="el" href="a02434.html">IDriver</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>drv</em> </td> + <td class="md" valign="top"> ) </td> + <td class="md" nowrap><code> [private]</code></td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +update the VertexBufferHard if NULL (ie not created or deleted by driver) or if VertexBufferDirty. +<p> + +<p> +Definition at line <a class="el" href="a05989.html#l00523">523</a> of file <a class="el" href="a05989.html">mesh.cpp</a>. +<p> +References <a class="el" href="a05990.html#l00712">_MeshMorpher</a>, <a class="el" href="a05990.html#l00664">_Skinned</a>, <a class="el" href="a05990.html#l00684">_VertexBufferHard</a>, <a class="el" href="a05990.html#l00688">_VertexBufferHardDirty</a>, <a class="el" href="a06004.html#l00077">NL3D::CMeshMorpher::BlendShapes</a>, <a class="el" href="a06711.html#l00453">NL3D::CVertexBuffer::getNumVertices()</a>, <a class="el" href="a06711.html#l00504">NL3D::CVertexBuffer::getUVRouting()</a>, <a class="el" href="a06711.html#l00483">NL3D::CVertexBuffer::getValueTypePointer()</a>, <a class="el" href="a06710.html#l00438">NL3D::CVertexBuffer::getVertexCoordPointer()</a>, <a class="el" href="a06711.html#l00319">NL3D::CVertexBuffer::getVertexFormat()</a>, <a class="el" href="a06711.html#l00473">NL3D::CVertexBuffer::getVertexSize()</a>, <a class="el" href="a05622.html#l00290">nlassert</a>, <a class="el" href="a02434.html#NL3D_1_1IDrivera75">NL3D::IDriver::slowUnlockVertexBufferHard()</a>, and <a class="el" href="a02434.html#NL3D_1_1IDrivera78">NL3D::IDriver::supportVertexBufferHard()</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02021">beginMesh()</a>, <a class="el" href="a05989.html#l00598">render()</a>, and <a class="el" href="a05989.html#l00788">renderSkin()</a>. +<p> +<div class="fragment"><pre>00524 { +00525 <span class="keywordflow">if</span>(!drv->supportVertexBufferHard()) +00526 <span class="keywordflow">return</span>; +00527 +00528 +00529 <span class="comment">/* If the mesh is skinned, still use normal CVertexBuffer.</span> +00530 <span class="comment"> * \todo yoyo: optimize. not done now because CMesh Skinned are not so used in game, </span> +00531 <span class="comment"> * and CMesh skinning is far not optimized (4 matrix mul all the time). Should use later the renderSkinGroupGeom()</span> +00532 <span class="comment"> * scheme</span> +00533 <span class="comment"> * Also, if the driver has slow VBhard unlock() (ie ATI gl extension), avoid use of them if MeshMorpher </span> +00534 <span class="comment"> * is used.</span> +00535 <span class="comment"> */</span> +00536 <span class="keywordtype">bool</span> avoidVBHard; +00537 avoidVBHard= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a> || ( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a> && <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->BlendShapes.size()>0 && drv->slowUnlockVertexBufferHard() ); +00538 <span class="keywordflow">if</span>( <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_3">_VertexBufferHardDirty</a> && avoidVBHard ) +00539 { +00540 <span class="comment">// delete possible old VBHard.</span> +00541 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>!=NULL) +00542 { +00543 <span class="comment">// VertexBufferHard lifetime < Driver lifetime.</span> +00544 <a class="code" href="a04199.html#a6">nlassert</a>(_Driver!=NULL); +00545 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_1">_Driver</a>->deleteVertexBufferHard(_VertexBufferHard); +00546 } +00547 <span class="keywordflow">return</span>; +00548 } +00549 +00550 <span class="comment">// If the vbufferhard is not synced to the vbuffer.</span> +00551 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_3">_VertexBufferHardDirty</a> || <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>==NULL) +00552 { +00553 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_3">_VertexBufferHardDirty</a>= <span class="keyword">false</span>; +00554 +00555 <span class="comment">// delete possible old VBHard.</span> +00556 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>!=NULL) +00557 { +00558 <span class="comment">// VertexBufferHard lifetime < Driver lifetime.</span> +00559 <a class="code" href="a04199.html#a6">nlassert</a>(_Driver!=NULL); +00560 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_1">_Driver</a>->deleteVertexBufferHard(_VertexBufferHard); +00561 } +00562 +00563 <span class="comment">// bkup drv in a refptr. (so we know if the vbuffer hard has to be deleted).</span> +00564 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_1">_Driver</a>= drv; +00565 <span class="comment">// try to create new one, in AGP Ram</span> +00566 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_1">_Driver</a>->createVertexBufferHard(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexFormat(), <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getValueTypePointer (), <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumVertices(), IDriver::VBHardAGP, <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getUVRouting()); +00567 +00568 <span class="comment">// If KO, use normal VertexBuffer.</span> +00569 <span class="keywordflow">if</span>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>==NULL) +00570 <span class="keywordflow">return</span>; +00571 <span class="comment">// else, setup and Fill it with VertexBuffer.</span> +00572 <span class="keywordflow">else</span> +00573 { +00574 <span class="comment">// If the mesh is static: not skinned/no meshMorpher, then setup a static VBHard -> runs faster under NVidia</span> +00575 <span class="keywordflow">if</span>( !<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr14">_Skinned</a> && ( !<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a> || <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr7">_MeshMorpher</a>->BlendShapes.size()==0) ) +00576 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>->lockHintStatic(<span class="keyword">true</span>); +00577 +00578 +00579 <span class="comment">// Fill VB</span> +00580 <span class="keywordtype">void</span> *vertexPtr= <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>->lock(); +00581 +00582 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexFormat() == <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>->getVertexFormat()); +00583 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumVertices() == <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>->getNumVertices()); +00584 <a class="code" href="a04199.html#a6">nlassert</a>(<a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexSize() == <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>->getVertexSize()); +00585 +00586 <span class="comment">// \todo yoyo: TODO_DX8 and DX8 ???</span> +00587 <span class="comment">// Because same internal format, just copy all block.</span> +00588 memcpy(vertexPtr, <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexCoordPointer(), <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getNumVertices() * <a class="code" href="a02878.html#NL3D_1_1CMeshGeomr15">_VBuffer</a>.getVertexSize() ); +00589 +00590 <a class="code" href="a02878.html#NL3D_1_1CMeshGeomz419_2">_VertexBufferHard</a>->unlock(); +00591 } +00592 +00593 } +00594 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NL3D_1_1CMeshGeomr0" doxytag="NL3D::CMeshGeom::_BBox" ></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="a02157.html">NLMISC::CAABBoxExt</a> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr0">NL3D::CMeshGeom::_BBox</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +For clipping. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00662">662</a> of file <a class="el" href="a05990.html">mesh.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr1" doxytag="NL3D::CMeshGeom::_BoneIdComputed" ></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"> bool <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr1">NL3D::CMeshGeom::_BoneIdComputed</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +This boolean is true if the bones id have been passed in the skeleton. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00669">669</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00172">build()</a>, <a class="el" href="a05989.html#l00123">CMeshGeom()</a>, and <a class="el" href="a05989.html#l01456">computeBonesId()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr2" doxytag="NL3D::CMeshGeom::_BoneIdExtended" ></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"> bool <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr2">NL3D::CMeshGeom::_BoneIdExtended</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +true if the _BonesIdExt have been computed (for bone Usage). +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00671">671</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00172">build()</a>, <a class="el" href="a05989.html#l00123">CMeshGeom()</a>, and <a class="el" href="a05989.html#l01456">computeBonesId()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr3" doxytag="NL3D::CMeshGeom::_BonesId" ></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#a10">sint32</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr3">NL3D::CMeshGeom::_BonesId</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +This array give the index in the skeleton of the local bones used. computed at first computeBoneId(). +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00676">676</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01549">buildBoneUsageVer3()</a>, <a class="el" href="a05989.html#l01456">computeBonesId()</a>, and <a class="el" href="a05990.html#l00440">getSkinBoneUsage()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr4" doxytag="NL3D::CMeshGeom::_BonesIdExt" ></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#a10">sint32</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr4">NL3D::CMeshGeom::_BonesIdExt</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Same as _BonesId but with parent of bones added. (used for bone usage). +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00678">678</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01456">computeBonesId()</a>, and <a class="el" href="a05989.html#l01596">updateSkeletonUsage()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr5" doxytag="NL3D::CMeshGeom::_BonesName" ></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<std::string> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr5">NL3D::CMeshGeom::_BonesName</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +This array give the name of the local bones used. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00674">674</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00172">build()</a>, and <a class="el" href="a05989.html#l01456">computeBonesId()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz419_1" doxytag="NL3D::CMeshGeom::_Driver" ></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="a03321.html">CRefPtr</a><<a class="el" href="a02434.html">IDriver</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz419_1">NL3D::CMeshGeom::_Driver</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +This is the driver used to setup the vbuffer hard. error if a mesh has not the same driver in his life. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00686">686</a> of file <a class="el" href="a05990.html">mesh.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr6" doxytag="NL3D::CMeshGeom::_MatrixBlocks" ></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="a02884.html">CMatrixBlock</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr6">NL3D::CMeshGeom::_MatrixBlocks</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The matrix blocks. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00660">660</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00458">applyMaterialRemap()</a>, <a class="el" href="a05989.html#l01715">applySkin()</a>, <a class="el" href="a05989.html#l00172">build()</a>, <a class="el" href="a05989.html#l01549">buildBoneUsageVer3()</a>, <a class="el" href="a05989.html#l01105">buildSkin()</a>, <a class="el" href="a05989.html#l01062">compileRunTime()</a>, <a class="el" href="a05989.html#l01456">computeBonesId()</a>, <a class="el" href="a05989.html#l02133">computeMeshVBHeap()</a>, <a class="el" href="a05990.html#l00393">getNbMatrixBlock()</a>, <a class="el" href="a05990.html#l00398">getNbRdrPass()</a>, <a class="el" href="a05989.html#l02016">getNumRdrPassesForInstance()</a>, <a class="el" href="a05989.html#l02011">getNumRdrPassesForMesh()</a>, <a class="el" href="a05989.html#l01429">getNumTriangles()</a>, <a class="el" href="a05990.html#l00413">getRdrPassMaterial()</a>, <a class="el" href="a05990.html#l00404">getRdrPassPrimitiveBlock()</a>, <a class="el" href="a05989.html#l00153">optimizeTriangleOrder()</a>, <a class="el" href="a05989.html#l01932">profileSceneRender()</a>, <a class="el" href="a05989.html#l00598">render()</a>, <a class="el" href="a05989.html#l02075">renderPass()</a>, <a class="el" href="a05989.html#l00915">renderSimpleWithMaterial()</a>, and <a class="el" href="a05989.html#l00788">renderSkin()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr7" doxytag="NL3D::CMeshGeom::_MeshMorpher" ></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="a02890.html">CMeshMorpher</a>* <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr7">NL3D::CMeshGeom::_MeshMorpher</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="a05990.html#l00712">712</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00172">build()</a>, <a class="el" href="a05989.html#l00123">CMeshGeom()</a>, <a class="el" href="a05989.html#l01062">compileRunTime()</a>, <a class="el" href="a05990.html#l00419">getNbBlendShapes()</a>, <a class="el" href="a05989.html#l00598">render()</a>, <a class="el" href="a05989.html#l00788">renderSkin()</a>, <a class="el" href="a05989.html#l00449">setBlendShapes()</a>, <a class="el" href="a05989.html#l00523">updateVertexBufferHard()</a>, and <a class="el" href="a05989.html#l00136">~CMeshGeom()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr8" doxytag="NL3D::CMeshGeom::_MeshVertexProgram" ></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="a02916.html">IMeshVertexProgram</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr8">NL3D::CMeshGeom::_MeshVertexProgram</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="a05990.html#l00716">716</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02058">activeInstance()</a>, <a class="el" href="a05989.html#l02021">beginMesh()</a>, <a class="el" href="a05989.html#l01615">bkupOriginalSkinVertices()</a>, <a class="el" href="a05989.html#l00172">build()</a>, <a class="el" href="a05989.html#l01062">compileRunTime()</a>, <a class="el" href="a05989.html#l02100">endMesh()</a>, <a class="el" href="a05989.html#l02114">getVBHeapInfo()</a>, <a class="el" href="a05990.html#l00478">hasMeshVertexProgram()</a>, <a class="el" href="a05989.html#l00474">initInstance()</a>, <a class="el" href="a05989.html#l00598">render()</a>, <a class="el" href="a05989.html#l00788">renderSkin()</a>, and <a class="el" href="a05989.html#l01663">restoreOriginalSkinVertices()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr9" doxytag="NL3D::CMeshGeom::_OriginalSkinNormals" ></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="a03128.html">CVector</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr9">NL3D::CMeshGeom::_OriginalSkinNormals</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="a05990.html#l00652">652</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01715">applySkin()</a>, <a class="el" href="a05989.html#l01615">bkupOriginalSkinVertices()</a>, <a class="el" href="a05989.html#l00598">render()</a>, <a class="el" href="a05989.html#l00788">renderSkin()</a>, and <a class="el" href="a05989.html#l01663">restoreOriginalSkinVertices()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr10" doxytag="NL3D::CMeshGeom::_OriginalSkinRestored" ></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"> bool <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr10">NL3D::CMeshGeom::_OriginalSkinRestored</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +This tells if the mesh VBuffer has coorect BindPos vertices. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00666">666</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01715">applySkin()</a>, <a class="el" href="a05989.html#l00123">CMeshGeom()</a>, <a class="el" href="a05989.html#l00598">render()</a>, and <a class="el" href="a05989.html#l01663">restoreOriginalSkinVertices()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr11" doxytag="NL3D::CMeshGeom::_OriginalSkinVertices" ></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="a03128.html">CVector</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr11">NL3D::CMeshGeom::_OriginalSkinVertices</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Skinning: this is the list of vertices (mirror of VBuffer), at the bind Pos. Potentially modified by the mesh morpher +<p> +Definition at line <a class="el" href="a05990.html#l00651">651</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01715">applySkin()</a>, <a class="el" href="a05989.html#l01615">bkupOriginalSkinVertices()</a>, <a class="el" href="a05989.html#l00598">render()</a>, <a class="el" href="a05989.html#l00788">renderSkin()</a>, and <a class="el" href="a05989.html#l01663">restoreOriginalSkinVertices()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr12" doxytag="NL3D::CMeshGeom::_OriginalTGSpace" ></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="a03128.html">CVector</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr12">NL3D::CMeshGeom::_OriginalTGSpace</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="a05990.html#l00653">653</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01715">applySkin()</a>, <a class="el" href="a05989.html#l01615">bkupOriginalSkinVertices()</a>, <a class="el" href="a05989.html#l00598">render()</a>, <a class="el" href="a05989.html#l00788">renderSkin()</a>, and <a class="el" href="a05989.html#l01663">restoreOriginalSkinVertices()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr13" doxytag="NL3D::CMeshGeom::_PreciseClipping" ></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"> bool <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr13">NL3D::CMeshGeom::_PreciseClipping</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Estimate if we must do a Precise clipping (ie with bboxes). +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00709">709</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00482">clip()</a>, <a class="el" href="a05989.html#l00123">CMeshGeom()</a>, and <a class="el" href="a05989.html#l01062">compileRunTime()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr14" doxytag="NL3D::CMeshGeom::_Skinned" ></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"> bool <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr14">NL3D::CMeshGeom::_Skinned</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +This tells if the mesh is correctly skinned. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00664">664</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l01615">bkupOriginalSkinVertices()</a>, <a class="el" href="a05989.html#l00172">build()</a>, <a class="el" href="a05989.html#l01549">buildBoneUsageVer3()</a>, <a class="el" href="a05989.html#l00123">CMeshGeom()</a>, <a class="el" href="a05989.html#l01062">compileRunTime()</a>, <a class="el" href="a05990.html#l00428">isSkinned()</a>, <a class="el" href="a05989.html#l00598">render()</a>, <a class="el" href="a05989.html#l00788">renderSkin()</a>, <a class="el" href="a05989.html#l01663">restoreOriginalSkinVertices()</a>, and <a class="el" href="a05989.html#l00523">updateVertexBufferHard()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz421_1" doxytag="NL3D::CMeshGeom::_SupportMBRFlags" ></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="a04558.html#a7">uint8</a> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz421_1">NL3D::CMeshGeom::_SupportMBRFlags</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +setuped at compileRunTime. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00705">705</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02058">activeInstance()</a>, <a class="el" href="a05989.html#l02021">beginMesh()</a>, <a class="el" href="a05989.html#l01062">compileRunTime()</a>, <a class="el" href="a05989.html#l02100">endMesh()</a>, <a class="el" href="a05989.html#l02114">getVBHeapInfo()</a>, <a class="el" href="a05989.html#l02075">renderPass()</a>, <a class="el" href="a05989.html#l02006">sortPerMaterial()</a>, and <a class="el" href="a05989.html#l02000">supportMeshBlockRendering()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr15" doxytag="NL3D::CMeshGeom::_VBuffer" ></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="a03692.html">CVertexBuffer</a> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr15">NL3D::CMeshGeom::_VBuffer</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +VBuffer of the mesh (potentially modified by the mesh morpher and skinning). +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00656">656</a> of file <a class="el" href="a05990.html">mesh.h</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomr16" doxytag="NL3D::CMeshGeom::_VBufferOri" ></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="a03692.html">CVertexBuffer</a> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomr16">NL3D::CMeshGeom::_VBufferOri</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The original VBuffer of the mesh used only if there are blend shapes. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00658">658</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00598">render()</a>, and <a class="el" href="a05989.html#l00788">renderSkin()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz419_2" doxytag="NL3D::CMeshGeom::_VertexBufferHard" ></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="a03321.html">CRefPtr</a><<a class="el" href="a03694.html">IVertexBufferHard</a>> <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz419_2">NL3D::CMeshGeom::_VertexBufferHard</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +The only one VBufferHard of the mesh. NULL by default. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00684">684</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l02021">beginMesh()</a>, <a class="el" href="a05989.html#l01932">profileSceneRender()</a>, <a class="el" href="a05989.html#l00598">render()</a>, <a class="el" href="a05989.html#l00788">renderSkin()</a>, <a class="el" href="a05989.html#l00523">updateVertexBufferHard()</a>, and <a class="el" href="a05989.html#l00136">~CMeshGeom()</a>. </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1CMeshGeomz419_3" doxytag="NL3D::CMeshGeom::_VertexBufferHardDirty" ></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"> bool <a class="el" href="a02878.html#NL3D_1_1CMeshGeomz419_3">NL3D::CMeshGeom::_VertexBufferHardDirty</a><code> [private]</code> + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +This tells if the VBuffer has changed since the last time or not. +<p> + +<p> +Definition at line <a class="el" href="a05990.html#l00688">688</a> of file <a class="el" href="a05990.html">mesh.h</a>. +<p> +Referenced by <a class="el" href="a05989.html#l00172">build()</a>, <a class="el" href="a05989.html#l00123">CMeshGeom()</a>, and <a class="el" href="a05989.html#l00523">updateVertexBufferHard()</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a05990.html">mesh.h</a><li><a class="el" href="a05989.html">mesh.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 06:52:03 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> |