예제 #1
0
        /// <summary>
        /// The initialize method is used by the emitter to initialize the particle.
        /// It is called within the emitter's createParticle method and need not
        /// be called by the user.
        /// </summary>
        /// <param name="emitter">The Emitter that created the particle.</param>
        /// <param name="particle">The particle to be initialized.</param>
        public override void Initialize(Emitter emitter, Particle particle)
        {
            Point loc;

            if (emitter.RotRadians == 0)
            {
                loc = m_zone.GetLocation();

                particle.TargetX = loc.X;
                particle.TargetY = loc.Y;
            }
            else
            {
                double sin = Math.Sin(emitter.RotRadians);
                double cos = Math.Cos(emitter.RotRadians);

                loc = m_zone.GetLocation();

                particle.TargetX = cos * loc.X - sin * loc.Y;
                particle.TargetY = cos * loc.Y + sin * loc.X;
            }

            particle.TargetX += emitter.X;
            particle.TargetY += emitter.Y;
        }
예제 #2
0
        /// <summary>
        /// The initialize method is used by the emitter to initialize the particle.
        /// It is called within the emitter's createParticle method and need not
        /// be called by the user.
        /// </summary>
        /// <param name="emitter">The Emitter that created the particle.</param>
        /// <param name="particle">The particle to be initialized.</param>
        public override void Initialize(Emitter emitter, Particle particle)
        {
            Point loc;

            loc = m_zone.GetLocation();
            particle.TargetX = loc.X;
            particle.TargetY = loc.Y;
        }
예제 #3
0
        /// <summary>
        /// The initialize method is used by the emitter to initialize the particle.
        /// It is called within the emitter's createParticle method and need not
        /// be called by the user.
        /// </summary>
        /// <param name="emitter">The Emitter that created the particle.</param>
        /// <param name="particle">The particle to be initialized.</param>
        public override void Initialize(Emitter emitter, Particle particle)
        {
            Point loc;

            loc        = m_zone.GetLocation();
            particle.X = loc.X;
            particle.Y = loc.Y;

            particle.PreviousX = particle.X;
            particle.PreviousY = particle.Y;
        }