Axiom.ParticleFX.EllipsoidEmitter.InitParticle C# (CSharp) Метод

InitParticle() публичный Метод

public InitParticle ( Particle particle ) : void
particle Axiom.ParticleSystems.Particle
Результат void
		public override void InitParticle( Particle particle )
		{
			float xOff, yOff, zOff;

			// First we create a random point inside a bounding sphere with a
			// radius of 1 (this is easy to do). The distance of the point from
			// 0,0,0 must be <= 1 (== 1 means on the surface and we count this as
			// inside, too).
			while ( true )
			{

				// three random values for one random point in 3D space
				xOff = Utility.SymmetricRandom();
				yOff = Utility.SymmetricRandom();
				zOff = Utility.SymmetricRandom();

				// the distance of x,y,z from 0,0,0 is sqrt(x*x+y*y+z*z), but
				// as usual we can omit the sqrt(), since sqrt(1) == 1 and we
				// use the 1 as boundary:
				if ( xOff * xOff + yOff * yOff + zOff * zOff <= 1 )
				{
					// found one valid point inside
					break;
				}
			}

			// scale the found point to the cylinder's size and move it
			// relatively to the center of the emitter point
			particle.Position = position + xOff * xRange + yOff * yRange * zOff * zRange;

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

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