public void Render(Earth3d window)
        {
            window.SetupMatricesOverlays();
            window.RenderContext11.DepthStencilMode = DepthStencilMode.Off;

            if (tour == null || tour.CurrentTourStop == null)
            {
                if (Properties.Settings.Default.ShowSafeArea && tour != null && tour.EditMode && !Capturing)
                {
                    DrawSafeZone(window);
                }
                return;
            }

            foreach (Overlay overlay in tour.CurrentTourStop.Overlays)
            {
                if (overlay.Animate && Tour.CurrentTourStop.KeyFramed)
                {
                    overlay.TweenFactor = tour.CurrentTourStop.TweenPosition;
                }
                else if (!Tour.CurrentTourStop.KeyFramed)
                {
                    overlay.TweenFactor = tour.CurrentTourStop.TweenPosition < .5f ? 0f : 1f;
                }
                overlay.Draw3D(window.RenderContext11, 1.0f, true);
            }

            if (Properties.Settings.Default.ShowSafeArea && tour != null && tour.EditMode && !Capturing)
            {
                DrawSafeZone(window);
            }
            selection.Draw3D(window.RenderContext11, 1.0f);

            if (!Scrubbing)
            {
                if (CurrentEditor != null)
                {
                    CurrentEditor.Render(window);
                }

                Settings.TourSettings = null;
            }
        }
예제 #2
0
        public void Render(Earth3d window)
        {
            window.SetupMatricesOverlays();
            window.RenderContext11.DepthStencilMode = DepthStencilMode.Off;

            if (tour == null || tour.CurrentTourStop == null)
            {
                return;
            }

            if (ProjectorServer)
            {
                overlayBlend.State = true;
            }

            if (!onTarget && !ProjectorServer)
            {
                slideStartTime = SpaceTimeController.MetaNow;
                if (Earth3d.MainWindow.OnTarget(Tour.CurrentTourStop.Target))
                {
                    onTarget = true;
                    overlayBlend.State = !Tour.CurrentTourStop.FadeInOverlays;
                    overlayBlend.TargetState = true;

                    if (!PreRoll)
                    {
                        if (tour.CurrentTourStop.MusicTrack != null)
                        {
                            tour.CurrentTourStop.MusicTrack.Play();
                        }

                        if (tour.CurrentTourStop.VoiceTrack != null)
                        {
                            tour.CurrentTourStop.VoiceTrack.Play();
                        }

                        foreach (Overlay overlay in tour.CurrentTourStop.Overlays)
                        {
                            overlay.Play();
                        }
                    }

                    LayerManager.SetVisibleLayerList(tour.CurrentTourStop.Layers);

                    if (tour.CurrentTourStop.KeyFramed)
                    {
                        tour.CurrentTourStop.KeyFrameMover.CurrentDateTime = tour.CurrentTourStop.StartTime;
                        tour.CurrentTourStop.KeyFrameMover.CurrentPosition = tour.CurrentTourStop.Target.CamParams;
                        tour.CurrentTourStop.KeyFrameMover.MoveTime = (double)(tour.CurrentTourStop.Duration.TotalMilliseconds / 1000.0);
                        Earth3d.MainWindow.Mover = tour.CurrentTourStop.KeyFrameMover;
                    }
                    else if (tour.CurrentTourStop.EndTarget != null && tour.CurrentTourStop.EndTarget.ZoomLevel != -1)
                    {
                        if (tour.CurrentTourStop.Target.Type == ImageSetType.SolarSystem)
                        {
                            tour.CurrentTourStop.Target.UpdatePlanetLocation(SpaceTimeController.UtcToJulian(tour.CurrentTourStop.StartTime));
                            tour.CurrentTourStop.EndTarget.UpdatePlanetLocation(SpaceTimeController.UtcToJulian(tour.CurrentTourStop.EndTime));
                        }

                        Earth3d.MainWindow.Mover = new ViewMoverKenBurnsStyle(tour.CurrentTourStop.Target.CamParams, tour.CurrentTourStop.EndTarget.CamParams, tour.CurrentTourStop.Duration.TotalMilliseconds / 1000.0, tour.CurrentTourStop.StartTime, tour.CurrentTourStop.EndTime, tour.CurrentTourStop.InterpolationType);

                    }

                    Settings.TourSettings = tour.CurrentTourStop;
                    SpaceTimeController.Now = tour.CurrentTourStop.StartTime;
                    SpaceTimeController.SyncToClock = false;
                }
            }

            if (currentMasterSlide != null)
            {
                foreach (Overlay overlay in currentMasterSlide.Overlays)
                {
                    overlay.TweenFactor = 1f;

                    overlay.Draw3D(window.RenderContext11, 1.0f, false);
                }
            }

            if (onTarget || ProjectorServer)
            {
                foreach (Overlay overlay in tour.CurrentTourStop.Overlays)
                {
                    if (!Tour.CurrentTourStop.KeyFramed || (overlay.Animate && overlay.AnimationTarget == null))
                    {
                        overlay.TweenFactor = (float)CameraParameters.EaseCurve(tour.CurrentTourStop.TweenPosition, overlay.InterpolationType == InterpolationType.Default ? tour.CurrentTourStop.InterpolationType : overlay.InterpolationType);
                    }
                    overlay.Draw3D(window.RenderContext11, overlayBlend.Opacity, false);
                }
            }
        }