public SceneViewController(MDILayoutManager mdiLayout, EventManager eventManager, UpdateTimer mainTimer, RendererWindow rendererWindow, OgreRenderManager renderManager, BackgroundScene background)
        {
            this.DefaultBackgroundColor = new Color(0.149f, 0.149f, 0.149f);
            this.background             = background;
            this.mainTimer        = mainTimer;
            this.rendererWindow   = rendererWindow;
            this.mdiLayout        = mdiLayout;
            cameraInputController = new CameraInputController(this, eventManager);

            rm = renderManager;
            mdiLayout.ActiveWindowChanged += new EventHandler(mdiLayout_ActiveWindowChanged);
            eventManager.setUnprojectFunction(unproject);
        }
 public SceneViewWindow(SceneViewController controller, CameraMover cameraMover, String name, BackgroundScene background, int zIndexStart)
 {
     this.zIndexStart      = zIndexStart;
     this.background       = background;
     this.controller       = controller;
     this.cameraMover      = cameraMover;
     this.name             = name;
     this.startPosition    = cameraMover.Translation;
     this.startLookAt      = cameraMover.LookAt;
     transparencyStateName = name;
     NearPlaneWorld        = 230;
     NearFarLength         = 450;
     MinNearDistance       = 1;
 }
Exemple #3
0
        public ViewportBackground(String name, int zOrder, BackgroundScene backgroundScene, RenderTarget renderTarget, bool clearEveryFrame)
        {
            this.name            = name;
            this.renderTarget    = renderTarget;
            this.backgroundScene = backgroundScene;

            //Create camera and viewport
            camera = backgroundScene.SceneManager.createCamera(name + "BackgroundCamera");
            camera.setNearClipDistance(1.0f);
            camera.setAutoAspectRatio(true);
            camera.setFOVy(new Degree(10.0f));
            vp = renderTarget.addViewport(camera, zOrder, 0.0f, 0.0f, 1.0f, 1.0f);
            vp.setBackgroundColor(new Color(0.149f, 0.149f, 0.149f));
            vp.setOverlaysEnabled(false);
            vp.setClearEveryFrame(clearEveryFrame);
            vp.clear();

            camera.lookAt(backgroundScene.BackgroundPosition);
        }
        public MDISceneViewWindow(RendererWindow rendererWindow, SceneViewController controller, CameraMover cameraMover, String name, BackgroundScene background, int zIndexStart)
            : base(controller, cameraMover, name, background, zIndexStart)
        {
            this.createBackground(((OgreWindow)PluginManager.Instance.RendererPlugin.PrimaryWindow).OgreRenderTarget, false);

            //MDI Window
            mdiWindow = new MDIDocumentWindow(Name);
            mdiWindow.AllowedDockLocations = DockLocation.Center;
            mdiWindow.SuppressLayout       = true;
            mdiWindow.Content              = this;
            mdiWindow.SuppressLayout       = false;
            mdiWindow.Caption              = Name;
            mdiWindow.Closed              += new EventHandler(mdiWindow_Closed);
            mdiWindow.ActiveStatusChanged += new EventHandler(mdiWindow_ActiveStatusChanged);

            PrimaryActionSelect.FirstFrameDownEvent   += selectEvent;
            SecondaryActionSelect.FirstFrameDownEvent += selectEvent;

            this.RendererWindow = rendererWindow;
        }
Exemple #5
0
        public TextureSceneView(SceneViewController controller, CameraMover cameraMover, String name, BackgroundScene background, int zIndexStart, int width, int height)
            : base(controller, cameraMover, name, background, zIndexStart)
        {
            resourceLoader   = new ManualResourceLoader(this);
            this.TextureName = name;
            texture          = TextureManager.getInstance().createManual(name, MyGUIInterface.Instance.CommonResourceGroup.FullName, TextureType.TEX_TYPE_2D, (uint)width, (uint)height, 1, 0, ogreTextureFormat, TextureUsage.TU_RENDERTARGET, resourceLoader, false, 0);

            pixelBuffer          = texture.Value.getBuffer();
            renderTexture        = pixelBuffer.Value.getRenderTarget();
            this.RenderingEnded += TextureSceneView_RenderingEnded;

            rendererWindow       = new ManualWindow(renderTexture);
            this.RendererWindow  = rendererWindow;
            this.ClearEveryFrame = true;

            this.BackColor = new Engine.Color(0, 0, 0, 0);
        }
        public SingleViewCloneWindow(NativeOSWindow parentWindow, WindowInfo windowInfo, SceneViewController controller, CameraMover cameraMover, String name, BackgroundScene background, int zIndexStart, bool floatOnParent)
            : base(controller, cameraMover, name, background, zIndexStart)
        {
            IntVector2 location = SystemInfo.getDisplayLocation(windowInfo.MonitorIndex);

            location.y          = -1;
            osWindow            = new NativeOSWindow(parentWindow, "Clone Window", location, new IntSize2(windowInfo.Width, windowInfo.Height), floatOnParent);
            this.rendererWindow = (OgreWindow)OgreInterface.Instance.createRendererWindow(new WindowInfo(osWindow, "CloneWindow"));
            this.createBackground(rendererWindow.OgreRenderTarget, true);
            this.RendererWindow = rendererWindow;
            osWindow.show();
            osWindow.Closed += osWindow_Closed;

            transparencyStateName           = controller.ActiveWindow.CurrentTransparencyState;
            controller.ActiveWindowChanged += controller_ActiveWindowChanged;
        }