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() : mPolygonModeOverrideable(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_1WireBoundingBoxa56">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_1WireBoundingBoxa57">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_1WireBoundingBoxa58">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_1WireBoundingBoxa59">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#a465">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="l00134"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa60">00134</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>; } |
---|
71 | 00135 |
---|
72 | 00140 <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a73">LightList</a>& getLights(<span class="keywordtype">void</span>) <span class="keyword">const</span> = 0; |
---|
73 | 00141 |
---|
74 | <a name="l00142"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa61">00142</a> <span class="keyword">virtual</span> <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a453">PlaneList</a>& getClipPlanes()<span class="keyword"> const </span>{ <span class="keywordflow">return</span> msDummyPlaneList; }; |
---|
75 | 00143 |
---|
76 | <a name="l00150"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa62">00150</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>; } |
---|
77 | 00151 |
---|
78 | <a name="l00167"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa63">00167</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) |
---|
79 | 00168 { |
---|
80 | 00169 mCustomParameters[index] = value; |
---|
81 | 00170 } |
---|
82 | 00171 |
---|
83 | <a name="l00176"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa64">00176</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> |
---|
84 | 00177 <span class="keyword"> </span>{ |
---|
85 | 00178 CustomParameterMap::const_iterator i = mCustomParameters.find(index); |
---|
86 | 00179 <span class="keywordflow">if</span> (i != mCustomParameters.end()) |
---|
87 | 00180 { |
---|
88 | 00181 <span class="keywordflow">return</span> i->second; |
---|
89 | 00182 } |
---|
90 | 00183 <span class="keywordflow">else</span> |
---|
91 | 00184 { |
---|
92 | 00185 <a class="code" href="OgreException_8h.html#a0">OGRE_EXCEPT</a>(Exception::ERR_ITEM_NOT_FOUND, |
---|
93 | 00186 <span class="stringliteral">"Parameter at the given index was not found."</span>, |
---|
94 | 00187 <span class="stringliteral">"Renderable::getCustomParameter"</span>); |
---|
95 | 00188 } |
---|
96 | 00189 } |
---|
97 | 00190 |
---|
98 | <a name="l00215"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa65">00215</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> _updateCustomGpuParameter( |
---|
99 | 00216 <span class="keyword">const</span> <a class="code" href="classOgre_1_1GpuProgramParameters_1_1AutoConstantEntry.html">GpuProgramParameters::AutoConstantEntry</a>& constantEntry, |
---|
100 | 00217 <a class="code" href="classOgre_1_1GpuProgramParameters.html">GpuProgramParameters</a>* params)<span class="keyword"> const</span> |
---|
101 | 00218 <span class="keyword"> </span>{ |
---|
102 | 00219 CustomParameterMap::const_iterator i = mCustomParameters.find(constantEntry.<a class="code" href="classOgre_1_1GpuProgramParameters_1_1AutoConstantEntry.html#Ogre_1_1GpuProgramParameters_1_1AutoConstantEntryo2">data</a>); |
---|
103 | 00220 <span class="keywordflow">if</span> (i != mCustomParameters.end()) |
---|
104 | 00221 { |
---|
105 | 00222 params-><a class="code" href="classOgre_1_1GpuProgramParameters.html#Ogre_1_1GpuProgramParametersa4">setConstant</a>(constantEntry.<a class="code" href="classOgre_1_1GpuProgramParameters_1_1AutoConstantEntry.html#Ogre_1_1GpuProgramParameters_1_1AutoConstantEntryo1">index</a>, i->second); |
---|
106 | 00223 } |
---|
107 | 00224 } |
---|
108 | 00225 |
---|
109 | <a name="l00231"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa66">00231</a> <span class="keyword">virtual</span> <span class="keywordtype">void</span> setPolygonModeOverrideable(<span class="keywordtype">bool</span> override) |
---|
110 | 00232 { |
---|
111 | 00233 mPolygonModeOverrideable = override; |
---|
112 | 00234 } |
---|
113 | 00235 |
---|
114 | <a name="l00239"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxa67">00239</a> <span class="keyword">virtual</span> <span class="keywordtype">bool</span> getPolygonModeOverrideable(<span class="keywordtype">void</span>)<span class="keyword"> const</span> |
---|
115 | 00240 <span class="keyword"> </span>{ |
---|
116 | 00241 <span class="keywordflow">return</span> mPolygonModeOverrideable; |
---|
117 | 00242 } |
---|
118 | 00243 |
---|
119 | 00244 |
---|
120 | 00245 <span class="keyword">protected</span>: |
---|
121 | <a name="l00246"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxt4">00246</a> <span class="keyword">static</span> <span class="keyword">const</span> <a class="code" href="namespaceOgre.html#a453">PlaneList</a> msDummyPlaneList; |
---|
122 | <a name="l00247"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxx1">00247</a> <span class="keyword">typedef</span> std::map<size_t, Vector4> <a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxx1">CustomParameterMap</a>; |
---|
123 | <a name="l00248"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxp26">00248</a> <a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxx1">CustomParameterMap</a> mCustomParameters; |
---|
124 | <a name="l00249"></a><a class="code" href="classOgre_1_1Renderable.html#Ogre_1_1WireBoundingBoxp27">00249</a> <span class="keywordtype">bool</span> mPolygonModeOverrideable; |
---|
125 | 00250 }; |
---|
126 | 00251 |
---|
127 | 00252 |
---|
128 | 00253 |
---|
129 | 00254 } |
---|
130 | 00255 |
---|
131 | 00256 <span class="preprocessor">#endif //__Renderable_H__</span> |
---|
132 | </pre></div><hr> |
---|
133 | <p> |
---|
134 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
135 | <!--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/> |
---|
136 | 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/> |
---|
137 | <!--/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#"> |
---|
138 | <Work rdf:about=""> |
---|
139 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
140 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
141 | </Work> |
---|
142 | <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> --> |
---|
143 | |
---|
144 | Last modified Sun Mar 12 14:37:47 2006 |
---|
145 | </p> |
---|
146 | </body> |
---|
147 | </html> |
---|