Ejemplo n.º 1
0
            public override void Update(float dt, FXEvent fxEvent)
            {
                timer += dt;


                while (timer > stageDesc.Period)
                {
                    timer -= period;

                    if (!looped)
                    {
                        stopped = true;
                        Kill();
                    }
                    else
                    {
                        counter++;
                        UpdatePeriodIntensity();
                    }
                }

                UpdateLightStyle();

                light.Position = FXFactory.GetPosition(stageDesc.OffsetDirection, stageDesc.OffsetFactor, fxEvent);
            }
Ejemplo n.º 2
0
        public Vector3 GetPosition(FXEvent fxEvent, Random rand)
        {
            var position = FXFactory.GetPosition(OffsetDirection, OffsetFactor, fxEvent);
            var radial   = FXFactory.GetRadialDistribution(rand, Distribution, MinSize, MaxSize);

            return(position + radial);
        }
Ejemplo n.º 3
0
        public Vector3 GetVelocity(FXEvent fxEvent, Random rand)
        {
            var velocityValue = FXFactory.GetLinearDistribution(rand, LinearDistribution, LinearVelocityMin, LinearVelocityMax);
            var velocity      = FXFactory.GetDirection(Direction, velocityValue, fxEvent);
            var addition      = FXFactory.GetRadialDistribution(rand, RadialDistribution, RadialVelocityMin, RadialVelocityMax);
            var advection     = fxEvent.Velocity * Advection;

            return(velocity + addition + advection);
        }
Ejemplo n.º 4
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="sfxSystem"></param>
        /// <param name="fxEvent"></param>
        public FXInstance(FXPlayback sfxSystem, FXEvent fxEvent, FXFactory fxFactory, bool looped)
        {
            this.fxAtom     = fxEvent.FXAtom;
            this.fxPlayback = sfxSystem;
            this.rw         = sfxSystem.rw;
            this.sw         = sfxSystem.sw;
            this.fxEvent    = fxEvent;

            AddParticleStage(fxFactory.ParticleStage1, fxEvent, looped);
            AddParticleStage(fxFactory.ParticleStage2, fxEvent, looped);
            AddParticleStage(fxFactory.ParticleStage3, fxEvent, looped);
            AddParticleStage(fxFactory.ParticleStage4, fxEvent, looped);

            AddLightStage(fxFactory.LightStage, fxEvent, looped);
            AddSoundStage(fxFactory.SoundStage, fxEvent, looped);
        }
Ejemplo n.º 5
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="instance"></param>
            /// <param name="position"></param>
            /// <param name="soundPath"></param>
            public SoundStage(FXInstance instance, FXSoundStage stageDesc, FXEvent fxEvent, bool looped) : base(instance)
            {
                var sound = instance.fxPlayback.LoadSound(stageDesc.Sound);

                if (sound == null)
                {
                    return;
                }

                emitter               = instance.sw.AllocEmitter();
                emitter.Position      = fxEvent.Origin;
                emitter.DistanceScale = FXFactory.GetRadius(stageDesc.Attenuation);
                emitter.DopplerScale  = 1;
                emitter.VolumeCurve   = null;
                emitter.LocalSound    = false;

                emitter.PlaySound(sound, looped ? PlayOptions.Looped : PlayOptions.None);
            }
Ejemplo n.º 6
0
            /// <summary>
            ///
            /// </summary>
            /// <param name="instance"></param>
            /// <param name="position"></param>
            /// <param name="color"></param>
            /// <param name="radius"></param>
            /// <param name="fadeInRate"></param>
            /// <param name="fadeOutRate"></param>
            public LightStage(FXInstance instance, FXLightStage stageDesc, FXEvent fxEvent, bool looped) : base(instance)
            {
                light          = new OmniLight();
                this.stageDesc = stageDesc;

                light.Position = FXFactory.GetPosition(stageDesc.OffsetDirection, stageDesc.OffsetFactor, fxEvent);

                light.RadiusInner = stageDesc.InnerRadius;
                light.RadiusOuter = stageDesc.OuterRadius;
                light.Intensity   = stageDesc.Intensity;

                this.period = stageDesc.Period;
                this.looped = looped;

                instance.rw.LightSet.OmniLights.Add(light);

                UpdatePeriodIntensity();
                UpdateLightStyle();
            }
Ejemplo n.º 7
0
 public float GetLifetime(Random rand)
 {
     return(FXFactory.GetLinearDistribution(rand, Distribution, MinLifetime, MaxLifetime));
 }