Axiom.ParticleFX.RingEmitter.InitParticle C# (CSharp) Méthode

InitParticle() public méthode

public InitParticle ( Particle particle ) : void
particle Axiom.ParticleSystems.Particle
Résultat void
		public override void InitParticle( Particle particle )
		{
			float alpha, a, b, x, y, z;

			// create a random angle from 0 .. PI*2
			alpha = Utility.RangeRandom( 0, Utility.TWO_PI );

			// create two random radius values that are bigger than the inner size
			a = Utility.RangeRandom( InnerX, 1.0f );
			b = Utility.RangeRandom( InnerY, 1.0f );

			// with a and b we have defined a random ellipse inside the inner
			// ellipse and the outer circle (radius 1.0)
			// with alpha, and a and b we select a random point on this ellipse
			// and calculate it's coordinates
			x = a * Utility.Sin( alpha );
			y = b * Utility.Cos( alpha );
			// the height is simple running from 0 to 1
			z = Utility.UnitRandom();     // 0..1

			// scale the found point to the ring's size and move it
			// relatively to the center of the emitter point

			particle.Position = position + x * xRange + y * yRange + z * zRange;

			// Generate complex data by reference
			GenerateEmissionColor( ref particle.Color );
			GenerateEmissionDirection( ref particle.Direction );
			GenerateEmissionVelocity( ref particle.Direction );

			// Generate simpler data
			particle.timeToLive = GenerateEmissionTTL();
		}