Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > bad97183153701b09df5fae1052b1c30 > files > 892

crystalspace-doc-1.2.1-5mdv2010.0.i586.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
<title>Crystal Space 1.2.1: csPolygonMeshTools Class Reference (Crystal Space 1.2.1 Public API Reference)</title>
<link href="tabs.css" rel="stylesheet" type="text/css">
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="head">
 <tr height="59">
  <td class="head" width="202" valign="bottom" style="padding-left:0;"><a href="http://www.crystalspace3d.org/"><img src="csblur.png" width="236" height="59" alt="CrystalSpace" border="0"></a></td>
  <td class="head"><h2>Public API Reference</h2></td>
 </tr>
 <tr height="11">
  <td colspan="2" class="headshadow" valign="top" style="padding-left:0;"><img src="csblurb.png" width="236" height="11" alt="" border="0"></td>
 </tr>
</table>
<div class="content">
<!-- Generated by Doxygen 1.5.3 -->
<div class="tabs">
  <ul>
    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
    <li><a href="modules.html"><span>Modules</span></a></li>
    <li><a href="namespaces.html"><span>Namespaces</span></a></li>
    <li class="current"><a href="classes.html"><span>Classes</span></a></li>
    <li><a href="files.html"><span>Files</span></a></li>
    <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
  </ul>
</div>
<div class="tabs">
  <ul>
    <li><a href="classes.html"><span>Alphabetical&nbsp;List</span></a></li>
    <li><a href="annotated.html"><span>Class&nbsp;List</span></a></li>
    <li><a href="hierarchy.html"><span>Class&nbsp;Hierarchy</span></a></li>
    <li><a href="functions.html"><span>Class&nbsp;Members</span></a></li>
  </ul>
</div>
<h1>csPolygonMeshTools Class Reference<br>
<small>
[<a class="el" href="group__geom__utils.html">Geometry utilities</a>]</small>
</h1><!-- doxytag: class="csPolygonMeshTools" -->A set of tools to work with <a class="el" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a> instances.  
<a href="#_details">More...</a>
<p>
<code>#include &lt;<a class="el" href="pmtools_8h-source.html">csgeom/pmtools.h</a>&gt;</code>
<p>

