1 | <html> |
---|
2 | <head> |
---|
3 | <title>OgrePatchSurface.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>OgrePatchSurface.h</h1><a href="OgrePatchSurface_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://www.ogre3d.org/</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 __PatchSurface_H__</span> |
---|
35 | 00026 <span class="preprocessor"></span><span class="preprocessor">#define __PatchSurface_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 |
---|
39 | 00030 <span class="preprocessor">#include "<a class="code" href="OgreVector3_8h.html">OgreVector3.h</a>"</span> |
---|
40 | 00031 <span class="preprocessor">#include "<a class="code" href="OgreString_8h.html">OgreString.h</a>"</span> |
---|
41 | 00032 <span class="preprocessor">#include "<a class="code" href="OgreRenderOperation_8h.html">OgreRenderOperation.h</a>"</span> |
---|
42 | 00033 <span class="preprocessor">#include "<a class="code" href="OgreAxisAlignedBox_8h.html">OgreAxisAlignedBox.h</a>"</span> |
---|
43 | 00034 |
---|
44 | 00035 <span class="keyword">namespace </span>Ogre { |
---|
45 | 00036 |
---|
46 | <a name="l00043"></a><a class="code" href="classOgre_1_1PatchSurface.html">00043</a> <span class="keyword">class </span><a class="code" href="OgrePlatform_8h.html#a16">_OgreExport</a> PatchSurface |
---|
47 | 00044 { |
---|
48 | 00045 <span class="keyword">public</span>: |
---|
49 | 00046 PatchSurface(); |
---|
50 | 00047 ~PatchSurface(); |
---|
51 | 00048 |
---|
52 | <a name="l00049"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacew5">00049</a> <span class="keyword">enum</span> PatchSurfaceType |
---|
53 | 00050 { |
---|
54 | 00052 PST_BEZIER |
---|
55 | 00053 }; |
---|
56 | 00054 |
---|
57 | 00056 <span class="keyword">enum</span> |
---|
58 | 00057 { |
---|
59 | 00058 AUTO_LEVEL = -1 |
---|
60 | 00059 }; |
---|
61 | 00060 |
---|
62 | <a name="l00061"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacew7">00061</a> <span class="keyword">enum</span> VisibleSide { |
---|
63 | 00063 VS_FRONT, |
---|
64 | 00065 VS_BACK, |
---|
65 | 00067 VS_BOTH |
---|
66 | 00068 }; |
---|
67 | 00096 <span class="keywordtype">void</span> defineSurface(<span class="keywordtype">void</span>* controlPointBuffer, |
---|
68 | 00097 <a class="code" href="classOgre_1_1VertexDeclaration.html">VertexDeclaration</a> *declaration, size_t width, size_t height, |
---|
69 | 00098 PatchSurfaceType pType = PST_BEZIER, |
---|
70 | 00099 size_t uMaxSubdivisionLevel = AUTO_LEVEL, size_t vMaxSubdivisionLevel = AUTO_LEVEL, |
---|
71 | 00100 VisibleSide visibleSide = VS_FRONT); |
---|
72 | 00101 |
---|
73 | 00107 size_t getRequiredVertexCount(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
74 | 00113 size_t getRequiredIndexCount(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
75 | 00114 |
---|
76 | 00116 size_t getCurrentIndexCount(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
77 | <a name="l00118"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacea6">00118</a> size_t getIndexOffset(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mIndexOffset; } |
---|
78 | <a name="l00120"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacea7">00120</a> size_t getVertexOffset(<span class="keywordtype">void</span>)<span class="keyword"> const </span>{ <span class="keywordflow">return</span> mVertexOffset; } |
---|
79 | 00121 |
---|
80 | 00122 |
---|
81 | 00124 <span class="keyword">const</span> <a class="code" href="classOgre_1_1AxisAlignedBox.html">AxisAlignedBox</a>& getBounds(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
82 | 00127 <a class="code" href="namespaceOgre.html#a420">Real</a> getBoundingSphereRadius(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
83 | 00143 <span class="keywordtype">void</span> build(<a class="code" href="classOgre_1_1HardwareVertexBufferSharedPtr.html">HardwareVertexBufferSharedPtr</a> destVertexBuffer, size_t vertexStart, |
---|
84 | 00144 <a class="code" href="classOgre_1_1HardwareIndexBufferSharedPtr.html">HardwareIndexBufferSharedPtr</a> destIndexBuffer, size_t indexStart); |
---|
85 | 00145 |
---|
86 | 00154 <span class="keywordtype">void</span> setSubdivisionFactor(<a class="code" href="namespaceOgre.html#a420">Real</a> factor); |
---|
87 | 00155 |
---|
88 | 00157 <a class="code" href="namespaceOgre.html#a420">Real</a> getSubdivisionFactor(<span class="keywordtype">void</span>) <span class="keyword">const</span>; |
---|
89 | 00158 |
---|
90 | <a name="l00159"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacea13">00159</a> <span class="keywordtype">void</span>* getControlPointBuffer(<span class="keywordtype">void</span>)<span class="keyword"> const</span> |
---|
91 | 00160 <span class="keyword"> </span>{ |
---|
92 | 00161 <span class="keywordflow">return</span> mControlPointBuffer; |
---|
93 | 00162 } |
---|
94 | <a name="l00165"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacea14">00165</a> <span class="keywordtype">void</span> notifyControlPointBufferDeallocated(<span class="keywordtype">void</span>) { |
---|
95 | 00166 mControlPointBuffer = 0; |
---|
96 | 00167 } |
---|
97 | 00168 <span class="keyword">protected</span>: |
---|
98 | <a name="l00170"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep0">00170</a> <a class="code" href="classOgre_1_1VertexDeclaration.html">VertexDeclaration</a>* mDeclaration; |
---|
99 | <a name="l00172"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep1">00172</a> <span class="keywordtype">void</span>* mControlPointBuffer; |
---|
100 | <a name="l00174"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep2">00174</a> PatchSurfaceType mType; |
---|
101 | <a name="l00176"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep3">00176</a> size_t mCtlWidth; |
---|
102 | <a name="l00178"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep4">00178</a> size_t mCtlHeight; |
---|
103 | <a name="l00180"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep5">00180</a> size_t mCtlCount; |
---|
104 | <a name="l00182"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep6">00182</a> size_t mULevel; |
---|
105 | <a name="l00184"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep7">00184</a> size_t mVLevel; |
---|
106 | <a name="l00186"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep8">00186</a> size_t mMaxULevel; |
---|
107 | <a name="l00187"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep9">00187</a> size_t mMaxVLevel; |
---|
108 | <a name="l00189"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep10">00189</a> size_t mMeshWidth; |
---|
109 | <a name="l00191"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep11">00191</a> size_t mMeshHeight; |
---|
110 | <a name="l00193"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep12">00193</a> VisibleSide mVSide; |
---|
111 | 00194 |
---|
112 | <a name="l00195"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep13">00195</a> <a class="code" href="namespaceOgre.html#a420">Real</a> mSubdivisionFactor; |
---|
113 | 00196 |
---|
114 | <a name="l00197"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep14">00197</a> std::vector<Vector3> mVecCtlPoints; |
---|
115 | 00198 |
---|
116 | 00201 size_t findLevel( <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>& a, <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>& b, <a class="code" href="classOgre_1_1Vector3.html">Vector3</a>& c); |
---|
117 | 00202 |
---|
118 | 00203 <span class="keywordtype">void</span> distributeControlPoints(<span class="keywordtype">void</span>* lockedBuffer); |
---|
119 | 00204 <span class="keywordtype">void</span> subdivideCurve(<span class="keywordtype">void</span>* lockedBuffer, size_t startIdx, size_t stepSize, size_t numSteps, size_t iterations); |
---|
120 | 00205 <span class="keywordtype">void</span> interpolateVertexData(<span class="keywordtype">void</span>* lockedBuffer, size_t leftIndex, size_t rightIndex, size_t destIndex); |
---|
121 | 00206 <span class="keywordtype">void</span> makeTriangles(<span class="keywordtype">void</span>); |
---|
122 | 00207 |
---|
123 | 00208 size_t getAutoULevel(<span class="keywordtype">bool</span> forMax = <span class="keyword">false</span>); |
---|
124 | 00209 size_t getAutoVLevel(<span class="keywordtype">bool</span> forMax = <span class="keyword">false</span>); |
---|
125 | 00210 |
---|
126 | <a name="l00211"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep15">00211</a> <a class="code" href="classOgre_1_1HardwareVertexBufferSharedPtr.html">HardwareVertexBufferSharedPtr</a> mVertexBuffer; |
---|
127 | <a name="l00212"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep16">00212</a> <a class="code" href="classOgre_1_1HardwareIndexBufferSharedPtr.html">HardwareIndexBufferSharedPtr</a> mIndexBuffer; |
---|
128 | <a name="l00213"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep17">00213</a> size_t mVertexOffset; |
---|
129 | <a name="l00214"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep18">00214</a> size_t mIndexOffset; |
---|
130 | <a name="l00215"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep19">00215</a> size_t mRequiredVertexCount; |
---|
131 | <a name="l00216"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep20">00216</a> size_t mRequiredIndexCount; |
---|
132 | <a name="l00217"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep21">00217</a> size_t mCurrIndexCount; |
---|
133 | 00218 |
---|
134 | <a name="l00219"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep22">00219</a> <a class="code" href="classOgre_1_1AxisAlignedBox.html">AxisAlignedBox</a> mAABB; |
---|
135 | <a name="l00220"></a><a class="code" href="classOgre_1_1PatchSurface.html#Ogre_1_1PatchSurfacep23">00220</a> <a class="code" href="namespaceOgre.html#a420">Real</a> mBoundingSphere; |
---|
136 | 00221 |
---|
137 | 00222 |
---|
138 | 00223 |
---|
139 | 00224 }; |
---|
140 | 00225 |
---|
141 | 00226 |
---|
142 | 00227 } <span class="comment">// namespace</span> |
---|
143 | 00228 |
---|
144 | 00229 <span class="preprocessor">#endif</span> |
---|
145 | </pre></div><hr> |
---|
146 | <p> |
---|
147 | Copyright © 2000-2005 by The OGRE Team<br /> |
---|
148 | <!--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/> |
---|
149 | 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/> |
---|
150 | <!--/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#"> |
---|
151 | <Work rdf:about=""> |
---|
152 | <license rdf:resource="http://creativecommons.org/licenses/by-sa/2.5/" /> |
---|
153 | <dc:type rdf:resource="http://purl.org/dc/dcmitype/Text" /> |
---|
154 | </Work> |
---|
155 | <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> --> |
---|
156 | |
---|
157 | Last modified Sun Feb 12 12:59:49 2006 |
---|
158 | </p> |
---|
159 | </body> |
---|
160 | </html> |
---|