<html> <head> <title>OgreRenderQueueSortingGrouping.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link type="text/css" rel="stylesheet" href="style.css"> </head> <body> <!-- Generated by Doxygen 1.3.6 --> <div class="qindex"><a class="qindex" href="index.html">Main Page</a> | <a class="qindex" href="namespaces.html">Namespace List</a> | <a class="qindex" href="hierarchy.html">Class Hierarchy</a> | <a class="qindex" href="classes.html">Alphabetical List</a> | <a class="qindex" href="annotated.html">Class List</a> | <a class="qindex" href="files.html">File List</a> | <a class="qindex" href="namespacemembers.html">Namespace Members</a> | <a class="qindex" href="functions.html">Class Members</a> | <a class="qindex" href="globals.html">File Members</a> | <a class="qindex" href="pages.html">Related Pages</a></div> <h1>OgreRenderQueueSortingGrouping.h</h1><a href="OgreRenderQueueSortingGrouping_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> 00002 <span class="comment">-----------------------------------------------------------------------------</span> 00003 <span class="comment">This source file is part of OGRE</span> 00004 <span class="comment"> (Object-oriented Graphics Rendering Engine)</span> 00005 <span class="comment">For the latest info, see http://www.ogre3d.org/</span> 00006 <span class="comment"></span> 00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span> 00008 <span class="comment">Also see acknowledgements in Readme.html</span> 00009 <span class="comment"></span> 00010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span> 00011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span> 00012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span> 00013 <span class="comment">version.</span> 00014 <span class="comment"></span> 00015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span> 00016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span> 00017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span> 00018 <span class="comment"></span> 00019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span> 00020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span> 00021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span> 00022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span> 00023 <span class="comment">-----------------------------------------------------------------------------</span> 00024 <span class="comment">*/</span> 00025 <span class="preprocessor">#ifndef __RenderQueueSortingGrouping_H__</span> 00026 <span class="preprocessor"></span><span class="preprocessor">#define __RenderQueueSortingGrouping_H__</span> 00027 <span class="preprocessor"></span> 00028 <span class="comment">// Precompiler options</span> 00029 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span> 00030 <span class="preprocessor">#include "<a class="code" href="OgreIteratorWrappers_8h.html">OgreIteratorWrappers.h</a>"</span> 00031 <span class="preprocessor">#include "<a class="code" href="OgreMaterial_8h.html">OgreMaterial.h</a>"</span> 00032 <span class="preprocessor">#include "<a class="code" href="OgreTechnique_8h.html">OgreTechnique.h</a>"</span> 00033 <span class="preprocessor">#include "<a class="code" href="OgrePass_8h.html">OgrePass.h</a>"</span> 00034 <span class="preprocessor">#include "<a class="code" href="OgreMaterialManager_8h.html">OgreMaterialManager.h</a>"</span> 00035 00036 <span class="keyword">namespace </span>Ogre { 00037 <a name="l00050"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html">00050</a> <span class="keyword">class </span><a class="code" href="classOgre_1_1RenderPriorityGroup.html">RenderPriorityGroup</a> 00051 { <a name="l00055"></a><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html">00055</a> <span class="keyword">struct </span><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html">RenderablePass</a> 00056 { <a name="l00058"></a><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso0">00058</a> <a class="code" href="classOgre_1_1Renderable.html">Renderable</a>* <a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso0">renderable</a>; <a name="l00060"></a><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso1">00060</a> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* pass; 00061 <a name="l00062"></a><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePassa0">00062</a> <a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePassa0">RenderablePass</a>(<a class="code" href="classOgre_1_1Renderable.html">Renderable</a>* rend, <a class="code" href="classOgre_1_1Pass.html">Pass</a>* p) :<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso0">renderable</a>(rend), pass(p) {} 00063 }; 00064 <a name="l00066"></a><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1SolidQueueItemLess.html">00066</a> <span class="keyword">struct </span><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1SolidQueueItemLess.html">SolidQueueItemLess</a> 00067 { <a name="l00068"></a><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1SolidQueueItemLess.html#Ogre_1_1RenderPriorityGroup_1_1SolidQueueItemLessa0">00068</a> <span class="keywordtype">bool</span> <a class="code" href="OgrePlatform_8h.html#a13">_OgreExport</a> <a class="code" href="structOgre_1_1RenderPriorityGroup_1_1SolidQueueItemLess.html#Ogre_1_1RenderPriorityGroup_1_1SolidQueueItemLessa0">operator()</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* a, <span class="keyword">const</span> <a class="code" href="classOgre_1_1Pass.html">Pass</a>* b)<span class="keyword"> const</span> 00069 <span class="keyword"> </span>{ 00070 <span class="comment">// Sort by passHash, which is pass, then texture unit changes</span> 00071 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> hasha = a-><a class="code" href="classOgre_1_1Pass.html#Ogre_1_1Passa99">getHash</a>(); 00072 <span class="keywordtype">unsigned</span> <span class="keywordtype">long</span> hashb = b-><a class="code" href="classOgre_1_1Pass.html#Ogre_1_1Passa99">getHash</a>(); 00073 <span class="keywordflow">if</span> (hasha == hashb) 00074 { 00075 <span class="comment">// Must differentiate by pointer incase 2 passes end up with the same hash</span> 00076 <span class="keywordflow">return</span> a < b; 00077 } 00078 <span class="keywordflow">else</span> 00079 { 00080 <span class="keywordflow">return</span> hasha < hashb; 00081 } 00082 } 00083 }; <a name="l00085"></a><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1TransparentQueueItemLess.html">00085</a> <span class="keyword">struct </span><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1TransparentQueueItemLess.html">TransparentQueueItemLess</a> 00086 { <a name="l00087"></a><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1TransparentQueueItemLess.html#Ogre_1_1RenderPriorityGroup_1_1TransparentQueueItemLesso0">00087</a> <span class="keyword">const</span> <a class="code" href="classOgre_1_1Camera.html">Camera</a>* <a class="code" href="structOgre_1_1RenderPriorityGroup_1_1TransparentQueueItemLess.html#Ogre_1_1RenderPriorityGroup_1_1TransparentQueueItemLesso0">camera</a>; <a name="l00088"></a><a class="code" href="structOgre_1_1RenderPriorityGroup_1_1TransparentQueueItemLess.html#Ogre_1_1RenderPriorityGroup_1_1TransparentQueueItemLessa0">00088</a> <span class="keywordtype">bool</span> <a class="code" href="OgrePlatform_8h.html#a13">_OgreExport</a> <a class="code" href="structOgre_1_1RenderPriorityGroup_1_1TransparentQueueItemLess.html#Ogre_1_1RenderPriorityGroup_1_1TransparentQueueItemLessa0">operator()</a>(<span class="keyword">const</span> <a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html">RenderablePass</a>& a, <span class="keyword">const</span> <a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html">RenderablePass</a>& b)<span class="keyword"> const</span> 00089 <span class="keyword"> </span>{ 00090 <span class="keywordflow">if</span> (a.<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso0">renderable</a> == b.<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso0">renderable</a>) 00091 { 00092 <span class="comment">// Same renderable, sort by pass hash</span> 00093 <span class="keywordflow">return</span> a.<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso1">pass</a>-><a class="code" href="classOgre_1_1Pass.html#Ogre_1_1Passa99">getHash</a>() < b.<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso1">pass</a>-><a class="code" href="classOgre_1_1Pass.html#Ogre_1_1Passa99">getHash</a>(); 00094 } 00095 <span class="keywordflow">else</span> 00096 { 00097 <span class="comment">// Different renderables, sort by depth</span> 00098 <a class="code" href="namespaceOgre.html#a420">Real</a> adepth = a.<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso0">renderable</a>-><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1SimpleRenderablea47">getSquaredViewDepth</a>(<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1TransparentQueueItemLess.html#Ogre_1_1RenderPriorityGroup_1_1TransparentQueueItemLesso0">camera</a>); 00099 <a class="code" href="namespaceOgre.html#a420">Real</a> bdepth = b.<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso0">renderable</a>-><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1SimpleRenderablea47">getSquaredViewDepth</a>(<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1TransparentQueueItemLess.html#Ogre_1_1RenderPriorityGroup_1_1TransparentQueueItemLesso0">camera</a>); 00100 <span class="keywordflow">if</span> (adepth == bdepth) 00101 { 00102 <span class="comment">// Must return deterministic result, doesn't matter what</span> 00103 <span class="keywordflow">return</span> a.<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso1">pass</a> < b.<a class="code" href="structOgre_1_1RenderPriorityGroup_1_1RenderablePass.html#Ogre_1_1RenderPriorityGroup_1_1RenderablePasso1">pass</a>; 00104 } 00105 <span class="keywordflow">else</span> 00106 { 00107 <span class="comment">// Sort DESCENDING by depth (ie far objects first)</span> 00108 <span class="keywordflow">return</span> (adepth > bdepth); 00109 } 00110 } 00111 00112 } 00113 }; 00114 <span class="keyword">public</span>: <a name="l00118"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw0">00118</a> <span class="keyword">typedef</span> std::vector<RenderablePass> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw0">TransparentRenderablePassList</a>; <a name="l00119"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw1">00119</a> <span class="keyword">typedef</span> std::vector<Renderable*> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw1">RenderableList</a>; <a name="l00122"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">00122</a> <span class="keyword">typedef</span> std::map<Pass*, RenderableList*, SolidQueueItemLess> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a>; 00123 <span class="keyword">protected</span>: <a name="l00125"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp0">00125</a> <a class="code" href="classOgre_1_1RenderQueueGroup.html">RenderQueueGroup</a>* mParent; <a name="l00126"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp1">00126</a> <span class="keywordtype">bool</span> mSplitPassesByLightingType; <a name="l00127"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp2">00127</a> <span class="keywordtype">bool</span> mSplitNoShadowPasses; <a name="l00129"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp3">00129</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp3">mSolidPasses</a>; <a name="l00131"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp4">00131</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp4">mSolidPassesDiffuseSpecular</a>; <a name="l00133"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp5">00133</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp5">mSolidPassesDecal</a>; <a name="l00135"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp6">00135</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp6">mSolidPassesNoShadow</a>; 00136 <a name="l00138"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp7">00138</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw0">TransparentRenderablePassList</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp7">mTransparentPasses</a>; 00139 00141 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupb0">destroySolidPassMap</a>(<a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a>& passmap); 00142 00144 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupb1">removeSolidPassEntry</a>(<a class="code" href="classOgre_1_1Pass.html">Pass</a>* p); 00145 00147 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupb2">clearSolidPassMap</a>(<a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a>& passmap); 00149 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupb3">addSolidRenderable</a>(<a class="code" href="classOgre_1_1Technique.html">Technique</a>* pTech, <a class="code" href="classOgre_1_1Renderable.html">Renderable</a>* rend, <span class="keywordtype">bool</span> toNoShadowMap); 00151 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupb4">addSolidRenderableSplitByLightType</a>(<a class="code" href="classOgre_1_1Technique.html">Technique</a>* pTech, <a class="code" href="classOgre_1_1Renderable.html">Renderable</a>* rend); 00153 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupb5">addTransparentRenderable</a>(<a class="code" href="classOgre_1_1Technique.html">Technique</a>* pTech, <a class="code" href="classOgre_1_1Renderable.html">Renderable</a>* rend); 00154 00155 <span class="keyword">public</span>: <a name="l00156"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa0">00156</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa0">RenderPriorityGroup</a>(<a class="code" href="classOgre_1_1RenderQueueGroup.html">RenderQueueGroup</a>* parent, 00157 <span class="keywordtype">bool</span> splitPassesByLightingType, <span class="keywordtype">bool</span> splitNoShadowPasses) 00158 :mParent(parent), mSplitPassesByLightingType(splitPassesByLightingType), 00159 mSplitNoShadowPasses(splitNoShadowPasses) { } 00160 <a name="l00161"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa1">00161</a> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa1">~RenderPriorityGroup</a>() { 00162 <span class="comment">// destroy all the pass map entries</span> 00163 <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupb0">destroySolidPassMap</a>(<a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp3">mSolidPasses</a>); 00164 <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupb0">destroySolidPassMap</a>(<a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp5">mSolidPassesDecal</a>); 00165 <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupb0">destroySolidPassMap</a>(<a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp4">mSolidPassesDiffuseSpecular</a>); 00166 <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupb0">destroySolidPassMap</a>(<a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp6">mSolidPassesNoShadow</a>); 00167 <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp7">mTransparentPasses</a>.clear(); 00168 00169 } 00170 <a name="l00172"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa2">00172</a> <span class="keyword">const</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a>& <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa2">_getSolidPasses</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> 00173 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp3">mSolidPasses</a>; } <a name="l00175"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa3">00175</a> <span class="keyword">const</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a>& <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa3">_getSolidPassesDiffuseSpecular</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> 00176 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp4">mSolidPassesDiffuseSpecular</a>; } <a name="l00178"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa4">00178</a> <span class="keyword">const</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a>& <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa4">_getSolidPassesDecal</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> 00179 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp5">mSolidPassesDecal</a>; } <a name="l00181"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa5">00181</a> <span class="keyword">const</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw2">SolidRenderablePassMap</a>& <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa5">_getSolidPassesNoShadow</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> 00182 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp6">mSolidPassesNoShadow</a>; } <a name="l00184"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa6">00184</a> <span class="keyword">const</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupw0">TransparentRenderablePassList</a>& <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa6">_getTransparentPasses</a>(<span class="keywordtype">void</span>)<span class="keyword"> const</span> 00185 <span class="keyword"> </span>{ <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupp7">mTransparentPasses</a>; } 00186 00187 00189 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa7">addRenderable</a>(<a class="code" href="classOgre_1_1Renderable.html">Renderable</a>* pRend); 00190 00193 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa8">sort</a>(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Camera.html">Camera</a>* cam); 00194 00197 <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa9">clear</a>(<span class="keywordtype">void</span>); 00198 <a name="l00202"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa10">00202</a> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa10">setSplitPassesByLightingType</a>(<span class="keywordtype">bool</span> split) 00203 { 00204 mSplitPassesByLightingType = split; 00205 } 00206 <a name="l00210"></a><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa11">00210</a> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa11">setSplitNoShadowPasses</a>(<span class="keywordtype">bool</span> split) 00211 { 00212 mSplitNoShadowPasses = split; 00213 } 00214 00215 00216 }; 00217 00218 <a name="l00228"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html">00228</a> <span class="keyword">class </span><a class="code" href="classOgre_1_1RenderQueueGroup.html">RenderQueueGroup</a> 00229 { 00230 <span class="keyword">public</span>: <a name="l00231"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupw0">00231</a> <span class="keyword">typedef</span> std::map<ushort, RenderPriorityGroup*, std::less<ushort> > <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupw0">PriorityMap</a>; <a name="l00232"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupw1">00232</a> <span class="keyword">typedef</span> <a class="code" href="classOgre_1_1MapIterator.html">MapIterator<PriorityMap></a> <a class="code" href="classOgre_1_1MapIterator.html">PriorityMapIterator</a>; 00233 <span class="keyword">protected</span>: <a name="l00234"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp0">00234</a> <a class="code" href="classOgre_1_1RenderQueue.html">RenderQueue</a>* mParent; <a name="l00235"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp1">00235</a> <span class="keywordtype">bool</span> mSplitPassesByLightingType; <a name="l00236"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp2">00236</a> <span class="keywordtype">bool</span> mSplitNoShadowPasses; <a name="l00238"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">00238</a> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupw0">PriorityMap</a> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>; <a name="l00240"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp4">00240</a> <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp4">mShadowsEnabled</a>; 00241 00242 00243 <span class="keyword">public</span>: <a name="l00244"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa0">00244</a> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa0">RenderQueueGroup</a>(<a class="code" href="classOgre_1_1RenderQueue.html">RenderQueue</a>* parent, <span class="keywordtype">bool</span> splitPassesByLightingType, 00245 <span class="keywordtype">bool</span> splitNoShadowPasses) 00246 :mParent(parent), mSplitPassesByLightingType(splitPassesByLightingType), 00247 mSplitNoShadowPasses(splitNoShadowPasses), <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp4">mShadowsEnabled</a>(true) {} 00248 <a name="l00249"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa1">00249</a> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa1">~RenderQueueGroup</a>() { 00250 <span class="comment">// destroy contents now</span> 00251 PriorityMap::iterator i; 00252 <span class="keywordflow">for</span> (i = <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.begin(); i != <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.end(); ++i) 00253 { 00254 <span class="keyword">delete</span> i->second; 00255 } 00256 } 00257 <a name="l00259"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa2">00259</a> <a class="code" href="classOgre_1_1MapIterator.html">PriorityMapIterator</a> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa2">getIterator</a>(<span class="keywordtype">void</span>) 00260 { 00261 <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupw1">PriorityMapIterator</a>(<a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.begin(), <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.end()); 00262 } 00263 <a name="l00265"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa3">00265</a> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa3">addRenderable</a>(<a class="code" href="classOgre_1_1Renderable.html">Renderable</a>* pRend, <a class="code" href="namespaceOgre.html#a422">ushort</a> priority) 00266 { 00267 <span class="comment">// Check if priority group is there</span> 00268 PriorityMap::iterator i = <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.find(priority); 00269 <a class="code" href="classOgre_1_1RenderPriorityGroup.html">RenderPriorityGroup</a>* pPriorityGrp; 00270 <span class="keywordflow">if</span> (i == <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.end()) 00271 { 00272 <span class="comment">// Missing, create</span> 00273 pPriorityGrp = <span class="keyword">new</span> <a class="code" href="classOgre_1_1RenderPriorityGroup.html">RenderPriorityGroup</a>(<span class="keyword">this</span>, 00274 mSplitPassesByLightingType, mSplitNoShadowPasses); 00275 <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.insert(PriorityMap::value_type(priority, pPriorityGrp)); 00276 } 00277 <span class="keywordflow">else</span> 00278 { 00279 pPriorityGrp = i->second; 00280 } 00281 00282 <span class="comment">// Add</span> 00283 pPriorityGrp-><a class="code" href="classOgre_1_1RenderPriorityGroup.html#Ogre_1_1RenderPriorityGroupa7">addRenderable</a>(pRend); 00284 00285 } 00286 <a name="l00293"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa4">00293</a> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa4">clear</a>(<span class="keywordtype">void</span>) 00294 { 00295 PriorityMap::iterator i, iend; 00296 iend = <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.end(); 00297 <span class="keywordflow">for</span> (i = <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.begin(); i != iend; ++i) 00298 { 00299 i->second->clear(); 00300 } 00301 00302 } 00303 <a name="l00316"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa5">00316</a> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa5">setShadowsEnabled</a>(<span class="keywordtype">bool</span> enabled) { <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp4">mShadowsEnabled</a> = enabled; } 00317 <a name="l00319"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa6">00319</a> <span class="keywordtype">bool</span> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa6">getShadowsEnabled</a>(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp4">mShadowsEnabled</a>; } 00320 <a name="l00324"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa7">00324</a> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa7">setSplitPassesByLightingType</a>(<span class="keywordtype">bool</span> split) 00325 { 00326 mSplitPassesByLightingType = split; 00327 PriorityMap::iterator i, iend; 00328 iend = <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.end(); 00329 <span class="keywordflow">for</span> (i = <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.begin(); i != iend; ++i) 00330 { 00331 i->second->setSplitPassesByLightingType(split); 00332 } 00333 } <a name="l00338"></a><a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa8">00338</a> <span class="keywordtype">void</span> <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupa8">setSplitNoShadowPasses</a>(<span class="keywordtype">bool</span> split) 00339 { 00340 mSplitNoShadowPasses = split; 00341 PriorityMap::iterator i, iend; 00342 iend = <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.end(); 00343 <span class="keywordflow">for</span> (i = <a class="code" href="classOgre_1_1RenderQueueGroup.html#Ogre_1_1RenderQueueGroupp3">mPriorityGroups</a>.begin(); i != iend; ++i) 00344 { 00345 i->second->setSplitNoShadowPasses(split); 00346 } 00347 } 00348 00349 }; 00350 00351 00352 00353 } 00354 00355 <span class="preprocessor">#endif</span> 00356 <span class="preprocessor"></span> 00357 </pre></div><p> Copyright © 2000-2005 by The OGRE Team<br /> Last modified Wed Feb 23 00:19:12 2005 </p> </body> </html>