<p>
<a href="classcsPolygonMeshTools-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
<tr><td></td></tr>
<tr><td colspan="2"><br><h2>Static Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#01957720dd38607fdfb2b1acafbb5d28">BoxInClosedMesh</a> (const <a class="el" href="classcsBox3.html">csBox3</a> &amp;box, <a class="el" href="classcsVector3.html">csVector3</a> *vertices, <a class="el" href="structcsTriangleMinMax.html">csTriangleMinMax</a> *tris, int tri_count, <a class="el" href="classcsPlane3.html">csPlane3</a> *planes)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Test if a box is in a closed mesh.  <a href="#01957720dd38607fdfb2b1acafbb5d28"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static <br>
<a class="el" href="structcsPolygonMeshEdge.html">csPolygonMeshEdge</a> *&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#7d747e46a8f5a407d2cd122154a39247">CalculateEdges</a> (<a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *, int &amp;num_edges)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Create a table of edges for this mesh.  <a href="#7d747e46a8f5a407d2cd122154a39247"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#e02ad2a3c7db11f5c0c5d4e70253fac4">CalculateNormals</a> (<a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *mesh, <a class="el" href="classcsVector3.html">csVector3</a> *normals)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This function will calculate normals for all polygons in the mesh.  <a href="#e02ad2a3c7db11f5c0c5d4e70253fac4"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#21529a137d25e6384e645a6a7817c64b">CalculateOutline</a> (<a class="el" href="structcsPolygonMeshEdge.html">csPolygonMeshEdge</a> *edges, int num_edges, <a class="el" href="classcsPlane3.html">csPlane3</a> *planes, int num_vertices, const <a class="el" href="classcsVector3.html">csVector3</a> &amp;pos, int *outline_edges, int &amp;num_outline_edges, bool *outline_verts, float &amp;valid_radius)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Given a table of edges (as calculated with <a class="el" href="classcsPolygonMeshTools.html#7d747e46a8f5a407d2cd122154a39247" title="Create a table of edges for this mesh.">CalculateEdges()</a>), a table of planes (as calculated with CalculatePlanes()), and a position in space.  <a href="#21529a137d25e6384e645a6a7817c64b"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#9c3c957c7b7cd2e71a5a30d73fa3c86a">CalculatePlanes</a> (<a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *mesh, <a class="el" href="classcsPlane3.html">csPlane3</a> *planes)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This function will calculate planes for all polygons in the mesh.  <a href="#9c3c957c7b7cd2e71a5a30d73fa3c86a"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static int&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#c0f514a332152f9e985d3c3dde27305e">CheckActiveEdges</a> (<a class="el" href="structcsPolygonMeshEdge.html">csPolygonMeshEdge</a> *edges, int num_edges, <a class="el" href="classcsPlane3.html">csPlane3</a> *planes)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">This function will check all edges and mark them as active if the two polygons are not co-planar.  <a href="#c0f514a332152f9e985d3c3dde27305e"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#6d47f70814d9be4ef8d708140cfd19fb">CloseMesh</a> (<a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *polyMesh, <a class="el" href="classcsArray.html">csArray</a>&lt; <a class="el" href="structcsMeshedPolygon.html">csMeshedPolygon</a> &gt; &amp;newPolys, int *&amp;vertidx, int &amp;vertidx_len)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Close a polygon mesh.  <a href="#6d47f70814d9be4ef8d708140cfd19fb"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#de52f49eabcd6c3fc25051a456e72d8c">IsMeshClosed</a> (<a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *polyMesh)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Test whether a polygon mesh is closed.  <a href="#de52f49eabcd6c3fc25051a456e72d8c"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#a32345fbb6c9de57d6d51dd6faecc401">IsMeshConvex</a> (<a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *polyMesh)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Test whether a polygon mesh is convex.  <a href="#a32345fbb6c9de57d6d51dd6faecc401"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#5a0a172969794aac9b92e9ab59820992">LineInClosedMesh</a> (const <a class="el" href="classcsVector3.html">csVector3</a> &amp;p1, const <a class="el" href="classcsVector3.html">csVector3</a> &amp;p2, <a class="el" href="classcsVector3.html">csVector3</a> *vertices, <a class="el" href="structcsTriangleMinMax.html">csTriangleMinMax</a> *tris, int tri_count, <a class="el" href="classcsPlane3.html">csPlane3</a> *planes)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Test if a line is in a closed mesh.  <a href="#5a0a172969794aac9b92e9ab59820992"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static bool&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#db3ecee799d6831cc5652f8ea0654d83">PointInClosedMesh</a> (const <a class="el" href="classcsVector3.html">csVector3</a> &amp;point, <a class="el" href="classcsVector3.html">csVector3</a> *vertices, <a class="el" href="structcsTriangleMinMax.html">csTriangleMinMax</a> *tris, int tri_count, <a class="el" href="classcsPlane3.html">csPlane3</a> *planes)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Test if a point is in a closed mesh.  <a href="#db3ecee799d6831cc5652f8ea0654d83"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#b12b7ffff2bd17325172e44a013932ee">Polygonize</a> (<a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *polymesh, <a class="el" href="structcsMeshedPolygon.html">csMeshedPolygon</a> *&amp;polygons, int &amp;poly_count)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Take a polygon mesh that has a valid set of triangles and generate a polygon table for that (delete with delete[]).  <a href="#b12b7ffff2bd17325172e44a013932ee"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#3bcbca92a885f64ba1e52c697ff89f02">SortTrianglesX</a> (<a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *polymesh, <a class="el" href="structcsTriangleMinMax.html">csTriangleMinMax</a> *&amp;tris, int &amp;tri_count, <a class="el" href="classcsPlane3.html">csPlane3</a> *&amp;planes)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Take a polygon mesh and sort triangles on maximum x coordinate.  <a href="#3bcbca92a885f64ba1e52c697ff89f02"></a><br></td></tr>
<tr><td class="memItemLeft" nowrap align="right" valign="top">static void&nbsp;</td><td class="memItemRight" valign="bottom"><a class="el" href="classcsPolygonMeshTools.html#197b28fbdf39c3ed8b0cd0ddce0a336e">Triangulate</a> (<a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *polymesh, <a class="el" href="structcsTriangle.html">csTriangle</a> *&amp;tris, int &amp;tri_count)</td></tr>

