Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > media > contrib-release > by-pkgid > 58828b263d8f56d90ac336dea07a4586 > files > 853

irrlicht-doc-1.6.1-1mdv2010.1.x86_64.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>Irrlicht Engine: irrMath.h Source File</title>
<link href="doxygen.css" rel="stylesheet" type="text/css">
</head><body>
<table class="irrlicht" >
  <tr valign="middle"> 
    <td><font size="2"><a class="qindex" href="index.html"><font color="#FFFFFF">Home</font></a> 
      | <a class="qindex" href="namespaces.html"><font color="#FFFFFF">Namespaces</font></a> 
      | <a class="qindex" href="hierarchy.html"><font color="#FFFFFF">Hierarchy</font></a> 
      | <a class="qindex" href="classes.html"><font color="#FFFFFF">Alphabetical 
      List</font></a> | <a class="qindex" href="annotated.html"><font color="#FFFFFF"> 
      Class list</font></a> | <a class="qindex" href="files.html"><font color="#FFFFFF">Files</font></a> 
      | <a class="qindex" href="namespacemembers.html"><font color="#FFFFFF"> 
      Namespace&nbsp;Members</font></a> | <a class="qindex" href="functions.html"><font color="#FFFFFF">Class 
      members</font></a> | <a class="qindex" href="globals.html"><font color="#FFFFFF">File 
      members</font></a> | <a class="qindex" href="pages.html"><font color="#FFFFFF">Tutorials</font></a></font> </td>
  </tr>
