<!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/frustum.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/frustum.h</h1><a href="frustum_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-2001 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_FRUSTRUM_H__</span> <a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">#define __CS_FRUSTRUM_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="cstypes_8h.html" title="Commonly used types and macros.">cstypes.h</a>"</span> <a name="l00032"></a>00032 <span class="preprocessor">#include "<a class="code" href="refcount_8h.html" title="Reference Counting Interface.">csutil/refcount.h</a>"</span> <a name="l00033"></a>00033 <span class="preprocessor">#include "<a class="code" href="vector3_8h.html" title="3D vector.">csgeom/vector3.h</a>"</span> <a name="l00034"></a>00034 <a name="l00035"></a>00035 <span class="keyword">class </span><a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>; <a name="l00036"></a>00036 <span class="keyword">template</span><<span class="keyword">class</span> T> <a name="l00037"></a>00037 <span class="keyword">class </span><a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr</a>; <a name="l00038"></a>00038 <span class="keyword">class </span><a class="code" href="classcsTransform.html" title="A class which defines a transformation from one coordinate system to another.">csTransform</a>; <a name="l00039"></a>00039 <span class="keyword">class </span><a class="code" href="classcsSegment3.html" title="A 3D line segment.">csSegment3</a>; <a name="l00040"></a>00040 <a name="l00046"></a>00046 <span class="keyword">enum</span> <a name="l00047"></a>00047 { <a name="l00049"></a><a class="code" href="group__geom__utils.html#gg61dadd085c1777f559549e05962b2c9e94cc72a1a3f8f76be34890b8b685f382">00049</a> <a class="code" href="group__geom__utils.html#gg61dadd085c1777f559549e05962b2c9e94cc72a1a3f8f76be34890b8b685f382" title="The polygon is fully outside frustum.">CS_FRUST_OUTSIDE</a> = 0, <a name="l00051"></a><a class="code" href="group__geom__utils.html#gg61dadd085c1777f559549e05962b2c9e5d55e08138192c764d87aec4cb6fd8e2">00051</a> <a class="code" href="group__geom__utils.html#gg61dadd085c1777f559549e05962b2c9e5d55e08138192c764d87aec4cb6fd8e2" title="The polygon is fully inside frustum.">CS_FRUST_INSIDE</a> = 1, <a name="l00053"></a><a class="code" href="group__geom__utils.html#gg61dadd085c1777f559549e05962b2c9eda01f0cc2cf09d08a4cc49d8ec31e208">00053</a> <a class="code" href="group__geom__utils.html#gg61dadd085c1777f559549e05962b2c9eda01f0cc2cf09d08a4cc49d8ec31e208" title="The polygon fully covers the frustum.">CS_FRUST_COVERED</a> = 2, <a name="l00055"></a><a class="code" href="group__geom__utils.html#gg61dadd085c1777f559549e05962b2c9e29a0b767ce5e46c8d3c8150713ed7dc8">00055</a> <a class="code" href="group__geom__utils.html#gg61dadd085c1777f559549e05962b2c9e29a0b767ce5e46c8d3c8150713ed7dc8" title="The polygon is partially inside frustum.">CS_FRUST_PARTIAL</a> = 3 <a name="l00056"></a>00056 }; <a name="l00059"></a><a class="code" href="group__geom__utils.html#gb16b3b21d99638775c56de4bc2e3481b">00059</a> <span class="keyword">enum</span> <a class="code" href="group__geom__utils.html#gb16b3b21d99638775c56de4bc2e3481b">csClipType</a> <a name="l00060"></a>00060 { <a name="l00061"></a><a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481baeb1dab65c1ae464a08812b43ea23b96">00061</a> <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481baeb1dab65c1ae464a08812b43ea23b96">CS_CLIPINFO_ORIGINAL</a> = 0, <a name="l00062"></a><a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481b49e16e6a3e8c7e5533cb90907498ccb9">00062</a> <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481b49e16e6a3e8c7e5533cb90907498ccb9">CS_CLIPINFO_ONEDGE</a> = 1, <a name="l00063"></a><a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481b95b11b959d4981b861946b6c854ce1de">00063</a> <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481b95b11b959d4981b861946b6c854ce1de">CS_CLIPINFO_INSIDE</a> = 2 <a name="l00064"></a>00064 }; <a name="l00065"></a>00065 <a name="l00072"></a><a class="code" href="structcsClipInfo.html">00072</a> <span class="keyword">struct </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a> <a name="l00073"></a>00073 { <a name="l00074"></a>00074 <a name="l00075"></a><a class="code" href="structcsClipInfo.html#8ee07ab026404466d8e4771a0834d270">00075</a> <a class="code" href="group__geom__utils.html#gb16b3b21d99638775c56de4bc2e3481b">csClipType</a> type; <span class="comment">// One of CS_CLIPINFO_???</span> <a name="l00076"></a>00076 <span class="keyword">union</span> <a name="l00077"></a>00077 { <a name="l00078"></a><a class="code" href="structcsClipInfo.html#dfa938852c03654d0dd0d325441a5931">00078</a> <span class="keyword">struct </span>{ <span class="keywordtype">int</span> idx; } original; <a name="l00079"></a><a class="code" href="structcsClipInfo.html#0ac16074521d122743c8c396842c8c68">00079</a> <span class="keyword">struct </span>{ <span class="keywordtype">int</span> i1, i2; <span class="keywordtype">float</span> r; } onedge; <a name="l00080"></a><a class="code" href="structcsClipInfo.html#801b6fb0fb8763a46e2cab58086186cf">00080</a> <span class="keyword">struct </span>{ <a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a>* ci1, * ci2; <span class="keywordtype">float</span> r; } inside; <a name="l00081"></a>00081 }; <a name="l00082"></a>00082 <a name="l00083"></a><a class="code" href="structcsClipInfo.html#c6df29bf2ae566f9e66ebc20777b24dd">00083</a> <a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a> () : type (<a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481baeb1dab65c1ae464a08812b43ea23b96">CS_CLIPINFO_ORIGINAL</a>) { } <a name="l00084"></a>00084 <span class="keywordtype">void</span> Clear (); <a name="l00085"></a><a class="code" href="structcsClipInfo.html#7dc595931ba65a04389636267b62d6b2">00085</a> ~<a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a> () { Clear (); } <a name="l00086"></a>00086 <a name="l00088"></a><a class="code" href="structcsClipInfo.html#553df9452e46699ce6e1c4e6f86d87da">00088</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> Copy (<a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a>& other) <a name="l00089"></a>00089 { <a name="l00090"></a>00090 <span class="keywordflow">if</span> (&other == <span class="keyword">this</span>) <span class="keywordflow">return</span>; <a name="l00091"></a>00091 Clear (); <a name="l00092"></a>00092 type = other.<a class="code" href="structcsClipInfo.html#8ee07ab026404466d8e4771a0834d270">type</a>; <a name="l00093"></a>00093 <span class="keywordflow">if</span> (type == <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481b95b11b959d4981b861946b6c854ce1de">CS_CLIPINFO_INSIDE</a>) <a name="l00094"></a>00094 { <a name="l00095"></a>00095 inside.r = other.<a class="code" href="structcsClipInfo.html#6a6339d566bf49d5e93862b9bcbc5731">inside</a>.r; <a name="l00096"></a>00096 inside.ci1 = <span class="keyword">new</span> <a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a> (); <a name="l00097"></a>00097 inside.ci1->Copy (*other.<a class="code" href="structcsClipInfo.html#6a6339d566bf49d5e93862b9bcbc5731">inside</a>.ci1); <a name="l00098"></a>00098 inside.ci2 = <span class="keyword">new</span> <a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a> (); <a name="l00099"></a>00099 inside.ci2->Copy (*other.<a class="code" href="structcsClipInfo.html#6a6339d566bf49d5e93862b9bcbc5731">inside</a>.ci2); <a name="l00100"></a>00100 } <a name="l00101"></a>00101 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (type == <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481baeb1dab65c1ae464a08812b43ea23b96">CS_CLIPINFO_ORIGINAL</a>) <a name="l00102"></a>00102 original.idx = other.<a class="code" href="structcsClipInfo.html#e3f3a0acab59e2f8bddcc9b859d4255d">original</a>.idx; <a name="l00103"></a>00103 <span class="keywordflow">else</span> <a name="l00104"></a>00104 onedge = other.<a class="code" href="structcsClipInfo.html#505deee665550779044db85e08f0ded2">onedge</a>; <a name="l00105"></a>00105 } <a name="l00106"></a>00106 <a name="l00108"></a><a class="code" href="structcsClipInfo.html#67553540381000245b21f4ea4328933f">00108</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> Move (<a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a>& other) <a name="l00109"></a>00109 { <a name="l00110"></a>00110 <span class="keywordflow">if</span> (&other == <span class="keyword">this</span>) <span class="keywordflow">return</span>; <a name="l00111"></a>00111 Clear (); <a name="l00112"></a>00112 type = other.<a class="code" href="structcsClipInfo.html#8ee07ab026404466d8e4771a0834d270">type</a>; <a name="l00113"></a>00113 <span class="keywordflow">if</span> (type == <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481b95b11b959d4981b861946b6c854ce1de">CS_CLIPINFO_INSIDE</a>) <a name="l00114"></a>00114 inside = other.<a class="code" href="structcsClipInfo.html#6a6339d566bf49d5e93862b9bcbc5731">inside</a>; <a name="l00115"></a>00115 <span class="keywordflow">else</span> <span class="keywordflow">if</span> (type == <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481baeb1dab65c1ae464a08812b43ea23b96">CS_CLIPINFO_ORIGINAL</a>) <a name="l00116"></a>00116 original.idx = other.<a class="code" href="structcsClipInfo.html#e3f3a0acab59e2f8bddcc9b859d4255d">original</a>.idx; <a name="l00117"></a>00117 <span class="keywordflow">else</span> <a name="l00118"></a>00118 onedge = other.<a class="code" href="structcsClipInfo.html#505deee665550779044db85e08f0ded2">onedge</a>; <a name="l00119"></a>00119 other.<a class="code" href="structcsClipInfo.html#8ee07ab026404466d8e4771a0834d270">type</a> = <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481baeb1dab65c1ae464a08812b43ea23b96">CS_CLIPINFO_ORIGINAL</a>; <a name="l00120"></a>00120 } <a name="l00121"></a>00121 <a name="l00122"></a><a class="code" href="structcsClipInfo.html#54d75370a3b0fff7531db094e9c2fb64">00122</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> Dump (<span class="keywordtype">int</span> indent) <a name="l00123"></a>00123 { <a name="l00124"></a>00124 <span class="keywordtype">char</span> ind[255]; <a name="l00125"></a>00125 <span class="keywordtype">int</span> i; <a name="l00126"></a>00126 <span class="keywordflow">for</span> (i = 0 ; i < indent ; i++) ind[i] = <span class="charliteral">' '</span>; <a name="l00127"></a>00127 ind[i] = 0; <a name="l00128"></a>00128 <span class="keywordflow">switch</span> (type) <a name="l00129"></a>00129 { <a name="l00130"></a>00130 <span class="keywordflow">case</span> <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481baeb1dab65c1ae464a08812b43ea23b96">CS_CLIPINFO_ORIGINAL</a>: <a name="l00131"></a>00131 printf (<span class="stringliteral">"%s ORIGINAL idx=%d\n"</span>, ind, original.idx); <a name="l00132"></a>00132 <span class="keywordflow">break</span>; <a name="l00133"></a>00133 <span class="keywordflow">case</span> <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481b49e16e6a3e8c7e5533cb90907498ccb9">CS_CLIPINFO_ONEDGE</a>: <a name="l00134"></a>00134 printf (<span class="stringliteral">"%s ONEDGE i1=%d i2=%d r=%g\n"</span>, ind, onedge.i1, onedge.i2, <a name="l00135"></a>00135 onedge.r); <a name="l00136"></a>00136 <span class="keywordflow">break</span>; <a name="l00137"></a>00137 <span class="keywordflow">case</span> <a class="code" href="group__geom__utils.html#ggb16b3b21d99638775c56de4bc2e3481b95b11b959d4981b861946b6c854ce1de">CS_CLIPINFO_INSIDE</a>: <a name="l00138"></a>00138 printf (<span class="stringliteral">"%s INSIDE r=%g\n"</span>, ind, inside.r); <a name="l00139"></a>00139 inside.ci1->Dump (indent+2); <a name="l00140"></a>00140 inside.ci2->Dump (indent+2); <a name="l00141"></a>00141 <span class="keywordflow">break</span>; <a name="l00142"></a>00142 } <a name="l00143"></a>00143 fflush (stdout); <a name="l00144"></a>00144 } <a name="l00145"></a>00145 }; <a name="l00146"></a>00146 <a name="l00157"></a><a class="code" href="classcsFrustum.html">00157</a> <span class="keyword">class </span>CS_CRYSTALSPACE_EXPORT <a class="code" href="classcsFrustum.html" title="A general frustum.">csFrustum</a> : <span class="keyword">public</span> <a class="code" href="classcsRefCount.html" title="This is a class which provides basic reference-counting semantics.">csRefCount</a> <a name="l00158"></a>00158 { <a name="l00159"></a>00159 <span class="keyword">private</span>: <a name="l00161"></a>00161 <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a> origin; <a name="l00162"></a>00162 <a name="l00168"></a>00168 <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices; <a name="l00170"></a>00170 <span class="keywordtype">size_t</span> num_vertices; <a name="l00172"></a>00172 <span class="keywordtype">size_t</span> max_vertices; <a name="l00173"></a>00173 <a name="l00175"></a>00175 <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* backplane; <a name="l00176"></a>00176 <a name="l00184"></a>00184 <span class="keywordtype">bool</span> wide; <a name="l00185"></a>00185 <a name="l00190"></a>00190 <span class="keywordtype">bool</span> mirrored; <a name="l00191"></a>00191 <a name="l00193"></a>00193 <span class="keywordtype">void</span> Clear (); <a name="l00194"></a>00194 <a name="l00196"></a>00196 <span class="keywordtype">void</span> ExtendVertexArray (<span class="keywordtype">size_t</span> num); <a name="l00197"></a>00197 <a name="l00198"></a>00198 <span class="keyword">public</span>: <a name="l00199"></a>00199 <a name="l00201"></a><a class="code" href="classcsFrustum.html#32b1d501aa473abc9cc28fdaf5e0b5fb">00201</a> <a class="code" href="classcsFrustum.html" title="A general frustum.">csFrustum</a> (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& o) : <a name="l00202"></a>00202 origin (o), vertices (0), num_vertices (0), max_vertices (0), <a name="l00203"></a>00203 backplane (0), wide (false), mirrored (false) <a name="l00204"></a>00204 { } <a name="l00205"></a>00205 <a name="l00211"></a>00211 <a class="code" href="classcsFrustum.html" title="A general frustum.">csFrustum</a> (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& o, <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* verts, <span class="keywordtype">size_t</span> num_verts, <a name="l00212"></a>00212 <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* backp = 0); <a name="l00213"></a>00213 <a name="l00219"></a>00219 <a class="code" href="classcsFrustum.html" title="A general frustum.">csFrustum</a> (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& o, <span class="keywordtype">size_t</span> num_verts, <a name="l00220"></a>00220 <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* backp = 0); <a name="l00221"></a>00221 <a name="l00223"></a>00223 <a class="code" href="classcsFrustum.html" title="A general frustum.">csFrustum</a> (<span class="keyword">const</span> <a class="code" href="classcsFrustum.html" title="A general frustum.">csFrustum</a> &copy); <a name="l00224"></a>00224 <a name="l00226"></a>00226 <span class="keyword">const</span> <a class="code" href="classcsFrustum.html" title="A general frustum.">csFrustum</a>& operator= (<span class="keyword">const</span> <a class="code" href="classcsFrustum.html" title="A general frustum.">csFrustum</a>& other); <a name="l00227"></a>00227 <a name="l00229"></a>00229 <span class="keyword">virtual</span> ~<a class="code" href="classcsFrustum.html" title="A general frustum.">csFrustum</a> (); <a name="l00230"></a>00230 <a name="l00232"></a><a class="code" href="classcsFrustum.html#2d041b91b8afb3bc54a7481cd965943f">00232</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> SetOrigin (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& o) { origin = o; } <a name="l00233"></a>00233 <a name="l00235"></a><a class="code" href="classcsFrustum.html#8a6827e3f078ed11241d5ec4db343f75">00235</a> <span class="keyword">inline</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& GetOrigin () { <span class="keywordflow">return</span> origin; } <a name="l00236"></a>00236 <a name="l00238"></a><a class="code" href="classcsFrustum.html#c1a88e883e3108957188b8aa6aef171a">00238</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& GetOrigin ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> origin; } <a name="l00239"></a>00239 <a name="l00245"></a><a class="code" href="classcsFrustum.html#76c2863500da69567d928826fe94133e">00245</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> SetMirrored (<span class="keywordtype">bool</span> m) { mirrored = m; } <a name="l00246"></a>00246 <a name="l00248"></a><a class="code" href="classcsFrustum.html#b2841c988ee2d28cbc120fee5c0271f2">00248</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> IsMirrored ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mirrored; } <a name="l00249"></a>00249 <a name="l00256"></a>00256 <span class="keywordtype">void</span> SetBackPlane (<span class="keyword">const</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>& plane); <a name="l00257"></a>00257 <a name="l00261"></a><a class="code" href="classcsFrustum.html#5e3059951ccdba4739cd9c8a460beebd">00261</a> <span class="keyword">inline</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* GetBackPlane ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> backplane; } <a name="l00262"></a>00262 <a name="l00266"></a>00266 <span class="keywordtype">void</span> RemoveBackPlane (); <a name="l00267"></a>00267 <a name="l00271"></a>00271 <span class="keywordtype">void</span> AddVertex (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& v); <a name="l00272"></a>00272 <a name="l00276"></a><a class="code" href="classcsFrustum.html#5e51cb3233217bb4cc04ec401f82c464">00276</a> <span class="keyword">inline</span> <span class="keywordtype">size_t</span> GetVertexCount ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> num_vertices; } <a name="l00277"></a>00277 <a name="l00281"></a><a class="code" href="classcsFrustum.html#8bbfb94e4dee1ea5e77e752a28338bdb">00281</a> <span class="keyword">inline</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& GetVertex (<span class="keywordtype">size_t</span> idx) <a name="l00282"></a>00282 { <a name="l00283"></a>00283 <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (idx < num_vertices); <a name="l00284"></a>00284 <span class="keywordflow">return</span> vertices[idx]; <a name="l00285"></a>00285 } <a name="l00286"></a>00286 <a name="l00290"></a><a class="code" href="classcsFrustum.html#1961f5b66b2aa1cabd94cf13de87372a">00290</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> idx)<span class="keyword"> const</span> <a name="l00291"></a>00291 <span class="keyword"> </span>{ <a name="l00292"></a>00292 <a class="code" href="cssysdef_8h.html#c380bd47888ecfe73e7b7a40b6f827a1" title="Assertion.">CS_ASSERT</a> (idx < num_vertices); <a name="l00293"></a>00293 <span class="keywordflow">return</span> vertices[idx]; <a name="l00294"></a>00294 } <a name="l00295"></a>00295 <a name="l00299"></a><a class="code" href="classcsFrustum.html#4395e97acfada9d70605b6314f2d16f8">00299</a> <span class="keyword">inline</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; } <a name="l00300"></a>00300 <a name="l00304"></a>00304 <span class="keywordtype">void</span> Transform (<a class="code" href="classcsTransform.html" title="A class which defines a transformation from one coordinate system to another.">csTransform</a>* trans); <a name="l00305"></a>00305 <a name="l00311"></a>00311 <span class="keywordtype">void</span> ClipToPlane (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& v1, <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& v2); <a name="l00312"></a>00312 <a name="l00321"></a>00321 <span class="keyword">static</span> <span class="keywordtype">void</span> ClipToPlane (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <span class="keywordtype">size_t</span>& num_vertices, <a name="l00322"></a>00322 <a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a>* clipinfo, <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& v1, <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& v2); <a name="l00323"></a>00323 <a name="l00324"></a>00324 <a class="code" href="cssysdef_8h.html#69b27a22db26f4a2bb7a26a85d2ab06b" title="A variant of CS_DEPRECATED_METHOD that also emits the message msg on compilers that...">CS_DEPRECATED_METHOD_MSG</a>(<span class="stringliteral">"num_vertices type changed to size_t"</span>) <a name="l00325"></a><a class="code" href="classcsFrustum.html#f36e42bb80a8279d0adc71ce6963b1e9">00325</a> static <span class="keywordtype">void</span> ClipToPlane (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <span class="keywordtype">int</span>& num_vertices, <a name="l00326"></a>00326 <a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a>* clipinfo, const <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& v1, const <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& v2) <a name="l00327"></a>00327 { <a name="l00328"></a>00328 <span class="keywordtype">size_t</span> nv; <a name="l00329"></a>00329 ClipToPlane (vertices, nv, clipinfo, v1, v2); <a name="l00330"></a>00330 num_vertices = int (nv); <a name="l00331"></a>00331 } <a name="l00332"></a>00332 <a name="l00341"></a>00341 <span class="keyword">static</span> <span class="keywordtype">void</span> ClipToPlane (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <span class="keywordtype">size_t</span>& num_vertices, <a name="l00342"></a>00342 <a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a>* clipinfo, <span class="keyword">const</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>& plane); <a name="l00343"></a>00343 <a name="l00344"></a>00344 <a class="code" href="cssysdef_8h.html#69b27a22db26f4a2bb7a26a85d2ab06b" title="A variant of CS_DEPRECATED_METHOD that also emits the message msg on compilers that...">CS_DEPRECATED_METHOD_MSG</a>(<span class="stringliteral">"num_vertices type changed to size_t"</span>) <a name="l00345"></a><a class="code" href="classcsFrustum.html#42b53ee72b5e0c1babc394c4fbcecbb2">00345</a> static <span class="keywordtype">void</span> ClipToPlane (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* vertices, <span class="keywordtype">int</span>& num_vertices, <a name="l00346"></a>00346 <a class="code" href="structcsClipInfo.html" title="Structure for use with ClipToPlane.">csClipInfo</a>* clipinfo, const <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>& plane) <a name="l00347"></a>00347 { <a name="l00348"></a>00348 <span class="keywordtype">size_t</span> nv; <a name="l00349"></a>00349 ClipToPlane (vertices, nv, clipinfo, plane); <a name="l00350"></a>00350 num_vertices = int (nv); <a name="l00351"></a>00351 } <a name="l00352"></a>00352 <a name="l00359"></a>00359 <span class="keywordtype">void</span> ClipPolyToPlane (<a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>* plane); <a name="l00360"></a>00360 <a name="l00366"></a>00366 <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<csFrustum></a> Intersect (<span class="keyword">const</span> <a class="code" href="classcsFrustum.html" title="A general frustum.">csFrustum</a>& other) <span class="keyword">const</span>; <a name="l00367"></a>00367 <a name="l00382"></a>00382 <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<csFrustum></a> Intersect (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* poly, <span class="keywordtype">size_t</span> num) <span class="keyword">const</span>; <a name="l00383"></a>00383 <a name="l00398"></a>00398 <span class="keyword">static</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<csFrustum></a> Intersect ( <a name="l00399"></a>00399 <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& frust_origin, <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* frust, <span class="keywordtype">size_t</span> num_frust, <a name="l00400"></a>00400 <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* poly, <span class="keywordtype">size_t</span> num); <a name="l00401"></a>00401 <a name="l00416"></a>00416 <span class="keyword">static</span> <a class="code" href="classcsPtr.html" title="A pointer encapsulator.">csPtr<csFrustum></a> Intersect ( <a name="l00417"></a>00417 <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& frust_origin, <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* frust, <span class="keywordtype">size_t</span> num_frust, <a name="l00418"></a>00418 <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& v1, <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& v2, <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& v3); <a name="l00419"></a>00419 <a name="l00425"></a>00425 <span class="keywordtype">bool</span> Intersect (<a class="code" href="classcsSegment3.html" title="A 3D line segment.">csSegment3</a>& segment); <a name="l00426"></a>00426 <a name="l00432"></a>00432 <span class="keyword">static</span> <span class="keywordtype">int</span> Classify (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* frustum, <span class="keywordtype">size_t</span> num_frust, <a name="l00433"></a>00433 <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* poly, <span class="keywordtype">size_t</span> num_poly); <a name="l00434"></a>00434 <a name="l00441"></a>00441 <span class="keyword">static</span> <span class="keywordtype">int</span> BatchClassify (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* frustum, <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* frustumNormals, <a name="l00442"></a>00442 <span class="keywordtype">size_t</span> num_frust, <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* poly, <span class="keywordtype">size_t</span> num_poly); <a name="l00443"></a>00443 <a name="l00448"></a>00448 <span class="keywordtype">bool</span> Contains (<span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& point); <a name="l00449"></a>00449 <a name="l00456"></a>00456 <span class="keyword">static</span> <span class="keywordtype">bool</span> Contains (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* frustum, <span class="keywordtype">size_t</span> num_frust, <a name="l00457"></a>00457 <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& point); <a name="l00458"></a>00458 <a name="l00464"></a>00464 <span class="keyword">static</span> <span class="keywordtype">bool</span> Contains (<a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>* frustum, <span class="keywordtype">size_t</span> num_frust, <a name="l00465"></a>00465 <span class="keyword">const</span> <a class="code" href="classcsPlane3.html" title="A plane in 3D space.">csPlane3</a>& plane, <span class="keyword">const</span> <a class="code" href="classcsVector3.html" title="A 3D vector.">csVector3</a>& point); <a name="l00466"></a>00466 <a name="l00468"></a><a class="code" href="classcsFrustum.html#566183940052ead9fbf6c82b940f12cb">00468</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> IsEmpty ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> !wide && vertices == 0; } <a name="l00469"></a>00469 <a name="l00471"></a><a class="code" href="classcsFrustum.html#bc62abb4adbbd8f3fb751ed96355ae31">00471</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> IsInfinite ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> wide && vertices == 0 && backplane == 0; } <a name="l00472"></a>00472 <a name="l00477"></a><a class="code" href="classcsFrustum.html#41bdce5fd6e67bdf268cf7a16aa634cb">00477</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> IsWide ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> wide && vertices == 0; } <a name="l00478"></a>00478 <a name="l00483"></a>00483 <span class="keywordtype">void</span> MakeInfinite (); <a name="l00484"></a>00484 <a name="l00488"></a>00488 <span class="keywordtype">void</span> MakeEmpty (); <a name="l00489"></a>00489 }; <a name="l00490"></a>00490 <a name="l00493"></a>00493 <span class="preprocessor">#endif // __CS_FRUSTRUM_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>