<!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/plane2.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/plane2.h</h1><a href="plane2_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-2000 by Jorrit Tyberghein</span> <a name="l00003"></a>00003 <span class="comment"> Largely rewritten by Ivan Avramovic <ivan@avramovic.com></span> <a name="l00004"></a>00004 <span class="comment"></span> <a name="l00005"></a>00005 <span class="comment"> This library is free software; you can redistribute it and/or</span> <a name="l00006"></a>00006 <span class="comment"> modify it under the terms of the GNU Library General Public</span> <a name="l00007"></a>00007 <span class="comment"> License as published by the Free Software Foundation; either</span> <a name="l00008"></a>00008 <span class="comment"> version 2 of the License, or (at your option) any later version.</span> <a name="l00009"></a>00009 <span class="comment"></span> <a name="l00010"></a>00010 <span class="comment"> This library is distributed in the hope that it will be useful,</span> <a name="l00011"></a>00011 <span class="comment"> but WITHOUT ANY WARRANTY; without even the implied warranty of</span> <a name="l00012"></a>00012 <span class="comment"> MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU</span> <a name="l00013"></a>00013 <span class="comment"> Library General Public License for more details.</span> <a name="l00014"></a>00014 <span class="comment"></span> <a name="l00015"></a>00015 <span class="comment"> You should have received a copy of the GNU Library General Public</span> <a name="l00016"></a>00016 <span class="comment"> License along with this library; if not, write to the Free</span> <a name="l00017"></a>00017 <span class="comment"> Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.</span> <a name="l00018"></a>00018 <span class="comment">*/</span> <a name="l00019"></a>00019 <a name="l00020"></a>00020 <span class="preprocessor">#ifndef __CS_PLANE2_H__</span> <a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">#define __CS_PLANE2_H__</span> <a name="l00022"></a>00022 <span class="preprocessor"></span> <a name="l00023"></a>00023 <a name="l00024"></a>00024 <span class="preprocessor">#include "csextern.h"</span> <a name="l00025"></a>00025 <a name="l00026"></a>00026 <span class="preprocessor">#include "<a class="code" href="segment_8h.html" title="2D line segment.">csgeom/segment.h</a>"</span> <a name="l00027"></a>00027 <span class="preprocessor">#include "<a class="code" href="vector2_8h.html" title="2D vector.">csgeom/vector2.h</a>"</span> <a name="l00028"></a>00028 <a name="l00036"></a>00036 <span class="keyword">enum</span> <a name="l00037"></a>00037 { <a name="l00038"></a><a class="code" href="group__geom__utils.html#ggc36f475ca5b446f4fde4c9b90bec77c8d9339894d3f5c86d9cb1ee425d87b908">00038</a> <a class="code" href="group__geom__utils.html#ggc36f475ca5b446f4fde4c9b90bec77c8d9339894d3f5c86d9cb1ee425d87b908">CS_POLY_IN</a> = 1, <a name="l00039"></a><a class="code" href="group__geom__utils.html#ggc36f475ca5b446f4fde4c9b90bec77c848ded91a714724cb354420e833cd3653">00039</a> <a class="code" href="group__geom__utils.html#ggc36f475ca5b446f4fde4c9b90bec77c848ded91a714724cb354420e833cd3653">CS_POLY_ON</a> = 0, <a name="l00040"></a><a class="code" href="group__geom__utils.html#ggc36f475ca5b446f4fde4c9b90bec77c8e40a3a2c15872f11f10bb26fc87ed078">00040</a> <a class="code" href="group__geom__utils.html#ggc36f475ca5b446f4fde4c9b90bec77c8e40a3a2c15872f11f10bb26fc87ed078">CS_POLY_OUT</a> = -1 <a name="l00041"></a>00041 }; <a name="l00042"></a>00042 <a name="l00048"></a><a class="code" href="classcsPlane2.html">00048</a> <span class="keyword">class </span><a class="code" href="classcsPlane2.html" title="A plane in 2D space.">csPlane2</a> <a name="l00049"></a>00049 { <a name="l00050"></a>00050 <span class="keyword">public</span>: <a name="l00052"></a><a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7">00052</a> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a> <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>; <a name="l00053"></a>00053 <a name="l00055"></a><a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2">00055</a> <span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a>; <a name="l00056"></a>00056 <a name="l00058"></a><a class="code" href="classcsPlane2.html#654b2688023ba968993c4c3e77cf3451">00058</a> <a class="code" href="classcsPlane2.html#654b2688023ba968993c4c3e77cf3451" title="Initialize to the xy plane.">csPlane2</a> () : <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a> (0,1), <a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a> (0) {} <a name="l00059"></a>00059 <a name="l00061"></a><a class="code" href="classcsPlane2.html#bb0d125943ad847d6ff565d39884b0ba">00061</a> <a class="code" href="classcsPlane2.html#654b2688023ba968993c4c3e77cf3451" title="Initialize to the xy plane.">csPlane2</a> (<span class="keyword">const</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a>& plane_norm, <span class="keywordtype">float</span> c=0) <a name="l00062"></a>00062 : <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a> (plane_norm), <a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a> (c) {} <a name="l00063"></a>00063 <a name="l00065"></a><a class="code" href="classcsPlane2.html#f75a260e2fbf07779368724ea6d91293">00065</a> <a class="code" href="classcsPlane2.html#654b2688023ba968993c4c3e77cf3451" title="Initialize to the xy plane.">csPlane2</a> (<span class="keywordtype">float</span> a, <span class="keywordtype">float</span> b, <span class="keywordtype">float</span> c=0) : <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a> (a,b), <a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a> (c) {} <a name="l00066"></a>00066 <a name="l00068"></a><a class="code" href="classcsPlane2.html#5dc161e80fc0902ff3504a06b5545e02">00068</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classcsPlane2.html#5dc161e80fc0902ff3504a06b5545e02" title="Initialize the plane given two vectors.">Set</a> (<span class="keyword">const</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a>& v1, <span class="keyword">const</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a>& v2) <a name="l00069"></a>00069 { <a name="l00070"></a>00070 <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>.<a class="code" href="classcsVector2.html#cf4ee25489c98e6b7b7a460c4edd4ac6" title="X component of vector.">x</a> = v2.<a class="code" href="classcsVector2.html#f736730a67b9ee807f1455da3d2be188" title="Y component of vector.">y</a>-v1.<a class="code" href="classcsVector2.html#f736730a67b9ee807f1455da3d2be188" title="Y component of vector.">y</a>; <a name="l00071"></a>00071 <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>.<a class="code" href="classcsVector2.html#f736730a67b9ee807f1455da3d2be188" title="Y component of vector.">y</a> = -(v2.<a class="code" href="classcsVector2.html#cf4ee25489c98e6b7b7a460c4edd4ac6" title="X component of vector.">x</a>-v1.<a class="code" href="classcsVector2.html#cf4ee25489c98e6b7b7a460c4edd4ac6" title="X component of vector.">x</a>); <a name="l00072"></a>00072 <a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a> = - (v2 * <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>); <a name="l00073"></a>00073 } <a name="l00074"></a>00074 <a name="l00076"></a><a class="code" href="classcsPlane2.html#77a3a1e084aa3440162e8c297ec6fb7d">00076</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classcsPlane2.html#5dc161e80fc0902ff3504a06b5545e02" title="Initialize the plane given two vectors.">Set</a> (<span class="keyword">const</span> <a class="code" href="classcsSegment2.html" title="A 2D line segment.">csSegment2</a>& s) <a name="l00077"></a>00077 { <a name="l00078"></a>00078 <a class="code" href="classcsPlane2.html#5dc161e80fc0902ff3504a06b5545e02" title="Initialize the plane given two vectors.">Set</a> (s.<a class="code" href="classcsSegment2.html#48ebbdb8de300930e733c0ba241d14df" title="Get the start of the segment.">Start</a> (), s.<a class="code" href="classcsSegment2.html#d2ec6a2367a75545af6d50913aca04b7" title="Get the end of the segment.">End</a> ()); <a name="l00079"></a>00079 } <a name="l00080"></a>00080 <a name="l00082"></a><a class="code" href="classcsPlane2.html#1e44c1215b01fb4317a497b517042c0c">00082</a> <a class="code" href="classcsPlane2.html#654b2688023ba968993c4c3e77cf3451" title="Initialize to the xy plane.">csPlane2</a> (<span class="keyword">const</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a>& v1, <span class="keyword">const</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a>& v2) <a name="l00083"></a>00083 { <a name="l00084"></a>00084 <a class="code" href="classcsPlane2.html#5dc161e80fc0902ff3504a06b5545e02" title="Initialize the plane given two vectors.">Set</a> (v1, v2); <a name="l00085"></a>00085 } <a name="l00086"></a>00086 <a name="l00088"></a><a class="code" href="classcsPlane2.html#f798d8bb97167e8ee495e1326756ca91">00088</a> <a class="code" href="classcsPlane2.html#654b2688023ba968993c4c3e77cf3451" title="Initialize to the xy plane.">csPlane2</a> (<span class="keyword">const</span> <a class="code" href="classcsSegment2.html" title="A 2D line segment.">csSegment2</a>& s) <a name="l00089"></a>00089 { <a name="l00090"></a>00090 <a class="code" href="classcsPlane2.html#5dc161e80fc0902ff3504a06b5545e02" title="Initialize the plane given two vectors.">Set</a> (s); <a name="l00091"></a>00091 } <a name="l00092"></a>00092 <a name="l00094"></a><a class="code" href="classcsPlane2.html#f757fe82384edc4756abc5ee2e5ad2b7">00094</a> <span class="keyword">inline</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a>& <a class="code" href="classcsPlane2.html#f757fe82384edc4756abc5ee2e5ad2b7" title="Return the normal vector of this plane.">Normal</a> () { <span class="keywordflow">return</span> <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>; } <a name="l00095"></a>00095 <a name="l00097"></a><a class="code" href="classcsPlane2.html#b9f995e5b9b9e5429ef29dc16a8f8fff">00097</a> <span class="keyword">inline</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a> <a class="code" href="classcsPlane2.html#b9f995e5b9b9e5429ef29dc16a8f8fff" title="Return the normal vector of this plane (const version).">GetNormal</a> ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>; } <a name="l00098"></a>00098 <a name="l00100"></a><a class="code" href="classcsPlane2.html#3fb7dad98d4453e8b094abc13899b874">00100</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#3fb7dad98d4453e8b094abc13899b874" title="Return the A component of this plane.">A</a> ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>.<a class="code" href="classcsVector2.html#cf4ee25489c98e6b7b7a460c4edd4ac6" title="X component of vector.">x</a>; } <a name="l00102"></a><a class="code" href="classcsPlane2.html#4c833b9a366372e0babb4dd5848c492f">00102</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#4c833b9a366372e0babb4dd5848c492f" title="Return the B component of this plane.">B</a> ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>.<a class="code" href="classcsVector2.html#f736730a67b9ee807f1455da3d2be188" title="Y component of vector.">y</a>; } <a name="l00104"></a><a class="code" href="classcsPlane2.html#dd884e0845743c574bfcc5f4887aef4a">00104</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#dd884e0845743c574bfcc5f4887aef4a" title="Return the C component of this plane.">C</a> ()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a>; } <a name="l00105"></a>00105 <a name="l00107"></a><a class="code" href="classcsPlane2.html#e4cdaa0690600bef79a37340c2a09900">00107</a> <span class="keyword">inline</span> <span class="keywordtype">float</span>& <a class="code" href="classcsPlane2.html#3fb7dad98d4453e8b094abc13899b874" title="Return the A component of this plane.">A</a> () { <span class="keywordflow">return</span> <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>.<a class="code" href="classcsVector2.html#cf4ee25489c98e6b7b7a460c4edd4ac6" title="X component of vector.">x</a>; } <a name="l00109"></a><a class="code" href="classcsPlane2.html#80ae8a1676eb3af520b848807fb0f6f5">00109</a> <span class="keyword">inline</span> <span class="keywordtype">float</span>& <a class="code" href="classcsPlane2.html#4c833b9a366372e0babb4dd5848c492f" title="Return the B component of this plane.">B</a> () { <span class="keywordflow">return</span> <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>.<a class="code" href="classcsVector2.html#f736730a67b9ee807f1455da3d2be188" title="Y component of vector.">y</a>; } <a name="l00111"></a><a class="code" href="classcsPlane2.html#405dd8243192053f8292a9a5299ba6b8">00111</a> <span class="keyword">inline</span> <span class="keywordtype">float</span>& <a class="code" href="classcsPlane2.html#dd884e0845743c574bfcc5f4887aef4a" title="Return the C component of this plane.">C</a> () { <span class="keywordflow">return</span> <a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a>; } <a name="l00112"></a>00112 <a name="l00114"></a><a class="code" href="classcsPlane2.html#4775b232506aa179e542e7ba5e4f056b">00114</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classcsPlane2.html#5dc161e80fc0902ff3504a06b5545e02" title="Initialize the plane given two vectors.">Set</a> (<span class="keywordtype">float</span> a, <span class="keywordtype">float</span> b, <span class="keywordtype">float</span> c) <a name="l00115"></a>00115 { <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>.<a class="code" href="classcsVector2.html#cf4ee25489c98e6b7b7a460c4edd4ac6" title="X component of vector.">x</a> = a; <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>.<a class="code" href="classcsVector2.html#f736730a67b9ee807f1455da3d2be188" title="Y component of vector.">y</a> = b; <a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a> = c; } <a name="l00116"></a>00116 <a name="l00118"></a><a class="code" href="classcsPlane2.html#2c5c2f025ea5ee025346e454b7e8476d">00118</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#2c5c2f025ea5ee025346e454b7e8476d" title="Classify the given vector with regards to this plane.">Classify</a> (<span class="keyword">const</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a>& pt)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>*pt+<a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a>; } <a name="l00119"></a>00119 <a name="l00121"></a><a class="code" href="classcsPlane2.html#816d8f4b4fb20d35a0d9c3850e8e9967">00121</a> <span class="keyword">static</span> <span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#2c5c2f025ea5ee025346e454b7e8476d" title="Classify the given vector with regards to this plane.">Classify</a> (<span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#3fb7dad98d4453e8b094abc13899b874" title="Return the A component of this plane.">A</a>, <span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#4c833b9a366372e0babb4dd5848c492f" title="Return the B component of this plane.">B</a>, <span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#dd884e0845743c574bfcc5f4887aef4a" title="Return the C component of this plane.">C</a>, <a name="l00122"></a>00122 <span class="keyword">const</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a>& pt) <a name="l00123"></a>00123 { <span class="keywordflow">return</span> A*pt.<a class="code" href="classcsVector2.html#cf4ee25489c98e6b7b7a460c4edd4ac6" title="X component of vector.">x</a> + B*pt.<a class="code" href="classcsVector2.html#f736730a67b9ee807f1455da3d2be188" title="Y component of vector.">y</a> + C; } <a name="l00124"></a>00124 <a name="l00130"></a><a class="code" href="classcsPlane2.html#c4c6e9a1558c408c7205929d50aab6d6">00130</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#c4c6e9a1558c408c7205929d50aab6d6" title="Compute the distance from the given vector to this plane.">Distance</a> (<span class="keyword">const</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a>& pt)<span class="keyword"> const</span> <a name="l00131"></a>00131 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <a class="code" href="group__geom__utils.html#g996f7be338ccb40d1a2a5abc1ad61759">ABS</a> (<a class="code" href="classcsPlane2.html#2c5c2f025ea5ee025346e454b7e8476d" title="Classify the given vector with regards to this plane.">Classify</a> (pt)); } <a name="l00132"></a>00132 <a name="l00139"></a><a class="code" href="classcsPlane2.html#5ddaa9e973408c73789f58f921b0448c">00139</a> <span class="keyword">inline</span> <span class="keywordtype">float</span> <a class="code" href="classcsPlane2.html#5ddaa9e973408c73789f58f921b0448c" title="Compute the squared distance between the given vector and this plane.">SquaredDistance</a> (<span class="keyword">const</span> <a class="code" href="classcsVector2.html" title="A 2D vector.">csVector2</a>& pt)<span class="keyword"> const</span> <a name="l00140"></a>00140 <span class="keyword"> </span>{ <a name="l00141"></a>00141 <span class="keywordflow">return</span> <a class="code" href="classcsPlane2.html#2c5c2f025ea5ee025346e454b7e8476d" title="Classify the given vector with regards to this plane.">Classify</a> (pt) / <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>.<a class="code" href="classcsVector2.html#75d5837b69e0c167b22c3f9309ee5177" title="Return the squared norm (magnitude) of this vector.">SquaredNorm</a> (); <a name="l00142"></a>00142 } <a name="l00143"></a>00143 <a name="l00145"></a><a class="code" href="classcsPlane2.html#c032481110e4ecf03b24b6dd5353c49b">00145</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classcsPlane2.html#c032481110e4ecf03b24b6dd5353c49b" title="Reverses the direction of the plane while maintianing the plane itself.">Invert</a> () { <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a> = -<a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>; <a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a> = -<a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a>; } <a name="l00146"></a>00146 <a name="l00148"></a><a class="code" href="classcsPlane2.html#5c942978977e9852da5460c5b6b7c05f">00148</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="classcsPlane2.html#5c942978977e9852da5460c5b6b7c05f" title="Normalizes the plane equation so that &#39;norm&#39; is a unit vector.">Normalize</a> () <a name="l00149"></a>00149 { <a name="l00150"></a>00150 <span class="keywordtype">float</span> f = <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a>.<a class="code" href="classcsVector2.html#5fd419d758e521c6a94337b85a1ede70" title="Return the norm (magnitude) of a 2D vector.">Norm</a> (); <a name="l00151"></a>00151 <span class="keywordflow">if</span> (f) { <a class="code" href="classcsPlane2.html#d42196ae41ef4a76048f20bf752cfce7" title="The normal vector (or the (A,B) components).">norm</a> /= f; <a class="code" href="classcsPlane2.html#ab7d543d13d9838854e5fb14d71176b2" title="The C component of the plane.">CC</a> /= f; } <a name="l00152"></a>00152 } <a name="l00153"></a>00153 }; <a name="l00154"></a>00154 <a name="l00157"></a>00157 <span class="preprocessor">#endif // __CS_PLANE2_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>