1 | <html> |
---|
2 | <head> |
---|
3 | <title>OgreRenderable.h Source File - OGRE Documentation</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> |
---|
4 | <link type="text/css" rel="stylesheet" href="style.css"> |
---|
5 | </head> |
---|
6 | |
---|
7 | <body> |
---|
8 | <!-- Generated by Doxygen 1.3.6 --> |
---|
9 | <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> |
---|
10 | <h1>OgreRenderable.h</h1><a href="OgreRenderable_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre>00001 <span class="comment">/*</span> |
---|
11 | 00002 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
12 | 00003 <span class="comment">This source file is part of OGRE</span> |
---|
13 | 00004 <span class="comment"> (Object-oriented Graphics Rendering Engine)</span> |
---|
14 | 00005 <span class="comment">For the latest info, see http://ogre.sourceforge.net/</span> |
---|
15 | 00006 <span class="comment"></span> |
---|
16 | 00007 <span class="comment">Copyright (c) 2000-2005 The OGRE Team</span> |
---|
17 | 00008 <span class="comment">Also see acknowledgements in Readme.html</span> |
---|
18 | 00009 <span class="comment"></span> |
---|
19 | 00010 <span class="comment">This program is free software; you can redistribute it and/or modify it under</span> |
---|
20 | 00011 <span class="comment">the terms of the GNU Lesser General Public License as published by the Free Software</span> |
---|
21 | 00012 <span class="comment">Foundation; either version 2 of the License, or (at your option) any later</span> |
---|
22 | 00013 <span class="comment">version.</span> |
---|
23 | 00014 <span class="comment"></span> |
---|
24 | 00015 <span class="comment">This program is distributed in the hope that it will be useful, but WITHOUT</span> |
---|
25 | 00016 <span class="comment">ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS</span> |
---|
26 | 00017 <span class="comment">FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.</span> |
---|
27 | 00018 <span class="comment"></span> |
---|
28 | 00019 <span class="comment">You should have received a copy of the GNU Lesser General Public License along with</span> |
---|
29 | 00020 <span class="comment">this program; if not, write to the Free Software Foundation, Inc., 59 Temple</span> |
---|
30 | 00021 <span class="comment">Place - Suite 330, Boston, MA 02111-1307, USA, or go to</span> |
---|
31 | 00022 <span class="comment">http://www.gnu.org/copyleft/lesser.txt.</span> |
---|
32 | 00023 <span class="comment">-----------------------------------------------------------------------------</span> |
---|
33 | 00024 <span class="comment">*/</span> |
---|
34 | 00025 <span class="preprocessor">#ifndef __Renderable_H__</span> |
---|
35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define __Renderable_H__</span> |
---|
36 | 00027 <span class="preprocessor"></span> |
---|
37 | 00028 <span class="preprocessor">#include "<a class="code" href="OgrePrerequisites_8h.html">OgrePrerequisites.h</a>"</span> |
---|
38 | 00029 <span class="preprocessor">#include "<a class="code" href="OgreCommon_8h.html">OgreCommon.h</a>"</span> |
---|
39 | 00030 |
---|
40 | 00031 <span class="preprocessor">#include "<a class="code" href="OgreRenderOperation_8h.html">OgreRenderOperation.h</a>"</span> |
---|
41 | 00032 <span class="preprocessor">#include "<a class="code" href="OgreMatrix4_8h.html">OgreMatrix4.h</a>"</span> |
---|
42 | 00033 <span class="preprocessor">#include "<a class="code" href="OgreMaterial_8h.html">OgreMaterial.h</a>"</span> |
---|
43 | 00034 <span class="preprocessor">#include "<a class="code" href="OgrePlane_8h.html">OgrePlane.h</a>"</span> |
---|
44 | 00035 <span class="preprocessor">#include "<a class="code" href="OgreGpuProgram_8h.html">OgreGpuProgram.h</a>"</span> |
---|
45 | 00036 <span class="preprocessor">#include "<a class="code" href="OgreVector4_8h.html">OgreVector4.h</a>"</span> |
---|
46 | 00037 <span class="preprocessor">#include "<a class="code" href="OgreException_8h.html">OgreException.h</a>"</span> |
---|
47 | 00038 |
---|
48 | 00039 <span class="keyword">namespace </span>Ogre { |
---|
49 | 00040 |
---|
50 | <a name="l00052"></a><a class="code" href="classOgre_1_1Renderable.html">00052</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> Renderable |
---|
51 | 00053 { |
---|
52 | 00054 <span class="keyword">public</span>: |
---|
53 | <a name="l00055"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1Renderablea0">00055</a> Renderable() : mRenderDetailOverrideable(true) {} |
---|
54 | <a name="l00057"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1Renderablea1">00057</a> <span class="keyword">virtual</span> ~Renderable() { } |
---|
55 | 00063 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classOgre_1_1MaterialPtr.html">MaterialPtr</a>& getMaterial(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0; |
---|
56 | <a name="l00069"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa42">00069</a> <span class="keyword">virtual</span> <a class="code" href="classOgre_1_1Technique.html">Technique</a>* getTechnique(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> getMaterial()->getBestTechnique(); } |
---|
57 | 00072 <span class="keyword">virtual</span> <span class="keywordtype">void</span> getRenderOperation(<a class="code" href="classOgre_1_1RenderOperation.html">RenderOperation</a>& op) = 0; |
---|
58 | 00082 <span class="keyword">virtual</span> <span class="keywordtype">void</span> getWorldTransforms(<a class="code" href="classOgre_1_1Matrix4.html">Matrix4</a>* xform) <span class="keyword">const</span> = 0; |
---|
59 | 00088 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classOgre_1_1Quaternion.html">Quaternion</a>& getWorldOrientation(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0; |
---|
60 | 00094 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>& getWorldPosition(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0; |
---|
61 | 00095 |
---|
62 | <a name="l00104"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa43">00104</a> <span class="keyword">virtual</span> <span class="keywordtype">unsigned</span> <span class="keywordtype">short</span> getNumWorldTransforms(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> 1; } |
---|
63 | 00105 |
---|
64 | <a name="l00114"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa44">00114</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> useIdentityProjection(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; } |
---|
65 | 00115 |
---|
66 | <a name="l00124"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa45">00124</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> useIdentityView(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; } |
---|
67 | 00125 |
---|
68 | 00131 <span class="keyword">virtual</span> <a class="code" href="namespaceOgre.html#a420">Real</a> getSquaredViewDepth(<span class="keyword">const</span> <a class="code" href="classOgre_1_1Camera.html">Camera</a>* cam) <span class="keyword">const</span> = 0; |
---|
69 | 00132 |
---|
70 | <a name="l00135"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa46">00135</a> <span class="keyword">virtual</span> <a class="code" href="namespaceOgre.html#a646">SceneDetailLevel</a> getRenderDetail()<span class="keyword"> const </span>{<span class="keywordflow">return</span> <a class="code" href="namespaceOgre.html#a646a102">SDL_SOLID</a>;} |
---|
71 | 00136 |
---|
72 | <a name="l00138"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa47">00138</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> getNormaliseNormals(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; } |
---|
73 | 00139 |
---|
74 | 00144 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a59">LightList</a>& getLights(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0; |
---|
75 | 00145 |
---|
76 | <a name="l00146"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa48">00146</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a410">PlaneList</a>& getClipPlanes()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> msDummyPlaneList; }; |
---|
77 | 00147 |
---|
78 | <a name="l00154"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa49">00154</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> getCastsShadows(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> <span class="keyword">false</span>; } |
---|
79 | 00155 |
---|
80 | <a name="l00171"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa50">00171</a> <span class="keywordtype">void</span> setCustomParameter(size_t index, <span class="keyword">const</span> <a class="code" href="classOgre_1_1Vector4.html">Vector4</a>& value) |
---|
81 | 00172 { |
---|
82 | 00173 mCustomParameters[index] = value; |
---|
83 | 00174 } |
---|
84 | 00175 |
---|
85 | <a name="l00180"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa51">00180</a> <span class="keyword">const</span> <a class="code" href="classOgre_1_1Vector4.html">Vector4</a>& getCustomParameter(size_t index)<span class="keyword"> const</span> |
---|
86 | 00181 <span class="keyword"> </span>{ |
---|
87 | 00182 CustomParameterMap::const_iterator i = mCustomParameters.find(index); |
---|
88 | 00183 <span class="keywordflow">if</span> (i != mCustomParameters.end()) |
---|
89 | 00184 { |
---|
90 | 00185 <span class="keywordflow">return</span> i->second; |
---|
91 | 00186 } |
---|
92 | 00187 <span class="keywordflow">else</span> |
---|
93 | 00188 { |
---|
94 | 00189 <a class="code" href="OgreException_8h.html#a0">OGRE_EXCEPT</a>(Exception::ERR_ITEM_NOT_FOUND, |
---|
95 | 00190 <span class="stringliteral">"Parameter at the given index was not found."</span>, |
---|
96 | 00191 <span class="stringliteral">"Renderable::getCustomParameter"</span>); |
---|
97 | 00192 } |
---|
98 | 00193 } |
---|
99 | 00194 |
---|
100 | <a name="l00219"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa52">00219</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> _updateCustomGpuParameter( |
---|
101 | 00220 <span class="keyword">const</span> <a class="code" href="classOgre_1_1GpuProgramParameters_1_1AutoConstantEntry.html">GpuProgramParameters::AutoConstantEntry</a>& constantEntry, |
---|
102 | 00221 <a class="code" href="classOgre_1_1GpuProgramParameters.html">GpuProgramParameters</a>* <a class="code" href="OgreGLPrerequisites_8h.html#a74">params</a>)<span class="keyword"> const</span> |
---|
103 | 00222 <span class="keyword"> </span>{ |
---|
104 | 00223 CustomParameterMap::const_iterator i = mCustomParameters.find(constantEntry.<a class="code" href="classOgre_1_1GpuProgramParameters_1_1AutoConstantEntry.html#Ogre_1_1GpuProgramParameters_1_1AutoConstantEntryo2">data</a>); |
---|
105 | 00224 <span class="keywordflow">if</span> (i != mCustomParameters.end()) |
---|
106 | 00225 { |
---|
107 | 00226 <a class="code" href="OgreGLPrerequisites_8h.html#a74">params</a>->setConstant(constantEntry.<a class="code" href="classOgre_1_1GpuProgramParameters_1_1AutoConstantEntry.html#Ogre_1_1GpuProgramParameters_1_1AutoConstantEntryo1">index</a>, i->second); |
---|
108 | 00227 } |
---|
109 | 00228 } |
---|
110 | 00229 |
---|
111 | <a name="l00235"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa53">00235</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> setRenderDetailOverrideable(<span class="keywordtype">bool</span> override) |
---|
112 | 00236 { |
---|
113 | 00237 mRenderDetailOverrideable = override; |
---|
114 | 00238 } |
---|
115 | 00239 |
---|
116 | <a name="l00243"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa54">00243</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> getRenderDetailOverrideable(<span class="keywordtype">void</span>)<span class="keyword"> const</span> |
---|
117 | 00244 <span class="keyword"> </span>{ |
---|
118 | 00245 <span class="keywordflow">return</span> mRenderDetailOverrideable; |
---|
119 | 00246 } |
---|
120 | 00247 |
---|
121 | 00248 |
---|
122 | 00249 <span class="keyword">protected</span>: |
---|
123 | <a name="l00250"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxt1">00250</a> <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a410">PlaneList</a> msDummyPlaneList; |
---|
124 | <a name="l00251"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxx0">00251</a> <span class="keyword">typedef</span> std::map<size_t, Vector4> <a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxx0">CustomParameterMap</a>; |
---|
125 | <a name="l00252"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxp20">00252</a> <a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxx0">CustomParameterMap</a> mCustomParameters; |
---|
126 | <a name="l00253"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxp21">00253</a> <span class="keywordtype">bool</span> mRenderDetailOverrideable; |
---|
127 | 00254 }; |
---|
128 | 00255 |
---|
129 | 00256 |
---|
130 | 00257 |
---|
131 | 00258 } |
---|
132 | 00259 |
---|
133 | 00260 <span class="preprocessor">#endif //__Renderable_H__</span> |
---|
134 | </pre></div><hr> |
---|
135 | <p> |
---|
136 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
137 | <!--Creative Commons License--><a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/"><img alt="Creative Commons License" border="0" src="http://creativecommons.org/images/public/somerights20.png"/></a><br/> |
---|
138 | This work is licensed under a <a rel="license" href="http://creativecommons.org/licenses/by-sa/2.5/">Creative Commons Attribution-ShareAlike 2.5 License</a>.<br/> |
---|
139 | <!--/Creative Commons License--><!-- <rdf:RDF xmlns="http://web.resource.org/cc/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"> |
---|
140 | <Work rdf:about=""> |
---|
141 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
142 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
143 | </Work> |
---|
144 | <License rdf:about="http://creativecommons.org/licenses/by-sa/2.5/"><permits rdf:resource="http://web.resource.org/cc/Reproduction"/><permits rdf:resource="http://web.resource.org/cc/Distribution"/><requires rdf:resource="http://web.resource.org/cc/Notice"/><requires rdf:resource="http://web.resource.org/cc/Attribution"/><permits rdf:resource="http://web.resource.org/cc/DerivativeWorks"/><requires rdf:resource="http://web.resource.org/cc/ShareAlike"/></License></rdf:RDF> --> |
---|
145 | |
---|
146 | Last modified Sun Feb 12 12:59:50 2006 |
---|
147 | </p> |
---|
148 | </body> |
---|
149 | </html> |
---|