<!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: SViewFrustum.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 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>SViewFrustum.h</h1><a href="_s_view_frustum_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">// 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 __S_VIEW_FRUSTUM_H_INCLUDED__</span> <a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __S_VIEW_FRUSTUM_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="plane3d_8h.html">plane3d.h</a>"</span> <a name="l00009"></a>00009 <span class="preprocessor">#include "<a class="code" href="vector3d_8h.html">vector3d.h</a>"</span> <a name="l00010"></a>00010 <span class="preprocessor">#include "<a class="code" href="line3d_8h.html">line3d.h</a>"</span> <a name="l00011"></a>00011 <span class="preprocessor">#include "<a class="code" href="aabbox3d_8h.html">aabbox3d.h</a>"</span> <a name="l00012"></a>00012 <span class="preprocessor">#include "<a class="code" href="matrix4_8h.html">matrix4.h</a>"</span> <a name="l00013"></a>00013 <span class="preprocessor">#include "<a class="code" href="_i_video_driver_8h.html">IVideoDriver.h</a>"</span> <a name="l00014"></a>00014 <a name="l00015"></a>00015 <span class="keyword">namespace </span>irr <a name="l00016"></a>00016 { <a name="l00017"></a>00017 <span class="keyword">namespace </span>scene <a name="l00018"></a>00018 { <a name="l00019"></a>00019 <a name="l00021"></a>00021 <a name="l00025"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html">00025</a> <span class="keyword">struct </span><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html" title="Defines the view frustum. That&#39;s the space visible by the camera.">SViewFrustum</a> <a name="l00026"></a>00026 { <a name="l00027"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0">00027</a> <span class="keyword">enum</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0">VFPLANES</a> <a name="l00028"></a>00028 { <a name="l00030"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f033c11636c0cf3a29df16551fb3222f89">00030</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f033c11636c0cf3a29df16551fb3222f89" title="Far plane of the frustum. That is the plane farest away from the eye.">VF_FAR_PLANE</a> = 0, <a name="l00032"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0d4e37002c2f3f5c9aa7219ca74ffb48e">00032</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0d4e37002c2f3f5c9aa7219ca74ffb48e" title="Near plane of the frustum. That is the plane nearest to the eye.">VF_NEAR_PLANE</a>, <a name="l00034"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f04d611f15cd215819287e533b45715d5c">00034</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f04d611f15cd215819287e533b45715d5c" title="Left plane of the frustum.">VF_LEFT_PLANE</a>, <a name="l00036"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0cc02c8b170e35f1416f1511646b051aa">00036</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0cc02c8b170e35f1416f1511646b051aa" title="Right plane of the frustum.">VF_RIGHT_PLANE</a>, <a name="l00038"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0a230be71193da774ddcb735ec7b10dd1">00038</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0a230be71193da774ddcb735ec7b10dd1" title="Bottom plane of the frustum.">VF_BOTTOM_PLANE</a>, <a name="l00040"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0dc6f550cf3890b19837cd8f0d7b1020a">00040</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0dc6f550cf3890b19837cd8f0d7b1020a" title="Top plane of the frustum.">VF_TOP_PLANE</a>, <a name="l00041"></a>00041 <a name="l00043"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f06c3c4cb8060a23a2365cf1df46fcefd7">00043</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f06c3c4cb8060a23a2365cf1df46fcefd7" title="Amount of planes enclosing the view frustum. Should be 6.">VF_PLANE_COUNT</a> <a name="l00044"></a>00044 }; <a name="l00045"></a>00045 <a name="l00046"></a>00046 <a name="l00048"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#7052e88c612bd1239115929e94e6210d">00048</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#7052e88c612bd1239115929e94e6210d" title="Default Constructor.">SViewFrustum</a>() {} <a name="l00049"></a>00049 <a name="l00051"></a>00051 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#7052e88c612bd1239115929e94e6210d" title="Default Constructor.">SViewFrustum</a>(<span class="keyword">const</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html" title="Defines the view frustum. That&#39;s the space visible by the camera.">SViewFrustum</a>& other); <a name="l00052"></a>00052 <a name="l00054"></a>00054 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#7052e88c612bd1239115929e94e6210d" title="Default Constructor.">SViewFrustum</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a>& mat); <a name="l00055"></a>00055 <a name="l00057"></a>00057 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#2517bde9292aa26119d75b9ff0b92833" title="This constructor creates a view frustum based on a projection and/or view matrix...">setFrom</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a>& mat); <a name="l00058"></a>00058 <a name="l00060"></a>00060 <a name="l00061"></a>00061 <span class="keywordtype">void</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#eabadaf532f08ba3cb98b897ff0619f2" title="transforms the frustum by the matrix">transform</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a>& mat); <a name="l00062"></a>00062 <a name="l00064"></a>00064 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#99712510130276f440e2c399dde7e5f3" title="returns the point which is on the far left upper corner inside the the view frustum...">getFarLeftUp</a>() <span class="keyword">const</span>; <a name="l00065"></a>00065 <a name="l00067"></a>00067 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#9a79eb4430af41031850adc7a0e0e3cf" title="returns the point which is on the far left bottom corner inside the the view frustum...">getFarLeftDown</a>() <span class="keyword">const</span>; <a name="l00068"></a>00068 <a name="l00070"></a>00070 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#1b7f3b1cd4da4ea886b77d674e1c17dd" title="returns the point which is on the far right top corner inside the the view frustum...">getFarRightUp</a>() <span class="keyword">const</span>; <a name="l00071"></a>00071 <a name="l00073"></a>00073 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#dd04c29bfa22d94be96c92ecff5420b9" title="returns the point which is on the far right bottom corner inside the the view frustum...">getFarRightDown</a>() <span class="keyword">const</span>; <a name="l00074"></a>00074 <a name="l00076"></a>00076 <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1aabbox3d.html" title="Axis aligned bounding box in 3d dimensional space.">core::aabbox3d<f32></a> &<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#4328fe06bedd409ae20e9efc64e68706" title="returns a bounding box enclosing the whole view frustum">getBoundingBox</a>() <span class="keyword">const</span>; <a name="l00077"></a>00077 <a name="l00079"></a>00079 <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#458eb19a23bcad50da0f9d3163e3621b" title="recalculates the bounding box member based on the planes">recalculateBoundingBox</a>(); <a name="l00080"></a>00080 <a name="l00082"></a>00082 <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a>& <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#cf8edd203e7479d2b444ed548075ffa6" title="get the given state&#39;s matrix based on frustum E_TRANSFORMATION_STATE">getTransform</a>( <a class="code" href="namespaceirr_1_1video.html#15b57657a320243be03ae6f66fcff43d" title="enumeration for geometry transformation states">video::E_TRANSFORMATION_STATE</a> state); <a name="l00083"></a>00083 <a name="l00085"></a>00085 <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a>& <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#cf8edd203e7479d2b444ed548075ffa6" title="get the given state&#39;s matrix based on frustum E_TRANSFORMATION_STATE">getTransform</a>( <a class="code" href="namespaceirr_1_1video.html#15b57657a320243be03ae6f66fcff43d" title="enumeration for geometry transformation states">video::E_TRANSFORMATION_STATE</a> state) <span class="keyword">const</span>; <a name="l00086"></a>00086 <a name="l00088"></a>00088 <a name="l00089"></a>00089 <span class="keywordtype">bool</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#ce0b4c93dcd1d4e6ae50615b457f1851" title="clips a line to the view frustum.">clipLine</a>(<a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">core::line3d<f32></a>& line) <span class="keyword">const</span>; <a name="l00090"></a>00090 <a name="l00092"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#77726fa084f416d69f058a7b2f887545">00092</a> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#77726fa084f416d69f058a7b2f887545" title="the position of the camera">cameraPosition</a>; <a name="l00093"></a>00093 <a name="l00095"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2">00095</a> <a class="code" href="classirr_1_1core_1_1plane3d.html" title="Template plane class with some intersection testing methods.">core::plane3d<f32></a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f06c3c4cb8060a23a2365cf1df46fcefd7" title="Amount of planes enclosing the view frustum. Should be 6.">VF_PLANE_COUNT</a>]; <a name="l00096"></a>00096 <a name="l00098"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#d4c8605ad3494093e3e5860e0332fe8a">00098</a> <a class="code" href="classirr_1_1core_1_1aabbox3d.html" title="Axis aligned bounding box in 3d dimensional space.">core::aabbox3d<f32></a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#d4c8605ad3494093e3e5860e0332fe8a" title="bounding box around the view frustum">boundingBox</a>; <a name="l00099"></a>00099 <a name="l00100"></a>00100 <span class="keyword">private</span>: <a name="l00102"></a>00102 <span class="keyword">enum</span> E_TRANSFORMATION_STATE_FRUSTUM <a name="l00103"></a>00103 { <a name="l00104"></a>00104 ETS_VIEW = 0, <a name="l00105"></a>00105 ETS_PROJECTION = 1, <a name="l00106"></a>00106 ETS_COUNT_FRUSTUM <a name="l00107"></a>00107 }; <a name="l00108"></a>00108 <a name="l00110"></a>00110 <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a> Matrices[ETS_COUNT_FRUSTUM]; <a name="l00111"></a>00111 }; <a name="l00112"></a>00112 <a name="l00113"></a>00113 <a name="l00117"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#a7cfed3ee9feee79efe02d26f3b14b0c">00117</a> <span class="keyword">inline</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#7052e88c612bd1239115929e94e6210d" title="Default Constructor.">SViewFrustum::SViewFrustum</a>(<span class="keyword">const</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html" title="Defines the view frustum. That&#39;s the space visible by the camera.">SViewFrustum</a>& other) <a name="l00118"></a>00118 { <a name="l00119"></a>00119 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#77726fa084f416d69f058a7b2f887545" title="the position of the camera">cameraPosition</a>=other.<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#77726fa084f416d69f058a7b2f887545" title="the position of the camera">cameraPosition</a>; <a name="l00120"></a>00120 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#d4c8605ad3494093e3e5860e0332fe8a" title="bounding box around the view frustum">boundingBox</a>=other.<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#d4c8605ad3494093e3e5860e0332fe8a" title="bounding box around the view frustum">boundingBox</a>; <a name="l00121"></a>00121 <a name="l00122"></a>00122 <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> i; <a name="l00123"></a>00123 <span class="keywordflow">for</span> (i=0; i<<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f06c3c4cb8060a23a2365cf1df46fcefd7" title="Amount of planes enclosing the view frustum. Should be 6.">VF_PLANE_COUNT</a>; ++i) <a name="l00124"></a>00124 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[i]=other.<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[i]; <a name="l00125"></a>00125 <a name="l00126"></a>00126 for (i=0; i<ETS_COUNT_FRUSTUM; ++i) <a name="l00127"></a>00127 Matrices[i]=other.<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#25f334d74a1c6c943dadfa3b3bfb4336" title="Hold a copy of important transform matrices.">Matrices</a>[i]; <a name="l00128"></a>00128 } <a name="l00129"></a>00129 <a name="l00130"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#cfcbb01f1e26f73ee1d9c7695302a508">00130</a> <span class="keyword">inline</span> SViewFrustum::SViewFrustum(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a>& mat) <a name="l00131"></a>00131 { <a name="l00132"></a>00132 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#2517bde9292aa26119d75b9ff0b92833" title="This constructor creates a view frustum based on a projection and/or view matrix...">setFrom</a> ( mat ); <a name="l00133"></a>00133 } <a name="l00134"></a>00134 <a name="l00135"></a>00135 <a name="l00136"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#eabadaf532f08ba3cb98b897ff0619f2">00136</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> SViewFrustum::transform(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a>& mat) <a name="l00137"></a>00137 { <a name="l00138"></a>00138 <span class="keywordflow">for</span> (<a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> i=0; i<<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f06c3c4cb8060a23a2365cf1df46fcefd7" title="Amount of planes enclosing the view frustum. Should be 6.">VF_PLANE_COUNT</a>; ++i) <a name="l00139"></a>00139 mat.<a class="code" href="classirr_1_1core_1_1_c_matrix4.html#c4f0d4156d573d8b73eb51dce76e094e" title="Transforms a plane by this matrix.">transformPlane</a>(<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[i]); <a name="l00140"></a>00140 <a name="l00141"></a>00141 mat.<a class="code" href="classirr_1_1core_1_1_c_matrix4.html#a6bb8b39114749d70e51bd1b90bce0a1" title="Transforms the vector by this matrix.">transformVect</a>(<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#77726fa084f416d69f058a7b2f887545" title="the position of the camera">cameraPosition</a>); <a name="l00142"></a>00142 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#458eb19a23bcad50da0f9d3163e3621b" title="recalculates the bounding box member based on the planes">recalculateBoundingBox</a>(); <a name="l00143"></a>00143 } <a name="l00144"></a>00144 <a name="l00145"></a>00145 <a name="l00146"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#99712510130276f440e2c399dde7e5f3">00146</a> <span class="keyword">inline</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#99712510130276f440e2c399dde7e5f3" title="returns the point which is on the far left upper corner inside the the view frustum...">SViewFrustum::getFarLeftUp</a>()<span class="keyword"> const</span> <a name="l00147"></a>00147 <span class="keyword"> </span>{ <a name="l00148"></a>00148 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> p; <a name="l00149"></a>00149 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f033c11636c0cf3a29df16551fb3222f89" title="Far plane of the frustum. That is the plane farest away from the eye.">scene::SViewFrustum::VF_FAR_PLANE</a>].getIntersectionWithPlanes( <a name="l00150"></a>00150 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0dc6f550cf3890b19837cd8f0d7b1020a" title="Top plane of the frustum.">scene::SViewFrustum::VF_TOP_PLANE</a>], <a name="l00151"></a>00151 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f04d611f15cd215819287e533b45715d5c" title="Left plane of the frustum.">scene::SViewFrustum::VF_LEFT_PLANE</a>], p); <a name="l00152"></a>00152 <a name="l00153"></a>00153 <span class="keywordflow">return</span> p; <a name="l00154"></a>00154 } <a name="l00155"></a>00155 <a name="l00156"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#9a79eb4430af41031850adc7a0e0e3cf">00156</a> <span class="keyword">inline</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#9a79eb4430af41031850adc7a0e0e3cf" title="returns the point which is on the far left bottom corner inside the the view frustum...">SViewFrustum::getFarLeftDown</a>()<span class="keyword"> const</span> <a name="l00157"></a>00157 <span class="keyword"> </span>{ <a name="l00158"></a>00158 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> p; <a name="l00159"></a>00159 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f033c11636c0cf3a29df16551fb3222f89" title="Far plane of the frustum. That is the plane farest away from the eye.">scene::SViewFrustum::VF_FAR_PLANE</a>].getIntersectionWithPlanes( <a name="l00160"></a>00160 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0a230be71193da774ddcb735ec7b10dd1" title="Bottom plane of the frustum.">scene::SViewFrustum::VF_BOTTOM_PLANE</a>], <a name="l00161"></a>00161 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f04d611f15cd215819287e533b45715d5c" title="Left plane of the frustum.">scene::SViewFrustum::VF_LEFT_PLANE</a>], p); <a name="l00162"></a>00162 <a name="l00163"></a>00163 <span class="keywordflow">return</span> p; <a name="l00164"></a>00164 } <a name="l00165"></a>00165 <a name="l00166"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#1b7f3b1cd4da4ea886b77d674e1c17dd">00166</a> <span class="keyword">inline</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#1b7f3b1cd4da4ea886b77d674e1c17dd" title="returns the point which is on the far right top corner inside the the view frustum...">SViewFrustum::getFarRightUp</a>()<span class="keyword"> const</span> <a name="l00167"></a>00167 <span class="keyword"> </span>{ <a name="l00168"></a>00168 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> p; <a name="l00169"></a>00169 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f033c11636c0cf3a29df16551fb3222f89" title="Far plane of the frustum. That is the plane farest away from the eye.">scene::SViewFrustum::VF_FAR_PLANE</a>].getIntersectionWithPlanes( <a name="l00170"></a>00170 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0dc6f550cf3890b19837cd8f0d7b1020a" title="Top plane of the frustum.">scene::SViewFrustum::VF_TOP_PLANE</a>], <a name="l00171"></a>00171 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0cc02c8b170e35f1416f1511646b051aa" title="Right plane of the frustum.">scene::SViewFrustum::VF_RIGHT_PLANE</a>], p); <a name="l00172"></a>00172 <a name="l00173"></a>00173 <span class="keywordflow">return</span> p; <a name="l00174"></a>00174 } <a name="l00175"></a>00175 <a name="l00176"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#dd04c29bfa22d94be96c92ecff5420b9">00176</a> <span class="keyword">inline</span> <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#dd04c29bfa22d94be96c92ecff5420b9" title="returns the point which is on the far right bottom corner inside the the view frustum...">SViewFrustum::getFarRightDown</a>()<span class="keyword"> const</span> <a name="l00177"></a>00177 <span class="keyword"> </span>{ <a name="l00178"></a>00178 <a class="code" href="classirr_1_1core_1_1vector3d.html" title="3d vector template class with lots of operators and methods.">core::vector3df</a> p; <a name="l00179"></a>00179 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f033c11636c0cf3a29df16551fb3222f89" title="Far plane of the frustum. That is the plane farest away from the eye.">scene::SViewFrustum::VF_FAR_PLANE</a>].getIntersectionWithPlanes( <a name="l00180"></a>00180 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0a230be71193da774ddcb735ec7b10dd1" title="Bottom plane of the frustum.">scene::SViewFrustum::VF_BOTTOM_PLANE</a>], <a name="l00181"></a>00181 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0cc02c8b170e35f1416f1511646b051aa" title="Right plane of the frustum.">scene::SViewFrustum::VF_RIGHT_PLANE</a>], p); <a name="l00182"></a>00182 <a name="l00183"></a>00183 <span class="keywordflow">return</span> p; <a name="l00184"></a>00184 } <a name="l00185"></a>00185 <a name="l00186"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#4328fe06bedd409ae20e9efc64e68706">00186</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1aabbox3d.html" title="Axis aligned bounding box in 3d dimensional space.">core::aabbox3d<f32></a> &<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#4328fe06bedd409ae20e9efc64e68706" title="returns a bounding box enclosing the whole view frustum">SViewFrustum::getBoundingBox</a>()<span class="keyword"> const</span> <a name="l00187"></a>00187 <span class="keyword"> </span>{ <a name="l00188"></a>00188 <span class="keywordflow">return</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#d4c8605ad3494093e3e5860e0332fe8a" title="bounding box around the view frustum">boundingBox</a>; <a name="l00189"></a>00189 } <a name="l00190"></a>00190 <a name="l00191"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#458eb19a23bcad50da0f9d3163e3621b">00191</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#458eb19a23bcad50da0f9d3163e3621b" title="recalculates the bounding box member based on the planes">SViewFrustum::recalculateBoundingBox</a>() <a name="l00192"></a>00192 { <a name="l00193"></a>00193 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#d4c8605ad3494093e3e5860e0332fe8a" title="bounding box around the view frustum">boundingBox</a>.reset ( <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#77726fa084f416d69f058a7b2f887545" title="the position of the camera">cameraPosition</a> ); <a name="l00194"></a>00194 <a name="l00195"></a>00195 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#d4c8605ad3494093e3e5860e0332fe8a" title="bounding box around the view frustum">boundingBox</a>.addInternalPoint(<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#99712510130276f440e2c399dde7e5f3" title="returns the point which is on the far left upper corner inside the the view frustum...">getFarLeftUp</a>()); <a name="l00196"></a>00196 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#d4c8605ad3494093e3e5860e0332fe8a" title="bounding box around the view frustum">boundingBox</a>.addInternalPoint(<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#1b7f3b1cd4da4ea886b77d674e1c17dd" title="returns the point which is on the far right top corner inside the the view frustum...">getFarRightUp</a>()); <a name="l00197"></a>00197 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#d4c8605ad3494093e3e5860e0332fe8a" title="bounding box around the view frustum">boundingBox</a>.addInternalPoint(<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#9a79eb4430af41031850adc7a0e0e3cf" title="returns the point which is on the far left bottom corner inside the the view frustum...">getFarLeftDown</a>()); <a name="l00198"></a>00198 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#d4c8605ad3494093e3e5860e0332fe8a" title="bounding box around the view frustum">boundingBox</a>.addInternalPoint(<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#dd04c29bfa22d94be96c92ecff5420b9" title="returns the point which is on the far right bottom corner inside the the view frustum...">getFarRightDown</a>()); <a name="l00199"></a>00199 } <a name="l00200"></a>00200 <a name="l00203"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#2517bde9292aa26119d75b9ff0b92833">00203</a> <span class="keyword">inline</span> <span class="keywordtype">void</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#2517bde9292aa26119d75b9ff0b92833" title="This constructor creates a view frustum based on a projection and/or view matrix...">SViewFrustum::setFrom</a>(<span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a>& mat) <a name="l00204"></a>00204 { <a name="l00205"></a>00205 <span class="comment">// left clipping plane</span> <a name="l00206"></a>00206 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f04d611f15cd215819287e533b45715d5c" title="Left plane of the frustum.">VF_LEFT_PLANE</a>].Normal.X = mat[3 ] + mat[0]; <a name="l00207"></a>00207 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f04d611f15cd215819287e533b45715d5c" title="Left plane of the frustum.">VF_LEFT_PLANE</a>].Normal.Y = mat[7 ] + mat[4]; <a name="l00208"></a>00208 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f04d611f15cd215819287e533b45715d5c" title="Left plane of the frustum.">VF_LEFT_PLANE</a>].Normal.Z = mat[11] + mat[8]; <a name="l00209"></a>00209 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f04d611f15cd215819287e533b45715d5c" title="Left plane of the frustum.">VF_LEFT_PLANE</a>].D = mat[15] + mat[12]; <a name="l00210"></a>00210 <a name="l00211"></a>00211 <span class="comment">// right clipping plane</span> <a name="l00212"></a>00212 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0cc02c8b170e35f1416f1511646b051aa" title="Right plane of the frustum.">VF_RIGHT_PLANE</a>].Normal.X = mat[3 ] - mat[0]; <a name="l00213"></a>00213 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0cc02c8b170e35f1416f1511646b051aa" title="Right plane of the frustum.">VF_RIGHT_PLANE</a>].Normal.Y = mat[7 ] - mat[4]; <a name="l00214"></a>00214 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0cc02c8b170e35f1416f1511646b051aa" title="Right plane of the frustum.">VF_RIGHT_PLANE</a>].Normal.Z = mat[11] - mat[8]; <a name="l00215"></a>00215 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0cc02c8b170e35f1416f1511646b051aa" title="Right plane of the frustum.">VF_RIGHT_PLANE</a>].D = mat[15] - mat[12]; <a name="l00216"></a>00216 <a name="l00217"></a>00217 <span class="comment">// top clipping plane</span> <a name="l00218"></a>00218 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0dc6f550cf3890b19837cd8f0d7b1020a" title="Top plane of the frustum.">VF_TOP_PLANE</a>].Normal.X = mat[3 ] - mat[1]; <a name="l00219"></a>00219 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0dc6f550cf3890b19837cd8f0d7b1020a" title="Top plane of the frustum.">VF_TOP_PLANE</a>].Normal.Y = mat[7 ] - mat[5]; <a name="l00220"></a>00220 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0dc6f550cf3890b19837cd8f0d7b1020a" title="Top plane of the frustum.">VF_TOP_PLANE</a>].Normal.Z = mat[11] - mat[9]; <a name="l00221"></a>00221 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0dc6f550cf3890b19837cd8f0d7b1020a" title="Top plane of the frustum.">VF_TOP_PLANE</a>].D = mat[15] - mat[13]; <a name="l00222"></a>00222 <a name="l00223"></a>00223 <span class="comment">// bottom clipping plane</span> <a name="l00224"></a>00224 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0a230be71193da774ddcb735ec7b10dd1" title="Bottom plane of the frustum.">VF_BOTTOM_PLANE</a>].Normal.X = mat[3 ] + mat[1]; <a name="l00225"></a>00225 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0a230be71193da774ddcb735ec7b10dd1" title="Bottom plane of the frustum.">VF_BOTTOM_PLANE</a>].Normal.Y = mat[7 ] + mat[5]; <a name="l00226"></a>00226 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0a230be71193da774ddcb735ec7b10dd1" title="Bottom plane of the frustum.">VF_BOTTOM_PLANE</a>].Normal.Z = mat[11] + mat[9]; <a name="l00227"></a>00227 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0a230be71193da774ddcb735ec7b10dd1" title="Bottom plane of the frustum.">VF_BOTTOM_PLANE</a>].D = mat[15] + mat[13]; <a name="l00228"></a>00228 <a name="l00229"></a>00229 <span class="comment">// far clipping plane</span> <a name="l00230"></a>00230 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f033c11636c0cf3a29df16551fb3222f89" title="Far plane of the frustum. That is the plane farest away from the eye.">VF_FAR_PLANE</a>].Normal.X = mat[3 ] - mat[2]; <a name="l00231"></a>00231 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f033c11636c0cf3a29df16551fb3222f89" title="Far plane of the frustum. That is the plane farest away from the eye.">VF_FAR_PLANE</a>].Normal.Y = mat[7 ] - mat[6]; <a name="l00232"></a>00232 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f033c11636c0cf3a29df16551fb3222f89" title="Far plane of the frustum. That is the plane farest away from the eye.">VF_FAR_PLANE</a>].Normal.Z = mat[11] - mat[10]; <a name="l00233"></a>00233 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f033c11636c0cf3a29df16551fb3222f89" title="Far plane of the frustum. That is the plane farest away from the eye.">VF_FAR_PLANE</a>].D = mat[15] - mat[14]; <a name="l00234"></a>00234 <a name="l00235"></a>00235 <span class="comment">// near clipping plane</span> <a name="l00236"></a>00236 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0d4e37002c2f3f5c9aa7219ca74ffb48e" title="Near plane of the frustum. That is the plane nearest to the eye.">VF_NEAR_PLANE</a>].Normal.X = mat[2]; <a name="l00237"></a>00237 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0d4e37002c2f3f5c9aa7219ca74ffb48e" title="Near plane of the frustum. That is the plane nearest to the eye.">VF_NEAR_PLANE</a>].Normal.Y = mat[6]; <a name="l00238"></a>00238 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0d4e37002c2f3f5c9aa7219ca74ffb48e" title="Near plane of the frustum. That is the plane nearest to the eye.">VF_NEAR_PLANE</a>].Normal.Z = mat[10]; <a name="l00239"></a>00239 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f0d4e37002c2f3f5c9aa7219ca74ffb48e" title="Near plane of the frustum. That is the plane nearest to the eye.">VF_NEAR_PLANE</a>].D = mat[14]; <a name="l00240"></a>00240 <a name="l00241"></a>00241 <span class="comment">// normalize normals</span> <a name="l00242"></a>00242 <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> i; <a name="l00243"></a>00243 <span class="keywordflow">for</span> ( i=0; i != <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f06c3c4cb8060a23a2365cf1df46fcefd7" title="Amount of planes enclosing the view frustum. Should be 6.">VF_PLANE_COUNT</a>; ++i) <a name="l00244"></a>00244 { <a name="l00245"></a>00245 <span class="keyword">const</span> <a class="code" href="namespaceirr.html#0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> len = -<a class="code" href="namespaceirr_1_1core.html#21c37238a7754b48ff18c486202a1e4b">core::reciprocal_squareroot</a>( <a name="l00246"></a>00246 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[i].Normal.getLengthSQ()); <a name="l00247"></a>00247 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[i].Normal *= len; <a name="l00248"></a>00248 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[i].D *= len; <a name="l00249"></a>00249 } <a name="l00250"></a>00250 <a name="l00251"></a>00251 <span class="comment">// make bounding box</span> <a name="l00252"></a>00252 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#458eb19a23bcad50da0f9d3163e3621b" title="recalculates the bounding box member based on the planes">recalculateBoundingBox</a>(); <a name="l00253"></a>00253 } <a name="l00254"></a>00254 <a name="l00258"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#cf8edd203e7479d2b444ed548075ffa6">00258</a> <span class="keyword">inline</span> <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a>& <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#cf8edd203e7479d2b444ed548075ffa6" title="get the given state&#39;s matrix based on frustum E_TRANSFORMATION_STATE">SViewFrustum::getTransform</a>(<a class="code" href="namespaceirr_1_1video.html#15b57657a320243be03ae6f66fcff43d" title="enumeration for geometry transformation states">video::E_TRANSFORMATION_STATE</a> state ) <a name="l00259"></a>00259 { <a name="l00260"></a>00260 <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index = 0; <a name="l00261"></a>00261 <span class="keywordflow">switch</span> ( state ) <a name="l00262"></a>00262 { <a name="l00263"></a>00263 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#15b57657a320243be03ae6f66fcff43de7ec186418508c67a7562af012d7b63f" title="Projection transformation.">video::ETS_PROJECTION</a>: <a name="l00264"></a>00264 index = SViewFrustum::ETS_PROJECTION; <span class="keywordflow">break</span>; <a name="l00265"></a>00265 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#15b57657a320243be03ae6f66fcff43d152f4262d5874186e0288934c7d31e14" title="View transformation.">video::ETS_VIEW</a>: <a name="l00266"></a>00266 index = SViewFrustum::ETS_VIEW; <span class="keywordflow">break</span>; <a name="l00267"></a>00267 <span class="keywordflow">default</span>: <a name="l00268"></a>00268 <span class="keywordflow">break</span>; <a name="l00269"></a>00269 } <a name="l00270"></a>00270 <span class="keywordflow">return</span> Matrices [ index ]; <a name="l00271"></a>00271 } <a name="l00272"></a>00272 <a name="l00276"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#8e253fc5e6ea47531033792b22f28945">00276</a> <span class="keyword">inline</span> <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1_c_matrix4.html" title="4x4 matrix. Mostly used as transformation matrix for 3d calculations.">core::matrix4</a>& <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#cf8edd203e7479d2b444ed548075ffa6" title="get the given state&#39;s matrix based on frustum E_TRANSFORMATION_STATE">SViewFrustum::getTransform</a>(<a class="code" href="namespaceirr_1_1video.html#15b57657a320243be03ae6f66fcff43d" title="enumeration for geometry transformation states">video::E_TRANSFORMATION_STATE</a> state )<span class="keyword"> const</span> <a name="l00277"></a>00277 <span class="keyword"> </span>{ <a name="l00278"></a>00278 <a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> index = 0; <a name="l00279"></a>00279 <span class="keywordflow">switch</span> ( state ) <a name="l00280"></a>00280 { <a name="l00281"></a>00281 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#15b57657a320243be03ae6f66fcff43de7ec186418508c67a7562af012d7b63f" title="Projection transformation.">video::ETS_PROJECTION</a>: <a name="l00282"></a>00282 index = SViewFrustum::ETS_PROJECTION; <span class="keywordflow">break</span>; <a name="l00283"></a>00283 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#15b57657a320243be03ae6f66fcff43d152f4262d5874186e0288934c7d31e14" title="View transformation.">video::ETS_VIEW</a>: <a name="l00284"></a>00284 index = SViewFrustum::ETS_VIEW; <span class="keywordflow">break</span>; <a name="l00285"></a>00285 <span class="keywordflow">default</span>: <a name="l00286"></a>00286 <span class="keywordflow">break</span>; <a name="l00287"></a>00287 } <a name="l00288"></a>00288 <span class="keywordflow">return</span> Matrices [ index ]; <a name="l00289"></a>00289 } <a name="l00290"></a>00290 <a name="l00292"></a><a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#ce0b4c93dcd1d4e6ae50615b457f1851">00292</a> <span class="keyword">inline</span> <span class="keywordtype">bool</span> <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#ce0b4c93dcd1d4e6ae50615b457f1851" title="clips a line to the view frustum.">SViewFrustum::clipLine</a>(<a class="code" href="classirr_1_1core_1_1line3d.html" title="3D line between two points with intersection methods.">core::line3d<f32></a>& line)<span class="keyword"> const</span> <a name="l00293"></a>00293 <span class="keyword"> </span>{ <a name="l00294"></a>00294 <span class="keywordtype">bool</span> wasClipped = <span class="keyword">false</span>; <a name="l00295"></a>00295 <span class="keywordflow">for</span> (<a class="code" href="namespaceirr.html#0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> i=0; i < <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#e3a96797aec028717f0589e82926b9f06c3c4cb8060a23a2365cf1df46fcefd7" title="Amount of planes enclosing the view frustum. Should be 6.">VF_PLANE_COUNT</a>; ++i) <a name="l00296"></a>00296 { <a name="l00297"></a>00297 <span class="keywordflow">if</span> (<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[i].classifyPointRelation(line.<a class="code" href="classirr_1_1core_1_1line3d.html#8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>) == <a class="code" href="namespaceirr_1_1core.html#8a9999eb0d151083f48afe5f7d17a96c30484977b2480b6d6621114512d0b703">core::ISREL3D_FRONT</a>) <a name="l00298"></a>00298 { <a name="l00299"></a>00299 line.<a class="code" href="classirr_1_1core_1_1line3d.html#8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a> = line.<a class="code" href="classirr_1_1core_1_1line3d.html#8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>.getInterpolated(line.<a class="code" href="classirr_1_1core_1_1line3d.html#ea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>, <a name="l00300"></a>00300 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[i].getKnownIntersectionWithLine(line.<a class="code" href="classirr_1_1core_1_1line3d.html#8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>, line.<a class="code" href="classirr_1_1core_1_1line3d.html#ea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>)); <a name="l00301"></a>00301 wasClipped = <span class="keyword">true</span>; <a name="l00302"></a>00302 } <a name="l00303"></a>00303 <span class="keywordflow">if</span> (<a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[i].classifyPointRelation(line.<a class="code" href="classirr_1_1core_1_1line3d.html#ea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>) == <a class="code" href="namespaceirr_1_1core.html#8a9999eb0d151083f48afe5f7d17a96c30484977b2480b6d6621114512d0b703">core::ISREL3D_FRONT</a>) <a name="l00304"></a>00304 { <a name="l00305"></a>00305 line.<a class="code" href="classirr_1_1core_1_1line3d.html#ea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a> = line.<a class="code" href="classirr_1_1core_1_1line3d.html#8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>.getInterpolated(line.<a class="code" href="classirr_1_1core_1_1line3d.html#ea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>, <a name="l00306"></a>00306 <a class="code" href="structirr_1_1scene_1_1_s_view_frustum.html#fa59258f22c23b6f1dc4bcaff142dba2" title="all planes enclosing the view frustum.">planes</a>[i].getKnownIntersectionWithLine(line.<a class="code" href="classirr_1_1core_1_1line3d.html#8874f77324b6ef6632e66b22051a3251" title="Start point of line.">start</a>, line.<a class="code" href="classirr_1_1core_1_1line3d.html#ea19cb33971bb20e1d736facdae8a8f0" title="End point of line.">end</a>)); <a name="l00307"></a>00307 wasClipped = <span class="keyword">true</span>; <a name="l00308"></a>00308 } <a name="l00309"></a>00309 } <a name="l00310"></a>00310 <span class="keywordflow">return</span> wasClipped; <a name="l00311"></a>00311 } <a name="l00312"></a>00312 <a name="l00313"></a>00313 <a name="l00314"></a>00314 } <span class="comment">// end namespace scene</span> <a name="l00315"></a>00315 } <span class="comment">// end namespace irr</span> <a name="l00316"></a>00316 <a name="l00317"></a>00317 <span class="preprocessor">#endif</span> <a name="l00318"></a>00318 <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 © 2003-2009 by Nikolaus Gebhardt. Generated on Sun Jan 10 09:24:05 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>