<!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: IMeshManipulator.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.6.2 --> <h1>IMeshManipulator.h</h1><a href="_i_mesh_manipulator_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-2010 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 __I_MESH_MANIPULATOR_H_INCLUDED__</span> <a name="l00006"></a>00006 <span class="preprocessor"></span><span class="preprocessor">#define __I_MESH_MANIPULATOR_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="_i_reference_counted_8h.html">IReferenceCounted.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="aabbox3d_8h.html">aabbox3d.h</a>"</span> <a name="l00011"></a>00011 <span class="preprocessor">#include "<a class="code" href="matrix4_8h.html">matrix4.h</a>"</span> <a name="l00012"></a>00012 <span class="preprocessor">#include "<a class="code" href="_i_animated_mesh_8h.html">IAnimatedMesh.h</a>"</span> <a name="l00013"></a>00013 <span class="preprocessor">#include "<a class="code" href="_i_mesh_buffer_8h.html">IMeshBuffer.h</a>"</span> <a name="l00014"></a>00014 <span class="preprocessor">#include "<a class="code" href="_s_vertex_manipulator_8h.html">SVertexManipulator.h</a>"</span> <a name="l00015"></a>00015 <a name="l00016"></a>00016 <span class="keyword">namespace </span>irr <a name="l00017"></a>00017 { <a name="l00018"></a>00018 <span class="keyword">namespace </span>scene <a name="l00019"></a>00019 { <a name="l00020"></a>00020 <a name="l00021"></a>00021 <span class="keyword">struct </span>SMesh; <a name="l00022"></a>00022 <a name="l00024"></a>00024 <a name="l00029"></a>00029 <span class="keyword">class </span>IMeshManipulator : <span class="keyword">public</span> <span class="keyword">virtual</span> IReferenceCounted <a name="l00030"></a>00030 { <a name="l00031"></a>00031 <span class="keyword">public</span>: <a name="l00032"></a>00032 <a name="l00034"></a>00034 <a name="l00037"></a>00037 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a7194e8a44bfe3a6444826f346c4104ff" title="Flips the direction of surfaces.">flipSurfaces</a>(IMesh* mesh) <span class="keyword">const</span> = 0; <a name="l00038"></a><a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#ad6492bed9f7cf798b717b30c99803bef">00038</a> <a name="l00040"></a>00040 <a name="l00042"></a>00042 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#ad6492bed9f7cf798b717b30c99803bef" title="Sets the alpha vertex color value of the whole mesh to a new value.">setVertexColorAlpha</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh.html" title="Class which holds the geometry of an object.">IMesh</a>* mesh, <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> alpha)<span class="keyword"> const</span> <a name="l00043"></a>00043 <span class="keyword"> </span>{ <a name="l00044"></a>00044 <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(<a class="code" href="classirr_1_1scene_1_1_s_vertex_color_set_alpha_manipulator.html" title="Vertex manipulator to set the alpha value of the vertex color to a fixed value.">scene::SVertexColorSetAlphaManipulator</a>(alpha), mesh); <a name="l00045"></a>00045 } <a name="l00046"></a><a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a2c17558cfa1b87000744dce7bf973d21">00046</a> <a name="l00048"></a>00048 <a name="l00050"></a>00050 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a2c17558cfa1b87000744dce7bf973d21" title="Sets the colors of all vertices to one color.">setVertexColors</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh.html" title="Class which holds the geometry of an object.">IMesh</a>* mesh, <a class="code" href="classirr_1_1video_1_1_s_color.html" title="Class representing a 32 bit ARGB color.">video::SColor</a> color)<span class="keyword"> const</span> <a name="l00051"></a>00051 <span class="keyword"> </span>{ <a name="l00052"></a>00052 <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(<a class="code" href="classirr_1_1scene_1_1_s_vertex_color_set_manipulator.html" title="Vertex manipulator to set color to a fixed color for all vertices.">scene::SVertexColorSetManipulator</a>(color), mesh); <a name="l00053"></a>00053 } <a name="l00054"></a>00054 <a name="l00056"></a>00056 <a name="l00059"></a>00059 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a8dba16b7eedeac07761c9c1247944429" title="Recalculates all normals of the mesh.">recalculateNormals</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh.html" title="Class which holds the geometry of an object.">IMesh</a>* mesh, <span class="keywordtype">bool</span> smooth = <span class="keyword">false</span>, <span class="keywordtype">bool</span> angleWeighted = <span class="keyword">false</span>) <span class="keyword">const</span> = 0; <a name="l00060"></a>00060 <a name="l00062"></a>00062 <a name="l00065"></a>00065 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a8dba16b7eedeac07761c9c1247944429" title="Recalculates all normals of the mesh.">recalculateNormals</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh_buffer.html" title="Struct for holding a mesh with a single material.">IMeshBuffer</a>* buffer, <span class="keywordtype">bool</span> smooth = <span class="keyword">false</span>, <span class="keywordtype">bool</span> angleWeighted = <span class="keyword">false</span>) <span class="keyword">const</span> = 0; <a name="l00066"></a>00066 <a name="l00068"></a>00068 <a name="l00073"></a>00073 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a0ea43e8c4e8489551228b3005d325cd6" title="Recalculates tangents, requires a tangent mesh.">recalculateTangents</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh.html" title="Class which holds the geometry of an object.">IMesh</a>* mesh, <a name="l00074"></a>00074 <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a8dba16b7eedeac07761c9c1247944429" title="Recalculates all normals of the mesh.">recalculateNormals</a>=<span class="keyword">false</span>, <span class="keywordtype">bool</span> smooth=<span class="keyword">false</span>, <a name="l00075"></a>00075 <span class="keywordtype">bool</span> angleWeighted=<span class="keyword">false</span>) <span class="keyword">const</span>=0; <a name="l00076"></a><a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#ab32481d2ae93369e223930531186b7e4">00076</a> <a name="l00078"></a>00078 <a name="l00080"></a>00080 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#ab32481d2ae93369e223930531186b7e4" title="Scales the actual mesh, not a scene node.">scale</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh.html" title="Class which holds the geometry of an object.">IMesh</a>* mesh, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html">core::vector3df</a>& factor)<span class="keyword"> const</span> <a name="l00081"></a>00081 <span class="keyword"> </span>{ <a name="l00082"></a>00082 <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(<a class="code" href="classirr_1_1scene_1_1_s_vertex_position_scale_manipulator.html" title="Vertex manipulator which scales the position of the vertex.">SVertexPositionScaleManipulator</a>(factor), mesh, <span class="keyword">true</span>); <a name="l00083"></a>00083 } <a name="l00084"></a><a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#ac39f47631c59d75f1e4cfa7a2617ca99">00084</a> <a name="l00086"></a>00086 <a name="l00088"></a>00088 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#ab32481d2ae93369e223930531186b7e4" title="Scales the actual mesh, not a scene node.">scale</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh_buffer.html" title="Struct for holding a mesh with a single material.">IMeshBuffer</a>* buffer, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html">core::vector3df</a>& factor)<span class="keyword"> const</span> <a name="l00089"></a>00089 <span class="keyword"> </span>{ <a name="l00090"></a>00090 <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(<a class="code" href="classirr_1_1scene_1_1_s_vertex_position_scale_manipulator.html" title="Vertex manipulator which scales the position of the vertex.">SVertexPositionScaleManipulator</a>(factor), buffer, <span class="keyword">true</span>); <a name="l00091"></a>00091 } <a name="l00092"></a>00092 <a name="l00094"></a>00094 <a name="l00097"></a>00097 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#ae7b9a0796adc9d57a0537a0127a092de" title="Scales the actual mesh, not a scene node.">scaleMesh</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh.html" title="Class which holds the geometry of an object.">IMesh</a>* mesh, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html">core::vector3df</a>& factor)<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#ab32481d2ae93369e223930531186b7e4" title="Scales the actual mesh, not a scene node.">scale</a>(mesh,factor);} <a name="l00098"></a>00098 <a name="l00100"></a>00100 <a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#afc1ae4a04d810389e0507d2ce3735e5d" title="Scale the texture coords of a mesh.">scaleTCoords</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh.html" title="Class which holds the geometry of an object.">scene::IMesh</a>* mesh, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector2d.html">core::vector2df</a>& factor, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> level=1)<span class="keyword"> const</span> <a name="l00104"></a>00104 <span class="keyword"> </span>{ <a name="l00105"></a>00105 <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(SVertexTCoordsScaleManipulator(factor, level), mesh); <a name="l00106"></a>00106 } <a name="l00107"></a>00107 <a name="l00109"></a>00109 <a name="l00112"></a>00112 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#afc1ae4a04d810389e0507d2ce3735e5d" title="Scale the texture coords of a mesh.">scaleTCoords</a>(scene::IMeshBuffer* buffer, <span class="keyword">const</span> <a class="code" href="namespaceirr_1_1core.html#a2cf08556d77f6f5a792973a6e27ed11b" title="Typedef for f32 2d vector.">core::vector2df</a>& factor, <a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> level=1)<span class="keyword"> const</span> <a name="l00113"></a>00113 <span class="keyword"> </span>{ <a name="l00114"></a>00114 <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(SVertexTCoordsScaleManipulator(factor, level), buffer); <a name="l00115"></a>00115 } <a name="l00116"></a><a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a367ce8914a0453051d82ffd57b343575">00116</a> <a name="l00118"></a>00118 <a name="l00120"></a>00120 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a367ce8914a0453051d82ffd57b343575" title="Applies a transformation to a mesh.">transform</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh.html" title="Class which holds the geometry of an object.">IMesh</a>* mesh, <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>& m)<span class="keyword"> const</span> <a name="l00121"></a>00121 <span class="keyword"> </span>{ <a name="l00122"></a>00122 <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(<a class="code" href="classirr_1_1scene_1_1_s_vertex_position_transform_manipulator.html" title="Vertex manipulator which transforms the position of the vertex.">SVertexPositionTransformManipulator</a>(m), mesh, <span class="keyword">true</span>); <a name="l00123"></a>00123 } <a name="l00124"></a><a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#aa3fd618c6c854a87392a1d902517507f">00124</a> <a name="l00126"></a>00126 <a name="l00128"></a>00128 <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a367ce8914a0453051d82ffd57b343575" title="Applies a transformation to a mesh.">transform</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh_buffer.html" title="Struct for holding a mesh with a single material.">IMeshBuffer</a>* buffer, <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>& m)<span class="keyword"> const</span> <a name="l00129"></a>00129 <span class="keyword"> </span>{ <a name="l00130"></a>00130 <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(<a class="code" href="classirr_1_1scene_1_1_s_vertex_position_transform_manipulator.html" title="Vertex manipulator which transforms the position of the vertex.">SVertexPositionTransformManipulator</a>(m), buffer, <span class="keyword">true</span>); <a name="l00131"></a>00131 } <a name="l00132"></a>00132 <a name="l00134"></a>00134 <a name="l00137"></a>00137 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a94e51ee7f96bcae0dc87846d559e5418" title="Applies a transformation to a mesh.">transformMesh</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh.html" title="Class which holds the geometry of an object.">IMesh</a>* mesh, <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>& m)<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a367ce8914a0453051d82ffd57b343575" title="Applies a transformation to a mesh.">transform</a>(mesh,m);} <a name="l00138"></a>00138 <a name="l00140"></a>00140 <a name="l00146"></a>00146 <span class="keyword">virtual</span> SMesh* <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a3d2e7401f1d43919834a1bfe0b65e77f" title="Clones a static IMesh into a modifiable SMesh.">createMeshCopy</a>(IMesh* mesh) <span class="keyword">const</span> = 0; <a name="l00147"></a>00147 <a name="l00149"></a>00149 <a name="l00153"></a>00153 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a82a3092d53e84e751bb13dac8dfa2ab4" title="Creates a planar texture mapping on the mesh.">makePlanarTextureMapping</a>(IMesh* mesh, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> resolution=0.001f) <span class="keyword">const</span> =0; <a name="l00154"></a>00154 <a name="l00156"></a>00156 <a name="l00160"></a>00160 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a82a3092d53e84e751bb13dac8dfa2ab4" title="Creates a planar texture mapping on the mesh.">makePlanarTextureMapping</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh_buffer.html" title="Struct for holding a mesh with a single material.">scene::IMeshBuffer</a>* meshbuffer, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> resolution=0.001f) <span class="keyword">const</span> =0; <a name="l00161"></a>00161 <a name="l00163"></a>00163 <a name="l00170"></a>00170 <span class="keyword">virtual</span> <span class="keywordtype">void</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a82a3092d53e84e751bb13dac8dfa2ab4" title="Creates a planar texture mapping on the mesh.">makePlanarTextureMapping</a>(<a class="code" href="classirr_1_1scene_1_1_i_mesh_buffer.html" title="Struct for holding a mesh with a single material.">scene::IMeshBuffer</a>* buffer, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> resolutionS, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> resolutionT, <a class="code" href="namespaceirr.html#a646874f69af8ff87fc10201b0254a761" title="8 bit unsigned variable.">u8</a> axis, <span class="keyword">const</span> <a class="code" href="classirr_1_1core_1_1vector3d.html">core::vector3df</a>& offset) <span class="keyword">const</span> =0; <a name="l00171"></a>00171 <a name="l00173"></a>00173 <a name="l00189"></a>00189 <span class="keyword">virtual</span> IMesh* <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#ab849bd2c83b206de1e5da19ce3481e35" title="Creates a copy of the mesh, which will only consist of S3DVertexTangents vertices...">createMeshWithTangents</a>(IMesh* mesh, <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a8dba16b7eedeac07761c9c1247944429" title="Recalculates all normals of the mesh.">recalculateNormals</a>=<span class="keyword">false</span>, <span class="keywordtype">bool</span> smooth=<span class="keyword">false</span>, <span class="keywordtype">bool</span> angleWeighted=<span class="keyword">false</span>, <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a0ea43e8c4e8489551228b3005d325cd6" title="Recalculates tangents, requires a tangent mesh.">recalculateTangents</a>=<span class="keyword">true</span>) <span class="keyword">const</span> = 0; <a name="l00190"></a>00190 <a name="l00192"></a>00192 <a name="l00197"></a>00197 <span class="keyword">virtual</span> IMesh* <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#abf123f6fece99816be402e1edf70dc13" title="Creates a copy of the mesh, which will only consist of S3DVertex2TCoord vertices...">createMeshWith2TCoords</a>(IMesh* mesh) <span class="keyword">const</span> = 0; <a name="l00198"></a>00198 <a name="l00200"></a>00200 <a name="l00205"></a>00205 <span class="keyword">virtual</span> IMesh* <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#af7feb558fbaad9671667d1332c83bb5d" title="Creates a copy of the mesh, which will only consist of S3DVertex vertices.">createMeshWith1TCoords</a>(IMesh* mesh) <span class="keyword">const</span> = 0; <a name="l00206"></a>00206 <a name="l00208"></a>00208 <a name="l00213"></a>00213 <span class="keyword">virtual</span> IMesh* <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a73051bc082f128a2e0592fb1a3da2b7d" title="Creates a copy of a mesh with all vertices unwelded.">createMeshUniquePrimitives</a>(IMesh* mesh) <span class="keyword">const</span> = 0; <a name="l00214"></a>00214 <a name="l00216"></a>00216 <a name="l00221"></a>00221 <span class="keyword">virtual</span> IMesh* <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#ac19065037302c0500cb6ebecefcc6c6d" title="Creates a copy of a mesh with vertices welded.">createMeshWelded</a>(IMesh* mesh, <a class="code" href="namespaceirr.html#a0277be98d67dc26ff93b1a6a1d086b07" title="32 bit floating point variable.">f32</a> tolerance=<a class="code" href="namespaceirr_1_1core.html#a9514dd34463a30102ef8836915cf9c4c">core::ROUNDING_ERROR_f32</a>) <span class="keyword">const</span> = 0; <a name="l00222"></a>00222 <a name="l00224"></a>00224 <a name="l00226"></a>00226 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a914c8cbfbde1428dea91b34fe99e716d" title="Get amount of polygons in mesh.">getPolyCount</a>(IMesh* mesh) <span class="keyword">const</span> = 0; <a name="l00227"></a>00227 <a name="l00229"></a>00229 <a name="l00231"></a>00231 <span class="keyword">virtual</span> <a class="code" href="namespaceirr.html#ac66849b7a6ed16e30ebede579f9b47c6" title="32 bit signed variable.">s32</a> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a914c8cbfbde1428dea91b34fe99e716d" title="Get amount of polygons in mesh.">getPolyCount</a>(IAnimatedMesh* mesh) <span class="keyword">const</span> = 0; <a name="l00232"></a>00232 <a name="l00234"></a>00234 <a name="l00240"></a>00240 <span class="keyword">virtual</span> IAnimatedMesh * <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a08c2483575a88f68d099690932c11562" title="Create a new AnimatedMesh and adds the mesh to it.">createAnimatedMesh</a>(IMesh* mesh, <a name="l00241"></a>00241 <a class="code" href="namespaceirr_1_1scene.html#a2fc85a64604521ca063f1881b5dd1c61" title="Possible types of (animated) meshes.">scene::E_ANIMATED_MESH_TYPE</a> type = <a class="code" href="namespaceirr_1_1scene.html#a2fc85a64604521ca063f1881b5dd1c61a6f44a8730987c53332017ff74048acd0" title="Unknown animated mesh type.">scene::EAMT_UNKNOWN</a>) <span class="keyword">const</span> = 0; <a name="l00242"></a>00242 <a name="l00244"></a>00244 <a name="l00248"></a>00248 <span class="keyword">template</span> <<span class="keyword">typename</span> Functor> <a name="l00249"></a>00249 <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(<span class="keyword">const</span> Functor& func, IMeshBuffer* buffer, <span class="keywordtype">bool</span> boundingBoxUpdate=<span class="keyword">false</span>)<span class="keyword"> const</span> <a name="l00250"></a>00250 <span class="keyword"> </span>{ <a name="l00251"></a>00251 <span class="keywordflow">return</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a06683525900f7e8bc98b390bbef35a9c" title="Apply a manipulator based on the type of the functor.">apply_</a>(func, buffer, boundingBoxUpdate, func); <a name="l00252"></a>00252 } <a name="l00253"></a>00253 <a name="l00254"></a>00254 <a name="l00256"></a>00256 <a name="l00260"></a>00260 <span class="keyword">template</span> <<span class="keyword">typename</span> Functor> <a name="l00261"></a>00261 <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(<span class="keyword">const</span> Functor& func, IMesh* mesh, <span class="keywordtype">bool</span> boundingBoxUpdate=<span class="keyword">false</span>)<span class="keyword"> const</span> <a name="l00262"></a>00262 <span class="keyword"> </span>{ <a name="l00263"></a>00263 <span class="keywordflow">if</span> (!mesh) <a name="l00264"></a>00264 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00265"></a>00265 <span class="keywordtype">bool</span> result = <span class="keyword">true</span>; <a name="l00266"></a>00266 <a class="code" href="namespaceirr_1_1core.html#adfc8fa01b30044c55f3332a1d6c1aa19" title="Typedef for a f32 3d bounding box.">core::aabbox3df</a> bufferbox; <a name="l00267"></a>00267 <span class="keywordflow">for</span> (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> i=0; i<mesh->getMeshBufferCount(); ++i) <a name="l00268"></a>00268 { <a name="l00269"></a>00269 result &= <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a26db02e50019d4ee5bd6cb24089e553b" title="Apply a manipulator on the Meshbuffer.">apply</a>(func, mesh->getMeshBuffer(i), boundingBoxUpdate); <a name="l00270"></a>00270 <span class="keywordflow">if</span> (boundingBoxUpdate) <a name="l00271"></a>00271 { <a name="l00272"></a>00272 <span class="keywordflow">if</span> (0==i) <a name="l00273"></a>00273 bufferbox.reset(mesh->getMeshBuffer(i)->getBoundingBox()); <a name="l00274"></a>00274 <span class="keywordflow">else</span> <a name="l00275"></a>00275 bufferbox.addInternalBox(mesh->getMeshBuffer(i)->getBoundingBox()); <a name="l00276"></a>00276 } <a name="l00277"></a>00277 } <a name="l00278"></a>00278 <span class="keywordflow">if</span> (boundingBoxUpdate) <a name="l00279"></a>00279 mesh->setBoundingBox(bufferbox); <a name="l00280"></a>00280 <span class="keywordflow">return</span> result; <a name="l00281"></a>00281 } <a name="l00282"></a>00282 <a name="l00283"></a>00283 <span class="keyword">protected</span>: <a name="l00285"></a>00285 <a name="l00290"></a>00290 <span class="keyword">template</span> <<span class="keyword">typename</span> Functor> <a name="l00291"></a>00291 <span class="keywordtype">bool</span> <a class="code" href="classirr_1_1scene_1_1_i_mesh_manipulator.html#a06683525900f7e8bc98b390bbef35a9c" title="Apply a manipulator based on the type of the functor.">apply_</a>(<span class="keyword">const</span> Functor& func, IMeshBuffer* buffer, <span class="keywordtype">bool</span> boundingBoxUpdate, <span class="keyword">const</span> IVertexManipulator& typeTest)<span class="keyword"> const</span> <a name="l00292"></a>00292 <span class="keyword"> </span>{ <a name="l00293"></a>00293 <span class="keywordflow">if</span> (!buffer) <a name="l00294"></a>00294 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00295"></a>00295 <a name="l00296"></a>00296 <a class="code" href="namespaceirr_1_1core.html#adfc8fa01b30044c55f3332a1d6c1aa19" title="Typedef for a f32 3d bounding box.">core::aabbox3df</a> bufferbox; <a name="l00297"></a>00297 <span class="keywordflow">for</span> (<a class="code" href="namespaceirr.html#a0416a53257075833e7002efd0a18e804" title="32 bit unsigned variable.">u32</a> i=0; i<buffer->getVertexCount(); ++i) <a name="l00298"></a>00298 { <a name="l00299"></a>00299 <span class="keywordflow">switch</span> (buffer->getVertexType()) <a name="l00300"></a>00300 { <a name="l00301"></a>00301 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deaca98c8b791280bbf9252c4f4a37e91a416" title="Standard vertex type used by the Irrlicht engine, video::S3DVertex.">video::EVT_STANDARD</a>: <a name="l00302"></a>00302 { <a name="l00303"></a>00303 video::S3DVertex* verts = (video::S3DVertex*)buffer->getVertices(); <a name="l00304"></a>00304 func(verts[i]); <a name="l00305"></a>00305 } <a name="l00306"></a>00306 <span class="keywordflow">break</span>; <a name="l00307"></a>00307 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deaca7b5127a706ee33eb4385d702da007016" title="Vertex with two texture coordinates, video::S3DVertex2TCoords.">video::EVT_2TCOORDS</a>: <a name="l00308"></a>00308 { <a name="l00309"></a>00309 video::S3DVertex2TCoords* verts = (video::S3DVertex2TCoords*)buffer->getVertices(); <a name="l00310"></a>00310 func(verts[i]); <a name="l00311"></a>00311 } <a name="l00312"></a>00312 <span class="keywordflow">break</span>; <a name="l00313"></a>00313 <span class="keywordflow">case</span> <a class="code" href="namespaceirr_1_1video.html#a0e3b59e025e0d0db0ed2ee0ce904deaca8c50b5b2c88f08709d640fecc83dfb9b" title="Vertex with a tangent and binormal vector, video::S3DVertexTangents.">video::EVT_TANGENTS</a>: <a name="l00314"></a>00314 { <a name="l00315"></a>00315 video::S3DVertexTangents* verts = (video::S3DVertexTangents*)buffer->getVertices(); <a name="l00316"></a>00316 func(verts[i]); <a name="l00317"></a>00317 } <a name="l00318"></a>00318 <span class="keywordflow">break</span>; <a name="l00319"></a>00319 } <a name="l00320"></a>00320 <span class="keywordflow">if</span> (boundingBoxUpdate) <a name="l00321"></a>00321 { <a name="l00322"></a>00322 <span class="keywordflow">if</span> (0==i) <a name="l00323"></a>00323 bufferbox.reset(buffer->getPosition(0)); <a name="l00324"></a>00324 <span class="keywordflow">else</span> <a name="l00325"></a>00325 bufferbox.addInternalPoint(buffer->getPosition(i)); <a name="l00326"></a>00326 } <a name="l00327"></a>00327 } <a name="l00328"></a>00328 <span class="keywordflow">if</span> (boundingBoxUpdate) <a name="l00329"></a>00329 buffer->setBoundingBox(bufferbox); <a name="l00330"></a>00330 <span class="keywordflow">return</span> <span class="keyword">true</span>; <a name="l00331"></a>00331 } <a name="l00332"></a>00332 }; <a name="l00333"></a>00333 <a name="l00334"></a>00334 } <span class="comment">// end namespace scene</span> <a name="l00335"></a>00335 } <span class="comment">// end namespace irr</span> <a name="l00336"></a>00336 <a name="l00337"></a>00337 <a name="l00338"></a>00338 <span class="preprocessor">#endif</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-2010 by Nikolaus Gebhardt. Generated on Sun Oct 24 12:41:57 2010 by <a href="http://www.doxygen.org" target="_blank">Doxygen</a> (1.6.2)</font></em></small></div></td> </tr> </table> <address style="align: right;"> </address> </body> </html>