<tr><td class="mdescLeft">&nbsp;</td><td class="mdescRight">Triangulate a mesh from the polygon mesh data in the <a class="el" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>.  <a href="#197b28fbdf39c3ed8b0cd0ddce0a336e"></a><br></td></tr>
</table>
<hr><a name="_details"></a><h2>Detailed Description</h2>
A set of tools to work with <a class="el" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a> instances. 
<p>
<dl compact><dt><b><a class="el" href="deprecated.html#_deprecated000002">Deprecated:</a></b></dt><dd>Use <a class="el" href="classcsTriangleMeshTools.html" title="A set of tools to work with iTriangleMesh instances.">csTriangleMeshTools</a> instead. </dd></dl>

<p>Definition at line <a class="el" href="pmtools_8h-source.html#l00082">82</a> of file <a class="el" href="pmtools_8h-source.html">pmtools.h</a>.</p>
<hr><h2>Member Function Documentation</h2>
<a class="anchor" name="01957720dd38607fdfb2b1acafbb5d28"></a><!-- doxytag: member="csPolygonMeshTools::BoxInClosedMesh" ref="01957720dd38607fdfb2b1acafbb5d28" args="(const csBox3 &amp;box, csVector3 *vertices, csTriangleMinMax *tris, int tri_count, csPlane3 *planes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static bool csPolygonMeshTools::BoxInClosedMesh           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classcsBox3.html">csBox3</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>box</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsVector3.html">csVector3</a> *&nbsp;</td>
          <td class="paramname"> <em>vertices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcsTriangleMinMax.html">csTriangleMinMax</a> *&nbsp;</td>
          <td class="paramname"> <em>tris</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>tri_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsPlane3.html">csPlane3</a> *&nbsp;</td>
          <td class="paramname"> <em>planes</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Test if a box is in a closed mesh. 
<p>
The mesh is defined by an array of triangles which should be sorted on x using the <a class="el" href="classcsPolygonMeshTools.html#3bcbca92a885f64ba1e52c697ff89f02" title="Take a polygon mesh and sort triangles on maximum x coordinate.">SortTrianglesX()</a> function. This function does not check if the mesh is really closed. This function also needs an array of planes. You can calculate that with CalculatePlanes(). This function does not check if the eight corner points are actually in the object. If they are not then you will actually reverse the check and this function will return true if the box is completely outside the object. Basically this function tests if the box intersects some polygon in the object and it will return false if it does. 
</div>
</div><p>
<a class="anchor" name="7d747e46a8f5a407d2cd122154a39247"></a><!-- doxytag: member="csPolygonMeshTools::CalculateEdges" ref="7d747e46a8f5a407d2cd122154a39247" args="(iPolygonMesh *, int &amp;num_edges)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static <a class="el" href="structcsPolygonMeshEdge.html">csPolygonMeshEdge</a>* csPolygonMeshTools::CalculateEdges           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *&nbsp;</td>
          <td class="paramname">, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&nbsp;</td>
          <td class="paramname"> <em>num_edges</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Create a table of edges for this mesh. 
<p>
The resulting table may later be deleted with 'delete[]'. Note that every edge will only connect two polygons. If more polygons connect to an edge then the edge will be duplicated. The 'active' flag of the returned edges is not calculated by this routine. Use 'CheckActiveEdges()' for that. 
</div>
</div><p>
<a class="anchor" name="e02ad2a3c7db11f5c0c5d4e70253fac4"></a><!-- doxytag: member="csPolygonMeshTools::CalculateNormals" ref="e02ad2a3c7db11f5c0c5d4e70253fac4" args="(iPolygonMesh *mesh, csVector3 *normals)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void csPolygonMeshTools::CalculateNormals           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *&nbsp;</td>
          <td class="paramname"> <em>mesh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsVector3.html">csVector3</a> *&nbsp;</td>
          <td class="paramname"> <em>normals</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This function will calculate normals for all polygons in the mesh. 
