Sophie

Sophie

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

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: csgeom/poly3d.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&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><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&nbsp;Pages</span></a></li>
  </ul>
</div>
<h1>csgeom/poly3d.h</h1><a href="poly3d_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) 1998 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_POLY3D_H__</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define __CS_POLY3D_H__</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span>
<a name="l00029"></a>00029 <span class="preprocessor">#include "csextern.h"</span>
<a name="l00030"></a>00030 
<a name="l00031"></a>00031 <span class="preprocessor">#include "<a class="code" href="plane3_8h.html" title="3D space plane.">csgeom/plane3.h</a>"</span>
<a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="vector3_8h.html" title="3D vector.">csgeom/vector3.h</a>"</span>
<a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="dirtyaccessarray_8h.html" title="Templated array class, allowing direct access to the internally stored array.">csutil/dirtyaccessarray.h</a>"</span>
<a name="l00034"></a>00034 
<a name="l00035"></a>00035 <span class="keyword">class </span><a class="code" href="classcsPoly2D.html" title="The following class represents a general 2D polygon.">csPoly2D</a>;
<a name="l00036"></a>00036 
<a name="l00038"></a>00038 <span class="keyword">enum</span>
<a name="l00039"></a>00039 {
<a name="l00041"></a><a class="code" href="group__geom__utils.html#gg05589fbab0657f08285ebdfe93f5ec9ee88d3fbccae84a9d22831150df35b7bd">00041</a>   <a class="code" href="group__geom__utils.html#gg05589fbab0657f08285ebdfe93f5ec9ee88d3fbccae84a9d22831150df35b7bd" title="Poly is on same plane.">CS_POL_SAME_PLANE</a> = 0,
<a name="l00043"></a><a class="code" href="group__geom__utils.html#gg05589fbab0657f08285ebdfe93f5ec9ea271cb2d4694f05e2df381d1cb98279d">00043</a>   <a class="code" href="group__geom__utils.html#gg05589fbab0657f08285ebdfe93f5ec9ea271cb2d4694f05e2df381d1cb98279d" title="Poly is completely in front of the given plane.">CS_POL_FRONT</a> = 1,
<a name="l00045"></a><a class="code" href="group__geom__utils.html#gg05589fbab0657f08285ebdfe93f5ec9ebd5e6308857d9f8cb82434d7d0086a70">00045</a>   <a class="code" href="group__geom__utils.html#gg05589fbab0657f08285ebdfe93f5ec9ebd5e6308857d9f8cb82434d7d0086a70" title="Poly is completely back of the given plane.">CS_POL_BACK</a> = 2,
<a name="l00047"></a><a class="code" href="group__geom__utils.html#gg05589fbab0657f08285ebdfe93f5ec9efbc4ca645c2a7478693b045287029b11">00047</a>   <a class="code" href="group__geom__utils.html#gg05589fbab0657f08285ebdfe93f5ec9efbc4ca645c2a7478693b045287029b11" title="Poly intersects with plane.">CS_POL_SPLIT_NEEDED</a> = 3
<a name="l00048"></a>00048 };
<a name="l00049"></a>00049 
<a name="l00053"></a><a class="code" href="classcsPoly3D.html">00053</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>
<a name="l00054"></a>00054 {
<a name="l00055"></a>00055 <span class="keyword">protected</span>:
<a name="l00057"></a><a class="code" href="classcsPoly3D.html#d32a70d5d3e92f3cd67b5c63a6d317bd">00057</a>   <a class="code" href="classcsDirtyAccessArray.html" title="A templated array class.">csDirtyAccessArray&lt;csVector3&gt;</a> vertices;
<a name="l00058"></a>00058 
<a name="l00059"></a>00059 <span class="keyword">public</span>:
<a name="l00063"></a>00063   <a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a> (<span class="keywordtype">size_t</span> start_size = 10);
<a name="l00064"></a>00064 
<a name="l00066"></a>00066   <a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a> (<span class="keyword">const</span> <a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>&amp; copy);
<a name="l00067"></a>00067 
<a name="l00069"></a>00069   <span class="keyword">virtual</span> ~<a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a> ();
<a name="l00070"></a>00070 
<a name="l00074"></a>00074   <span class="keywordtype">void</span> MakeEmpty ();
<a name="l00075"></a>00075 
<a name="l00079"></a><a class="code" href="classcsPoly3D.html#9691ea579ebd3be1375e2aa54508ea7a">00079</a>   <span class="keyword">inline</span> <span class="keywordtype">size_t</span> GetVertexCount ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> vertices.GetSize (); }
<a name="l00080"></a>00080 
<a name="l00084"></a><a class="code" href="classcsPoly3D.html#35f6c75ed5c61e85a91c51f330bd43c4">00084</a>   <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* GetVertices ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> vertices.GetArray (); }
<a name="l00085"></a>00085 
<a name="l00089"></a><a class="code" href="classcsPoly3D.html#6beb80bb2cc395e0c15d43eca6e5054f">00089</a>   <span class="keyword">inline</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* GetVertices () { <span class="keywordflow">return</span> vertices.GetArray (); }
<a name="l00090"></a>00090 
<a name="l00094"></a><a class="code" href="classcsPoly3D.html#32c16a4cb49d35507ac50e4f5969496f">00094</a>   <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* GetVertex (<span class="keywordtype">size_t</span> i)<span class="keyword"> const</span>
<a name="l00095"></a>00095 <span class="keyword">  </span>{
<a name="l00096"></a>00096     <span class="keywordflow">if</span> (i &gt;= vertices.GetSize ()) <span class="keywordflow">return</span> 0;
<a name="l00097"></a>00097     <span class="keywordflow">return</span> &amp;(vertices.GetArray ()[i]);
<a name="l00098"></a>00098   }
<a name="l00099"></a>00099 
<a name="l00103"></a><a class="code" href="classcsPoly3D.html#abf094660b7ed09f860ca6dc867f631e">00103</a>   <span class="keyword">inline</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; operator[] (<span class="keywordtype">size_t</span> i)
<a name="l00104"></a>00104   {
<a name="l00105"></a>00105     <span class="keywordflow">return</span> vertices[i];
<a name="l00106"></a>00106   }
<a name="l00107"></a>00107 
<a name="l00111"></a><a class="code" href="classcsPoly3D.html#aa01037355eb0f05c480c1fe815ed666">00111</a>   <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; operator[] (<span class="keywordtype">size_t</span> i)<span class="keyword"> const</span>
<a name="l00112"></a>00112 <span class="keyword">  </span>{
<a name="l00113"></a>00113     <span class="keywordflow">return</span> vertices[i];
<a name="l00114"></a>00114   }
<a name="l00115"></a>00115 
<a name="l00119"></a><a class="code" href="classcsPoly3D.html#9d98c2e3368d716d13620784faf8a8d5">00119</a>   <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* GetFirst ()<span class="keyword"> const</span>
<a name="l00120"></a>00120 <span class="keyword">  </span>{ 
<a name="l00121"></a>00121     <span class="keywordflow">if</span> (vertices.GetSize ()&lt;=0) <span class="keywordflow">return</span> 0;  
<a name="l00122"></a>00122     <span class="keywordflow">else</span> <span class="keywordflow">return</span> vertices.GetArray ();
<a name="l00123"></a>00123   }
<a name="l00124"></a>00124 
<a name="l00128"></a><a class="code" href="classcsPoly3D.html#08c19ee5d278f7f81b17b7a79600a7af">00128</a>   <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* GetLast ()<span class="keyword"> const</span>
<a name="l00129"></a>00129 <span class="keyword">  </span>{ 
<a name="l00130"></a>00130     <span class="keywordflow">if</span> (vertices.GetSize ()&lt;=0) <span class="keywordflow">return</span> 0; 
<a name="l00131"></a>00131     <span class="keywordflow">else</span> <span class="keywordflow">return</span> 
<a name="l00132"></a>00132       &amp;(vertices.GetArray ())[vertices.GetSize ()-1]; 
<a name="l00133"></a>00133   }
<a name="l00134"></a>00134 
<a name="l00138"></a>00138   <span class="keywordtype">bool</span> In (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; v) <span class="keyword">const</span>;
<a name="l00139"></a>00139 
<a name="l00143"></a>00143   <span class="keyword">static</span> <span class="keywordtype">bool</span> In (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* poly, <span class="keywordtype">size_t</span> num_poly, <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; v);
<a name="l00144"></a>00144 
<a name="l00148"></a>00148   <span class="keywordtype">void</span> MakeRoom (<span class="keywordtype">size_t</span> new_max);
<a name="l00149"></a>00149 
<a name="l00153"></a><a class="code" href="classcsPoly3D.html#363705c1227104d87de0723798799a6b">00153</a>   <span class="keyword">inline</span> <span class="keywordtype">void</span> SetVertexCount (<span class="keywordtype">size_t</span> n) 
<a name="l00154"></a>00154   { 
<a name="l00155"></a>00155     MakeRoom (n);
<a name="l00156"></a>00156     vertices.SetSize (n); 
<a name="l00157"></a>00157   }
<a name="l00158"></a>00158 
<a name="l00163"></a><a class="code" href="classcsPoly3D.html#69f609b555c1be059b802fa6168c16a4">00163</a>   <span class="keyword">inline</span> <span class="keywordtype">size_t</span> AddVertex (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; v)
<a name="l00164"></a>00164   {
<a name="l00165"></a>00165     <span class="keywordflow">return</span> AddVertex (v.<a class="code" href="classcsVector3.html#823fdba459ff91e8a5e6834ded7c815f" title="The X component of the vector.">x</a>, v.<a class="code" href="classcsVector3.html#e0a74264b61eb5d61da63b3c101af719" title="The Y component of the vector.">y</a>, v.<a class="code" href="classcsVector3.html#3f761bd195c7ccec59ea863a87a1ad05" title="The Z component of the vector.">z</a>);
<a name="l00166"></a>00166   }
<a name="l00167"></a>00167 
<a name="l00172"></a>00172   <span class="keywordtype">size_t</span> AddVertex (<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
<a name="l00173"></a>00173 
<a name="l00177"></a><a class="code" href="classcsPoly3D.html#7211a74df5b674ac8b39af3c11bc2aba">00177</a>   <span class="keyword">inline</span> <span class="keywordtype">void</span> SetVertices (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a> <span class="keyword">const</span>* v, <span class="keywordtype">size_t</span> num)
<a name="l00178"></a>00178   {
<a name="l00179"></a>00179     MakeRoom (num);
<a name="l00180"></a>00180     memcpy (vertices.GetArray (), v, num * <span class="keyword">sizeof</span> (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>));
<a name="l00181"></a>00181   }
<a name="l00182"></a>00182 
<a name="l00190"></a>00190   <span class="keywordtype">bool</span> ProjectXPlane (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; point, <span class="keywordtype">float</span> plane_x,
<a name="l00191"></a>00191         <a class="code" href="classcsPoly2D.html" title="The following class represents a general 2D polygon.">csPoly2D</a>* poly2d) <span class="keyword">const</span>;
<a name="l00192"></a>00192 
<a name="l00200"></a>00200   <span class="keywordtype">bool</span> ProjectYPlane (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; point, <span class="keywordtype">float</span> plane_y,
<a name="l00201"></a>00201         <a class="code" href="classcsPoly2D.html" title="The following class represents a general 2D polygon.">csPoly2D</a>* poly2d) <span class="keyword">const</span>;
<a name="l00202"></a>00202 
<a name="l00210"></a>00210   <span class="keywordtype">bool</span> ProjectZPlane (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; point, <span class="keywordtype">float</span> plane_z,
<a name="l00211"></a>00211         <a class="code" href="classcsPoly2D.html" title="The following class represents a general 2D polygon.">csPoly2D</a>* poly2d) <span class="keyword">const</span>;
<a name="l00212"></a>00212 
<a name="l00220"></a><a class="code" href="classcsPoly3D.html#4ce08b4d23911e7e40387e6b2a1dd2a1">00220</a>   <span class="keyword">inline</span> <span class="keywordtype">bool</span> ProjectAxisPlane (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; point, <span class="keywordtype">int</span> plane_nr,
<a name="l00221"></a>00221         <span class="keywordtype">float</span> plane_pos, <a class="code" href="classcsPoly2D.html" title="The following class represents a general 2D polygon.">csPoly2D</a>* poly2d)<span class="keyword"> const</span>
<a name="l00222"></a>00222 <span class="keyword">  </span>{
<a name="l00223"></a>00223     <span class="keywordflow">switch</span> (plane_nr)
<a name="l00224"></a>00224     {
<a name="l00225"></a>00225       <span class="keywordflow">case</span> <a class="code" href="group__geom__utils.html#ggdb49720dc49f7d4e4cf9adbf2948e4098e81da4ab0c7c07c39847d17fb3a95b5" title="X axis.">CS_AXIS_X</a>: <span class="keywordflow">return</span> ProjectXPlane (point, plane_pos, poly2d);
<a name="l00226"></a>00226       <span class="keywordflow">case</span> <a class="code" href="group__geom__utils.html#ggdb49720dc49f7d4e4cf9adbf2948e4099734b1073fe8f5572622f5e39120317d" title="Y axis.">CS_AXIS_Y</a>: <span class="keywordflow">return</span> ProjectYPlane (point, plane_pos, poly2d);
<a name="l00227"></a>00227       <span class="keywordflow">case</span> <a class="code" href="group__geom__utils.html#ggdb49720dc49f7d4e4cf9adbf2948e4092524f76ec772151941164bee31d5d9f1" title="Z axis.">CS_AXIS_Z</a>: <span class="keywordflow">return</span> ProjectZPlane (point, plane_pos, poly2d);
<a name="l00228"></a>00228     }
<a name="l00229"></a>00229     <span class="keywordflow">return</span> <span class="keyword">false</span>;
<a name="l00230"></a>00230   }
<a name="l00231"></a>00231 
<a name="l00239"></a>00239   <span class="keyword">static</span> <span class="keywordtype">int</span> Classify (<span class="keyword">const</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>&amp; pl,
<a name="l00240"></a>00240         <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <span class="keywordtype">size_t</span> num_vertices);
<a name="l00241"></a>00241 
<a name="l00249"></a><a class="code" href="classcsPoly3D.html#a62580d9c2e50e1614603395f82a06c9">00249</a>   <span class="keyword">inline</span> <span class="keywordtype">int</span> Classify (<span class="keyword">const</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>&amp; pl)<span class="keyword"> const</span>
<a name="l00250"></a>00250 <span class="keyword">  </span>{
<a name="l00251"></a>00251     <span class="keywordflow">return</span> Classify (pl, vertices.GetArray (), vertices.GetSize ());
<a name="l00252"></a>00252   }
<a name="l00253"></a>00253 
<a name="l00255"></a>00255   <span class="keywordtype">int</span> ClassifyX (<span class="keywordtype">float</span> x) <span class="keyword">const</span>;
<a name="l00256"></a>00256 
<a name="l00258"></a>00258   <span class="keywordtype">int</span> ClassifyY (<span class="keywordtype">float</span> y) <span class="keyword">const</span>;
<a name="l00259"></a>00259 
<a name="l00261"></a>00261   <span class="keywordtype">int</span> ClassifyZ (<span class="keywordtype">float</span> z) <span class="keyword">const</span>;
<a name="l00262"></a>00262 
<a name="l00264"></a><a class="code" href="classcsPoly3D.html#2e0593a3f3d91f8975eeb5f2dd69628d">00264</a>   <span class="keyword">inline</span> <span class="keywordtype">int</span> ClassifyAxis (<span class="keywordtype">int</span> axis, <span class="keywordtype">float</span> where)<span class="keyword"> const</span>
<a name="l00265"></a>00265 <span class="keyword">  </span>{
<a name="l00266"></a>00266     <span class="keywordflow">switch</span> (axis)
<a name="l00267"></a>00267     {
<a name="l00268"></a>00268       <span class="keywordflow">case</span> <a class="code" href="group__geom__utils.html#ggdb49720dc49f7d4e4cf9adbf2948e4098e81da4ab0c7c07c39847d17fb3a95b5" title="X axis.">CS_AXIS_X</a>: <span class="keywordflow">return</span> ClassifyX (where);
<a name="l00269"></a>00269       <span class="keywordflow">case</span> <a class="code" href="group__geom__utils.html#ggdb49720dc49f7d4e4cf9adbf2948e4099734b1073fe8f5572622f5e39120317d" title="Y axis.">CS_AXIS_Y</a>: <span class="keywordflow">return</span> ClassifyY (where);
<a name="l00270"></a>00270       <span class="keywordflow">case</span> <a class="code" href="group__geom__utils.html#ggdb49720dc49f7d4e4cf9adbf2948e4092524f76ec772151941164bee31d5d9f1" title="Z axis.">CS_AXIS_Z</a>: <span class="keywordflow">return</span> ClassifyZ (where);
<a name="l00271"></a>00271     }
<a name="l00272"></a>00272     <span class="keywordflow">return</span> 0;
<a name="l00273"></a>00273   }
<a name="l00274"></a>00274 
<a name="l00282"></a>00282   <span class="keywordtype">int</span> IsAxisAligned (<span class="keywordtype">float</span>&amp; where, <span class="keywordtype">float</span> epsilon = SMALL_EPSILON) <span class="keyword">const</span>;
<a name="l00283"></a>00283 
<a name="l00288"></a>00288   <span class="keywordtype">int</span> ComputeMainNormalAxis () <span class="keyword">const</span>;
<a name="l00289"></a>00289 
<a name="l00291"></a>00291   <span class="keywordtype">void</span> CutToPlane (<span class="keyword">const</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>&amp; split_plane);
<a name="l00292"></a>00292 
<a name="l00294"></a>00294   <span class="keywordtype">void</span> SplitWithPlane (<a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>&amp; front, <a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>&amp; back,
<a name="l00295"></a>00295         <span class="keyword">const</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>&amp; split_plane) <span class="keyword">const</span>;
<a name="l00296"></a>00296 
<a name="l00298"></a>00298   <span class="keywordtype">void</span> SplitWithPlaneX (<a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>&amp; front, <a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>&amp; back, <span class="keywordtype">float</span> x) <span class="keyword">const</span>;
<a name="l00299"></a>00299 
<a name="l00301"></a>00301   <span class="keywordtype">void</span> SplitWithPlaneY (<a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>&amp; front, <a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>&amp; back, <span class="keywordtype">float</span> y) <span class="keyword">const</span>;
<a name="l00302"></a>00302 
<a name="l00304"></a>00304   <span class="keywordtype">void</span> SplitWithPlaneZ (<a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>&amp; front, <a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>&amp; back, <span class="keywordtype">float</span> z) <span class="keyword">const</span>;
<a name="l00305"></a>00305 
<a name="l00307"></a>00307   <span class="keyword">static</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a> ComputeNormal (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <span class="keywordtype">size_t</span> num);
<a name="l00308"></a>00308 
<a name="l00310"></a>00310   <span class="keyword">static</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a> ComputeNormal (<span class="keyword">const</span> <a class="code" href="classcsArray.html" title="A templated array class.">csArray&lt;csVector3&gt;</a>&amp; poly);
<a name="l00311"></a>00311 
<a name="l00313"></a>00313   <span class="keyword">static</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a> ComputeNormal (<span class="keywordtype">int</span>* poly, <span class="keywordtype">size_t</span> num, <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices);
<a name="l00314"></a>00314 
<a name="l00316"></a><a class="code" href="classcsPoly3D.html#ea8d51aa6679fb21a1c040adc7f0ce64">00316</a>   <span class="keyword">inline</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a> ComputeNormal ()<span class="keyword"> const</span>
<a name="l00317"></a>00317 <span class="keyword">  </span>{
<a name="l00318"></a>00318     <span class="keywordflow">return</span> ComputeNormal (vertices.GetArray (), vertices.GetSize ());
<a name="l00319"></a>00319   }
<a name="l00320"></a>00320 
<a name="l00322"></a>00322   <span class="keyword">static</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a> ComputePlane (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <span class="keywordtype">size_t</span> num);
<a name="l00323"></a>00323 
<a name="l00325"></a>00325   <span class="keyword">static</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a> ComputePlane (<span class="keyword">const</span> <a class="code" href="classcsArray.html" title="A templated array class.">csArray&lt;csVector3&gt;</a>&amp; poly);
<a name="l00326"></a>00326 
<a name="l00328"></a>00328   <span class="keyword">static</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a> ComputePlane (<span class="keywordtype">int</span>* poly, <span class="keywordtype">size_t</span> num, <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices);
<a name="l00329"></a>00329 
<a name="l00331"></a><a class="code" href="classcsPoly3D.html#06c9b47077a862288b74826ae97de5fe">00331</a>   <span class="keyword">inline</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a> ComputePlane ()<span class="keyword"> const</span>
<a name="l00332"></a>00332 <span class="keyword">  </span>{
<a name="l00333"></a>00333     <span class="keywordflow">return</span> ComputePlane (vertices.GetArray (), vertices.GetSize ());
<a name="l00334"></a>00334   }
<a name="l00335"></a>00335 
<a name="l00339"></a>00339   <span class="keywordtype">float</span> GetArea() <span class="keyword">const</span>;
<a name="l00340"></a>00340 
<a name="l00344"></a>00344   <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a> GetCenter () <span class="keyword">const</span>;
<a name="l00345"></a>00345 
<a name="l00347"></a>00347   <span class="keywordtype">bool</span> InSphere(<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; center, <span class="keywordtype">float</span> radius);
<a name="l00348"></a>00348 };
<a name="l00349"></a>00349 
<a name="l00351"></a><a class="code" href="structcsCompressVertex.html">00351</a> <span class="keyword">struct </span><a class="code" href="structcsCompressVertex.html" title="This structure is used by csVector3Array::CompressVertices().">csCompressVertex</a>
<a name="l00352"></a>00352 {
<a name="l00353"></a><a class="code" href="structcsCompressVertex.html#301dd85964c8ade4f58ed4198d3feb98">00353</a>   <span class="keywordtype">size_t</span> <a class="code" href="structcsCompressVertex.html#301dd85964c8ade4f58ed4198d3feb98">orig_idx</a>;
<a name="l00354"></a><a class="code" href="structcsCompressVertex.html#0a1b12debf30b760d49cd6f9dcd496a9">00354</a>   <span class="keywordtype">int</span> <a class="code" href="structcsCompressVertex.html#60ee98506e0a757c8e80bc585dd13f81">x</a>, <a class="code" href="structcsCompressVertex.html#d978314d284814884136022e71924711">y</a>, <a class="code" href="structcsCompressVertex.html#0a1b12debf30b760d49cd6f9dcd496a9">z</a>;
<a name="l00355"></a><a class="code" href="structcsCompressVertex.html#026bc21c2f871c939fa09f054ab616ee">00355</a>   <span class="keywordtype">size_t</span> <a class="code" href="structcsCompressVertex.html#026bc21c2f871c939fa09f054ab616ee">new_idx</a>;
<a name="l00356"></a><a class="code" href="structcsCompressVertex.html#e3e383ff1c56f2f8990a4a7cf455fca0">00356</a>   <span class="keywordtype">bool</span> <a class="code" href="structcsCompressVertex.html#e3e383ff1c56f2f8990a4a7cf455fca0">used</a>;
<a name="l00357"></a>00357 };
<a name="l00358"></a>00358 
<a name="l00365"></a><a class="code" href="classcsVector3Array.html">00365</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsVector3Array.html" title="This is actually the same class as csPoly3D.">csVector3Array</a> : <span class="keyword">public</span> <a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a>
<a name="l00366"></a>00366 {
<a name="l00367"></a>00367 <span class="keyword">public</span>:
<a name="l00368"></a><a class="code" href="classcsVector3Array.html#6620a9debf30dc21e1b6799981d94281">00368</a>   <a class="code" href="classcsVector3Array.html" title="This is actually the same class as csPoly3D.">csVector3Array</a> (<span class="keywordtype">size_t</span> start_size = 10) : <a class="code" href="classcsPoly3D.html" title="The following class represents a general 3D polygon.">csPoly3D</a> (start_size) { }
<a name="l00369"></a>00369 
<a name="l00374"></a><a class="code" href="classcsVector3Array.html#f99afaa87a3a56fb079dd18d156167bf">00374</a>   <span class="keyword">inline</span> <span class="keywordtype">size_t</span> AddVertexSmart (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>&amp; v)
<a name="l00375"></a>00375   { <span class="keywordflow">return</span> AddVertexSmart (v.<a class="code" href="classcsVector3.html#823fdba459ff91e8a5e6834ded7c815f" title="The X component of the vector.">x</a>, v.<a class="code" href="classcsVector3.html#e0a74264b61eb5d61da63b3c101af719" title="The Y component of the vector.">y</a>, v.<a class="code" href="classcsVector3.html#3f761bd195c7ccec59ea863a87a1ad05" title="The Z component of the vector.">z</a>); }
<a name="l00376"></a>00376 
<a name="l00381"></a>00381   <span class="keywordtype">size_t</span> AddVertexSmart (<span class="keywordtype">float</span> x, <span class="keywordtype">float</span> y, <span class="keywordtype">float</span> z);
<a name="l00382"></a>00382 
<a name="l00394"></a>00394   <span class="keyword">static</span> <a class="code" href="structcsCompressVertex.html" title="This structure is used by csVector3Array::CompressVertices().">csCompressVertex</a>* CompressVertices (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices,
<a name="l00395"></a>00395         <span class="keywordtype">size_t</span> num_vertices, <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>*&amp; new_vertices, <span class="keywordtype">size_t</span>&amp; new_count);
<a name="l00396"></a>00396 
<a name="l00405"></a>00405   <span class="keyword">static</span> <a class="code" href="structcsCompressVertex.html" title="This structure is used by csVector3Array::CompressVertices().">csCompressVertex</a>* CompressVertices (<a class="code" href="classcsArray.html" title="A templated array class.">csArray&lt;csVector3&gt;</a>&amp; vertices);
<a name="l00406"></a>00406 };
<a name="l00407"></a>00407 
<a name="l00410"></a>00410 <span class="preprocessor">#endif // __CS_POLY3D_H__</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>