Particle Effects

The XParticle Class.
  • Particles in the Xploit Engine are 2D images/Textures that are positioned in 3D Space.
  • Particles can be started anytime in the update method and will die after its lifespan(-999 = infinite time).
  • Particles can be stopped at anytime by calling the <particle>.StopEffect Method.
  • The texture in the particle must be added as a content in your Content file.

Usage :
       Xparticle particle;

       //in the LoadContent Method
       protected override void LoadContent()
             particle = new XParticle("Sun", -999);
              particle = new XParticle(<Reference to a texture here>, 90<sec>);      //this way you can assign multiple particles with the same texture

              //you can see that this has 5 parameters (Explained below)
              //Can be called in the UpdateMethod as well
              xxx.StartEffect(new Vector3(0, 0, 0), Matrix.CreateRotationY(MathHelper.ToRadians(1)), Matrix.CreateTranslation(20, 20, -20), true, 100000);

StartEffect Parameters :
  • Position in 3d space.
  • Continuous animation Matrix (this matrix is multiplied for every frame drawn).
  • Static animation Matrix(this matrix is applied for every frame without multiplying itself).
  • A flag that indicates whether the static animation is to be performed before the continuous animation.
  • Size of the particle, usually a very high number.

Last edited Jan 3, 2010 at 3:15 PM by adityav89, version 2


No comments yet.