diff options
Diffstat (limited to '')
-rw-r--r-- | docs/doxygen/nel/a03943.html | 351 |
1 files changed, 351 insertions, 0 deletions
diff --git a/docs/doxygen/nel/a03943.html b/docs/doxygen/nel/a03943.html new file mode 100644 index 00000000..5a237f5f --- /dev/null +++ b/docs/doxygen/nel/a03943.html @@ -0,0 +1,351 @@ +<!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::UShape 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::UShape Class Reference</h1><code>#include <<a class="el" href="a06627.html">u_shape.h</a>></code> +<p> +<hr><a name="_details"></a><h2>Detailed Description</h2> +Game interface for managing shape. NB: unlike old GameInterface, here the <a class="el" href="a03943.html">UShape</a> is a Proxy: it keep a ptr on a <a class="el" href="a02539.html">IShape</a>, thus it can be created or destroyed statically, on the stack etc...<p> +<dl compact><dt><b>Author:</b></dt><dd>Lionel Berenguier <p> +Nevrax France </dd></dl> +<dl compact><dt><b>Date:</b></dt><dd>2001 </dd></dl> + +<p> + +<p> +Definition at line <a class="el" href="a06627.html#l00047">47</a> of file <a class="el" href="a06627.html">u_shape.h</a>.<table border=0 cellpadding=0 cellspacing=0> +<tr><td></td></tr> +<tr><td colspan=2><br><h2>Public Member Functions</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top>void </td><td class="memItemRight" valign=bottom><a class="el" href="a03943.html#NL3D_1_1UShapea0">attach</a> (class <a class="el" href="a02539.html">IShape</a> *shape)</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Attach a <a class="el" href="a02539.html">IShape</a> to this proxy. <a href="#NL3D_1_1UShapea0"></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="a03943.html#NL3D_1_1UShapea1">cameraCollisionable</a> () const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top>bool </td><td class="memItemRight" valign=bottom><a class="el" href="a03943.html#NL3D_1_1UShapea2">empty</a> () const </td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">return true if the proxy is <a class="el" href="a03943.html#NL3D_1_1UShapea2">empty()</a> (not attached) <a href="#NL3D_1_1UShapea2"></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="a03943.html#NL3D_1_1UShapea3">getMeshTriangles</a> (std::vector< <a class="el" href="a03128.html">NLMISC::CVector</a> > &vertices, std::vector< <a class="el" href="a04558.html#a11">uint32</a> > &indices) const </td></tr> + +<tr><td class="memItemLeft" nowrap align=right valign=top> </td><td class="memItemRight" valign=bottom><a class="el" href="a03943.html#NL3D_1_1UShapea4">UShape</a> ()</td></tr> + +<tr><td class="mdescLeft"> </td><td class="mdescRight">Proxy interface. <a href="#NL3D_1_1UShapea4"></a><br><br></td></tr> +<tr><td colspan=2><br><h2>Private Attributes</h2></td></tr> +<tr><td class="memItemLeft" nowrap align=right valign=top><a class="el" href="a02539.html">IShape</a> * </td><td class="memItemRight" valign=bottom><a class="el" href="a03943.html#NL3D_1_1UShaper0">_Shape</a></td></tr> + +</table> +<hr><h2>Constructor & Destructor Documentation</h2> +<a class="anchor" name="NL3D_1_1UShapea4" doxytag="NL3D::UShape::UShape" ></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::UShape::UShape </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> +Proxy interface. +<p> + +<p> +Definition at line <a class="el" href="a06626.html#l00042">42</a> of file <a class="el" href="a06626.html">u_shape.cpp</a>. +<p> +<div class="fragment"><pre>00042 : <a class="code" href="a03943.html#NL3D_1_1UShaper0">_Shape</a>(NULL) +00043 { +00044 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Member Function Documentation</h2> +<a class="anchor" name="NL3D_1_1UShapea0" doxytag="NL3D::UShape::attach" ></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::UShape::attach </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">class <a class="el" href="a02539.html">IShape</a> * </td> + <td class="mdname1" valign="top" nowrap> <em>shape</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> +Attach a <a class="el" href="a02539.html">IShape</a> to this proxy. +<p> + +<p> +Definition at line <a class="el" href="a06626.html#l00047">47</a> of file <a class="el" href="a06626.html">u_shape.cpp</a>. +<p> +Referenced by <a class="el" href="a06380.html#l00107">NL3D::CShapeBankUser::getShape()</a>. +<p> +<div class="fragment"><pre>00048 { +00049 <a class="code" href="a03943.html#NL3D_1_1UShaper0">_Shape</a>= shape; +00050 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1UShapea1" doxytag="NL3D::UShape::cameraCollisionable" ></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::UShape::cameraCollisionable </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</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Return true if this mesh is candidate for Camera Collision For now return true if have some lightmap! +<p> +Definition at line <a class="el" href="a06626.html#l00125">125</a> of file <a class="el" href="a06626.html">u_shape.cpp</a>. +<p> +References <a class="el" href="a05992.html#l00234">NL3D::CMeshBase::_LightInfos</a>. +<p> +<div class="fragment"><pre>00126 { +00127 <span class="comment">/* For now do it easy, take only lightmapped (ie big) objects. An object that is lightmapped</span> +00128 <span class="comment"> should have some lightInfos</span> +00129 <span class="comment"> */</span> +00130 CMeshBase *mesh= dynamic_cast<CMeshBase*>(<a class="code" href="a03943.html#NL3D_1_1UShaper0">_Shape</a>); +00131 <span class="keywordflow">if</span>(mesh) +00132 { +00133 <span class="keywordflow">return</span> !mesh->_LightInfos.empty(); +00134 } +00135 <span class="keywordflow">else</span> +00136 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00137 } +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1UShapea2" doxytag="NL3D::UShape::empty" ></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::UShape::empty </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 proxy is <a class="el" href="a03943.html#NL3D_1_1UShapea2">empty()</a> (not attached) +<p> + +<p> +Definition at line <a class="el" href="a06627.html#l00056">56</a> of file <a class="el" href="a06627.html">u_shape.h</a>. +<p> +<div class="fragment"><pre>00056 {<span class="keywordflow">return</span> <a class="code" href="a03943.html#NL3D_1_1UShaper0">_Shape</a>==NULL;} +</pre></div> </td> + </tr> +</table> +<a class="anchor" name="NL3D_1_1UShapea3" doxytag="NL3D::UShape::getMeshTriangles" ></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::UShape::getMeshTriangles </td> + <td class="md" valign="top">( </td> + <td class="md" nowrap valign="top">std::vector< <a class="el" href="a03128.html">NLMISC::CVector</a> > & </td> + <td class="mdname" nowrap> <em>vertices</em>, </td> + </tr> + <tr> + <td class="md" nowrap align="right"></td> + <td></td> + <td class="md" nowrap>std::vector< <a class="el" href="a04558.html#a11">uint32</a> > & </td> + <td class="mdname" nowrap> <em>indices</em></td> + </tr> + <tr> + <td></td> + <td class="md">) </td> + <td class="md" colspan="2"> const</td> + </tr> + + </table> + </td> + </tr> +</table> +<table cellspacing=5 cellpadding=0 border=0> + <tr> + <td> + + </td> + <td> + +<p> +Get the mesh under Triangle Form. For now only <a class="el" href="a02857.html">CMesh</a> and <a class="el" href="a02910.html">CMeshMultiLod</a> (<a class="el" href="a02878.html">CMeshGeom</a> only) are supported. <dl compact><dt><b>Parameters:</b></dt><dd> + <table border="0" cellspacing="2" cellpadding="0"> + <tr><td valign=top><em>vertices</em> </td><td>array of vertices </td></tr> + <tr><td valign=top><em>indices</em> </td><td>triplets of indices to vertices </td></tr> + </table> +</dl> +<dl compact><dt><b>Returns:</b></dt><dd>false if cannot be converted</dd></dl> + +<p> +Definition at line <a class="el" href="a06626.html#l00053">53</a> of file <a class="el" href="a06626.html">u_shape.cpp</a>. +<p> +References <a class="el" href="a06016.html#l00599">NL3D::CMeshMultiLod::getMeshGeom()</a>, <a class="el" href="a05989.html#l02463">NL3D::CMesh::getMeshGeom()</a>, <a class="el" href="a05990.html#l00393">NL3D::CMeshGeom::getNbMatrixBlock()</a>, <a class="el" href="a05990.html#l00398">NL3D::CMeshGeom::getNbRdrPass()</a>, <a class="el" href="a06017.html#l00144">NL3D::CMeshMultiLod::getNumSlotMesh()</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="a05990.html#l00404">NL3D::CMeshGeom::getRdrPassPrimitiveBlock()</a>, <a class="el" href="a06197.html#l00091">NL3D::CPrimitiveBlock::getTriPointer()</a>, <a class="el" href="a05990.html#l00390">NL3D::CMeshGeom::getVertexBuffer()</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="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> +<div class="fragment"><pre>00054 { +00055 <span class="keywordflow">if</span>(!<a class="code" href="a03943.html#NL3D_1_1UShaper0">_Shape</a>) +00056 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00057 +00058 <span class="comment">// **** try to get a CMeshGeom</span> +00059 CMesh *mesh= dynamic_cast<CMesh*>(<a class="code" href="a03943.html#NL3D_1_1UShaper0">_Shape</a>); +00060 CMeshMultiLod *meshMulti= dynamic_cast<CMeshMultiLod*>(<a class="code" href="a03943.html#NL3D_1_1UShaper0">_Shape</a>); +00061 <span class="keyword">const</span> CMeshGeom *meshGeom= NULL; +00062 <span class="keywordflow">if</span>(mesh) +00063 { +00064 meshGeom= &mesh->getMeshGeom(); +00065 } +00066 <span class="keywordflow">else</span> <span class="keywordflow">if</span>(meshMulti) +00067 { +00068 <span class="comment">// get the first (bigger) meshGeom</span> +00069 <span class="keywordflow">if</span>(meshMulti->getNumSlotMesh()) +00070 { +00071 meshGeom= dynamic_cast<const CMeshGeom*>(&meshMulti->getMeshGeom(0)); +00072 } +00073 } +00074 +00075 <span class="keywordflow">if</span>(!meshGeom) +00076 <span class="keywordflow">return</span> <span class="keyword">false</span>; +00077 +00078 <span class="comment">// **** Build the vertices and indices</span> +00079 <a class="code" href="a04558.html#a15">uint</a> i; +00080 vertices.clear(); +00081 indices.clear(); +00082 +00083 <span class="comment">// build vertices</span> +00084 <span class="keyword">const</span> CVertexBuffer &vb= meshGeom->getVertexBuffer(); +00085 vertices.resize(vb.getNumVertices()); +00086 <span class="keyword">const</span> <a class="code" href="a04558.html#a7">uint8</a> *pVert= (<span class="keyword">const</span> <a class="code" href="a04558.html#a7">uint8</a>*)vb.getVertexCoordPointer(0); +00087 <a class="code" href="a04558.html#a15">uint</a> vSize= vb.getVertexSize(); +00088 <span class="keywordflow">for</span>(i=0;i<vertices.size();i++) +00089 { +00090 vertices[i]= *(<span class="keyword">const</span> CVector*)pVert; +00091 pVert+= vSize; +00092 } +00093 +00094 <span class="comment">// count numTris</span> +00095 <a class="code" href="a04558.html#a15">uint</a> numTris= 0; +00096 <span class="keywordflow">for</span>(i=0;i<meshGeom->getNbMatrixBlock();i++) +00097 { +00098 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> rp=0;rp<meshGeom->getNbRdrPass(i);rp++) +00099 { +00100 numTris+= meshGeom->getRdrPassPrimitiveBlock(i, rp).getNumTri(); +00101 } +00102 } +00103 indices.resize(numTris*3); +00104 +00105 <span class="comment">// build indices</span> +00106 <a class="code" href="a04558.html#a15">uint</a> triIdx= 0; +00107 <span class="keywordflow">for</span>(i=0;i<meshGeom->getNbMatrixBlock();i++) +00108 { +00109 <span class="keywordflow">for</span>(<a class="code" href="a04558.html#a15">uint</a> rp=0;rp<meshGeom->getNbRdrPass(i);rp++) +00110 { +00111 <span class="keyword">const</span> CPrimitiveBlock &pb= meshGeom->getRdrPassPrimitiveBlock(i, rp); +00112 <span class="comment">// copy</span> +00113 memcpy(&indices[triIdx*3], pb.getTriPointer(), pb.getNumTri()*3*<span class="keyword">sizeof</span>(<a class="code" href="a04558.html#a11">uint32</a>)); +00114 <span class="comment">// next</span> +00115 triIdx+= pb.getNumTri(); +00116 } +00117 } +00118 +00119 <span class="comment">// ok!</span> +00120 <span class="keywordflow">return</span> <span class="keyword">true</span>; +00121 } +</pre></div> </td> + </tr> +</table> +<hr><h2>Field Documentation</h2> +<a class="anchor" name="NL3D_1_1UShaper0" doxytag="NL3D::UShape::_Shape" ></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"> class <a class="el" href="a02539.html">IShape</a>* <a class="el" href="a03943.html#NL3D_1_1UShaper0">NL3D::UShape::_Shape</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="a06627.html#l00074">74</a> of file <a class="el" href="a06627.html">u_shape.h</a>. </td> + </tr> +</table> +<hr>The documentation for this class was generated from the following files:<ul> +<li><a class="el" href="a06627.html">u_shape.h</a><li><a class="el" href="a06626.html">u_shape.cpp</a></ul> +<hr size="1"><address style="align: right;"><small>Generated on Tue Mar 16 08:50:01 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> |