1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 2<html xml:lang="en-US" lang="en-US"> 3 <head> 4 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> 5 <meta http-equiv="Content-Style-Type" content="text/css" /> 6 <link rel="stylesheet" href="../../../css/document.css" type="text/css" /> 7 <title>Graphics Library (gfx) Sample Demos</title> 8 </head> 9 <body> 10 <h1><CODE>ParticleMissileDemo</CODE></h1> 11 12 <div class="section"><img src="images/ParticleMissileDemo.png" border="0" width="400" height="240"/></div> 13 14 <h2>Overview</h2> 15 <p>This demo creates missiles from particles. Use the +Control Pad to control the direction of emission. Press the A Button to fire a missile, and press the B button to delete all missiles.</p> 16 17 <h2>How to Use</h2> 18 <p> 19 <ul> 20 <li>Demo-Specific Operations</li> 21 <ul> 22 <li>Left: Adjust firing angle</li> 23 <li>Right: Adjust firing angle</li> 24 <li>A Button: Fire</li> 25 <li>B Button: Delete all</li> 26 </ul> 27 <li>Common Operations</li> 28 <ul> 29 <li>Circle Pad: Rotate the camera</li> 30 <li>Circle Pad + A Button: Move the camera back and forth</li> 31 <li>Circle Pad + B Button: Move the camera in parallel</li> 32 <li>Circle Pad + Y Button: Move the camera up and down</li> 33 <li>X Button: Reset the camera position</li> 34 <li>START Button: Restart the demo</li> 35 </ul> 36 </ul> 37 </p> 38 39 <h2>Description</h2> 40 <p>This section describes the main points of the demo.</p> 41 42 <h3>Number of Instances</h3> 43 <p>This demo only generates one <CODE>ParticleModel</CODE> instance, and one <CODE>ParticleEmitter</CODE> instance. Missiles are emitted and killed on a per-particle basis.</p> 44 45 <h3>Adjusting the Firing Angle</h3> 46 <p>The demo adjusts the firing angle by applying a rotation transform to the <CODE>ParticleEmitter</CODE>. The missile speed is specified in the data as <CODE>(0.0f, 1.0f, 0.0f)</CODE>, and this vector is affected by the emitter's angle of rotation.</p> 47 48 <h3>Firing</h3> 49 <p>The demo fires missiles from the <CODE>ParticleEmitter</CODE> by emitting them.</p> 50<pre> 51// Sample emission code 52nw::gfx::ParticleEmitter* emitter; 53emitter->UpdateParticleFrame(); 54emitter->Emission(particleContext); 55emitter->Reset(); 56</pre> 57 58 <h3>Adjusting the Working Memory</h3> 59 <p>The data's runtime working memory must be adjusted depending on the number of missiles on-screen that can be fired simultaneously.</p> 60 61 <h3>Deleting Missiles</h3> 62 <p>The demo uses the <CODE>nw::gfx::ParticleCollection::KillParticle</CODE> function to delete missiles. This function allows for deletion on a per-particle basis. The demo uses the <CODE>nw::gfx::ParticleCollection::KillParticles</CODE> function to delete all missiles at once.</p> 63 64 <hr><p>CONFIDENTIAL</p></body> 65</html> 66 67