<p>
The given array of 'normals' should be big enough to have normals for the number of polygons as defined in the mesh itself. 
</div>
</div><p>
<a class="anchor" name="21529a137d25e6384e645a6a7817c64b"></a><!-- doxytag: member="csPolygonMeshTools::CalculateOutline" ref="21529a137d25e6384e645a6a7817c64b" args="(csPolygonMeshEdge *edges, int num_edges, csPlane3 *planes, int num_vertices, const csVector3 &amp;pos, int *outline_edges, int &amp;num_outline_edges, bool *outline_verts, float &amp;valid_radius)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void csPolygonMeshTools::CalculateOutline           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcsPolygonMeshEdge.html">csPolygonMeshEdge</a> *&nbsp;</td>
          <td class="paramname"> <em>edges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>num_edges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsPlane3.html">csPlane3</a> *&nbsp;</td>
          <td class="paramname"> <em>planes</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>num_vertices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classcsVector3.html">csVector3</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>pos</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&nbsp;</td>
          <td class="paramname"> <em>outline_edges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&nbsp;</td>
          <td class="paramname"> <em>num_outline_edges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">bool *&nbsp;</td>
          <td class="paramname"> <em>outline_verts</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">float &amp;&nbsp;</td>
          <td class="paramname"> <em>valid_radius</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Given a table of edges (as calculated with <a class="el" href="classcsPolygonMeshTools.html#7d747e46a8f5a407d2cd122154a39247" title="Create a table of edges for this mesh.">CalculateEdges()</a>), a table of planes (as calculated with CalculatePlanes()), and a position in space. 
<p>
This function will calculate an outline that is valid from that position. This outline will be given as an array of bool indicating which vertex indices that are used (so these have to be transformed from 3D to 2D) and also an array of double vertex indices (every set of two vertex indices forms one edge) that form the outline. This function will also return a radius. As long as the position doesn't move outside this radius the outline will be valid. The two input tables should have enough space for the returned number of edges and vertex indices. The safest way is to allocate double the amount of vertices as there are active edges in the input edge table and enough vertices as the polygon mesh supports. <br>
 Note: this function requires that the given edges are marked as active or not (use <a class="el" href="classcsPolygonMeshTools.html#c0f514a332152f9e985d3c3dde27305e" title="This function will check all edges and mark them as active if the two polygons are...">CheckActiveEdges()</a>). <br>
 Note: num_outline_edges will be the amount of edges (which means that there will be twice as much vertices in the 'outline_edges' table. 
</div>
</div><p>
<a class="anchor" name="9c3c957c7b7cd2e71a5a30d73fa3c86a"></a><!-- doxytag: member="csPolygonMeshTools::CalculatePlanes" ref="9c3c957c7b7cd2e71a5a30d73fa3c86a" args="(iPolygonMesh *mesh, csPlane3 *planes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void csPolygonMeshTools::CalculatePlanes           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *&nbsp;</td>
          <td class="paramname"> <em>mesh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsPlane3.html">csPlane3</a> *&nbsp;</td>
          <td class="paramname"> <em>planes</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This function will calculate planes for all polygons in the mesh. 
<p>
The given array of 'planes' should be big enough to have planes for the number of polygons as defined in the mesh itself. 
</div>
</div><p>
<a class="anchor" name="c0f514a332152f9e985d3c3dde27305e"></a><!-- doxytag: member="csPolygonMeshTools::CheckActiveEdges" ref="c0f514a332152f9e985d3c3dde27305e" args="(csPolygonMeshEdge *edges, int num_edges, csPlane3 *planes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static int csPolygonMeshTools::CheckActiveEdges           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structcsPolygonMeshEdge.html">csPolygonMeshEdge</a> *&nbsp;</td>
          <td class="paramname"> <em>edges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>num_edges</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsPlane3.html">csPlane3</a> *&nbsp;</td>
          <td class="paramname"> <em>planes</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
This function will check all edges and mark them as active if the two polygons are not co-planar. 
<p>
This function will return the number of active edges. 
</div>
</div><p>
<a class="anchor" name="6d47f70814d9be4ef8d708140cfd19fb"></a><!-- doxytag: member="csPolygonMeshTools::CloseMesh" ref="6d47f70814d9be4ef8d708140cfd19fb" args="(iPolygonMesh *polyMesh, csArray&lt; csMeshedPolygon &gt; &amp;newPolys, int *&amp;vertidx, int &amp;vertidx_len)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void csPolygonMeshTools::CloseMesh           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *&nbsp;</td>
          <td class="paramname"> <em>polyMesh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsArray.html">csArray</a>&lt; <a class="el" href="structcsMeshedPolygon.html">csMeshedPolygon</a> &gt; &amp;&nbsp;</td>
          <td class="paramname"> <em>newPolys</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int *&amp;&nbsp;</td>
          <td class="paramname"> <em>vertidx</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&nbsp;</td>
          <td class="paramname"> <em>vertidx_len</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Close a polygon mesh. 
<p>
The current implementation is rather naive; it just returns all faces, but flipped. The returned table is a table of indices that are used in the returned polygons. Don't forget to delete[] that table! 
</div>
</div><p>
<a class="anchor" name="de52f49eabcd6c3fc25051a456e72d8c"></a><!-- doxytag: member="csPolygonMeshTools::IsMeshClosed" ref="de52f49eabcd6c3fc25051a456e72d8c" args="(iPolygonMesh *polyMesh)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static bool csPolygonMeshTools::IsMeshClosed           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *&nbsp;</td>
          <td class="paramname"> <em>polyMesh</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Test whether a polygon mesh is closed. 
<p>
<dl class="remark" compact><dt><b>Remarks:</b></dt><dd>This function works best if vertices are shared. </dd></dl>

</div>
</div><p>
<a class="anchor" name="a32345fbb6c9de57d6d51dd6faecc401"></a><!-- doxytag: member="csPolygonMeshTools::IsMeshConvex" ref="a32345fbb6c9de57d6d51dd6faecc401" args="(iPolygonMesh *polyMesh)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static bool csPolygonMeshTools::IsMeshConvex           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *&nbsp;</td>
          <td class="paramname"> <em>polyMesh</em>          </td>
          <td>&nbsp;)&nbsp;</td>
          <td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Test whether a polygon mesh is convex. 
