Exemple #1
0
 /// <summary>
 /// Called at the full frame rate
 /// elapsedTime is time since last frame
 /// Executes in the UpdaterThread
 /// </summary>
 public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
 {
     Pantograph1.UpdateState(MSTSWagon.Pantographs[1].CommandUp, elapsedTime);
     Pantograph2.UpdateState(MSTSWagon.Pantographs[2].CommandUp, elapsedTime);
     LeftDoor.UpdateState(MSTSWagon.DoorLeftOpen, elapsedTime);
     RightDoor.UpdateState(MSTSWagon.DoorRightOpen, elapsedTime);
     Mirrors.UpdateState(MSTSWagon.MirrorOpen, elapsedTime);
     UnloadingParts.UpdateState(MSTSWagon.UnloadingPartsOpen, elapsedTime);
     UpdateAnimation(frame, elapsedTime);
 }
Exemple #2
0
        /// <summary>
        /// Called at the full frame rate
        /// elapsedTime is time since last frame
        /// Executes in the UpdaterThread
        /// </summary>
        public override void PrepareFrame(RenderFrame frame, ElapsedTime elapsedTime)
        {
            Pantograph1.UpdateState(MSTSWagon.Pantographs[1].CommandUp, elapsedTime);
            Pantograph2.UpdateState(MSTSWagon.Pantographs[2].CommandUp, elapsedTime);
            if (MSTSWagon.Pantographs.List.Count > 2)
            {
                Pantograph3.UpdateState(MSTSWagon.Pantographs[3].CommandUp, elapsedTime);
            }
            if (MSTSWagon.Pantographs.List.Count > 3)
            {
                Pantograph4.UpdateState(MSTSWagon.Pantographs[4].CommandUp, elapsedTime);
            }
            LeftDoor.UpdateState(MSTSWagon.DoorLeftOpen, elapsedTime);
            RightDoor.UpdateState(MSTSWagon.DoorRightOpen, elapsedTime);
            Mirrors.UpdateState(MSTSWagon.MirrorOpen, elapsedTime);
            UnloadingParts.UpdateState(MSTSWagon.UnloadingPartsOpen, elapsedTime);
            UpdateAnimation(frame, elapsedTime);

            var car = Car as MSTSWagon;

            // Steam leak in heating hose
            foreach (var drawer in HeatingHose)
            {
                drawer.SetOutput(car.HeatingHoseSteamVelocityMpS, car.HeatingHoseSteamVolumeM3pS, car.HeatingHoseParticleDurationS);
            }

            // Heating Steam Boiler Exhaust
            foreach (var drawer in HeatingSteamBoiler)
            {
                drawer.SetOutput(car.HeatingSteamBoilerVolumeM3pS, car.HeatingSteamBoilerDurationS, car.HeatingSteamBoilerSteadyColor);
            }

            // Exhaust for HEP/Electrical Generator
            foreach (var drawer in WagonGenerator)
            {
                drawer.SetOutput(car.WagonGeneratorVolumeM3pS, car.WagonGeneratorDurationS, car.WagonGeneratorSteadyColor);
            }

            // Wagon fire smoke
            foreach (var drawer in WagonSmoke)
            {
                drawer.SetOutput(car.WagonSmokeVelocityMpS, car.WagonSmokeVolumeM3pS, car.WagonSmokeDurationS, car.WagonSmokeSteadyColor);
                // drawer.SetOutput(car.WagonSmokeVolumeM3pS, car.WagonSmokeDurationS, car.WagonSmokeSteadyColor);
            }

            foreach (List <ParticleEmitterViewer> drawers in ParticleDrawers.Values)
            {
                foreach (ParticleEmitterViewer drawer in drawers)
                {
                    drawer.PrepareFrame(frame, elapsedTime);
                }
            }
        }