source: GTP/trunk/App/Demos/Illum/Rain/docs/html/RainCloseDropsParticles_8h-source.html @ 2221

Revision 2221, 12.5 KB checked in by plemenos, 18 years ago (diff)
  • Property svn:executable set to *
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
2<html><head><meta http-equiv="Content-Type" content="text/html;charset=iso-8859-1">
3<title>gametools-rain: RainCloseDropsParticles.h Source File</title>
4<link href="doxygen.css" rel="stylesheet" type="text/css">
5<link href="tabs.css" rel="stylesheet" type="text/css">
6</head><body>
7<!-- Generated by Doxygen 1.4.6 -->
8<div class="tabs">
9  <ul>
10    <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
11    <li><a href="annotated.html"><span>Classes</span></a></li>
12    <li id="current"><a href="files.html"><span>Files</span></a></li>
13  </ul></div>
14<h1>RainCloseDropsParticles.h</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001
15<a name="l00003"></a>00003 <span class="comment">//</span>
16<a name="l00004"></a>00004 <span class="comment">//              Realistic rain real-time simulation program</span>
17<a name="l00005"></a>00005 <span class="comment">//</span>
18<a name="l00006"></a>00006 <span class="comment">//              Pierre Rousseau</span>
19<a name="l00007"></a>00007 <span class="comment">//</span>
20<a name="l00009"></a>00009 <span class="comment"></span><span class="comment">//</span>
21<a name="l00010"></a>00010 <span class="comment">//              Particle systems handling</span>
22<a name="l00011"></a>00011 <span class="comment">//</span>
23<a name="l00013"></a>00013 <span class="comment"></span>
24<a name="l00014"></a>00014 <span class="preprocessor">#ifndef __RAIN_CLOSE_DROPS_PARTICLES__</span>
25<a name="l00015"></a>00015 <span class="preprocessor"></span><span class="preprocessor">#define __RAIN_CLOSE_DROPS_PARTICLES__</span>
26<a name="l00016"></a>00016 <span class="preprocessor"></span>
27<a name="l00017"></a>00017
28<a name="l00018"></a>00018 <span class="preprocessor">#include "CommonRain.h"</span>
29<a name="l00019"></a>00019 <span class="preprocessor">#include "RainTextureFrameListener.h"</span>
30<a name="l00020"></a>00020 <span class="preprocessor">#include "RainManualHardwareBillboardMeshLoader.h"</span>
31<a name="l00021"></a>00021 <span class="preprocessor">#include "RainLight.h"</span>
32<a name="l00022"></a>00022
33<a name="l00023"></a>00023
34<a name="l00024"></a>00024
35<a name="l00025"></a>00025
36<a name="l00026"></a>00026
37<a name="l00027"></a>00027
38<a name="l00031"></a><a class="code" href="classCloseDropsParticles.html">00031</a> <span class="keyword">class </span><a class="code" href="classCloseDropsParticles.html">CloseDropsParticles</a>
39<a name="l00032"></a>00032 {
40<a name="l00033"></a>00033 <span class="keyword">private</span> :
41<a name="l00034"></a>00034     SceneManager *mSceneMgr;
42<a name="l00035"></a>00035     RainLightManager *mRainLightMgr;
43<a name="l00036"></a>00036     SceneNode *mParticlesNode, *mParentCam, *mParentSyst;
44<a name="l00037"></a>00037
45<a name="l00038"></a>00038     <span class="comment">// wide angle camera used to render the drops</span>
46<a name="l00039"></a>00039     Ogre::Camera *mCamera;
47<a name="l00040"></a>00040     RenderTexture *dropsTexture;
48<a name="l00041"></a>00041     MaterialPtr dropsTexturesMaterial;
49<a name="l00042"></a>00042
50<a name="l00043"></a>00043     <span class="comment">// simulation textures, containing particle positions</span>
51<a name="l00044"></a>00044 <span class="keywordtype">int</span> mActiveParticlesCount;
52<a name="l00045"></a>00045     RenderTexture *particlePosTexture, *particlePosTextureBackup;
53<a name="l00046"></a>00046
54<a name="l00047"></a>00047     BillboardSet *bbSet1, *bbSet2; <span class="comment">// billboardsets for ping-pong position textures</span>
55<a name="l00048"></a>00048
56<a name="l00049"></a>00049
57<a name="l00050"></a>00050 <span class="keyword">public</span> :
58<a name="l00052"></a><a class="code" href="classCloseDropsParticles.html#1e01a41391f939b3f4e1f2b140f9f192">00052</a>     <span class="keywordtype">float</span> <a class="code" href="classCloseDropsParticles.html#1e01a41391f939b3f4e1f2b140f9f192">mRainWidth</a>;
59<a name="l00054"></a><a class="code" href="classCloseDropsParticles.html#9812ff8eb6059ecc22d1a659a3581262">00054</a>     <span class="keywordtype">float</span> <a class="code" href="classCloseDropsParticles.html#9812ff8eb6059ecc22d1a659a3581262">mRainStreaksHeight</a>;
60<a name="l00055"></a>00055
61<a name="l00056"></a>00056
62<a name="l00064"></a>00064     <a class="code" href="classCloseDropsParticles.html#854ab941991fcb21d1640fc6d938e408">CloseDropsParticles</a>(SceneManager *sceneMgr, SceneNode *parentSyst, SceneNode *parentCam);
63<a name="l00065"></a>00065
64<a name="l00067"></a>00067     <a class="code" href="classCloseDropsParticles.html#9f3718c6d0721b1bce367ec2d55f2b35">~CloseDropsParticles</a>();
65<a name="l00068"></a>00068
66<a name="l00070"></a>00070 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#f8ced0c0f82c037a0d4a6a685c9b0435">createLights</a>();
67<a name="l00071"></a>00071
68<a name="l00073"></a>00073     RainLightManager *<a class="code" href="classCloseDropsParticles.html#07b630c2f9893453cf7a6a0a81704d85">getLightManagerPtr</a>();
69<a name="l00074"></a>00074
70<a name="l00076"></a>00076 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#d2686c928601912243528dbf93f122e3">updateLights</a>();
71<a name="l00077"></a>00077
72<a name="l00079"></a>00079 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#1353cbebfae74f3e9e8cbb9b9e429089">definePosTextureAndBackup</a>();
73<a name="l00080"></a>00080
74<a name="l00082"></a>00082 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#1ea41c537ac5a889452f8b311d161e3d">makeControlOverlay</a>();
75<a name="l00083"></a>00083
76<a name="l00085"></a>00085 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#e7e63a1a54ec6368046e377ef02ed622">updatePositionTexture</a>(<span class="keywordtype">bool</span> primary);
77<a name="l00086"></a>00086
78<a name="l00088"></a>00088 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#ed530332d6ea95622da6d65d2f453a0f">updateFragmentProgramParameter</a>(<span class="keyword">const</span> String &amp;name, <span class="keywordtype">float</span> value);
79<a name="l00090"></a>00090 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#ed530332d6ea95622da6d65d2f453a0f">updateFragmentProgramParameter</a>(<span class="keyword">const</span> String &amp;name, Ogre::Vector3 value);
80<a name="l00092"></a>00092 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#ed530332d6ea95622da6d65d2f453a0f">updateFragmentProgramParameter</a>(<span class="keyword">const</span> String &amp;name, Ogre::Vector4 value);
81<a name="l00096"></a>00096 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#382d373910aeeca4da9c4c2c21d3c474">updateShaderParameters</a>(<span class="keywordtype">float</span> tslf, <span class="keywordtype">float</span> rainBbSide, <span class="keywordtype">float</span> streaksHeight, <span class="keywordtype">int</span> nbLights,
82<a name="l00097"></a>00097 Vector3 viewPos, Vector3 viewDir, Vector3 fallVect, Vector3 boxMin, Vector3 boxMax, Vector3 lastMove, Vector3 randomMove, <span class="keywordtype">int</span> useShader);
83<a name="l00098"></a>00098
84<a name="l00099"></a>00099
85<a name="l00101"></a>00101 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#faf0938f86626973a5f787a339d68e39">updateTimeSinceLastFrame</a>(<span class="keywordtype">float</span> tslf);
86<a name="l00103"></a>00103 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#f9de759fa82c8ec7042200d2370e74d6">updateRainBilboardSideLength</a>(<span class="keywordtype">float</span> rainBbSide);
87<a name="l00105"></a>00105 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#c12db346d5dcb629eece45cf16827718">updateStreaksHeight</a>(<span class="keywordtype">float</span> streaksHeight);
88<a name="l00107"></a>00107 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#b09a148f6d44e4ee87a5081c74757a98">updateLightCount</a>(<span class="keywordtype">float</span> nbLights);
89<a name="l00109"></a>00109 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#2925efdc8a09636534a780a34e8bffdf">updateViewPos</a>(Vector3 viewPos);
90<a name="l00111"></a>00111 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#f1b8b1a995996677bd75584ef85b1596">updateViewDir</a>(Vector3 viewDir);
91<a name="l00113"></a>00113 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#1a590aabe2601cf7705423e8724874a9">updateFallVector</a>(Vector3 fallVect);
92<a name="l00115"></a>00115 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#3a2aca7152213edefb89ce819069e47a">updateBoxMin</a>(Vector3 boxMin);
93<a name="l00117"></a>00117 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#98be1ed6e9561ed2afbf3b625fc55428">updateBoxMax</a>(Vector3 boxMax);
94<a name="l00119"></a>00119 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#91e9858663a5155b23c734703b807fd9">updateLastMove</a>(Vector3 lastMove);
95<a name="l00121"></a>00121 <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#c6ecb49d550648cf42ca847088ba7f84">updateRandomMove</a>(Vector3 randomMove);
96<a name="l00122"></a>00122
97<a name="l00125"></a><a class="code" href="classCloseDropsParticles.html#9be4bfaed25d7fb306f353fcf38553b3">00125</a>     <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#9be4bfaed25d7fb306f353fcf38553b3">hidePositionBillboards</a>()
98<a name="l00126"></a>00126     {
99<a name="l00127"></a>00127         bbSet1-&gt;setVisible(<span class="keyword">false</span>);
100<a name="l00128"></a>00128         bbSet2-&gt;setVisible(<span class="keyword">false</span>);
101<a name="l00129"></a>00129     }
102<a name="l00132"></a><a class="code" href="classCloseDropsParticles.html#7504154f99f56be93e7ebf5e374ef506">00132</a>     <span class="keywordtype">void</span> <a class="code" href="classCloseDropsParticles.html#7504154f99f56be93e7ebf5e374ef506">showPositionBillboards</a>()
103<a name="l00133"></a>00133     {
104<a name="l00134"></a>00134         bbSet1-&gt;setVisible(<span class="keyword">true</span>);
105<a name="l00135"></a>00135         bbSet2-&gt;setVisible(<span class="keyword">true</span>);
106<a name="l00136"></a>00136     }
107<a name="l00137"></a>00137
108<a name="l00138"></a>00138 <span class="keyword">private</span> :
109<a name="l00139"></a>00139
110<a name="l00141"></a>00141 <span class="keywordtype">void</span> createMaterial(String name);
111<a name="l00142"></a>00142
112<a name="l00144"></a>00144     Camera* createDropsCamera();
113<a name="l00145"></a>00145
114<a name="l00147"></a>00147 <span class="keywordtype">void</span> GPUmaterial();
115<a name="l00148"></a>00148     
116<a name="l00150"></a>00150 <span class="keywordtype">void</span> initializeBillboardsPositionTexture();
117<a name="l00151"></a>00151     
118<a name="l00153"></a>00153     MeshPtr createHardwareBillboardMesh(String materialName, String meshName=BILLBOARD_MESH_NAME);
119<a name="l00154"></a>00154
120<a name="l00156"></a>00156 <span class="keywordtype">void</span> modifyClonedHardwareBillboardMesh(MeshPtr msh, <span class="keywordtype">int</span> partNumber);
121<a name="l00157"></a>00157
122<a name="l00159"></a>00159 <span class="keywordtype">void</span> initParticles();
123<a name="l00160"></a>00160     
124<a name="l00162"></a>00162 <span class="keywordtype">void</span> createBillboardsPositionRenderTexture(RenderTexture *PSPosTexture, Vector3 nodePos, BillboardSet *bbSet);
125<a name="l00163"></a>00163
126<a name="l00165"></a>00165 <span class="keywordtype">void</span> createBillboardsPositionTextureMaterial(String inputTextureName);
127<a name="l00166"></a>00166 };
128<a name="l00167"></a>00167
129<a name="l00168"></a>00168
130<a name="l00169"></a>00169
131<a name="l00170"></a>00170
132<a name="l00171"></a>00171 <span class="preprocessor">#endif // __RAIN_CLOSE_DROPS_PARTICLES__</span>
133</pre></div><hr size="1"><address style="align: right;"><small>Generated on Wed May 17 16:55:30 2006 for gametools-rain by&nbsp;
134<a href="http://www.doxygen.org/index.html">
135<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.4.6 </small></address>
136</body>
137</html>
Note: See TracBrowser for help on using the repository browser.