<p>
Note! This is NOT a fast function. Use with care. <dl class="remark" compact><dt><b>Remarks:</b></dt><dd>This function works best if vertices are shared. </dd></dl>

</div>
</div><p>
<a class="anchor" name="5a0a172969794aac9b92e9ab59820992"></a><!-- doxytag: member="csPolygonMeshTools::LineInClosedMesh" ref="5a0a172969794aac9b92e9ab59820992" args="(const csVector3 &amp;p1, const csVector3 &amp;p2, csVector3 *vertices, csTriangleMinMax *tris, int tri_count, csPlane3 *planes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static bool csPolygonMeshTools::LineInClosedMesh           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classcsVector3.html">csVector3</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>p1</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">const <a class="el" href="classcsVector3.html">csVector3</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>p2</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsVector3.html">csVector3</a> *&nbsp;</td>
          <td class="paramname"> <em>vertices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcsTriangleMinMax.html">csTriangleMinMax</a> *&nbsp;</td>
          <td class="paramname"> <em>tris</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>tri_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsPlane3.html">csPlane3</a> *&nbsp;</td>
          <td class="paramname"> <em>planes</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Test if a line is in a closed mesh. 
<p>
The mesh is defined by an array of triangles which should be sorted on x using the <a class="el" href="classcsPolygonMeshTools.html#3bcbca92a885f64ba1e52c697ff89f02" title="Take a polygon mesh and sort triangles on maximum x coordinate.">SortTrianglesX()</a> function. This function does not check if the mesh is really closed. This function also needs an array of planes. You can calculate that with CalculatePlanes(). This function does not check if the two points are actually in the object. If they are not then you will actually reverse the check and this function will return true if the line is completely outside the object. Basically this function tests if the line intersects some polygon in the object and it will return false if it does. 
</div>
</div><p>
<a class="anchor" name="db3ecee799d6831cc5652f8ea0654d83"></a><!-- doxytag: member="csPolygonMeshTools::PointInClosedMesh" ref="db3ecee799d6831cc5652f8ea0654d83" args="(const csVector3 &amp;point, csVector3 *vertices, csTriangleMinMax *tris, int tri_count, csPlane3 *planes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static bool csPolygonMeshTools::PointInClosedMesh           </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="classcsVector3.html">csVector3</a> &amp;&nbsp;</td>
          <td class="paramname"> <em>point</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsVector3.html">csVector3</a> *&nbsp;</td>
          <td class="paramname"> <em>vertices</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcsTriangleMinMax.html">csTriangleMinMax</a> *&nbsp;</td>
          <td class="paramname"> <em>tris</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int&nbsp;</td>
          <td class="paramname"> <em>tri_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsPlane3.html">csPlane3</a> *&nbsp;</td>
          <td class="paramname"> <em>planes</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Test if a point is in a closed mesh. 
