ResetDimensions() public méthode

public ResetDimensions ( ) : void
Résultat void
 /// <summary>
 ///		Initializes a particle based on the emitter's approach and parameters.
 ///	</summary>
 ///	<remarks>
 ///		See the GetEmissionCount method for details of why there is a separation between
 ///		'requested' emissions and actual initialized particles.
 /// </remarks>
 /// <param name="particle">Reference to a particle which must be initialized based on how this emitter starts particles</param>
 public virtual void InitParticle(Particle particle)
 {
     particle.ResetDimensions();
 }
 /// <summary>
 ///		Initializes a particle based on the emitter's approach and parameters.
 ///	</summary>
 ///	<remarks>
 ///		See the GetEmissionCount method for details of why there is a separation between
 ///		'requested' emissions and actual initialized particles.
 /// </remarks>
 /// <param name="particle">Reference to a particle which must be initialized based on how this emitter starts particles</param>
 public virtual void InitParticle(Particle particle)
 {
     particle.ResetDimensions();
 }
        public override void InitParticle(Particle particle)
        {
            float alpha, beta, a, b, c, x, y, z;

            particle.ResetDimensions();

            // create two random angles alpha and beta
            // with these two angles, we are able to select any point on an
            // ellipsoid's surface
            MathUtil.RangeRandom(durationMin, durationMax);

            alpha = MathUtil.RangeRandom(0,MathUtil.TWO_PI);
            beta  = MathUtil.RangeRandom(0,MathUtil.PI);

            // create three random radius values that are bigger than the inner
            // size, but smaller/equal than/to the outer size 1.0 (inner size is
            // between 0 and 1)
            a = MathUtil.RangeRandom(InnerX,1.0f);
            b = MathUtil.RangeRandom(InnerY,1.0f);
            c = MathUtil.RangeRandom(InnerZ,1.0f);

            // with a,b,c we have defined a random ellipsoid between the inner
            // ellipsoid and the outer sphere (radius 1.0)
            // with alpha and beta we select on point on this random ellipsoid
            // and calculate the 3D coordinates of this point
            x = a * MathUtil.Cos(alpha) * MathUtil.Sin(beta);
            y = b * MathUtil.Sin(alpha) * MathUtil.Sin(beta);
            z = c * MathUtil.Cos(beta);

            // scale the found point to the ellipsoid'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(particle.Color);
            GenerateEmissionDirection(ref particle.Direction);
            GenerateEmissionVelocity(ref particle.Direction);

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