<!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: csgeom/trimeshtools.h Source File (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 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><a href="classes.html"><span>Classes</span></a></li> <li class="current"><a href="files.html"><span>Files</span></a></li> <li><a href="pages.html"><span>Related Pages</span></a></li> </ul> </div> <h1>csgeom/trimeshtools.h</h1><a href="trimeshtools_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span> <a name="l00002"></a>00002 <span class="comment"> Copyright (C) 2007 by Jorrit Tyberghein</span> <a name="l00003"></a>00003 <span class="comment"></span> <a name="l00004"></a>00004 <span class="comment"> This library is free software; you can redistribute it and/or</span> <a name="l00005"></a>00005 <span class="comment"> modify it under the terms of the GNU Library General Public</span> <a name="l00006"></a>00006 <span class="comment"> License as published by the Free Software Foundation; either</span> <a name="l00007"></a>00007 <span class="comment"> version 2 of the License, or (at your option) any later version.</span> <a name="l00008"></a>00008 <span class="comment"></span> <a name="l00009"></a>00009 <span class="comment"> This library is distributed in the hope that it will be useful,</span> <a name="l00010"></a>00010 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00011"></a>00011 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00012"></a>00012 <span class="comment"> Library General Public License for more details.</span> <a name="l00013"></a>00013 <span class="comment"></span> <a name="l00014"></a>00014 <span class="comment"> You should have received a copy of the GNU Library General Public</span> <a name="l00015"></a>00015 <span class="comment"> License along with this library; if not, write to the Free</span> <a name="l00016"></a>00016 <span class="comment"> Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00017"></a>00017 <span class="comment">*/</span> <a name="l00018"></a>00018 <a name="l00019"></a>00019 <span class="preprocessor">#ifndef __CS_TRIMESHTOOLS_H__</span> <a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define __CS_TRIMESHTOOLS_H__</span> <a name="l00021"></a>00021 <span class="preprocessor"></span> <a name="l00022"></a>00022 <a name="l00023"></a>00023 <span class="preprocessor">#include "csextern.h"</span> <a name="l00024"></a>00024 <a name="l00025"></a>00025 <span class="preprocessor">#include "<a class="code" href="csgeom_2trimesh_8h.html" title="Triangle mesh.">csgeom/trimesh.h</a>"</span> <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="pmtools_8h.html" title="Set of tools to work with iPolygonMesh instances.">csgeom/pmtools.h</a>"</span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="csutil_2array_8h.html" title="Generic Array Template.">csutil/array.h</a>"</span> <a name="l00028"></a>00028 <a name="l00029"></a>00029 <span class="keyword">struct </span><a class="code" href="structcsTriangle.html" title="A triangle.">csTriangle</a>; <a name="l00030"></a>00030 <a name="l00038"></a>00038 <span class="keyword">class </span><a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>; <a name="l00039"></a>00039 <span class="keyword">class </span><a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>; <a name="l00040"></a>00040 <span class="keyword">struct </span><a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>; <a name="l00041"></a>00041 <a name="l00045"></a><a class="code" href="structcsTriangleMeshEdge.html">00045</a> <span class="keyword">struct </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="structcsTriangleMeshEdge.html" title="A definition of one edge.">csTriangleMeshEdge</a> <a name="l00046"></a>00046 { <a name="l00051"></a><a class="code" href="structcsTriangleMeshEdge.html#6f75ea4d4a1742e7ecfad3a80e5440c9">00051</a> <span class="keywordtype">int</span> vt1, vt2; <a name="l00056"></a><a class="code" href="structcsTriangleMeshEdge.html#897b1c21b3f18157628f19a0be24070b">00056</a> <span class="keywordtype">int</span> tri1, tri2; <a name="l00057"></a>00057 <a name="l00064"></a><a class="code" href="structcsTriangleMeshEdge.html#e0f2247f6326ad71b156b3d48850dc6e">00064</a> <span class="keywordtype">bool</span> active; <a name="l00065"></a>00065 }; <a name="l00066"></a>00066 <a name="l00070"></a><a class="code" href="classcsTriangleMeshTools.html">00070</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsTriangleMeshTools.html" title="A set of tools to work with iTriangleMesh instances.">csTriangleMeshTools</a> <a name="l00071"></a>00071 { <a name="l00072"></a>00072 <span class="keyword">private</span>: <a name="l00073"></a>00073 <span class="keyword">static</span> <span class="keywordtype">void</span> CalculatePlanes (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <a name="l00074"></a>00074 <a class="code" href="structcsTriangleMinMax.html" title="A triangle with minimum/maximum information on x.">csTriangleMinMax</a>* tris, <span class="keywordtype">size_t</span> num_tris, <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* planes); <a name="l00075"></a>00075 <a name="l00076"></a>00076 <span class="keyword">public</span>: <a name="l00082"></a>00082 <span class="keyword">static</span> <span class="keywordtype">void</span> CalculateNormals (<a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>* mesh, <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* normals); <a name="l00083"></a>00083 <a name="l00089"></a>00089 <span class="keyword">static</span> <span class="keywordtype">void</span> CalculatePlanes (<a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>* mesh, <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* planes); <a name="l00090"></a>00090 <a name="l00098"></a>00098 <span class="keyword">static</span> <a class="code" href="structcsTriangleMeshEdge.html" title="A definition of one edge.">csTriangleMeshEdge</a>* CalculateEdges (<a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>*, <span class="keywordtype">size_t</span>& num_edges); <a name="l00099"></a>00099 <a name="l00105"></a>00105 <span class="keyword">static</span> <span class="keywordtype">size_t</span> CheckActiveEdges (<a class="code" href="structcsTriangleMeshEdge.html" title="A definition of one edge.">csTriangleMeshEdge</a>* edges, <span class="keywordtype">size_t</span> num_edges, <a name="l00106"></a>00106 <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* planes); <a name="l00107"></a>00107 <a name="l00129"></a>00129 <span class="keyword">static</span> <span class="keywordtype">void</span> CalculateOutline (<a class="code" href="structcsTriangleMeshEdge.html" title="A definition of one edge.">csTriangleMeshEdge</a>* edges, <span class="keywordtype">size_t</span> num_edges, <a name="l00130"></a>00130 <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* planes, <span class="keywordtype">size_t</span> num_vertices, <a name="l00131"></a>00131 <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& pos, <a name="l00132"></a>00132 <span class="keywordtype">size_t</span>* outline_edges, <span class="keywordtype">size_t</span>& num_outline_edges, <a name="l00133"></a>00133 <span class="keywordtype">bool</span>* outline_verts, <a name="l00134"></a>00134 <span class="keywordtype">float</span>& valid_radius); <a name="l00135"></a>00135 <a name="l00140"></a>00140 <span class="keyword">static</span> <span class="keywordtype">bool</span> IsMeshClosed (<a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>* trimesh); <a name="l00141"></a>00141 <a name="l00147"></a>00147 <span class="keyword">static</span> <span class="keywordtype">bool</span> IsMeshConvex (<a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>* trimesh); <a name="l00148"></a>00148 <a name="l00154"></a>00154 <span class="keyword">static</span> <span class="keywordtype">void</span> CloseMesh (<a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>* trimesh, <a class="code" href="classcsArray.html" title="A templated array class.">csArray<csTriangle></a>& newtris); <a name="l00155"></a>00155 <a name="l00164"></a>00164 <span class="keyword">static</span> <span class="keywordtype">void</span> SortTrianglesX (<a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>* trimesh, <a name="l00165"></a>00165 <a class="code" href="structcsTriangleMinMax.html" title="A triangle with minimum/maximum information on x.">csTriangleMinMax</a>*& tris, <span class="keywordtype">size_t</span>& tri_count, <a name="l00166"></a>00166 <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>*& planes); <a name="l00167"></a>00167 <a name="l00175"></a>00175 <span class="keyword">static</span> <span class="keywordtype">bool</span> PointInClosedMesh (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& point, <a name="l00176"></a>00176 <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <a name="l00177"></a>00177 <a class="code" href="structcsTriangleMinMax.html" title="A triangle with minimum/maximum information on x.">csTriangleMinMax</a>* tris, <span class="keywordtype">int</span> tri_count, <a name="l00178"></a>00178 <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* planes); <a name="l00179"></a>00179 <a name="l00192"></a>00192 <span class="keyword">static</span> <span class="keywordtype">bool</span> LineInClosedMesh (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& p1, <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& p2, <a name="l00193"></a>00193 <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <a name="l00194"></a>00194 <a class="code" href="structcsTriangleMinMax.html" title="A triangle with minimum/maximum information on x.">csTriangleMinMax</a>* tris, <span class="keywordtype">int</span> tri_count, <a name="l00195"></a>00195 <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* planes); <a name="l00196"></a>00196 <a name="l00209"></a>00209 <span class="keyword">static</span> <span class="keywordtype">bool</span> BoxInClosedMesh (<span class="keyword">const</span> <a class="code" href="classcsBox3.html" title="A bounding box in 3D space.">csBox3</a>& box, <a name="l00210"></a>00210 <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <a name="l00211"></a>00211 <a class="code" href="structcsTriangleMinMax.html" title="A triangle with minimum/maximum information on x.">csTriangleMinMax</a>* tris, <span class="keywordtype">int</span> tri_count, <a name="l00212"></a>00212 <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* planes); <a name="l00213"></a>00213 <a name="l00218"></a>00218 <span class="keyword">static</span> <a class="code" href="classcsArray.html" title="A templated array class.">csArray<csArray<int></a> > *CalculateVertexConnections ( <a name="l00219"></a>00219 <a class="code" href="structiTriangleMesh.html" title="This interface reprents a mesh of triangles.">iTriangleMesh</a>* mesh); <a name="l00220"></a>00220 }; <a name="l00221"></a>00221 <a name="l00224"></a>00224 <span class="preprocessor">#endif // __CS_TRIMESHTOOLS_H__</span> <a name="l00225"></a>00225 <span class="preprocessor"></span> </pre></div><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>