<p>
The mesh is defined by an array of triangles which should be sorted on x using the <a class="el" href="classcsPolygonMeshTools.html#3bcbca92a885f64ba1e52c697ff89f02" title="Take a polygon mesh and sort triangles on maximum x coordinate.">SortTrianglesX()</a> function. This function does not check if the mesh is really closed. This function also needs an array of planes. You can calculate that with CalculatePlanes(). 
</div>
</div><p>
<a class="anchor" name="b12b7ffff2bd17325172e44a013932ee"></a><!-- doxytag: member="csPolygonMeshTools::Polygonize" ref="b12b7ffff2bd17325172e44a013932ee" args="(iPolygonMesh *polymesh, csMeshedPolygon *&amp;polygons, int &amp;poly_count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void csPolygonMeshTools::Polygonize           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *&nbsp;</td>
          <td class="paramname"> <em>polymesh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcsMeshedPolygon.html">csMeshedPolygon</a> *&amp;&nbsp;</td>
          <td class="paramname"> <em>polygons</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&nbsp;</td>
          <td class="paramname"> <em>poly_count</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Take a polygon mesh that has a valid set of triangles and generate a polygon table for that (delete with delete[]). 
<p>
Note that the polygons will point inside the triangle table! 
</div>
</div><p>
<a class="anchor" name="3bcbca92a885f64ba1e52c697ff89f02"></a><!-- doxytag: member="csPolygonMeshTools::SortTrianglesX" ref="3bcbca92a885f64ba1e52c697ff89f02" args="(iPolygonMesh *polymesh, csTriangleMinMax *&amp;tris, int &amp;tri_count, csPlane3 *&amp;planes)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void csPolygonMeshTools::SortTrianglesX           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *&nbsp;</td>
          <td class="paramname"> <em>polymesh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcsTriangleMinMax.html">csTriangleMinMax</a> *&amp;&nbsp;</td>
          <td class="paramname"> <em>tris</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&nbsp;</td>
          <td class="paramname"> <em>tri_count</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="classcsPlane3.html">csPlane3</a> *&amp;&nbsp;</td>
          <td class="paramname"> <em>planes</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Take a polygon mesh and sort triangles on maximum x coordinate. 
<p>
That means that the first triangle in the returned array will have a minimum x coordinates that is lower then further triangles. This is useful for the SortedIn() routine below. This routine will also calculate planes. When done delete the returned arrays. 
</div>
</div><p>
<a class="anchor" name="197b28fbdf39c3ed8b0cd0ddce0a336e"></a><!-- doxytag: member="csPolygonMeshTools::Triangulate" ref="197b28fbdf39c3ed8b0cd0ddce0a336e" args="(iPolygonMesh *polymesh, csTriangle *&amp;tris, int &amp;tri_count)" -->
<div class="memitem">
<div class="memproto">
      <table class="memname">
        <tr>
          <td class="memname">static void csPolygonMeshTools::Triangulate           </td>
          <td>(</td>
          <td class="paramtype"><a class="el" href="structiPolygonMesh.html">iPolygonMesh</a> *&nbsp;</td>
          <td class="paramname"> <em>polymesh</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype"><a class="el" href="structcsTriangle.html">csTriangle</a> *&amp;&nbsp;</td>
          <td class="paramname"> <em>tris</em>, </td>
        </tr>
        <tr>
          <td class="paramkey"></td>
          <td></td>
          <td class="paramtype">int &amp;&nbsp;</td>
          <td class="paramname"> <em>tri_count</em></td><td>&nbsp;</td>
        </tr>
        <tr>
          <td></td>
          <td>)</td>
          <td></td><td></td><td width="100%"><code> [static]</code></td>
        </tr>
      </table>
</div>
<div class="memdoc">

<p>
Triangulate a mesh from the polygon mesh data in the <a class="el" href="structiPolygonMesh.html" title="This interface reprents a mesh of polygons.">iPolygonMesh</a>. 
<p>
Returns a table of triangles (delete with delete[]). Note that this function will always triangulate the polygons even if there is a perfectly usable array of triangles in the mesh. You should test for this outside of this function. 
</div>
</div><p>
<hr>The documentation for this class was generated from the following file:<ul>
<li>csgeom/<a class="el" href="pmtools_8h-source.html">pmtools.h</a></ul>
<hr size="1"><address><small>Generated for Crystal Space 1.2.1 by 
<a href="http://www.doxygen.org/index.html">doxygen</a> 1.5.3 
</small></address> </div></body> </html>