<?xml version="1.0"?><?xml-stylesheet type="text/xsl" href="/rss.xsl"?><rss version="2.0"><channel><title>tranquillity Wiki Rss Feed</title><link>http://tranquillity.codeplex.com/</link><description>tranquillity Wiki Rss Description</description><item><title>Updated Wiki: Home</title><link>http://tranquillity.codeplex.com/wikipage?version=17</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;strong&gt;Project Description&lt;/strong&gt; &lt;br&gt;
Tranquillity is a compact, easy to use and highly extendible &lt;strong&gt;3D &lt;/strong&gt;
particle system for Windows Phone 7 XNA projects.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.codeplex.com/Download?ProjectName=tranquillity&amp;DownloadId=315394" border="0" alt="Tranquillity Demos" style="padding-left:0px; padding-right:0px; display:inline; margin-left:0px; vertical-align:top; margin-right:0px; padding-top:0px; border-width:0px"&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For installation/integration, check out the &lt;a href="http://tranquillity.codeplex.com/wikipage?title=Getting%20Started"&gt;
Getting Started Guide&lt;/a&gt;. To learn how to use Tranquillity check out &lt;a href="http://tranquillity.codeplex.com/wikipage?title=Using%20Tranquillity"&gt;
Using Tranquillity&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The project is currently in beta; be sure to leave your comments and report bugs. You can get in touch with me on twitter (&lt;a href="http://www.twitter.com/ayakobovich"&gt;@ayakobovich&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;If you end up using &lt;span id="ctl00_ctl00_MasterContent_ProjectTitleControl1_TitleLabel"&gt;
this project in your game, please credit by mentioning that your project particles are powered by Tranquillity.&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Fri, 04 May 2012 17:18:01 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20120504051801P</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=27</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;span style="font-family:segoe ui"&gt;&lt;span style="color:#30332d"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Using Tranquillity is easy; most tasks can be achieved in a couple of lines of code. The demo project included with the source showcases more advanced scenarios including AppHub’s fire, smoke and explosion samples.&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity’s &lt;em&gt;
&lt;strong&gt;ParticleManager&lt;/strong&gt;. &lt;/em&gt;&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;&lt;/em&gt; is a
&lt;em&gt;&lt;strong&gt;DrawableGameComponent&lt;/strong&gt;&lt;/em&gt; that can simply be added to your Game’s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;ParticleManager&lt;/span&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ParticleManager&lt;/span&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;em&gt;&lt;strong&gt;ParticleManager &lt;/strong&gt;&lt;/em&gt;needs to know how your world is being viewed. Use the
&lt;em&gt;&lt;strong&gt;SetMatrices&lt;/strong&gt;&lt;/em&gt; method to set the view and projection matrices.&lt;/p&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem: &lt;/strong&gt;All particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed to/from this system on the fly,
 it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various affectors.
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the
&lt;em&gt;&lt;strong&gt;LoadContent&lt;/strong&gt;&lt;/em&gt; method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;DynamicParticleSystem &lt;/span&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;DynamicParticleSystem&lt;/span&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;Texture2D &lt;/span&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Texture2D&lt;/span&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;[1] { &lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Optionally, a custom &lt;em&gt;BlendState&lt;/em&gt; can be specified:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem, &lt;span style="color:#2b91af"&gt;BlendState&lt;/span&gt;.Additive);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;&lt;strong&gt;RandomHelper&lt;/strong&gt;&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Color(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.NormalizedVector3(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Float(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af"&gt;TimeSpan&lt;/span&gt;.FromSeconds(&lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.IntBetween(1, 3))&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; );&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;h2&gt;Particle Emitters&lt;/h2&gt;
&lt;p&gt;Emission of particles can be automated using a particle emitter. To create a custom particle emitter, implement the
&lt;em&gt;&lt;strong&gt;IParticleEmitter&lt;/strong&gt;&lt;/em&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleEmitter &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IParticleEmitter &lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/strong&gt; method will allow the emitter to automatically emit particles in the particle system it is added to. The
&lt;strong&gt;&lt;em&gt;Emit &lt;/em&gt;&lt;/strong&gt;method can be used to emit particles manually.&lt;/p&gt;
&lt;p&gt;An emitter can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddEmitter(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleEmitter&lt;/span&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Affectors&lt;/h2&gt;
&lt;p&gt;A particle affector can affect one or more properties of all particles in a system. There are three default affectors in Tranquillity that use the particle’s age as the time factor:&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Decelerate:&lt;/strong&gt; Slows a particle down to a complete stop towards the end of its lifespan. This affectors affects only particles that have a velocity.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fadeout:&lt;/strong&gt; Reduces the alpha of a particle until it becomes completely transparent towards the end of its lifespan.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shrink:&lt;/strong&gt; Reduces the size of a particle until it disappears completely towards the end of its lifespan.
&lt;p&gt;To create a custom particle affector, implement the &lt;strong&gt;&lt;em&gt;IParticleAffector&lt;/em&gt;&lt;/strong&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleAffector &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IParticleAffector&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Affect&lt;/em&gt;&lt;/strong&gt; method will allow the affector to access the properties of the parameter particle.&lt;/p&gt;
&lt;p&gt;An affector can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddAffector(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleAffector&lt;/span&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Tue, 27 Dec 2011 01:07:46 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111227010746A</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=26</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;span style="font-family:segoe ui"&gt;&lt;span style="color:#30332d"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Using Tranquillity is easy; most tasks can be achieved in a couple of lines of code. The demo project included with the source showcases more advanced scenarios including AppHub’s fire, smoke and explosion samples.&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity’s &lt;em&gt;
&lt;strong&gt;ParticleManager&lt;/strong&gt;. &lt;/em&gt;&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;&lt;/em&gt; is a
&lt;em&gt;&lt;strong&gt;DrawableGameComponent&lt;/strong&gt;&lt;/em&gt; that can simply be added to your Game’s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;ParticleManager&lt;/span&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ParticleManager&lt;/span&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The &lt;em&gt;&lt;strong&gt;ParticleManager &lt;/strong&gt;&lt;/em&gt;needs to know how your world is being viewed. You will need to use the
&lt;em&gt;&lt;strong&gt;SetMatrices&lt;/strong&gt;&lt;/em&gt; method to set the view and projection matrices.&lt;/p&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem: &lt;/strong&gt;All particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed to/from this system on the fly,
 it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various affectors.
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the
&lt;em&gt;&lt;strong&gt;LoadContent&lt;/strong&gt;&lt;/em&gt; method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;DynamicParticleSystem &lt;/span&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;DynamicParticleSystem&lt;/span&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;Texture2D &lt;/span&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Texture2D&lt;/span&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;[1] { &lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Optionally, a custom &lt;em&gt;BlendState&lt;/em&gt; can be specified:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem, &lt;span style="color:#2b91af"&gt;BlendState&lt;/span&gt;.Additive);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;&lt;strong&gt;RandomHelper&lt;/strong&gt;&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Color(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.NormalizedVector3(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Float(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;span style="color:#2b91af"&gt;TimeSpan&lt;/span&gt;.FromSeconds(&lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.IntBetween(1, 3))&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; );&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;h2&gt;Particle Emitters&lt;/h2&gt;
&lt;p&gt;Emission of particles can be automated using a particle emitter. To create a custom particle emitter, implement the
&lt;em&gt;&lt;strong&gt;IParticleEmitter&lt;/strong&gt;&lt;/em&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleEmitter &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IParticleEmitter &lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/strong&gt; method will allow the emitter to automatically emit particles in the particle system it is added to. The
&lt;strong&gt;&lt;em&gt;Emit &lt;/em&gt;&lt;/strong&gt;method can be used to emit particles manually.&lt;/p&gt;
&lt;p&gt;An emitter can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddEmitter(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleEmitter&lt;/span&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Affectors&lt;/h2&gt;
&lt;p&gt;A particle affector can affect one or more properties of all particles in a system. There are three default affectors in Tranquillity that use the particle’s age as the time factor:&lt;/p&gt;
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Decelerate:&lt;/strong&gt; Slows a particle down to a complete stop towards the end of its lifespan. This affectors affects only particles that have a velocity.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fadeout:&lt;/strong&gt; Reduces the alpha of a particle until it becomes completely transparent towards the end of its lifespan.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shrink:&lt;/strong&gt; Reduces the size of a particle until it disappears completely towards the end of its lifespan.
&lt;p&gt;To create a custom particle affector, implement the &lt;strong&gt;&lt;em&gt;IParticleAffector&lt;/em&gt;&lt;/strong&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleAffector &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IParticleAffector&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Affect&lt;/em&gt;&lt;/strong&gt; method will allow the affector to access the properties of the parameter particle.&lt;/p&gt;
&lt;p&gt;An affector can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddAffector(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleAffector&lt;/span&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;/li&gt;&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Tue, 27 Dec 2011 01:07:04 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111227010704A</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=25</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;span style="font-family:Segoe UI"&gt;&lt;span style="color:#30332d"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Using Tranquillity is easy; most tasks can be achieved in a couple of lines of code. The demo project included with the source showcases more advanced scenarios including AppHub&amp;rsquo;s fire, smoke and explosion samples.&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity&amp;rsquo;s
&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;. &lt;/em&gt;&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;&lt;/em&gt; is a
&lt;em&gt;&lt;strong&gt;DrawableGameComponent&lt;/strong&gt;&lt;/em&gt; that can simply be added to your Game&amp;rsquo;s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;ParticleManager&lt;/span&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ParticleManager&lt;/span&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem: &lt;/strong&gt;All particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed to/from this system on the fly,
 it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various affectors.
&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the
&lt;em&gt;&lt;strong&gt;LoadContent&lt;/strong&gt;&lt;/em&gt; method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;DynamicParticleSystem &lt;/span&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;DynamicParticleSystem&lt;/span&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;Texture2D &lt;/span&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Texture2D&lt;/span&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;[1] { &lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Optionally, a custom &lt;em&gt;BlendState&lt;/em&gt; can be specified:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem, &lt;span style="color:#2b91af"&gt;BlendState&lt;/span&gt;.Additive);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;&lt;strong&gt;RandomHelper&lt;/strong&gt;&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Color(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.NormalizedVector3(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Float(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;TimeSpan&lt;/span&gt;.FromSeconds(&lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.IntBetween(1, 3))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;h2&gt;Particle Emitters&lt;/h2&gt;
&lt;p&gt;Emission of particles can be automated using a particle emitter. To create a custom particle emitter, implement the
&lt;em&gt;&lt;strong&gt;IParticleEmitter&lt;/strong&gt;&lt;/em&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleEmitter &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IParticleEmitter &lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/strong&gt; method will allow the emitter to automatically emit particles in the particle system it is added to. The
&lt;strong&gt;&lt;em&gt;Emit &lt;/em&gt;&lt;/strong&gt;method can be used to emit particles manually.&lt;/p&gt;
&lt;p&gt;An emitter can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddEmitter(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleEmitter&lt;/span&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Affectors&lt;/h2&gt;
&lt;p&gt;A particle affector can affect one or more properties of all particles in a system. There are three default affectors in Tranquillity that use the particle&amp;rsquo;s age as the time factor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Decelerate:&lt;/strong&gt; Slows a particle down to a complete stop towards the end of its lifespan. This affectors affects only particles that have a velocity.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fadeout:&lt;/strong&gt; Reduces the alpha of a particle until it becomes completely transparent towards the end of its lifespan.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shrink:&lt;/strong&gt; Reduces the size of a particle until it disappears completely towards the end of its lifespan.
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;To create a custom particle affector, implement the &lt;strong&gt;&lt;em&gt;IParticleAffector&lt;/em&gt;&lt;/strong&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleAffector &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IParticleAffector&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Affect&lt;/em&gt;&lt;/strong&gt; method will allow&amp;nbsp;the affector to access the properties of the parameter particle.&lt;/p&gt;
&lt;p&gt;An affector can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddAffector(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleAffector&lt;/span&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Mon, 19 Dec 2011 04:26:09 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111219042609A</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=24</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;span style="font-family:Segoe UI"&gt;&lt;span style="color:#30332d"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Using Tranquillity is easy; most tasks can be achieved in a couple of lines of code. The demo project included with the source showcases more advanced scenarios including AppHub&amp;rsquo;s fire, smoke and explosion samples.&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity&amp;rsquo;s
&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;. &lt;/em&gt;&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;&lt;/em&gt; is a
&lt;em&gt;&lt;strong&gt;DrawableGameComponent&lt;/strong&gt;&lt;/em&gt; that can simply be added to your Game&amp;rsquo;s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;ParticleManager&lt;/span&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ParticleManager&lt;/span&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem: &lt;/strong&gt;All particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed to/from this system on the fly,
 it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various affectors.
&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the
&lt;em&gt;&lt;strong&gt;LoadContent&lt;/strong&gt;&lt;/em&gt; method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;DynamicParticleSystem &lt;/span&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;DynamicParticleSystem&lt;/span&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;Texture2D &lt;/span&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Texture2D&lt;/span&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;[1] { &lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Optionally, a custom &lt;em&gt;BlendState&lt;/em&gt; can be specified:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem, &lt;span style="color:#2b91af"&gt;BlendState&lt;/span&gt;.Additive);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;&lt;strong&gt;RandomHelper&lt;/strong&gt;&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Color(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.NormalizedVector3(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Float(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;TimeSpan&lt;/span&gt;.FromSeconds(&lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.IntBetween(1, 3))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;h2&gt;Particle Emitters&lt;/h2&gt;
&lt;p&gt;Emission of particles can be automated using a particle emitter. To create a custom particle emitter, implement the
&lt;em&gt;&lt;strong&gt;IParticleEmitter&lt;/strong&gt;&lt;/em&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleEmitter &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IParticleEmitter &lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/strong&gt; method will allow the emitter to automatically emit particles in the particle system it is added to. The
&lt;strong&gt;&lt;em&gt;Emit &lt;/em&gt;&lt;/strong&gt;method can be used to emit particles manually.&lt;/p&gt;
&lt;p&gt;An emitter can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddEmitter(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleEmitter&lt;/span&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Affectors&lt;/h2&gt;
&lt;p&gt;A particle affector can affect one or more properties of all particles in a system. There are three default affectors in Tranquillity that use the particle&amp;rsquo;s age as the time factor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Decelerate:&lt;/strong&gt; Slows a particle down to a complete stop towards the end of its lifespan. This affectors affects only particles that have a velocity.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fadeout:&lt;/strong&gt; Reduces the alpha of a particle until it becomes completely transparent towards the end of its lifespan.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shrink:&lt;/strong&gt; Reduces the size of a particle until it disappears completely towards the end of its lifespan.
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;To create a custom particle affectors, implement the &lt;strong&gt;&lt;em&gt;IParticleAffector&lt;/em&gt;&lt;/strong&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleAffector &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IParticleAffector&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Affect&lt;/em&gt;&lt;/strong&gt; method will the affector to access the properties of the parameter particle.&lt;/p&gt;
&lt;p&gt;An affector can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddAffector(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleAffector&lt;/span&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Mon, 19 Dec 2011 04:25:29 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111219042529A</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=23</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;span style="font-family:Segoe UI"&gt;&lt;span style="color:#30332d"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Using Tranquillity is easy; most tasks can be achieved in a couple of lines of code. The demo project included with the source showcases more advanced scenarios including AppHub&amp;rsquo;s fire, smoke and explosion samples.&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity&amp;rsquo;s
&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;. &lt;/em&gt;&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;&lt;/em&gt; is a
&lt;em&gt;&lt;strong&gt;DrawableGameComponent&lt;/strong&gt;&lt;/em&gt; that can simply be added to your Game&amp;rsquo;s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;ParticleManager&lt;/span&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;ParticleManager&lt;/span&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;nbsp;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem: &lt;/strong&gt;All particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed to/from this system on the fly,
 it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various affectors.
&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the
&lt;em&gt;&lt;strong&gt;LoadContent&lt;/strong&gt;&lt;/em&gt; method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;DynamicParticleSystem &lt;/span&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;DynamicParticleSystem&lt;/span&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span style="color:#2b91af"&gt;Texture2D &lt;/span&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Texture2D&lt;/span&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;[1] { &lt;span style="color:#2b91af"&gt;Color&lt;/span&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Optionally, a custom &lt;em&gt;BlendState&lt;/em&gt; can be specified:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem, &lt;span style="color:#2b91af"&gt;BlendState&lt;/span&gt;.Additive);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;&lt;strong&gt;RandomHelper&lt;/strong&gt;&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Color(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.NormalizedVector3(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.Float(),&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;span style="color:#2b91af"&gt;TimeSpan&lt;/span&gt;.FromSeconds(&lt;span style="color:#2b91af"&gt;RandomHelper&lt;/span&gt;.IntBetween(1, 3))&lt;br&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; );&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;h2&gt;Particle Emitters&lt;/h2&gt;
&lt;p&gt;Emission of particles can be automated using a particle emitter. To create a custom particle emitter, implement the
&lt;em&gt;&lt;strong&gt;IParticleEmitter&lt;/strong&gt;&lt;/em&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleEmitter &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IParticleEmitter &lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/strong&gt; method will allow the emitter to automatically emit particles in the particle system it is added to. The
&lt;strong&gt;&lt;em&gt;Emit &lt;/em&gt;&lt;/strong&gt;method can be used to emit particles manually.&lt;/p&gt;
&lt;p&gt;An emitter can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddEmitter(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleEmitter&lt;/span&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Affectors&lt;/h2&gt;
&lt;p&gt;A particle affector can affect one or more properties of all particles in a system. There are three default affectors in Tranquillity that use the particle&amp;rsquo;s age as the time factor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Decelerate:&lt;/strong&gt; Slows a particle down to a complete stop towards the end of its lifespan. This affectors affects only particles that have a velocity.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fadeout:&lt;/strong&gt; Reduces the alpha of a particle until it becomes completely transparent towards the end of its lifespan.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shrink:&lt;/strong&gt; Reduces the size of a particle until it disappears completely invisible towards the end of its lifespan.
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;To create a custom particle affectors, implement the &lt;strong&gt;&lt;em&gt;IParticleAffector&lt;/em&gt;&lt;/strong&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleAffector &lt;/span&gt;: &lt;span style="color:#2b91af"&gt;IParticleAffector&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Affect&lt;/em&gt;&lt;/strong&gt; method will the affector to access the properties of the parameter particle.&lt;/p&gt;
&lt;p&gt;An affector can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddAffector(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;span style="color:#2b91af"&gt;CustomParticleAffector&lt;/span&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Mon, 19 Dec 2011 04:24:46 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111219042446A</guid></item><item><title>Updated Wiki: Home</title><link>http://tranquillity.codeplex.com/wikipage?version=16</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;strong&gt;Project Description&lt;/strong&gt; &lt;br&gt;
Tranquillity is a compact, easy to use and highly extendible &lt;strong&gt;3D &lt;/strong&gt;
particle system for Windows Phone 7 XNA projects.&lt;/p&gt;
&lt;p&gt;&lt;img src="http://download.codeplex.com/Download?ProjectName=tranquillity&amp;DownloadId=315394" border="0" alt="Tranquillity Demos" width="731" height="682" style="padding-left:0px; padding-right:0px; display:inline; margin-left:0px; vertical-align:top; margin-right:0px; padding-top:0px; border-width:0px"&gt;&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;For installation/integration, check out the &lt;a href="http://tranquillity.codeplex.com/wikipage?title=Getting%20Started"&gt;
Getting Started Guide&lt;/a&gt;. To learn how to use Tranquillity check out &lt;a href="http://tranquillity.codeplex.com/wikipage?title=Using%20Tranquillity"&gt;
Using Tranquillity&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The project is currently in beta; be sure to leave your comments and report bugs. You can get in touch with me on twitter (&lt;a href="http://www.twitter.com/ayakobovich"&gt;@ayakobovich&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;If you end up using &lt;span id="ctl00_ctl00_MasterContent_ProjectTitleControl1_TitleLabel"&gt;
this project in your game, please credit by mentioning that your project particles are powered by Tranquillity.&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Mon, 19 Dec 2011 04:20:13 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20111219042013A</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=22</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#30332d" style="font-size:19.2pt"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Using Tranquillity is easy; most tasks can be achieved in a couple of lines of code. The demo project included with the source showcases more advanced scenarios including AppHub’s fire, smoke and explosion samples.&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity’s &lt;em&gt;
&lt;strong&gt;ParticleManager&lt;/strong&gt;. &lt;/em&gt;&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;&lt;/em&gt; is a
&lt;em&gt;&lt;strong&gt;DrawableGameComponent&lt;/strong&gt;&lt;/em&gt; that can simply be added to your Game’s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem: &lt;/strong&gt;All particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed to/from this system on the fly,
 it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various affectors.
&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the
&lt;em&gt;&lt;strong&gt;LoadContent&lt;/strong&gt;&lt;/em&gt; method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;DynamicParticleSystem &lt;/font&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;DynamicParticleSystem&lt;/font&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;Texture2D &lt;/font&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Texture2D&lt;/font&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;font color="#2b91af"&gt;Color&lt;/font&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Color&lt;/font&gt;[1] { &lt;font color="#2b91af"&gt;Color&lt;/font&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Optionally, a custom &lt;em&gt;BlendState&lt;/em&gt; can be specified:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem, &lt;font color="#2b91af"&gt;BlendState&lt;/font&gt;.Additive);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;&lt;strong&gt;RandomHelper&lt;/strong&gt;&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Color(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.NormalizedVector3(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Float(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;TimeSpan&lt;/font&gt;.FromSeconds(&lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.IntBetween(1, 3))&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; );&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;h2&gt;Particle Emitters&lt;/h2&gt;
&lt;p&gt;Emission of particles can be automated using a particle emitter. To create a custom particle emitter, implement the
&lt;em&gt;&lt;strong&gt;IParticleEmitter&lt;/strong&gt;&lt;/em&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleEmitter &lt;/font&gt;: &lt;font color="#2b91af"&gt;IParticleEmitter &lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/strong&gt; method will allow the emitter to automatically emit particles in the particle system it is added to. The
&lt;strong&gt;&lt;em&gt;Emit &lt;/em&gt;&lt;/strong&gt;method can be used to emit particles manually.&lt;/p&gt;
&lt;p&gt;An emitter can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddEmitter(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleEmitter&lt;/font&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Affectors&lt;/h2&gt;
&lt;p&gt;A particle affector can affect one or more properties of all particles in a system. There are three default affectors in Tranquillity that use the particle’s age as the time factor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Decelerate:&lt;/strong&gt; Slows a particle down to a complete stop towards the end of its lifespan. This affectors affects only particle that have a velocity.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fadeout:&lt;/strong&gt; Reduces the alpha of a particle until it becomes completely transparent towards the end of its lifespan.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shrink:&lt;/strong&gt; Reduces the size of a particle until it disappears completely invisible towards the end of its lifespan.
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;To create a custom particle affectors, implement the &lt;strong&gt;&lt;em&gt;IParticleAffector&lt;/em&gt;&lt;/strong&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleAffector &lt;/font&gt;: &lt;font color="#2b91af"&gt;IParticleAffector&lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Affect&lt;/em&gt;&lt;/strong&gt; method will the affector to access the properties of the parameter particle.&lt;/p&gt;
&lt;p&gt;An affector can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddAffector(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleAffector&lt;/font&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Sat, 17 Dec 2011 05:52:21 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111217055221A</guid></item><item><title>Updated Wiki: Documentation</title><link>http://tranquillity.codeplex.com/documentation?version=11</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;a href="http://tranquillity.codeplex.com/wikipage?title=Getting%20Started"&gt;Getting Started&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://tranquillity.codeplex.com/wikipage?title=Using%20Tranquillity"&gt;Using Tranquillity&lt;/a&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Sat, 17 Dec 2011 05:51:20 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20111217055120A</guid></item><item><title>Updated Wiki: Getting Started</title><link>http://tranquillity.codeplex.com/wikipage?title=Getting Started&amp;version=2</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;Getting Started&lt;/h1&gt;
&lt;p&gt;You have two easy options to integrate Tranquillity into your project/engine.&lt;/p&gt;
&lt;h2&gt;Reference the DLL&lt;/h2&gt;
&lt;p&gt;If you downloaded the binary release, simply copy it (and optionally the associated .xml documentation file) to a convenient location within your solution project. If you don’t already have it, it would be useful to create a “Dependencies” folder where you
 can keep all of your binary dependencies. &lt;br&gt;
&lt;br&gt;
Once you copied the library file, right-click on your project and select &lt;em&gt;&lt;strong&gt;Add Reference&lt;/strong&gt;&lt;/em&gt;.
&lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257508"&gt;
&lt;br&gt;
&lt;br&gt;
Navigate to the folder where you placed the library file, select it and press Ok.&lt;/p&gt;
&lt;h2&gt;Build from source&lt;/h2&gt;
&lt;p&gt;To work with the source code, download the Tranquillity repository in the solution directory.
&lt;br&gt;
To include the project in your solution, right-click on the solution, hover over &lt;em&gt;
&lt;strong&gt;Add&lt;/strong&gt;&lt;/em&gt; and select &lt;em&gt;&lt;strong&gt;Existing Project&lt;/strong&gt;&lt;/em&gt;. &lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257514"&gt;
&lt;br&gt;
&lt;br&gt;
Navigate to the Tranquillity folder in your solution folder, select &lt;em&gt;&lt;strong&gt;Tranquillity.csproj&lt;/strong&gt;&lt;/em&gt; and press
&lt;em&gt;&lt;strong&gt;Ok&lt;/strong&gt;&lt;/em&gt;. &lt;br&gt;
Once the Tranquillity project is included in your solution, right-click your game/engine project’s
&lt;em&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;/em&gt; and select &lt;em&gt;&lt;strong&gt;Add Reference&lt;/strong&gt;&lt;/em&gt;.
&lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257515"&gt;
&lt;br&gt;
&lt;br&gt;
Select &lt;em&gt;&lt;strong&gt;Tranquillity&lt;/strong&gt;&lt;/em&gt; under the &lt;em&gt;&lt;strong&gt;Projects&lt;/strong&gt;&lt;/em&gt; tab and press
&lt;em&gt;&lt;strong&gt;Ok&lt;/strong&gt;&lt;/em&gt;. &lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257517"&gt;&lt;/p&gt;
&lt;p&gt;You’re done! Check out &lt;a href="http://tranquillity.codeplex.com/wikipage?title=Using%20Tranquillity"&gt;
Using Tranquillity&lt;/a&gt; to learning how to use it.&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Sat, 17 Dec 2011 05:50:00 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Getting Started 20111217055000A</guid></item><item><title>Updated Wiki: Getting Started</title><link>http://tranquillity.codeplex.com/wikipage?title=Getting Started&amp;version=1</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;Getting Started&lt;/h1&gt;
&lt;p&gt;You have two easy options to integrate Tranquillity into your project/engine.&lt;/p&gt;
&lt;h2&gt;Reference the DLL&lt;/h2&gt;
&lt;p&gt;If you downloaded the binary release, simply copy it (and optionally the associated .xml documentation file) to a convenient location within your solution project. If you don’t already have it, it would be useful to create a “Dependencies” folder where you
 can keep all of your binary dependencies. &lt;br&gt;
&lt;br&gt;
Once you copied the library file, right-click on your project and select &lt;em&gt;&lt;strong&gt;Add Reference&lt;/strong&gt;&lt;/em&gt;.
&lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257508"&gt;
&lt;br&gt;
&lt;br&gt;
Navigate to the folder where you placed the library file, select it and press Ok.&lt;/p&gt;
&lt;h2&gt;Build from source&lt;/h2&gt;
&lt;p&gt;To work with the source code, download the Tranquillity repository in the solution directory.
&lt;br&gt;
To include the project in your solution, right-click on the solution, hover over &lt;em&gt;
&lt;strong&gt;Add&lt;/strong&gt;&lt;/em&gt; and select &lt;em&gt;&lt;strong&gt;Existing Project&lt;/strong&gt;&lt;/em&gt;. &lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257514"&gt;
&lt;br&gt;
&lt;br&gt;
Navigate to the Tranquillity folder in your solution folder, select &lt;em&gt;&lt;strong&gt;Tranquillity.csproj&lt;/strong&gt;&lt;/em&gt; and press
&lt;em&gt;&lt;strong&gt;Ok&lt;/strong&gt;&lt;/em&gt;. &lt;br&gt;
Once the Tranquillity project is included in your solution, right-click your game/engine project’s
&lt;em&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;/em&gt; and select &lt;em&gt;&lt;strong&gt;Add Reference&lt;/strong&gt;&lt;/em&gt;.
&lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257515"&gt;
&lt;br&gt;
&lt;br&gt;
Select &lt;em&gt;&lt;strong&gt;Tranquillity&lt;/strong&gt;&lt;/em&gt; under the &lt;em&gt;&lt;strong&gt;Projects&lt;/strong&gt;&lt;/em&gt; tab and press
&lt;em&gt;&lt;strong&gt;Ok&lt;/strong&gt;&lt;/em&gt;. &lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257517"&gt;&lt;/p&gt;
&lt;p&gt;You’re done! Check out &lt;a href="http://tranquillity.codeplex.com/wikipage?title=Using%20Tranquillity"&gt;
Using Tranquillity&lt;/a&gt; to get started with the code.&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Sat, 17 Dec 2011 05:49:13 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Getting Started 20111217054913A</guid></item><item><title>Updated Wiki: Documentation</title><link>http://tranquillity.codeplex.com/documentation?version=10</link><description>&lt;div class="wikidoc"&gt;
&lt;h1&gt;Getting Started&lt;/h1&gt;
&lt;p&gt;You have two easy options to integrate Tranquillity into your project/engine.&lt;/p&gt;
&lt;h2&gt;Reference the DLL&lt;/h2&gt;
&lt;p&gt;If you downloaded the binary release, simply copy it (and optionally the associated .xml documentation file) to a convenient location within your solution project. If you don’t already have it, it would be useful to create a “Dependencies” folder where you
 can keep all of your binary dependencies. &lt;br&gt;
&lt;br&gt;
Once you copied the library file, right-click on your project and select &lt;em&gt;&lt;strong&gt;Add Reference&lt;/strong&gt;&lt;/em&gt;.
&lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257508"&gt;
&lt;br&gt;
&lt;br&gt;
Navigate to the folder where you placed the library file, select it and press Ok.&lt;/p&gt;
&lt;h2&gt;Build from source&lt;/h2&gt;
&lt;p&gt;To work with the source code, download the Tranquillity repository in the solution directory.
&lt;br&gt;
To include the project in your solution, right-click on the solution, hover over &lt;em&gt;
&lt;strong&gt;Add&lt;/strong&gt;&lt;/em&gt; and select &lt;em&gt;&lt;strong&gt;Existing Project&lt;/strong&gt;&lt;/em&gt;. &lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257514"&gt;
&lt;br&gt;
&lt;br&gt;
Navigate to the Tranquillity folder in your solution folder, select &lt;em&gt;&lt;strong&gt;Tranquillity.csproj&lt;/strong&gt;&lt;/em&gt; and press
&lt;em&gt;&lt;strong&gt;Ok&lt;/strong&gt;&lt;/em&gt;. &lt;br&gt;
Once the Tranquillity project is included in your solution, right-click your game/engine project’s
&lt;em&gt;&lt;strong&gt;Reference&lt;/strong&gt;&lt;/em&gt; and select &lt;em&gt;&lt;strong&gt;Add Reference&lt;/strong&gt;&lt;/em&gt;.
&lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257515"&gt;
&lt;br&gt;
&lt;br&gt;
Select &lt;em&gt;&lt;strong&gt;Tranquillity&lt;/strong&gt;&lt;/em&gt; under the &lt;em&gt;&lt;strong&gt;Projects&lt;/strong&gt;&lt;/em&gt; tab and press
&lt;em&gt;&lt;strong&gt;Ok&lt;/strong&gt;&lt;/em&gt;. &lt;br&gt;
&lt;br&gt;
&lt;img alt="" src="http://www.codeplex.com/download?ProjectName=tranquillity&amp;DownloadId=257517"&gt;&lt;/p&gt;
&lt;p&gt;You’re done! Check out &lt;a href="http://tranquillity.codeplex.com/wikipage?title=Using%20Tranquillity"&gt;
Using Tranquillity&lt;/a&gt; to get started with the code.&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Sat, 17 Dec 2011 05:47:19 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Documentation 20111217054719A</guid></item><item><title>Updated Wiki: Home</title><link>http://tranquillity.codeplex.com/wikipage?version=15</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;strong&gt;Project Description&lt;/strong&gt; &lt;br&gt;
Tranquillity is a compact, easy to use and highly extendible &lt;strong&gt;3D &lt;/strong&gt;
particle system for Windows Phone 7 XNA projects.&lt;/p&gt;
&lt;p&gt;&lt;img border="0" alt="Tranquillity Demos" src="http://download.codeplex.com/Download?ProjectName=tranquillity&amp;DownloadId=315394" width="731" height="682" style="border-right-width:0px; padding-left:0px; padding-right:0px; display:inline; border-top-width:0px; border-bottom-width:0px; margin-left:0px; vertical-align:top; border-left-width:0px; margin-right:0px; padding-top:0px"&gt;&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;For installation/integration, check out the &lt;a href="http://tranquillity.codeplex.com/documentation"&gt;
Getting Started Guide&lt;/a&gt;. To learn how to use Tranquillity check out &lt;a href="http://tranquillity.codeplex.com/wikipage?title=Using%20Tranquillity"&gt;
Using Tranquillity&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The project is currently in beta; be sure to leave your comments and report bugs. You can get in touch with me on twitter (&lt;a href="http://www.twitter.com/ayakobovich"&gt;@ayakobovich&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;If you end up using &lt;span id="ctl00_ctl00_MasterContent_ProjectTitleControl1_TitleLabel"&gt;
this project in your game, please credit by mentioning that your project particles are powered by Tranquillity.&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Sat, 17 Dec 2011 05:45:50 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20111217054550A</guid></item><item><title>Updated Wiki: Home</title><link>http://tranquillity.codeplex.com/wikipage?version=14</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;strong&gt;Project Description&lt;/strong&gt; &lt;br&gt;
Tranquillity is a compact, easy to use and highly extendible &lt;strong&gt;3D &lt;/strong&gt;
particle system for Windows Phone 7 XNA projects.&lt;/p&gt;
&lt;p&gt;&lt;img border="0" alt="Tranquillity Demos" src="http://download.codeplex.com/Download?ProjectName=tranquillity&amp;DownloadId=315394" width="731" height="682" style="border-right-width:0px; padding-left:0px; padding-right:0px; display:inline; border-top-width:0px; border-bottom-width:0px; margin-left:0px; vertical-align:top; border-left-width:0px; margin-right:0px; padding-top:0px"&gt;&lt;/p&gt;
&lt;p&gt;&amp;#160;&lt;/p&gt;
&lt;p&gt;For installation/integration, check out the &lt;a href="http://tranquillity.codeplex.com/documentation"&gt;
Getting Started Guide&lt;/a&gt;. To learn how to use Tranquillity check out &lt;a href="http://http://tranquillity.codeplex.com/wikipage?title=Using%20Tranquillity"&gt;
Using Tranquillity&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The project is currently in beta; be sure to leave your comments and report bugs. You can get in touch with me on twitter (&lt;a href="http://www.twitter.com/ayakobovich"&gt;@ayakobovich&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;&lt;em&gt;If you end up using &lt;span id="ctl00_ctl00_MasterContent_ProjectTitleControl1_TitleLabel"&gt;
this project in your game, please credit by mentioning that your project particles are powered by Tranquillity.&lt;/span&gt;&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Sat, 17 Dec 2011 05:45:19 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Home 20111217054519A</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=21</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#30332d" style="font-size:19.2pt"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Using Tranquillity is easy; most tasks can be achieved in a couple of lines of code. The demo project included with the source showcases more advanced scenarios including AppHub’s fire, smoke and explosion samples.&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity’s &lt;em&gt;
&lt;strong&gt;ParticleManager&lt;/strong&gt;. &lt;/em&gt;&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;&lt;/em&gt; is a
&lt;em&gt;&lt;strong&gt;DrawableGameComponent&lt;/strong&gt;&lt;/em&gt; that can simply be added to your Game’s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem: &lt;/strong&gt;All particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed to/from this system on the fly,
 it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various affectors.
&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the
&lt;em&gt;&lt;strong&gt;LoadContent&lt;/strong&gt;&lt;/em&gt; method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;DynamicParticleSystem &lt;/font&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;DynamicParticleSystem&lt;/font&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;Texture2D &lt;/font&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Texture2D&lt;/font&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;font color="#2b91af"&gt;Color&lt;/font&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Color&lt;/font&gt;[1] { &lt;font color="#2b91af"&gt;Color&lt;/font&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Optionally, a custom &lt;em&gt;BlendState&lt;/em&gt; can be specified:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem, &lt;font color="#2b91af"&gt;BlendState&lt;/font&gt;.Additive);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;&lt;strong&gt;RandomHelper&lt;/strong&gt;&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Color(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.NormalizedVector3(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Float(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;TimeSpan&lt;/font&gt;.FromSeconds(&lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.IntBetween(1, 3))&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; );&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;h2&gt;Particle Emitters&lt;/h2&gt;
&lt;p&gt;Emission of particles can be automated using a particle emitter. To create a custom particle emitter, implement the
&lt;em&gt;&lt;strong&gt;IParticleEmitter&lt;/strong&gt;&lt;/em&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleEmitter &lt;/font&gt;: &lt;font color="#2b91af"&gt;IParticleEmitter &lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/strong&gt; method will allow the emitter to automatically emit particles in the particle system it is added to. The
&lt;strong&gt;&lt;em&gt;Emit &lt;/em&gt;&lt;/strong&gt;method can be used to emit particles manually.&lt;/p&gt;
&lt;p&gt;An emitter can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddEmitter(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleEmitter&lt;/font&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Affectors&lt;/h2&gt;
&lt;p&gt;A particle affector can affect one or more properties of all particles in a system. There are three default affectors in Tranquillity that use the particle’s age as the time factor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Decelerate:&lt;/strong&gt; Slows a particle down to a complete stop towards the end of its lifespan. This affectors affects only particle that have a velocity.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fadeout:&lt;/strong&gt; Reduces the alpha of a particle until it becomes completely transparent towards the end of its lifespan.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shrink:&lt;/strong&gt; Reduces the size of a particle until it disappears completely invisible towards the end of its lifespan.
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;To create a custom particle affectors, implement the &lt;strong&gt;&lt;em&gt;IParticleAffector&lt;/em&gt;&lt;/strong&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleAffector &lt;/font&gt;: &lt;font color="#2b91af"&gt;IParticleAffector&lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Affect&lt;/em&gt;&lt;/strong&gt; method will the affector to access the properties of the parameter particle.&lt;/p&gt;
&lt;p&gt;An affector can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddAffector(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleAffector&lt;/font&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Sat, 17 Dec 2011 05:43:31 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111217054331A</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=20</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#30332d" style="font-size:19.2pt"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;Using Tranquillity is easy; most tasks can be achieved in a couple of lines of code. The demo project included with the source showcases more advanced scenarios including AppHub’s fire, smoke and explosion samples.&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity’s &lt;em&gt;
&lt;strong&gt;ParticleManager&lt;/strong&gt;. &lt;/em&gt;&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;&lt;/em&gt; is a
&lt;em&gt;&lt;strong&gt;DrawableGameComponent&lt;/strong&gt;&lt;/em&gt; that can simply be added to your Game’s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem: &lt;/strong&gt;All particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed to/from this system on the fly,
 it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various affectors.
&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the
&lt;em&gt;&lt;strong&gt;LoadContent&lt;/strong&gt;&lt;/em&gt; method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;DynamicParticleSystem &lt;/font&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;DynamicParticleSystem&lt;/font&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;Texture2D &lt;/font&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Texture2D&lt;/font&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;font color="#2b91af"&gt;Color&lt;/font&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Color&lt;/font&gt;[1] { &lt;font color="#2b91af"&gt;Color&lt;/font&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Optionally, a custom &lt;em&gt;BlendState&lt;/em&gt; can be specified:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem, &lt;font color="#2b91af"&gt;BlendState&lt;/font&gt;.Additive);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;&lt;strong&gt;RandomHelper&lt;/strong&gt;&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Color(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.NormalizedVector3(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Float(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;TimeSpan&lt;/font&gt;.FromSeconds(&lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.IntBetween(1, 3))&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; );&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;h2&gt;Particle Emitters&lt;/h2&gt;
&lt;p&gt;Emission of particles can be automated using a particle emitter. To create a custom particle emitter, implement the
&lt;em&gt;&lt;strong&gt;IParticleEmitter&lt;/strong&gt;&lt;/em&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleEmitter &lt;/font&gt;: &lt;font color="#2b91af"&gt;IParticleEmitter &lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/strong&gt; method will allow the emitter to automatically emit particles in the particle system it is added to. The
&lt;strong&gt;&lt;em&gt;Emit &lt;/em&gt;&lt;/strong&gt;method can be used to emit particles manually.&lt;/p&gt;
&lt;p&gt;An emitter can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddEmitter(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleEmitter&lt;/font&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Affectors&lt;/h2&gt;
&lt;p&gt;A particle affector can affect one or more properties of all particles in a system. There are three default affectors in Tranquillity that use the particle’s age as the time factor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Decelerate:&lt;/strong&gt; Slows a particle down to a complete stop towards the end of its lifespan. This affectors affects only particle that have a velocity.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fadeout:&lt;/strong&gt; Reduces the alpha of a particle until it becomes completely transparent towards the end of its lifespan.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shrink:&lt;/strong&gt; Reduces the size of a particle until it disappears completely invisible towards the end of its lifespan.
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;To create a custom particle affectors, implement the &lt;strong&gt;&lt;em&gt;IParticleAffector&lt;/em&gt;&lt;/strong&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleAffector &lt;/font&gt;: &lt;font color="#2b91af"&gt;IParticleAffector&lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Affect&lt;/em&gt;&lt;/strong&gt; method will the affector to access the properties of the parameter particle.&lt;/p&gt;
&lt;p&gt;An affector can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddAffector(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleAffector&lt;/font&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Sat, 17 Dec 2011 05:42:49 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111217054249A</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=19</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#30332d" style="font-size:19.2pt"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity’s &lt;em&gt;
&lt;strong&gt;ParticleManager&lt;/strong&gt;. &lt;/em&gt;&lt;em&gt;&lt;strong&gt;ParticleManager&lt;/strong&gt;&lt;/em&gt; is a
&lt;em&gt;&lt;strong&gt;DrawableGameComponent&lt;/strong&gt;&lt;/em&gt; that can simply be added to your Game’s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem: &lt;/strong&gt;All particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed to/from this system on the fly,
 it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various affectors.
&lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the
&lt;em&gt;&lt;strong&gt;LoadContent&lt;/strong&gt;&lt;/em&gt; method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;DynamicParticleSystem &lt;/font&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;DynamicParticleSystem&lt;/font&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;Texture2D &lt;/font&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Texture2D&lt;/font&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;font color="#2b91af"&gt;Color&lt;/font&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Color&lt;/font&gt;[1] { &lt;font color="#2b91af"&gt;Color&lt;/font&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Optionally, a custom &lt;em&gt;BlendState&lt;/em&gt; can be specified:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem, &lt;font color="#2b91af"&gt;BlendState&lt;/font&gt;.Additive);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;&lt;strong&gt;RandomHelper&lt;/strong&gt;&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Color(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.NormalizedVector3(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Float(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;TimeSpan&lt;/font&gt;.FromSeconds(&lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.IntBetween(1, 3))&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; );&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;h2&gt;Particle Emitters&lt;/h2&gt;
&lt;p&gt;Emission of particles can be automated using a particle emitter. To create a custom particle emitter, implement the
&lt;em&gt;&lt;strong&gt;IParticleEmitter&lt;/strong&gt;&lt;/em&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleEmitter &lt;/font&gt;: &lt;font color="#2b91af"&gt;IParticleEmitter &lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Update&lt;/em&gt;&lt;/strong&gt; method will allow the emitter to automatically emit particles in the particle system it is added to. The
&lt;strong&gt;&lt;em&gt;Emit &lt;/em&gt;&lt;/strong&gt;method can be used to emit particles manually.&lt;/p&gt;
&lt;p&gt;An emitter can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddEmitter(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleEmitter&lt;/font&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Affectors&lt;/h2&gt;
&lt;p&gt;A particle affector can affect one or more properties of all particles in a system. There are three default affectors in Tranquillity that use the particle’s age as the time factor:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Decelerate:&lt;/strong&gt; Slows a particle down to a complete stop towards the end of its lifespan. This affectors affects only particle that have a velocity.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Fadeout:&lt;/strong&gt; Reduces the alpha of a particle until it becomes completely transparent towards the end of its lifespan.
&lt;/li&gt;&lt;li&gt;&lt;strong&gt;Shrink:&lt;/strong&gt; Reduces the size of a particle until it disappears completely invisible towards the end of its lifespan.
&lt;/li&gt;&lt;/ul&gt;
&lt;p&gt;To create a custom particle affectors, implement the &lt;strong&gt;&lt;em&gt;IParticleAffector&lt;/em&gt;&lt;/strong&gt; interface:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleAffector &lt;/font&gt;: &lt;font color="#2b91af"&gt;IParticleAffector&lt;/font&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Implementing the &lt;strong&gt;&lt;em&gt;Affect&lt;/em&gt;&lt;/strong&gt; method will the affector to access the properties of the parameter particle.&lt;/p&gt;
&lt;p&gt;An affector can be added to any dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddAffector(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;CustomParticleAffector&lt;/font&gt;());&lt;/pre&gt;
&lt;/div&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Sat, 17 Dec 2011 05:39:07 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111217053907A</guid></item><item><title>Updated Wiki: Temporary Post Used For Theme Detection (cc5e704c-54e0-4a13-91e8-3d78cfb4d6a6 - 3bfe001a-32de-4114-a6b4-4005b770f6d7)</title><link>http://tranquillity.codeplex.com/wikipage?title=Temporary Post Used For Theme Detection (cc5e704c-54e0-4a13-91e8-3d78cfb4d6a6 - 3bfe001a-32de-4114-a6b4-4005b770f6d7)&amp;version=1</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;This is a temporary post that was not deleted. Please delete this manually. (208b3e3e-ca19-4ff1-81ed-9a42e84e0a49 - 3bfe001a-32de-4114-a6b4-4005b770f6d7)&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Fri, 16 Dec 2011 22:00:26 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Temporary Post Used For Theme Detection (cc5e704c-54e0-4a13-91e8-3d78cfb4d6a6 - 3bfe001a-32de-4114-a6b4-4005b770f6d7) 20111216100026P</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=18</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#30332d" style="font-size:19.2pt"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity’s &lt;em&gt;
ParticleManager.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;ParticleManager&lt;/em&gt; is a &lt;em&gt;DrawableGameComponent&lt;/em&gt; that can simply be added to your Game’s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem:&lt;/strong&gt;&lt;em&gt; &lt;/em&gt;As the name implies, all particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed
 to/from this system on the fly, it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various
&lt;em&gt;affectors&lt;/em&gt;. &lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the LoadContent() method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;DynamicParticleSystem &lt;/font&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;DynamicParticleSystem&lt;/font&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;Texture2D &lt;/font&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Texture2D&lt;/font&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;font color="#2b91af"&gt;Color&lt;/font&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Color&lt;/font&gt;[1] { &lt;font color="#2b91af"&gt;Color&lt;/font&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Optionally, a custom &lt;em&gt;BlendState&lt;/em&gt; can be specified:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(particleSystem, &lt;font color="#2b91af"&gt;BlendState&lt;/font&gt;.Additive);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;RandomHelper&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Color(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.NormalizedVector3(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Float(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;TimeSpan&lt;/font&gt;.FromSeconds(&lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.IntBetween(1, 3))&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; );&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Fri, 16 Dec 2011 06:36:00 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111216063600A</guid></item><item><title>Updated Wiki: Using Tranquillity</title><link>http://tranquillity.codeplex.com/wikipage?title=Using Tranquillity&amp;version=17</link><description>&lt;div class="wikidoc"&gt;
&lt;p&gt;&lt;font face="Segoe UI"&gt;&lt;font color="#30332d" style="font-size:19.2pt"&gt;&lt;strong&gt;Using Tranquillity&lt;/strong&gt;&lt;/font&gt;&lt;/font&gt;&lt;/p&gt;
&lt;p&gt;All particle properties, behavior and drawing are managed by Tranquillity’s &lt;em&gt;
ParticleManager.&lt;/em&gt;&lt;/p&gt;
&lt;h2&gt;Particle Manager&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;ParticleManager&lt;/em&gt; is a &lt;em&gt;DrawableGameComponent&lt;/em&gt; that can simply be added to your Game’s component collection.&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt; particleManager;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   3:  &lt;/span&gt;...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   4:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   5:  &lt;/span&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; Game1()&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   6:  &lt;/span&gt;{&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   7:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   8:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   9:  &lt;/span&gt;    particleManager = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;ParticleManager&lt;/font&gt;(&lt;span class="kwrd"&gt;this&lt;/span&gt;);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  10:  &lt;/span&gt;    Components.Add(particleManager);&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  11:  &lt;/span&gt;&amp;#160;&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;  12:  &lt;/span&gt;    ...&lt;/pre&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;  13:  &lt;/span&gt;}&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particle Systems&lt;/h2&gt;
&lt;p&gt;A &lt;em&gt;ParticleSystem&lt;/em&gt; defines a group of particles that share a texture representation. There are two base particle system types in Tranquillity:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;StaticParticleSystem:&lt;/strong&gt;&lt;em&gt; &lt;/em&gt;As the name implies, all particles in this system have static properties. Once a particle is added to this system type, it cannot move, grow, change color, etc. Although particles can be added and removed
 to/from this system on the fly, it is ideal for static allocation of particles. &lt;/li&gt;&lt;li&gt;&lt;strong&gt;DynamicParticleSystem:&lt;/strong&gt; A dynamic particle system contains particles that can have a velocity, rotation, lifespan and can be affected by various
&lt;em&gt;affectors&lt;/em&gt;. &lt;/li&gt;&lt;/ul&gt;
&lt;h3&gt;&lt;em&gt;Creating and registering a particle system&lt;/em&gt;&lt;/h3&gt;
&lt;p&gt;To create a system, specify the maximum capacity and the texture to be used for this system in the LoadContent() method. For example, create a dynamic particle system:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;DynamicParticleSystem &lt;/font&gt;particleSystem = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;DynamicParticleSystem&lt;/font&gt;(1000, texture);&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;The texture can be either an image or a 1x1 pixel, which can be generated on the fly:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;&lt;font color="#2b91af"&gt;Texture2D &lt;/font&gt;pixel = &lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Texture2D&lt;/font&gt;(GraphicsDevice, 1, 1);&lt;/pre&gt;
&lt;pre&gt;&lt;span class="lnum"&gt;   2:  &lt;/span&gt;pixel.SetData&amp;lt;&lt;font color="#2b91af"&gt;Color&lt;/font&gt;&amp;gt;(&lt;span class="kwrd"&gt;new&lt;/span&gt; &lt;font color="#2b91af"&gt;Color&lt;/font&gt;[1] { &lt;font color="#2b91af"&gt;Color&lt;/font&gt;.White });&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Add the system to the particle manager:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleManager.AddParticleSystem(explosionParticleSystem);&lt;/pre&gt;
&lt;/div&gt;
&lt;h2&gt;Particles&lt;/h2&gt;
&lt;p&gt;The overloaded &lt;em&gt;AddParticle&lt;/em&gt; method can be used to add particles to any system. The
&lt;em&gt;RandomHelper&lt;/em&gt; class can be used to randomize the generation of particles. For example:&lt;/p&gt;
&lt;div class="csharpcode"&gt;
&lt;pre class="alt"&gt;&lt;span class="lnum"&gt;   1:  &lt;/span&gt;particleSystem.AddParticle(&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Vector3Between(Vector3.Up, Vector3.Down),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Color(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.NormalizedVector3(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.Float(),&lt;br&gt;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160;&amp;#160; &lt;font color="#2b91af"&gt;TimeSpan&lt;/font&gt;.FromSeconds(&lt;font color="#2b91af"&gt;RandomHelper&lt;/font&gt;.IntBetween(1, 3)));&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;Use the &lt;em&gt;RemoveAt&lt;/em&gt; method to remove a particle at the given index.&lt;/p&gt;
&lt;/div&gt;&lt;div class="ClearBoth"&gt;&lt;/div&gt;</description><author>AlexYakobovich</author><pubDate>Fri, 16 Dec 2011 06:30:36 GMT</pubDate><guid isPermaLink="false">Updated Wiki: Using Tranquillity 20111216063036A</guid></item></channel></rss>