</table>
<!-- Generated by Doxygen 1.5.6 -->
<h1>irrMath.h</h1><a href="irr_math_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// Copyright (C) 2002-2009 Nikolaus Gebhardt</span>
<a name="l00002"></a>00002 <span class="comment">// This file is part of the "Irrlicht Engine".</span>
<a name="l00003"></a>00003 <span class="comment">// For conditions of distribution and use, see copyright notice in irrlicht.h</span>
<a name="l00004"></a>00004 
<a name="l00005"></a>00005 <span class="preprocessor">#ifndef __IRR_MATH_H_INCLUDED__</span>
<a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __IRR_MATH_H_INCLUDED__</span>
<a name="l00007"></a>00007 <span class="preprocessor"></span>
<a name="l00008"></a>00008 <span class="preprocessor">#include "<a class="code" href="_irr_compile_config_8h.html">IrrCompileConfig.h</a>"</span>
<a name="l00009"></a>00009 <span class="preprocessor">#include "<a class="code" href="irr_types_8h.html">irrTypes.h</a>"</span>
<a name="l00010"></a>00010 <span class="preprocessor">#include &lt;math.h&gt;</span>
<a name="l00011"></a>00011 <span class="preprocessor">#include &lt;float.h&gt;</span>
<a name="l00012"></a>00012 <span class="preprocessor">#include &lt;stdlib.h&gt;</span> <span class="comment">// for abs() etc.</span>
<a name="l00013"></a>00013 <span class="preprocessor">#include &lt;limits.h&gt;</span> <span class="comment">// For INT_MAX / UINT_MAX</span>
<a name="l00014"></a>00014 
<a name="l00015"></a>00015 <span class="preprocessor">#if defined(_IRR_SOLARIS_PLATFORM_) || defined(__BORLANDC__) || defined (__BCPLUSPLUS__) || defined (_WIN32_WCE)</span>
<a name="l00016"></a>00016 <span class="preprocessor"></span><span class="preprocessor">        #define sqrtf(X) (f32)sqrt((f64)(X))</span>
<a name="l00017"></a>00017 <span class="preprocessor"></span><span class="preprocessor">        #define sinf(X) (f32)sin((f64)(X))</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">        #define cosf(X) (f32)cos((f64)(X))</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">        #define asinf(X) (f32)asin((f64)(X))</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span><span class="preprocessor">        #define acosf(X) (f32)acos((f64)(X))</span>
<a name="l00021"></a>00021 <span class="preprocessor"></span><span class="preprocessor">        #define atan2f(X,Y) (f32)atan2((f64)(X),(f64)(Y))</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span><span class="preprocessor">        #define ceilf(X) (f32)ceil((f64)(X))</span>
<a name="l00023"></a>00023 <span class="preprocessor"></span><span class="preprocessor">        #define floorf(X) (f32)floor((f64)(X))</span>
<a name="l00024"></a>00024 <span class="preprocessor"></span><span class="preprocessor">        #define powf(X,Y) (f32)pow((f64)(X),(f64)(Y))</span>
<a name="l00025"></a>00025 <span class="preprocessor"></span><span class="preprocessor">        #define fmodf(X,Y) (f32)fmod((f64)(X),(f64)(Y))</span>
<a name="l00026"></a>00026 <span class="preprocessor"></span><span class="preprocessor">        #define fabsf(X) (f32)fabs((f64)(X))</span>
<a name="l00027"></a>00027 <span class="preprocessor"></span><span class="preprocessor">        #define logf(X) (f32)log((f64)(X))</span>
<a name="l00028"></a>00028 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00029"></a>00029 <span class="preprocessor"></span>
<a name="l00030"></a>00030 <span class="preprocessor">#ifndef FLT_MAX</span>
<a name="l00031"></a><a class="code" href="irr_math_8h.html#7fbf1534f9e0f0bfdb86fb928902474c">00031</a> <span class="preprocessor"></span><span class="preprocessor">#define FLT_MAX 3.402823466E+38F</span>
<a name="l00032"></a>00032 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="keyword">namespace </span>irr
<a name="l00035"></a>00035 {
<a name="l00036"></a>00036 <span class="keyword">namespace </span>core
<a name="l00037"></a>00037 {
<a name="l00038"></a>00038 
<a name="l00040"></a>00040 
<a name="l00041"></a><a class="code" href="namespaceirr_1_1core.html#ac9f99b6a999bdf25fec402c59e8342a">00041</a>         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1core.html#ac9f99b6a999bdf25fec402c59e8342a" title="Rounding error constant often used when comparing f32 values.">ROUNDING_ERROR_S32</a> = 1;
<a name="l00042"></a><a class="code" href="namespaceirr_1_1core.html#9514dd34463a30102ef8836915cf9c4c">00042</a>         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#9514dd34463a30102ef8836915cf9c4c">ROUNDING_ERROR_f32</a> = 0.000001f;
<a name="l00043"></a><a class="code" href="namespaceirr_1_1core.html#7b314c22d6804639cbcbce5231724f0b">00043</a>         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="namespaceirr_1_1core.html#7b314c22d6804639cbcbce5231724f0b">ROUNDING_ERROR_f64</a> = 0.00000001;
<a name="l00044"></a>00044 
<a name="l00045"></a>00045 <span class="preprocessor">#ifdef PI // make sure we don't collide with a define</span>
<a name="l00046"></a>00046 <span class="preprocessor"></span><span class="preprocessor">#undef PI</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00049"></a><a class="code" href="namespaceirr_1_1core.html#26d877e2caf3e6f31c298a0417a0707e">00049</a> <span class="preprocessor">        const f32 PI            = 3.14159265359f;</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span>                                                
<a name="l00052"></a><a class="code" href="namespaceirr_1_1core.html#c97bfaa5b44703e61c23c91b88f3ec3a">00052</a>         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#c97bfaa5b44703e61c23c91b88f3ec3a" title="Constant for reciprocal of PI.">RECIPROCAL_PI</a> = 1.0f/<a class="code" href="namespaceirr_1_1core.html#26d877e2caf3e6f31c298a0417a0707e" title="Constant for PI.">PI</a>;
<a name="l00053"></a>00053 
<a name="l00055"></a><a class="code" href="namespaceirr_1_1core.html#beab884c4376c5740f6d916356e9baa3">00055</a>         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#beab884c4376c5740f6d916356e9baa3" title="Constant for half of PI.">HALF_PI</a>       = <a class="code" href="namespaceirr_1_1core.html#26d877e2caf3e6f31c298a0417a0707e" title="Constant for PI.">PI</a>/2.0f;
<a name="l00056"></a>00056 
<a name="l00057"></a>00057 <span class="preprocessor">#ifdef PI64 // make sure we don't collide with a define</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="preprocessor">#undef PI64</span>
<a name="l00059"></a>00059 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00061"></a><a class="code" href="namespaceirr_1_1core.html#166af519140dc00cbd88684e835086f8">00061</a> <span class="preprocessor">        const f64 PI64          = 3.1415926535897932384626433832795028841971693993751;</span>
<a name="l00062"></a>00062 <span class="preprocessor"></span>
<a name="l00064"></a><a class="code" href="namespaceirr_1_1core.html#d3a2ddd6d772edb4d663d73fae5434e3">00064</a>         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="namespaceirr_1_1core.html#d3a2ddd6d772edb4d663d73fae5434e3" title="Constant for 64bit reciprocal of PI.">RECIPROCAL_PI64</a> = 1.0/<a class="code" href="namespaceirr_1_1core.html#166af519140dc00cbd88684e835086f8" title="Constant for 64bit PI.">PI64</a>;
<a name="l00065"></a>00065 
<a name="l00067"></a><a class="code" href="namespaceirr_1_1core.html#4b91e69e51a2e374aec940cba3869028">00067</a>         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#4b91e69e51a2e374aec940cba3869028" title="32bit Constant for converting from degrees to radians">DEGTORAD</a> = <a class="code" href="namespaceirr_1_1core.html#26d877e2caf3e6f31c298a0417a0707e" title="Constant for PI.">PI</a> / 180.0f;
<a name="l00068"></a>00068 
<a name="l00070"></a><a class="code" href="namespaceirr_1_1core.html#e3a530e0ef661960b7af89f07d817bd5">00070</a>         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#e3a530e0ef661960b7af89f07d817bd5" title="32bit constant for converting from radians to degrees (formally known as GRAD_PI)...">RADTODEG</a>   = 180.0f / <a class="code" href="namespaceirr_1_1core.html#26d877e2caf3e6f31c298a0417a0707e" title="Constant for PI.">PI</a>;
<a name="l00071"></a>00071 
<a name="l00073"></a><a class="code" href="namespaceirr_1_1core.html#8e21b5969c8292857f7c9c5dcfd61c35">00073</a>         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="namespaceirr_1_1core.html#8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)...">DEGTORAD64</a> = <a class="code" href="namespaceirr_1_1core.html#166af519140dc00cbd88684e835086f8" title="Constant for 64bit PI.">PI64</a> / 180.0;
<a name="l00074"></a>00074 
<a name="l00076"></a><a class="code" href="namespaceirr_1_1core.html#e7afeb48af12f5f5130cd179a644ec58">00076</a>         <span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="namespaceirr_1_1core.html#e7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a> = 180.0 / <a class="code" href="namespaceirr_1_1core.html#166af519140dc00cbd88684e835086f8" title="Constant for 64bit PI.">PI64</a>;
<a name="l00077"></a>00077 
<a name="l00079"></a>00079 
<a name="l00082"></a><a class="code" href="namespaceirr_1_1core.html#8deb22ad77fb8ead3f6683bbf9ad3f67">00082</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#8deb22ad77fb8ead3f6683bbf9ad3f67" title="Utility function to convert a radian value to degrees.">radToDeg</a>(<a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> radians)
<a name="l00083"></a>00083         {
<a name="l00084"></a>00084                 <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1core.html#e3a530e0ef661960b7af89f07d817bd5" title="32bit constant for converting from radians to degrees (formally known as GRAD_PI)...">RADTODEG</a> * radians;
<a name="l00085"></a>00085         }
<a name="l00086"></a>00086 
<a name="l00088"></a>00088 
<a name="l00091"></a><a class="code" href="namespaceirr_1_1core.html#ab39939b1518daee0967c368a3bf924a">00091</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="namespaceirr_1_1core.html#8deb22ad77fb8ead3f6683bbf9ad3f67" title="Utility function to convert a radian value to degrees.">radToDeg</a>(<a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> radians)
<a name="l00092"></a>00092         {
<a name="l00093"></a>00093                 <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1core.html#e7afeb48af12f5f5130cd179a644ec58" title="64bit constant for converting from radians to degrees">RADTODEG64</a> * radians;
<a name="l00094"></a>00094         }
<a name="l00095"></a>00095 
<a name="l00097"></a>00097 
<a name="l00100"></a><a class="code" href="namespaceirr_1_1core.html#d58b3d0e755a4f25ad19d5f5d4fb0280">00100</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#d58b3d0e755a4f25ad19d5f5d4fb0280" title="Utility function to convert a degrees value to radians.">degToRad</a>(<a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> degrees)
<a name="l00101"></a>00101         {
<a name="l00102"></a>00102                 <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1core.html#4b91e69e51a2e374aec940cba3869028" title="32bit Constant for converting from degrees to radians">DEGTORAD</a> * degrees;
<a name="l00103"></a>00103         }
<a name="l00104"></a>00104 
<a name="l00106"></a>00106 
<a name="l00109"></a><a class="code" href="namespaceirr_1_1core.html#2def535b4f391ceb86ec0497cbb4bf80">00109</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="namespaceirr_1_1core.html#d58b3d0e755a4f25ad19d5f5d4fb0280" title="Utility function to convert a degrees value to radians.">degToRad</a>(<a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> degrees)
<a name="l00110"></a>00110         {
<a name="l00111"></a>00111                 <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1core.html#8e21b5969c8292857f7c9c5dcfd61c35" title="64bit constant for converting from degrees to radians (formally known as GRAD_PI2)...">DEGTORAD64</a> * degrees;
<a name="l00112"></a>00112         }
<a name="l00113"></a>00113 
<a name="l00115"></a>00115         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l00116"></a><a class="code" href="namespaceirr_1_1core.html#307354570474ae7d399cb1c536c3546d">00116</a>         <span class="keyword">inline</span> <span class="keyword">const</span> T&amp; <a class="code" href="namespaceirr_1_1core.html#307354570474ae7d399cb1c536c3546d" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)...">min_</a>(<span class="keyword">const</span> T&amp; a, <span class="keyword">const</span> T&amp; b)
<a name="l00117"></a>00117         {
<a name="l00118"></a>00118                 <span class="keywordflow">return</span> a &lt; b ? a : b;
<a name="l00119"></a>00119         }
<a name="l00120"></a>00120 
<a name="l00122"></a>00122         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l00123"></a><a class="code" href="namespaceirr_1_1core.html#e20fd3a0ca22187474d9a957f4a6578b">00123</a>         <span class="keyword">inline</span> <span class="keyword">const</span> T&amp; <a class="code" href="namespaceirr_1_1core.html#307354570474ae7d399cb1c536c3546d" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)...">min_</a>(<span class="keyword">const</span> T&amp; a, <span class="keyword">const</span> T&amp; b, <span class="keyword">const</span> T&amp; c)
<a name="l00124"></a>00124         {
<a name="l00125"></a>00125                 <span class="keywordflow">return</span> a &lt; b ? <a class="code" href="namespaceirr_1_1core.html#307354570474ae7d399cb1c536c3546d" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)...">min_</a>(a, c) : <a class="code" href="namespaceirr_1_1core.html#307354570474ae7d399cb1c536c3546d" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)...">min_</a>(b, c);
<a name="l00126"></a>00126         }
<a name="l00127"></a>00127 
<a name="l00129"></a>00129         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l00130"></a><a class="code" href="namespaceirr_1_1core.html#fc29e2de032d68f1d26fd81d11073a95">00130</a>         <span class="keyword">inline</span> <span class="keyword">const</span> T&amp; <a class="code" href="namespaceirr_1_1core.html#fc29e2de032d68f1d26fd81d11073a95" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)...">max_</a>(<span class="keyword">const</span> T&amp; a, <span class="keyword">const</span> T&amp; b)
<a name="l00131"></a>00131         {
<a name="l00132"></a>00132                 <span class="keywordflow">return</span> a &lt; b ? b : a;
<a name="l00133"></a>00133         }
<a name="l00134"></a>00134 
<a name="l00136"></a>00136         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l00137"></a><a class="code" href="namespaceirr_1_1core.html#425e2da73833f4f47a83b7b5b21ac729">00137</a>         <span class="keyword">inline</span> <span class="keyword">const</span> T&amp; <a class="code" href="namespaceirr_1_1core.html#fc29e2de032d68f1d26fd81d11073a95" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)...">max_</a>(<span class="keyword">const</span> T&amp; a, <span class="keyword">const</span> T&amp; b, <span class="keyword">const</span> T&amp; c)
<a name="l00138"></a>00138         {
<a name="l00139"></a>00139                 <span class="keywordflow">return</span> a &lt; b ? <a class="code" href="namespaceirr_1_1core.html#fc29e2de032d68f1d26fd81d11073a95" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)...">max_</a>(b, c) : <a class="code" href="namespaceirr_1_1core.html#fc29e2de032d68f1d26fd81d11073a95" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)...">max_</a>(a, c);
<a name="l00140"></a>00140         }
<a name="l00141"></a>00141 
<a name="l00143"></a>00143         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l00144"></a><a class="code" href="namespaceirr_1_1core.html#96bc3fc4602e5b04250d0964ba25e79b">00144</a>         <span class="keyword">inline</span> T <a class="code" href="namespaceirr_1_1core.html#96bc3fc4602e5b04250d0964ba25e79b" title="returns abs of two values. Own implementation to get rid of STL (VS6 problems)">abs_</a>(<span class="keyword">const</span> T&amp; a)
<a name="l00145"></a>00145         {
<a name="l00146"></a>00146                 <span class="keywordflow">return</span> a &lt; (T)0 ? -a : a;
<a name="l00147"></a>00147         }
<a name="l00148"></a>00148 
<a name="l00151"></a>00151         <span class="keyword">template</span>&lt;<span class="keyword">class</span> T&gt;
<a name="l00152"></a><a class="code" href="namespaceirr_1_1core.html#c394166a81388acd0b97daff680a7474">00152</a>         <span class="keyword">inline</span> T <a class="code" href="namespaceirr_1_1core.html#c394166a81388acd0b97daff680a7474">lerp</a>(<span class="keyword">const</span> T&amp; a, <span class="keyword">const</span> T&amp; b, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> t)
<a name="l00153"></a>00153         {
<a name="l00154"></a>00154                 <span class="keywordflow">return</span> (T)(a*(1.f-t)) + (b*t);
<a name="l00155"></a>00155         }
<a name="l00156"></a>00156 
<a name="l00158"></a>00158         <span class="keyword">template</span> &lt;<span class="keyword">class</span> T&gt;
<a name="l00159"></a><a class="code" href="namespaceirr_1_1core.html#91284ddd030b8651cab294e16aa5f6bc">00159</a>         <span class="keyword">inline</span> <span class="keyword">const</span> T <a class="code" href="namespaceirr_1_1core.html#91284ddd030b8651cab294e16aa5f6bc" title="clamps a value between low and high">clamp</a> (<span class="keyword">const</span> T&amp; value, <span class="keyword">const</span> T&amp; low, <span class="keyword">const</span> T&amp; high)
<a name="l00160"></a>00160         {
<a name="l00161"></a>00161                 <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1core.html#307354570474ae7d399cb1c536c3546d" title="returns minimum of two values. Own implementation to get rid of the STL (VS6 problems)...">min_</a> (<a class="code" href="namespaceirr_1_1core.html#fc29e2de032d68f1d26fd81d11073a95" title="returns maximum of two values. Own implementation to get rid of the STL (VS6 problems)...">max_</a>(value,low), high);
<a name="l00162"></a>00162         }
<a name="l00163"></a>00163 
<a name="l00165"></a><a class="code" href="namespaceirr_1_1core.html#bf9b9b140cc365908ea4c8c47451e4e3">00165</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceirr_1_1core.html#bf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">equals</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> b, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> tolerance = <a class="code" href="namespaceirr_1_1core.html#7b314c22d6804639cbcbce5231724f0b">ROUNDING_ERROR_f64</a>)
<a name="l00166"></a>00166         {
<a name="l00167"></a>00167                 <span class="keywordflow">return</span> (a + tolerance &gt;= b) &amp;&amp; (a - tolerance &lt;= b);
<a name="l00168"></a>00168         }
<a name="l00169"></a>00169 
<a name="l00171"></a><a class="code" href="namespaceirr_1_1core.html#e9c63fd2065e6afd30b4537166706ddf">00171</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceirr_1_1core.html#bf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">equals</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> b, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> tolerance = <a class="code" href="namespaceirr_1_1core.html#9514dd34463a30102ef8836915cf9c4c">ROUNDING_ERROR_f32</a>)
<a name="l00172"></a>00172         {
<a name="l00173"></a>00173                 <span class="keywordflow">return</span> (a + tolerance &gt;= b) &amp;&amp; (a - tolerance &lt;= b);
<a name="l00174"></a>00174         }
<a name="l00175"></a>00175 <span class="preprocessor">#if 0</span>
<a name="l00177"></a>00177 <span class="preprocessor">        inline bool equals(const s32 a, const s32 b)</span>
<a name="l00178"></a>00178 <span class="preprocessor"></span>        {
<a name="l00179"></a>00179                 <span class="keywordflow">return</span> (a == b);
<a name="l00180"></a>00180         }
<a name="l00181"></a>00181 
<a name="l00183"></a>00183         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceirr_1_1core.html#bf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">equals</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b)
<a name="l00184"></a>00184         {
<a name="l00185"></a>00185                 <span class="keywordflow">return</span> (a == b);
<a name="l00186"></a>00186         }
<a name="l00187"></a>00187 <span class="preprocessor">#endif</span>
<a name="l00189"></a><a class="code" href="namespaceirr_1_1core.html#fe4784d5bf091acce7777c40c4010ff8">00189</a> <span class="preprocessor">        inline bool equals(const s32 a, const s32 b, const s32 tolerance = ROUNDING_ERROR_S32)</span>
<a name="l00190"></a>00190 <span class="preprocessor"></span>        {
<a name="l00191"></a>00191                 <span class="keywordflow">return</span> (a + tolerance &gt;= b) &amp;&amp; (a - tolerance &lt;= b);
<a name="l00192"></a>00192         }
<a name="l00193"></a>00193 
<a name="l00195"></a><a class="code" href="namespaceirr_1_1core.html#9a54aa08fdc2119258ad8dfa44f8dadf">00195</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceirr_1_1core.html#bf9b9b140cc365908ea4c8c47451e4e3" title="returns if a equals b, taking possible rounding errors into account">equals</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> tolerance = <a class="code" href="namespaceirr_1_1core.html#ac9f99b6a999bdf25fec402c59e8342a" title="Rounding error constant often used when comparing f32 values.">ROUNDING_ERROR_S32</a>)
<a name="l00196"></a>00196         {
<a name="l00197"></a>00197                 <span class="keywordflow">return</span> (a + tolerance &gt;= b) &amp;&amp; (a - tolerance &lt;= b);
<a name="l00198"></a>00198         }
<a name="l00199"></a>00199 
<a name="l00200"></a>00200 
<a name="l00202"></a><a class="code" href="namespaceirr_1_1core.html#fc24e6ba26469ec7ca7001ed272dc3b2">00202</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceirr_1_1core.html#fc24e6ba26469ec7ca7001ed272dc3b2" title="returns if a equals zero, taking rounding errors into account">iszero</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> tolerance = <a class="code" href="namespaceirr_1_1core.html#7b314c22d6804639cbcbce5231724f0b">ROUNDING_ERROR_f64</a>)
<a name="l00203"></a>00203         {
<a name="l00204"></a>00204                 <span class="keywordflow">return</span> fabs(a) &lt;= tolerance;
<a name="l00205"></a>00205         }
<a name="l00206"></a>00206 
<a name="l00208"></a><a class="code" href="namespaceirr_1_1core.html#af94a81169679083a48f9f9e6dced684">00208</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceirr_1_1core.html#fc24e6ba26469ec7ca7001ed272dc3b2" title="returns if a equals zero, taking rounding errors into account">iszero</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> tolerance = <a class="code" href="namespaceirr_1_1core.html#9514dd34463a30102ef8836915cf9c4c">ROUNDING_ERROR_f32</a>)
<a name="l00209"></a>00209         {
<a name="l00210"></a>00210                 <span class="keywordflow">return</span> fabsf(a) &lt;= tolerance;
<a name="l00211"></a>00211         }
<a name="l00212"></a>00212 
<a name="l00214"></a><a class="code" href="namespaceirr_1_1core.html#6e179d6dd92b81607f0539329dc2410a">00214</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceirr_1_1core.html#6e179d6dd92b81607f0539329dc2410a" title="returns if a equals not zero, taking rounding errors into account">isnotzero</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> tolerance = <a class="code" href="namespaceirr_1_1core.html#9514dd34463a30102ef8836915cf9c4c">ROUNDING_ERROR_f32</a>)
<a name="l00215"></a>00215         {
<a name="l00216"></a>00216                 <span class="keywordflow">return</span> fabsf(a) &gt; tolerance;
<a name="l00217"></a>00217         }
<a name="l00218"></a>00218 
<a name="l00220"></a><a class="code" href="namespaceirr_1_1core.html#3842b13dc7bd40f068cc8f7fd91bcfa5">00220</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceirr_1_1core.html#fc24e6ba26469ec7ca7001ed272dc3b2" title="returns if a equals zero, taking rounding errors into account">iszero</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> tolerance = 0)
<a name="l00221"></a>00221         {
<a name="l00222"></a>00222                 <span class="keywordflow">return</span> ( a &amp; 0x7ffffff ) &lt;= tolerance;
<a name="l00223"></a>00223         }
<a name="l00224"></a>00224 
<a name="l00226"></a><a class="code" href="namespaceirr_1_1core.html#fa64d4495f986ec0fa840e61cba45c68">00226</a>         <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="namespaceirr_1_1core.html#fc24e6ba26469ec7ca7001ed272dc3b2" title="returns if a equals zero, taking rounding errors into account">iszero</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> tolerance = 0)
<a name="l00227"></a>00227         {
<a name="l00228"></a>00228                 <span class="keywordflow">return</span> a &lt;= tolerance;
<a name="l00229"></a>00229         }
<a name="l00230"></a>00230 
<a name="l00231"></a><a class="code" href="namespaceirr_1_1core.html#a0d9ebcfeca532643e76cf58b98daca1">00231</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1core.html#a0d9ebcfeca532643e76cf58b98daca1">s32_min</a>(<a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> a, <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> b)
<a name="l00232"></a>00232         {
<a name="l00233"></a>00233                 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> mask = (a - b) &gt;&gt; 31;
<a name="l00234"></a>00234                 <span class="keywordflow">return</span> (a &amp; mask) | (b &amp; ~mask);
<a name="l00235"></a>00235         }
<a name="l00236"></a>00236 
<a name="l00237"></a><a class="code" href="namespaceirr_1_1core.html#3adbc0ee7f78051eb2a35511fe90bd2d">00237</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1core.html#3adbc0ee7f78051eb2a35511fe90bd2d">s32_max</a>(<a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> a, <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> b)
<a name="l00238"></a>00238         {
<a name="l00239"></a>00239                 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> mask = (a - b) &gt;&gt; 31;
<a name="l00240"></a>00240                 <span class="keywordflow">return</span> (b &amp; mask) | (a &amp; ~mask);
<a name="l00241"></a>00241         }
<a name="l00242"></a>00242 
<a name="l00243"></a><a class="code" href="namespaceirr_1_1core.html#a7828c932a36c62a67fd0f2b972d8b21">00243</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1core.html#a7828c932a36c62a67fd0f2b972d8b21">s32_clamp</a> (<a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> value, <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> low, <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> high)
<a name="l00244"></a>00244         {
<a name="l00245"></a>00245                 <span class="keywordflow">return</span> <a class="code" href="namespaceirr_1_1core.html#a0d9ebcfeca532643e76cf58b98daca1">s32_min</a>(<a class="code" href="namespaceirr_1_1core.html#3adbc0ee7f78051eb2a35511fe90bd2d">s32_max</a>(value,low), high);
<a name="l00246"></a>00246         }
<a name="l00247"></a>00247 
<a name="l00248"></a>00248         <span class="comment">/*</span>
<a name="l00249"></a>00249 <span class="comment">                float IEEE-754 bit represenation</span>
<a name="l00250"></a>00250 <span class="comment"></span>
<a name="l00251"></a>00251 <span class="comment">                0      0x00000000</span>
<a name="l00252"></a>00252 <span class="comment">                1.0    0x3f800000</span>
<a name="l00253"></a>00253 <span class="comment">                0.5    0x3f000000</span>
<a name="l00254"></a>00254 <span class="comment">                3      0x40400000</span>
<a name="l00255"></a>00255 <span class="comment">                +inf   0x7f800000</span>
<a name="l00256"></a>00256 <span class="comment">                -inf   0xff800000</span>
<a name="l00257"></a>00257 <span class="comment">                +NaN   0x7fc00000 or 0x7ff00000</span>
<a name="l00258"></a>00258 <span class="comment">                in general: number = (sign ? -1:1) * 2^(exponent) * 1.(mantissa bits)</span>
<a name="l00259"></a>00259 <span class="comment">        */</span>
<a name="l00260"></a>00260 
<a name="l00261"></a><a class="code" href="unionirr_1_1core_1_1inttofloat.html#87651356c7436ac7755e85189412f75a">00261</a>         <span class="keyword">typedef</span> <span class="keyword">union </span>{ <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> u; <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> s; <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> f; } <a class="code" href="unionirr_1_1core_1_1inttofloat.html">inttofloat</a>;
<a name="l00262"></a>00262 
<a name="l00263"></a><a class="code" href="irr_math_8h.html#fc4f1a86cb2a79c560b29ee5edd0f94d">00263</a> <span class="preprocessor">        #define F32_AS_S32(f)           (*((s32 *) &amp;(f)))</span>
<a name="l00264"></a><a class="code" href="irr_math_8h.html#fdeb4b30296d2b1dccec72427bdb39f2">00264</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_AS_U32(f)           (*((u32 *) &amp;(f)))</span>
<a name="l00265"></a><a class="code" href="irr_math_8h.html#b5498fea750901e87dfeca4e27425f16">00265</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_AS_U32_POINTER(f)   ( ((u32 *) &amp;(f)))</span>
<a name="l00266"></a>00266 <span class="preprocessor"></span>
<a name="l00267"></a><a class="code" href="irr_math_8h.html#ff2ace8fbd4b2ee6833ae0ed8dd9469a">00267</a> <span class="preprocessor">        #define F32_VALUE_0             0x00000000</span>
<a name="l00268"></a><a class="code" href="irr_math_8h.html#93465b810662025b38f42244b100fc2e">00268</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_VALUE_1             0x3f800000</span>
<a name="l00269"></a><a class="code" href="irr_math_8h.html#58566d4b084b3c9740b3215cf7a607bb">00269</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_SIGN_BIT            0x80000000U</span>
<a name="l00270"></a><a class="code" href="irr_math_8h.html#94abc82f2a2794c8331c9dad9a06958b">00270</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_EXPON_MANTISSA      0x7FFFFFFFU</span>
<a name="l00271"></a>00271 <span class="preprocessor"></span>
<a name="l00274"></a>00274 <span class="preprocessor">#ifdef IRRLICHT_FAST_MATH</span>
<a name="l00275"></a>00275 <span class="preprocessor"></span><span class="preprocessor">        #define IR(x)                           ((u32&amp;)(x))</span>
<a name="l00276"></a>00276 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00277"></a><a class="code" href="namespaceirr_1_1core.html#ff42ea2c4d80cb7b45b71d1f63c6a226">00277</a> <span class="preprocessor"></span>        <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1core.html#ff42ea2c4d80cb7b45b71d1f63c6a226">IR</a>(<a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> x) {<a class="code" href="unionirr_1_1core_1_1inttofloat.html">inttofloat</a> tmp; tmp.<a class="code" href="unionirr_1_1core_1_1inttofloat.html#b0dd36fa35cbb368602fa0d18b2d9788">f</a>=x; <span class="keywordflow">return</span> tmp.<a class="code" href="unionirr_1_1core_1_1inttofloat.html#87651356c7436ac7755e85189412f75a">u</a>;}
<a name="l00278"></a>00278 <span class="preprocessor">#endif</span>
<a name="l00279"></a>00279 <span class="preprocessor"></span>
<a name="l00281"></a><a class="code" href="irr_math_8h.html#a854d8430e0acc31adb1ddb3647f6534">00281</a> <span class="preprocessor">        #define AIR(x)                          (IR(x)&amp;0x7fffffff)</span>
<a name="l00282"></a>00282 <span class="preprocessor"></span>
<a name="l00284"></a>00284 <span class="preprocessor">#ifdef IRRLICHT_FAST_MATH</span>
<a name="l00285"></a>00285 <span class="preprocessor"></span><span class="preprocessor">        #define FR(x)                           ((f32&amp;)(x))</span>
<a name="l00286"></a>00286 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00287"></a><a class="code" href="namespaceirr_1_1core.html#e0940bd4032e5f10cf83b460f73571a3">00287</a> <span class="preprocessor"></span>        <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#e0940bd4032e5f10cf83b460f73571a3" title="Floating-point representation of an integer value.">FR</a>(<a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> x) {<a class="code" href="unionirr_1_1core_1_1inttofloat.html">inttofloat</a> tmp; tmp.<a class="code" href="unionirr_1_1core_1_1inttofloat.html#87651356c7436ac7755e85189412f75a">u</a>=x; <span class="keywordflow">return</span> tmp.<a class="code" href="unionirr_1_1core_1_1inttofloat.html#b0dd36fa35cbb368602fa0d18b2d9788">f</a>;}
<a name="l00288"></a><a class="code" href="namespaceirr_1_1core.html#10bf7ddf910b7feac9a36fd141a9f5ba">00288</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#e0940bd4032e5f10cf83b460f73571a3" title="Floating-point representation of an integer value.">FR</a>(<a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> x) {<a class="code" href="unionirr_1_1core_1_1inttofloat.html">inttofloat</a> tmp; tmp.<a class="code" href="unionirr_1_1core_1_1inttofloat.html#1adc8b3417ac325bd9695c0cbb6c043e">s</a>=x; <span class="keywordflow">return</span> tmp.<a class="code" href="unionirr_1_1core_1_1inttofloat.html#b0dd36fa35cbb368602fa0d18b2d9788">f</a>;}
<a name="l00289"></a>00289 <span class="preprocessor">#endif</span>
<a name="l00290"></a>00290 <span class="preprocessor"></span>
<a name="l00292"></a><a class="code" href="irr_math_8h.html#3ec4980c07f6b510c61230356e014d24">00292</a> <span class="preprocessor">        #define IEEE_1_0                        0x3f800000</span>
<a name="l00294"></a><a class="code" href="irr_math_8h.html#2b311316554140ac181c31d86f4f3786">00294</a> <span class="preprocessor">        #define IEEE_255_0                      0x437f0000</span>
<a name="l00295"></a>00295 <span class="preprocessor"></span>
<a name="l00296"></a>00296 <span class="preprocessor">#ifdef IRRLICHT_FAST_MATH</span>
<a name="l00297"></a>00297 <span class="preprocessor"></span><span class="preprocessor">        #define F32_LOWER_0(f)          (F32_AS_U32(f) &gt;  F32_SIGN_BIT)</span>
<a name="l00298"></a>00298 <span class="preprocessor"></span><span class="preprocessor">        #define F32_LOWER_EQUAL_0(f)    (F32_AS_S32(f) &lt;= F32_VALUE_0)</span>
<a name="l00299"></a>00299 <span class="preprocessor"></span><span class="preprocessor">        #define F32_GREATER_0(f)        (F32_AS_S32(f) &gt;  F32_VALUE_0)</span>
<a name="l00300"></a>00300 <span class="preprocessor"></span><span class="preprocessor">        #define F32_GREATER_EQUAL_0(f)  (F32_AS_U32(f) &lt;= F32_SIGN_BIT)</span>
<a name="l00301"></a>00301 <span class="preprocessor"></span><span class="preprocessor">        #define F32_EQUAL_1(f)          (F32_AS_U32(f) == F32_VALUE_1)</span>
<a name="l00302"></a>00302 <span class="preprocessor"></span><span class="preprocessor">        #define F32_EQUAL_0(f)          ( (F32_AS_U32(f) &amp; F32_EXPON_MANTISSA ) == F32_VALUE_0)</span>
<a name="l00303"></a>00303 <span class="preprocessor"></span>
<a name="l00304"></a>00304         <span class="comment">// only same sign</span>
<a name="l00305"></a>00305 <span class="preprocessor">        #define F32_A_GREATER_B(a,b)    (F32_AS_S32((a)) &gt; F32_AS_S32((b)))</span>
<a name="l00306"></a>00306 <span class="preprocessor"></span>
<a name="l00307"></a>00307 <span class="preprocessor">#else</span>
<a name="l00308"></a>00308 <span class="preprocessor"></span>
<a name="l00309"></a><a class="code" href="irr_math_8h.html#a86a7d03858f88ebbf9e36592583ced6">00309</a> <span class="preprocessor">        #define F32_LOWER_0(n)          ((n) &lt;  0.0f)</span>
<a name="l00310"></a><a class="code" href="irr_math_8h.html#26bc42a9cc1fc775bc588052c32ff9a0">00310</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_LOWER_EQUAL_0(n)    ((n) &lt;= 0.0f)</span>
<a name="l00311"></a><a class="code" href="irr_math_8h.html#2fdc9e94ce29e1866ddf64e5903d43a1">00311</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_GREATER_0(n)        ((n) &gt;  0.0f)</span>
<a name="l00312"></a><a class="code" href="irr_math_8h.html#407afe61680cc405bbe04922d36423af">00312</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_GREATER_EQUAL_0(n)  ((n) &gt;= 0.0f)</span>
<a name="l00313"></a><a class="code" href="irr_math_8h.html#e907baf637203996fb3187581c2def80">00313</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_EQUAL_1(n)          ((n) == 1.0f)</span>
<a name="l00314"></a><a class="code" href="irr_math_8h.html#3c82a09fb606a67c19514b534d364d6c">00314</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_EQUAL_0(n)          ((n) == 0.0f)</span>
<a name="l00315"></a><a class="code" href="irr_math_8h.html#b4092d1d22af18e03372117e347b633c">00315</a> <span class="preprocessor"></span><span class="preprocessor">        #define F32_A_GREATER_B(a,b)    ((a) &gt; (b))</span>
<a name="l00316"></a>00316 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00317"></a>00317 <span class="preprocessor"></span>
<a name="l00318"></a>00318 
<a name="l00319"></a>00319 <span class="preprocessor">#ifndef REALINLINE</span>
<a name="l00320"></a>00320 <span class="preprocessor"></span><span class="preprocessor">        #ifdef _MSC_VER</span>
<a name="l00321"></a>00321 <span class="preprocessor"></span><span class="preprocessor">                #define REALINLINE __forceinline</span>
<a name="l00322"></a>00322 <span class="preprocessor"></span><span class="preprocessor">        #else</span>
<a name="l00323"></a><a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">00323</a> <span class="preprocessor"></span><span class="preprocessor">                #define REALINLINE inline</span>
<a name="l00324"></a>00324 <span class="preprocessor"></span><span class="preprocessor">        #endif</span>
<a name="l00325"></a>00325 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00326"></a>00326 <span class="preprocessor"></span>
<a name="l00327"></a>00327 <span class="preprocessor">#if defined(__BORLANDC__) || defined (__BCPLUSPLUS__)</span>
<a name="l00328"></a>00328 <span class="preprocessor"></span>
<a name="l00329"></a>00329         <span class="comment">// 8-bit bools in borland builder</span>
<a name="l00330"></a>00330 
<a name="l00332"></a>00332         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1core.html#d6426246733e5dc16713f43352d85cdb" title="conditional set based on mask and arithmetic shift">if_c_a_else_b</a> ( <span class="keyword">const</span> <a class="code" href="namespaceirr.html#9395eaea339bcb546b319e9c96bf7410" title="8 bit character variable.">c8</a> condition, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b )
<a name="l00333"></a>00333         {
<a name="l00334"></a>00334                 <span class="keywordflow">return</span> ( ( -condition &gt;&gt; 7 ) &amp; ( a ^ b ) ) ^ b;
<a name="l00335"></a>00335         }
<a name="l00336"></a>00336 
<a name="l00338"></a>00338         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1core.html#f19c13d0084052f12357308c0cd83005" title="conditional set based on mask and arithmetic shift">if_c_a_else_0</a> ( <span class="keyword">const</span> <a class="code" href="namespaceirr.html#9395eaea339bcb546b319e9c96bf7410" title="8 bit character variable.">c8</a> condition, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a )
<a name="l00339"></a>00339         {
<a name="l00340"></a>00340                 <span class="keywordflow">return</span> ( -condition &gt;&gt; 31 ) &amp; a;
<a name="l00341"></a>00341         }
<a name="l00342"></a>00342 <span class="preprocessor">#else</span>
<a name="l00343"></a>00343 <span class="preprocessor"></span>
<a name="l00345"></a><a class="code" href="namespaceirr_1_1core.html#d6426246733e5dc16713f43352d85cdb">00345</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1core.html#d6426246733e5dc16713f43352d85cdb" title="conditional set based on mask and arithmetic shift">if_c_a_else_b</a> ( <span class="keyword">const</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> condition, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> b )
<a name="l00346"></a>00346         {
<a name="l00347"></a>00347                 <span class="keywordflow">return</span> ( ( -condition &gt;&gt; 31 ) &amp; ( a ^ b ) ) ^ b;
<a name="l00348"></a>00348         }
<a name="l00349"></a>00349 
<a name="l00351"></a><a class="code" href="namespaceirr_1_1core.html#f1ec8eb919fdb81c259920cce4004329">00351</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#e9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> <a class="code" href="namespaceirr_1_1core.html#d6426246733e5dc16713f43352d85cdb" title="conditional set based on mask and arithmetic shift">if_c_a_else_b</a> ( <span class="keyword">const</span> <a class="code" href="namespaceirr.html#43ace0af066371ac0862bac3f7314220" title="16 bit signed variable.">s16</a> condition, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#e9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#e9f8ec82692ad3b83c21f555bfa70bcc" title="16 bit unsigned variable.">u16</a> b )
<a name="l00352"></a>00352         {
<a name="l00353"></a>00353                 <span class="keywordflow">return</span> ( ( -condition &gt;&gt; 15 ) &amp; ( a ^ b ) ) ^ b;
<a name="l00354"></a>00354         }
<a name="l00355"></a>00355 
<a name="l00357"></a><a class="code" href="namespaceirr_1_1core.html#f19c13d0084052f12357308c0cd83005">00357</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> <a class="code" href="namespaceirr_1_1core.html#f19c13d0084052f12357308c0cd83005" title="conditional set based on mask and arithmetic shift">if_c_a_else_0</a> ( <span class="keyword">const</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> condition, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> a )
<a name="l00358"></a>00358         {
<a name="l00359"></a>00359                 <span class="keywordflow">return</span> ( -condition &gt;&gt; 31 ) &amp; a;
<a name="l00360"></a>00360         }
<a name="l00361"></a>00361 <span class="preprocessor">#endif</span>
<a name="l00362"></a>00362 <span class="preprocessor"></span>
<a name="l00363"></a>00363         <span class="comment">/*</span>
<a name="l00364"></a>00364 <span class="comment">                if (condition) state |= m; else state &amp;= ~m;</span>
<a name="l00365"></a>00365 <span class="comment">        */</span>
<a name="l00366"></a><a class="code" href="namespaceirr_1_1core.html#628051738e8873b91b064e6014024f41">00366</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <span class="keywordtype">void</span> <a class="code" href="namespaceirr_1_1core.html#628051738e8873b91b064e6014024f41">setbit_cond</a> ( <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> &amp;state, <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> condition, <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> mask )
<a name="l00367"></a>00367         {
<a name="l00368"></a>00368                 <span class="comment">// 0, or any postive to mask</span>
<a name="l00369"></a>00369                 <span class="comment">//s32 conmask = -condition &gt;&gt; 31;</span>
<a name="l00370"></a>00370                 state ^= ( ( -condition &gt;&gt; 31 ) ^ state ) &amp; mask;
<a name="l00371"></a>00371         }
<a name="l00372"></a>00372 
<a name="l00373"></a><a class="code" href="namespaceirr_1_1core.html#894a901069c34298987761c5f3d74f1f">00373</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#894a901069c34298987761c5f3d74f1f">round_</a>( <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> x )
<a name="l00374"></a>00374         {
<a name="l00375"></a>00375                 <span class="keywordflow">return</span> floorf( x + 0.5f );
<a name="l00376"></a>00376         }
<a name="l00377"></a>00377 
<a name="l00378"></a><a class="code" href="namespaceirr_1_1core.html#b4c17ceae6e2b96383e842eabb9596ab">00378</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <span class="keywordtype">void</span> <a class="code" href="namespaceirr_1_1core.html#b4c17ceae6e2b96383e842eabb9596ab">clearFPUException</a> ()
<a name="l00379"></a>00379         {
<a name="l00380"></a>00380 <span class="preprocessor">#ifdef IRRLICHT_FAST_MATH</span>
<a name="l00381"></a>00381 <span class="preprocessor"></span>                <span class="keywordflow">return</span>;
<a name="l00382"></a>00382 <span class="preprocessor">#ifdef feclearexcept</span>
<a name="l00383"></a>00383 <span class="preprocessor"></span>                feclearexcept(FE_ALL_EXCEPT);
<a name="l00384"></a>00384 <span class="preprocessor">#elif defined(_MSC_VER)</span>
<a name="l00385"></a>00385 <span class="preprocessor"></span>                __asm fnclex;
<a name="l00386"></a>00386 <span class="preprocessor">#elif defined(__GNUC__) &amp;&amp; defined(__x86__)</span>
<a name="l00387"></a>00387 <span class="preprocessor"></span>                __asm__ __volatile__ (<span class="stringliteral">"fclex \n\t"</span>);
<a name="l00388"></a>00388 <span class="preprocessor">#else</span>
<a name="l00389"></a>00389 <span class="preprocessor"></span><span class="preprocessor">#  warn clearFPUException not supported.</span>
<a name="l00390"></a>00390 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00391"></a>00391 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00392"></a>00392 <span class="preprocessor"></span>        }
<a name="l00393"></a>00393 
<a name="l00394"></a>00394         <span class="comment">// calculate: sqrt ( x )</span>
<a name="l00395"></a><a class="code" href="namespaceirr_1_1core.html#f2f378cc34a19f5da6fe1d4961646d1d">00395</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#f2f378cc34a19f5da6fe1d4961646d1d">squareroot</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> f)
<a name="l00396"></a>00396         {
<a name="l00397"></a>00397                 <span class="keywordflow">return</span> sqrtf(f);
<a name="l00398"></a>00398         }
<a name="l00399"></a>00399 
<a name="l00400"></a>00400         <span class="comment">// calculate: sqrt ( x )</span>
<a name="l00401"></a><a class="code" href="namespaceirr_1_1core.html#d4378f076bf251c05e543ce888da8f48">00401</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="namespaceirr_1_1core.html#f2f378cc34a19f5da6fe1d4961646d1d">squareroot</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> f)
<a name="l00402"></a>00402         {
<a name="l00403"></a>00403                 <span class="keywordflow">return</span> sqrt(f);
<a name="l00404"></a>00404         }
<a name="l00405"></a>00405 
<a name="l00406"></a>00406         <span class="comment">// calculate: sqrt ( x )</span>
<a name="l00407"></a><a class="code" href="namespaceirr_1_1core.html#6943186698de9d2ff47ce03fbe025230">00407</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1core.html#f2f378cc34a19f5da6fe1d4961646d1d">squareroot</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> f)
<a name="l00408"></a>00408         {
<a name="l00409"></a>00409                 <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a><span class="keyword">&gt;</span>(<a class="code" href="namespaceirr_1_1core.html#f2f378cc34a19f5da6fe1d4961646d1d">squareroot</a>(static_cast&lt;f32&gt;(f)));
<a name="l00410"></a>00410         }
<a name="l00411"></a>00411 
<a name="l00412"></a>00412         <span class="comment">// calculate: 1 / sqrt ( x )</span>
<a name="l00413"></a><a class="code" href="namespaceirr_1_1core.html#daef309f12c2a3386e94610e24f2bfa7">00413</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="namespaceirr_1_1core.html#daef309f12c2a3386e94610e24f2bfa7">reciprocal_squareroot</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> x)
<a name="l00414"></a>00414         {
<a name="l00415"></a>00415                 <span class="keywordflow">return</span> 1.0 / sqrt(x);
<a name="l00416"></a>00416         }
<a name="l00417"></a>00417 
<a name="l00418"></a>00418         <span class="comment">// calculate: 1 / sqrtf ( x )</span>
<a name="l00419"></a><a class="code" href="namespaceirr_1_1core.html#42eb747bb19d6ca2cb9d8977eb402c72">00419</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#daef309f12c2a3386e94610e24f2bfa7">reciprocal_squareroot</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> f)
<a name="l00420"></a>00420         {
<a name="l00421"></a>00421 <span class="preprocessor">#if defined ( IRRLICHT_FAST_MATH )</span>
<a name="l00422"></a>00422 <span class="preprocessor"></span><span class="preprocessor">        #if defined(_MSC_VER)</span>
<a name="l00423"></a>00423 <span class="preprocessor"></span>                <span class="comment">// SSE reciprocal square root estimate, accurate to 12 significant</span>
<a name="l00424"></a>00424                 <span class="comment">// bits of the mantissa</span>
<a name="l00425"></a>00425                 <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> recsqrt;
<a name="l00426"></a>00426                 __asm rsqrtss xmm0, f           <span class="comment">// xmm0 = rsqrtss(f)</span>
<a name="l00427"></a>00427                 __asm movss recsqrt, xmm0       <span class="comment">// return xmm0</span>
<a name="l00428"></a>00428                 <span class="keywordflow">return</span> recsqrt;
<a name="l00429"></a>00429 
<a name="l00430"></a>00430 <span class="comment">/*</span>
<a name="l00431"></a>00431 <span class="comment">                // comes from Nvidia</span>
<a name="l00432"></a>00432 <span class="comment">                u32 tmp = (u32(IEEE_1_0 &lt;&lt; 1) + IEEE_1_0 - *(u32*)&amp;x) &gt;&gt; 1;</span>
<a name="l00433"></a>00433 <span class="comment">                f32 y = *(f32*)&amp;tmp;</span>
<a name="l00434"></a>00434 <span class="comment">                return y * (1.47f - 0.47f * x * y * y);</span>
<a name="l00435"></a>00435 <span class="comment">*/</span>
<a name="l00436"></a>00436 <span class="preprocessor">        #else</span>
<a name="l00437"></a>00437 <span class="preprocessor"></span>                <span class="keywordflow">return</span> 1.f / sqrtf(f);
<a name="l00438"></a>00438 <span class="preprocessor">        #endif</span>
<a name="l00439"></a>00439 <span class="preprocessor"></span><span class="preprocessor">#else // no fast math</span>
<a name="l00440"></a>00440 <span class="preprocessor"></span>                <span class="keywordflow">return</span> 1.f / sqrtf(f);
<a name="l00441"></a>00441 <span class="preprocessor">#endif</span>
<a name="l00442"></a>00442 <span class="preprocessor"></span>        }
<a name="l00443"></a>00443 
<a name="l00444"></a>00444         <span class="comment">// calculate: 1 / sqrtf( x )</span>
<a name="l00445"></a><a class="code" href="namespaceirr_1_1core.html#21c37238a7754b48ff18c486202a1e4b">00445</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1core.html#daef309f12c2a3386e94610e24f2bfa7">reciprocal_squareroot</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> x)
<a name="l00446"></a>00446         {
<a name="l00447"></a>00447                 <span class="keywordflow">return</span> <span class="keyword">static_cast&lt;</span><a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a><span class="keyword">&gt;</span>(<a class="code" href="namespaceirr_1_1core.html#daef309f12c2a3386e94610e24f2bfa7">reciprocal_squareroot</a>(static_cast&lt;f32&gt;(x)));
<a name="l00448"></a>00448         }
<a name="l00449"></a>00449 
<a name="l00450"></a>00450         <span class="comment">// calculate: 1 / x</span>
<a name="l00451"></a><a class="code" href="namespaceirr_1_1core.html#a01390f49052dfe07e16ee6c5233f4eb">00451</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#a01390f49052dfe07e16ee6c5233f4eb">reciprocal</a>( <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> f )
<a name="l00452"></a>00452         {
<a name="l00453"></a>00453 <span class="preprocessor">#if defined (IRRLICHT_FAST_MATH)</span>
<a name="l00454"></a>00454 <span class="preprocessor"></span>
<a name="l00455"></a>00455                 <span class="comment">// SSE Newton-Raphson reciprocal estimate, accurate to 23 significant</span>
<a name="l00456"></a>00456                 <span class="comment">// bi ts of the mantissa</span>
<a name="l00457"></a>00457                 <span class="comment">// One Newtown-Raphson Iteration:</span>
<a name="l00458"></a>00458                 <span class="comment">// f(i+1) = 2 * rcpss(f) - f * rcpss(f) * rcpss(f)</span>
<a name="l00459"></a>00459                 <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rec;
<a name="l00460"></a>00460                 __asm rcpss xmm0, f               <span class="comment">// xmm0 = rcpss(f)</span>
<a name="l00461"></a>00461                 __asm movss xmm1, f               <span class="comment">// xmm1 = f</span>
<a name="l00462"></a>00462                 __asm mulss xmm1, xmm0            <span class="comment">// xmm1 = f * rcpss(f)</span>
<a name="l00463"></a>00463                 __asm mulss xmm1, xmm0            <span class="comment">// xmm2 = f * rcpss(f) * rcpss(f)</span>
<a name="l00464"></a>00464                 __asm addss xmm0, xmm0            <span class="comment">// xmm0 = 2 * rcpss(f)</span>
<a name="l00465"></a>00465                 __asm subss xmm0, xmm1            <span class="comment">// xmm0 = 2 * rcpss(f) </span>
<a name="l00466"></a>00466                                                                                   <span class="comment">//        - f * rcpss(f) * rcpss(f)</span>
<a name="l00467"></a>00467                 __asm movss rec, xmm0             <span class="comment">// return xmm0</span>
<a name="l00468"></a>00468                 <span class="keywordflow">return</span> rec;
<a name="l00469"></a>00469 
<a name="l00470"></a>00470 
<a name="l00472"></a>00472                 <span class="comment">// instead set f to a high value to get a return value near zero..</span>
<a name="l00473"></a>00473                 <span class="comment">// -1000000000000.f.. is use minus to stay negative..</span>
<a name="l00474"></a>00474                 <span class="comment">// must test's here (plane.normal dot anything ) checks on &lt;= 0.f</span>
<a name="l00475"></a>00475                 <span class="comment">//u32 x = (-(AIR(f) != 0 ) &gt;&gt; 31 ) &amp; ( IR(f) ^ 0xd368d4a5 ) ^ 0xd368d4a5;</span>
<a name="l00476"></a>00476                 <span class="comment">//return 1.f / FR ( x );</span>
<a name="l00477"></a>00477 
<a name="l00478"></a>00478 <span class="preprocessor">#else // no fast math</span>
<a name="l00479"></a>00479 <span class="preprocessor"></span>                <span class="keywordflow">return</span> 1.f / f;
<a name="l00480"></a>00480 <span class="preprocessor">#endif</span>
<a name="l00481"></a>00481 <span class="preprocessor"></span>        }
<a name="l00482"></a>00482 
<a name="l00483"></a>00483         <span class="comment">// calculate: 1 / x</span>
<a name="l00484"></a><a class="code" href="namespaceirr_1_1core.html#c4402e2ec5b151212168736b8cfdd587">00484</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> <a class="code" href="namespaceirr_1_1core.html#a01390f49052dfe07e16ee6c5233f4eb">reciprocal</a> ( <span class="keyword">const</span> <a class="code" href="namespaceirr.html#1325b02603ad449f92c68fc640af9b28" title="64 bit floating point variable.">f64</a> f )
<a name="l00485"></a>00485         {
<a name="l00486"></a>00486                 <span class="keywordflow">return</span> 1.0 / f;
<a name="l00487"></a>00487         }
<a name="l00488"></a>00488 
<a name="l00489"></a>00489 
<a name="l00490"></a>00490         <span class="comment">// calculate: 1 / x, low precision allowed</span>
<a name="l00491"></a><a class="code" href="namespaceirr_1_1core.html#b5de17006aac4618e43d5f816ffc97c9">00491</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#b5de17006aac4618e43d5f816ffc97c9">reciprocal_approxim</a> ( <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> f )
<a name="l00492"></a>00492         {
<a name="l00493"></a>00493 <span class="preprocessor">#if defined( IRRLICHT_FAST_MATH)</span>
<a name="l00494"></a>00494 <span class="preprocessor"></span>
<a name="l00495"></a>00495                 <span class="comment">// SSE Newton-Raphson reciprocal estimate, accurate to 23 significant</span>
<a name="l00496"></a>00496                 <span class="comment">// bi ts of the mantissa</span>
<a name="l00497"></a>00497                 <span class="comment">// One Newtown-Raphson Iteration:</span>
<a name="l00498"></a>00498                 <span class="comment">// f(i+1) = 2 * rcpss(f) - f * rcpss(f) * rcpss(f)</span>
<a name="l00499"></a>00499                 <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> rec;
<a name="l00500"></a>00500                 __asm rcpss xmm0, f               <span class="comment">// xmm0 = rcpss(f)</span>
<a name="l00501"></a>00501                 __asm movss xmm1, f               <span class="comment">// xmm1 = f</span>
<a name="l00502"></a>00502                 __asm mulss xmm1, xmm0            <span class="comment">// xmm1 = f * rcpss(f)</span>
<a name="l00503"></a>00503                 __asm mulss xmm1, xmm0            <span class="comment">// xmm2 = f * rcpss(f) * rcpss(f)</span>
<a name="l00504"></a>00504                 __asm addss xmm0, xmm0            <span class="comment">// xmm0 = 2 * rcpss(f)</span>
<a name="l00505"></a>00505                 __asm subss xmm0, xmm1            <span class="comment">// xmm0 = 2 * rcpss(f) </span>
<a name="l00506"></a>00506                                                                                   <span class="comment">//        - f * rcpss(f) * rcpss(f)</span>
<a name="l00507"></a>00507                 __asm movss rec, xmm0             <span class="comment">// return xmm0</span>
<a name="l00508"></a>00508                 <span class="keywordflow">return</span> rec;
<a name="l00509"></a>00509 
<a name="l00510"></a>00510 
<a name="l00511"></a>00511 <span class="comment">/*</span>
<a name="l00512"></a>00512 <span class="comment">                // SSE reciprocal estimate, accurate to 12 significant bits of</span>
<a name="l00513"></a>00513 <span class="comment">                f32 rec;</span>
<a name="l00514"></a>00514 <span class="comment">                __asm rcpss xmm0, f             // xmm0 = rcpss(f)</span>
<a name="l00515"></a>00515 <span class="comment">                __asm movss rec , xmm0          // return xmm0</span>
<a name="l00516"></a>00516 <span class="comment">                return rec;</span>
<a name="l00517"></a>00517 <span class="comment">*/</span>
<a name="l00518"></a>00518 <span class="comment">/*</span>
<a name="l00519"></a>00519 <span class="comment">                register u32 x = 0x7F000000 - IR ( p );</span>
<a name="l00520"></a>00520 <span class="comment">                const f32 r = FR ( x );</span>
<a name="l00521"></a>00521 <span class="comment">                return r * (2.0f - p * r);</span>
<a name="l00522"></a>00522 <span class="comment">*/</span>
<a name="l00523"></a>00523 <span class="preprocessor">#else // no fast math</span>
<a name="l00524"></a>00524 <span class="preprocessor"></span>                <span class="keywordflow">return</span> 1.f / f;
<a name="l00525"></a>00525 <span class="preprocessor">#endif</span>
<a name="l00526"></a>00526 <span class="preprocessor"></span>        }
<a name="l00527"></a>00527 
<a name="l00528"></a>00528 
<a name="l00529"></a><a class="code" href="namespaceirr_1_1core.html#c230a392b15e3d27c6e2a07a6925a8c4">00529</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1core.html#c230a392b15e3d27c6e2a07a6925a8c4">floor32</a>(<a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> x)
<a name="l00530"></a>00530         {
<a name="l00531"></a>00531 <span class="preprocessor">#ifdef IRRLICHT_FAST_MATH</span>
<a name="l00532"></a>00532 <span class="preprocessor"></span>                <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> h = 0.5f;
<a name="l00533"></a>00533 
<a name="l00534"></a>00534                 <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> t;
<a name="l00535"></a>00535 
<a name="l00536"></a>00536 <span class="preprocessor">#if defined(_MSC_VER)</span>
<a name="l00537"></a>00537 <span class="preprocessor"></span>                __asm
<a name="l00538"></a>00538                 {
<a name="l00539"></a>00539                         fld     x
<a name="l00540"></a>00540                         fsub    h
<a name="l00541"></a>00541                         fistp   t
<a name="l00542"></a>00542                 }
<a name="l00543"></a>00543 <span class="preprocessor">#elif defined(__GNUC__)</span>
<a name="l00544"></a>00544 <span class="preprocessor"></span>                __asm__ __volatile__ (
<a name="l00545"></a>00545                         <span class="stringliteral">"fsub %2 \n\t"</span>
<a name="l00546"></a>00546                         <span class="stringliteral">"fistpl %0"</span>
<a name="l00547"></a>00547                         : <span class="stringliteral">"=m"</span> (t)
<a name="l00548"></a>00548                         : <span class="stringliteral">"t"</span> (x), <span class="stringliteral">"f"</span> (h)
<a name="l00549"></a>00549                         : <span class="stringliteral">"st"</span>
<a name="l00550"></a>00550                         );
<a name="l00551"></a>00551 <span class="preprocessor">#else</span>
<a name="l00552"></a>00552 <span class="preprocessor"></span><span class="preprocessor">#  warn IRRLICHT_FAST_MATH not supported.</span>
<a name="l00553"></a>00553 <span class="preprocessor"></span>                <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a>) floorf ( x );
<a name="l00554"></a>00554 <span class="preprocessor">#endif</span>
<a name="l00555"></a>00555 <span class="preprocessor"></span>                <span class="keywordflow">return</span> t;
<a name="l00556"></a>00556 <span class="preprocessor">#else // no fast math</span>
<a name="l00557"></a>00557 <span class="preprocessor"></span>                <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a>) floorf ( x );
<a name="l00558"></a>00558 <span class="preprocessor">#endif</span>
<a name="l00559"></a>00559 <span class="preprocessor"></span>        }
<a name="l00560"></a>00560 
<a name="l00561"></a>00561 
<a name="l00562"></a><a class="code" href="namespaceirr_1_1core.html#0fb8b4d0f177af411fdd4bd94b6779ce">00562</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1core.html#0fb8b4d0f177af411fdd4bd94b6779ce">ceil32</a> ( <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> x )
<a name="l00563"></a>00563         {
<a name="l00564"></a>00564 <span class="preprocessor">#ifdef IRRLICHT_FAST_MATH</span>
<a name="l00565"></a>00565 <span class="preprocessor"></span>                <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> h = 0.5f;
<a name="l00566"></a>00566 
<a name="l00567"></a>00567                 <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> t;
<a name="l00568"></a>00568 
<a name="l00569"></a>00569 <span class="preprocessor">#if defined(_MSC_VER)</span>
<a name="l00570"></a>00570 <span class="preprocessor"></span>                __asm
<a name="l00571"></a>00571                 {
<a name="l00572"></a>00572                         fld     x
<a name="l00573"></a>00573                         fadd    h
<a name="l00574"></a>00574                         fistp   t
<a name="l00575"></a>00575                 }
<a name="l00576"></a>00576 <span class="preprocessor">#elif defined(__GNUC__)</span>
<a name="l00577"></a>00577 <span class="preprocessor"></span>                __asm__ __volatile__ (
<a name="l00578"></a>00578                         <span class="stringliteral">"fadd %2 \n\t"</span>
<a name="l00579"></a>00579                         <span class="stringliteral">"fistpl %0 \n\t"</span>
<a name="l00580"></a>00580                         : <span class="stringliteral">"=m"</span>(t)
<a name="l00581"></a>00581                         : <span class="stringliteral">"t"</span>(x), <span class="stringliteral">"f"</span>(h)
<a name="l00582"></a>00582                         : <span class="stringliteral">"st"</span>
<a name="l00583"></a>00583                         );
<a name="l00584"></a>00584 <span class="preprocessor">#else</span>
<a name="l00585"></a>00585 <span class="preprocessor"></span><span class="preprocessor">#  warn IRRLICHT_FAST_MATH not supported.</span>
<a name="l00586"></a>00586 <span class="preprocessor"></span>                <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a>) ceilf ( x );
<a name="l00587"></a>00587 <span class="preprocessor">#endif</span>
<a name="l00588"></a>00588 <span class="preprocessor"></span>                <span class="keywordflow">return</span> t;
<a name="l00589"></a>00589 <span class="preprocessor">#else // not fast math</span>
<a name="l00590"></a>00590 <span class="preprocessor"></span>                <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a>) ceilf ( x );
<a name="l00591"></a>00591 <span class="preprocessor">#endif</span>
<a name="l00592"></a>00592 <span class="preprocessor"></span>        }
<a name="l00593"></a>00593 
<a name="l00594"></a>00594 
<a name="l00595"></a>00595 
<a name="l00596"></a><a class="code" href="namespaceirr_1_1core.html#e46f57f03e9033c57c180fbe83b04cf2">00596</a>         <a class="code" href="irr_math_8h.html#3695e51e0a187a6c49684ba3206b0d0a">REALINLINE</a> <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="namespaceirr_1_1core.html#e46f57f03e9033c57c180fbe83b04cf2">round32</a>(<a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> x)
<a name="l00597"></a>00597         {
<a name="l00598"></a>00598 <span class="preprocessor">#if defined(IRRLICHT_FAST_MATH)</span>
<a name="l00599"></a>00599 <span class="preprocessor"></span>                <a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> t;
<a name="l00600"></a>00600 
<a name="l00601"></a>00601 <span class="preprocessor">#if defined(_MSC_VER)</span>
<a name="l00602"></a>00602 <span class="preprocessor"></span>                __asm
<a name="l00603"></a>00603                 {
<a name="l00604"></a>00604                         fld   x
<a name="l00605"></a>00605                         fistp t
<a name="l00606"></a>00606                 }
<a name="l00607"></a>00607 <span class="preprocessor">#elif defined(__GNUC__)</span>
<a name="l00608"></a>00608 <span class="preprocessor"></span>                __asm__ __volatile__ (
<a name="l00609"></a>00609                         <span class="stringliteral">"fistpl %0 \n\t"</span>
<a name="l00610"></a>00610                         : <span class="stringliteral">"=m"</span>(t)
<a name="l00611"></a>00611                         : <span class="stringliteral">"t"</span>(x)
<a name="l00612"></a>00612                         : <span class="stringliteral">"st"</span>
<a name="l00613"></a>00613                         );
<a name="l00614"></a>00614 <span class="preprocessor">#else</span>
<a name="l00615"></a>00615 <span class="preprocessor"></span><span class="preprocessor">#  warn IRRLICHT_FAST_MATH not supported.</span>
<a name="l00616"></a>00616 <span class="preprocessor"></span>                <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a>) <a class="code" href="namespaceirr_1_1core.html#894a901069c34298987761c5f3d74f1f">round_</a>(x);
<a name="l00617"></a>00617 <span class="preprocessor">#endif</span>
<a name="l00618"></a>00618 <span class="preprocessor"></span>                <span class="keywordflow">return</span> t;
<a name="l00619"></a>00619 <span class="preprocessor">#else // no fast math</span>
<a name="l00620"></a>00620 <span class="preprocessor"></span>                <span class="keywordflow">return</span> (<a class="code" href="namespaceirr.html#c66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a>) <a class="code" href="namespaceirr_1_1core.html#894a901069c34298987761c5f3d74f1f">round_</a>(x);
<a name="l00621"></a>00621 <span class="preprocessor">#endif</span>
<a name="l00622"></a>00622 <span class="preprocessor"></span>        }
<a name="l00623"></a>00623 
<a name="l00624"></a><a class="code" href="namespaceirr_1_1core.html#944684da42c3118ebe85ec9c3f77c331">00624</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#944684da42c3118ebe85ec9c3f77c331">f32_max3</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> b, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> c)
<a name="l00625"></a>00625         {
<a name="l00626"></a>00626                 <span class="keywordflow">return</span> a &gt; b ? (a &gt; c ? a : c) : (b &gt; c ? b : c);
<a name="l00627"></a>00627         }
<a name="l00628"></a>00628 
<a name="l00629"></a><a class="code" href="namespaceirr_1_1core.html#8d7bec533c867b22d0e870236ecf4bad">00629</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#8d7bec533c867b22d0e870236ecf4bad">f32_min3</a>(<span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> a, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> b, <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> c)
<a name="l00630"></a>00630         {
<a name="l00631"></a>00631                 <span class="keywordflow">return</span> a &lt; b ? (a &lt; c ? a : c) : (b &lt; c ? b : c);
<a name="l00632"></a>00632         }
<a name="l00633"></a>00633 
<a name="l00634"></a><a class="code" href="namespaceirr_1_1core.html#df530866e57502da85e6a1f0c23932a2">00634</a>         <span class="keyword">inline</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> <a class="code" href="namespaceirr_1_1core.html#df530866e57502da85e6a1f0c23932a2">fract</a> ( <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> x )
<a name="l00635"></a>00635         {
<a name="l00636"></a>00636                 <span class="keywordflow">return</span> x - floorf ( x );
<a name="l00637"></a>00637         }
<a name="l00638"></a>00638 
<a name="l00639"></a>00639 } <span class="comment">// end namespace core</span>
<a name="l00640"></a>00640 } <span class="comment">// end namespace irr</span>
<a name="l00641"></a>00641 
<a name="l00642"></a>00642 <span class="preprocessor">#ifndef IRRLICHT_FAST_MATH</span>
<a name="l00643"></a>00643 <span class="preprocessor"></span>        <span class="keyword">using</span> <a class="code" href="namespaceirr_1_1core.html#ff42ea2c4d80cb7b45b71d1f63c6a226">irr::core::IR</a>;
<a name="l00644"></a>00644         <span class="keyword">using</span> <a class="code" href="namespaceirr_1_1core.html#e0940bd4032e5f10cf83b460f73571a3" title="Floating-point representation of an integer value.">irr::core::FR</a>;
<a name="l00645"></a>00645 <span class="preprocessor">#endif</span>
<a name="l00646"></a>00646 <span class="preprocessor"></span>
<a name="l00647"></a>00647 <span class="preprocessor">#endif</span>
<a name="l00648"></a>00648 <span class="preprocessor"></span>
</pre></div></div>
<hr size="1">
<address style="align: right;">
<small> </small>
</address>
<table width="100%" border="0" cellspacing="0" cellpadding="2">
  <tr> 
    <td width="0"> <div align="left"><small><a href="http://irrlicht.sourceforge.net" target="_blank"><img src="irrlicht.png" alt="The Irrlicht Engine" align="middle" border=0 width=88 height=31></a></small></div></td>
    <td> <div align="left"><small><em><font size="2">The <a href="http://irrlicht.sourceforge.net" target="_blank">Irrlicht 
        Engine</a> Documentation &copy; 2003-2009 by Nikolaus Gebhardt. Generated 
        on Sun Jan 10 09:24:04 2010 by <a href="http://www.doxygen.org" target="_blank">Doxygen</a> 
        (1.5.6)</font></em></small></div></td>
  </tr>
</table>
<address style="align: right;">
</address>
</body>
</html>