private bool Setup()
        {
            createLogManager();
            this.mRoot = new Root(PLUGINS_CFG);
            //mOverlaySystem = new Mogre.OverlaySystem();
            setupResources();
            if (!this.Configure())
            {
                return(false);
            }

            this.ChooseSceneManager();
            this.CreateCamera();
            this.CreateViewports();
            createCompositor();

            TextureManager.Singleton.DefaultNumMipmaps = 5;

            this.LoadResources();
            //
            this.mInput = new MoisManager();
            int windowHnd;

            this.mWindow.GetCustomAttribute("WINDOW", out windowHnd);
            this.mInput.Startup(windowHnd, this.mWindow.Width, this.mWindow.Height);
            //System.Windows.Forms.Control form = System.Windows.Forms.Form.FromHandle(new IntPtr(windowHnd));
            //form.MinimumSize = new System.Drawing.Size(800, 600);

            this.mTrayMgr = new SdkTrayManager("trayMgr", this.mWindow, this.mInput.Mouse, this);
            this.mTrayMgr.showFrameStats(TrayLocation.TL_BOTTOMLEFT);
            this.mTrayMgr.hideCursor();
            //this.mTrayMgr.hideFrameStats();
            //this.mTrayMgr.showFrameStats(TrayLocation.TL_BOTTOMLEFT);
            //this.mTrayMgr.showLogo(TrayLocation.TL_BOTTOMLEFT);
            //this.mTrayMgr.showOkDialog("context...", "this is a test");
            //this.mTrayMgr.showLoadingBar();


            this.mPanel = this.mTrayMgr.createParamsPanel(TrayLocation.TL_NONE, "DetailsPanel", 200, new string[] { "cam.pX", "cam.pY", "cam.pZ", "cam.oW", "cam.oX", "cam.oY", "cam.oZ", "Filtering", "Poly Mode" });
            this.mPanel.setParamValue(7, "Bilinear");
            this.mPanel.setParamValue(8, "Solid");
            this.mPanel.hide();
            MaterialManager.Singleton.SetDefaultTextureFiltering(TextureFilterOptions.TFO_NONE);
            //
            this.CreateScene();
            //
            this.mTrayMgr._HookMouseEvent();
            //
            this.AddFrameLstn(new RootLstn(RootLstn.TypeLstn.FrameRendering, this.OnFrameRendering));
            return(true);
        }
Example #2
0
        public void UpdateCamera(float frameTime, MoisManager input)
        {
            if (input != null)
            {
                this.UpdateKeys(input);
            }
            if (this.mFreeze)
            {
                return;
            }

            var move = Vector3.ZERO;

            if (this.mGoingForward)
            {
                move += this.mCamera.Direction;
            }
            if (this.mGoingBack)
            {
                move -= this.mCamera.Direction;
            }
            if (this.mGoingRight)
            {
                move += this.mCamera.Right;
            }
            if (this.mGoingLeft)
            {
                move -= this.mCamera.Right;
            }
            if (this.mGoingUp)
            {
                move += this.mCamera.Up;
            }
            if (this.mGoingDown)
            {
                move -= this.mCamera.Up;
            }

            move.Normalise();

            move *= 100;
            if (mFastMove)
            {
                move *= 6;
            }                             // With shift button pressed, move twice as fast.
            if (move != Vector3.ZERO)
            {
                mCamera.Move(move * frameTime);
            }
        }
Example #3
0
 protected virtual void Shutdown()
 {
     if (mInput != null)
     {
         mInput.Shutdown();
         mInput = null;
     }
     if (this.mTrayMgr != null)
     {
         this.mTrayMgr.destroyAllWidgets();
         //this.mTrayMgr.clearAllTrays();
         this.mTrayMgr = null;
     }
     if (mRoot != null)
     {
         mRoot.Shutdown();
     }
     mRoot = null;
 }
Example #4
0
        public void UpdateCamera(float frameTime, MoisManager input)
        {

            if (input != null) { this.UpdateKeys(input); }
            if (this.mFreeze) { return; }

            var move = Vector3.ZERO;
            if (this.mGoingForward) move += this.mCamera.Direction;
            if (this.mGoingBack) move -= this.mCamera.Direction;
            if (this.mGoingRight) move += this.mCamera.Right;
            if (this.mGoingLeft) move -= this.mCamera.Right;
            if (this.mGoingUp) move += this.mCamera.Up;
            if (this.mGoingDown) move -= this.mCamera.Up;

            move.Normalise();

            move *= 100;
            if (mFastMove) { move *= 6; } // With shift button pressed, move twice as fast.
            if (move != Vector3.ZERO) { mCamera.Move(move * frameTime); }
        }
Example #5
0
        private void UpdateKeys(MoisManager input)
        {
            if (input.IsKeyDown(MOIS.KeyCode.KC_W) || input.IsKeyDown(MOIS.KeyCode.KC_UP)) {
                this.GoingForward = true; 
            }
            else { this.GoingForward = false; }
            if (input.IsKeyDown(MOIS.KeyCode.KC_S) || input.IsKeyDown(MOIS.KeyCode.KC_DOWN)) { this.GoingBack = true; }
            else { this.GoingBack = false; }
            if (input.IsKeyDown(MOIS.KeyCode.KC_A) || input.IsKeyDown(MOIS.KeyCode.KC_LEFT)) { this.GoingLeft = true; }
            else { this.GoingLeft = false; }
            if (input.IsKeyDown(MOIS.KeyCode.KC_D) || input.IsKeyDown(MOIS.KeyCode.KC_RIGHT)) { this.GoingRight = true; }
            else { this.GoingRight = false; }
            if (input.IsKeyDown(MOIS.KeyCode.KC_E) || input.IsKeyDown(MOIS.KeyCode.KC_PGUP)) { this.GoingUp = true; }
            else { this.GoingUp = false; }
            if (input.IsKeyDown(MOIS.KeyCode.KC_Q) || input.IsKeyDown(MOIS.KeyCode.KC_PGDOWN)) { this.GoingDown = true; }
            else { this.GoingDown = false; }
            if (input.IsKeyDown(MOIS.KeyCode.KC_LSHIFT) || input.IsKeyDown(MOIS.KeyCode.KC_RSHIFT)) { this.FastMove = true; }
            else { this.FastMove = false; }

            this.MouseMovement(input.MouseMoveX, input.MouseMoveY);
        }
Example #6
0
        private void UpdateKeys(MoisManager input)
        {
            if (input.IsKeyDown(MOIS.KeyCode.KC_W) || input.IsKeyDown(MOIS.KeyCode.KC_UP))
            {
                this.GoingForward = true;
            }
            else
            {
                this.GoingForward = false;
            }
            if (input.IsKeyDown(MOIS.KeyCode.KC_S) || input.IsKeyDown(MOIS.KeyCode.KC_DOWN))
            {
                this.GoingBack = true;
            }
            else
            {
                this.GoingBack = false;
            }
            if (input.IsKeyDown(MOIS.KeyCode.KC_A) || input.IsKeyDown(MOIS.KeyCode.KC_LEFT))
            {
                this.GoingLeft = true;
            }
            else
            {
                this.GoingLeft = false;
            }
            if (input.IsKeyDown(MOIS.KeyCode.KC_D) || input.IsKeyDown(MOIS.KeyCode.KC_RIGHT))
            {
                this.GoingRight = true;
            }
            else
            {
                this.GoingRight = false;
            }
            if (input.IsKeyDown(MOIS.KeyCode.KC_E) || input.IsKeyDown(MOIS.KeyCode.KC_PGUP))
            {
                this.GoingUp = true;
            }
            else
            {
                this.GoingUp = false;
            }
            if (input.IsKeyDown(MOIS.KeyCode.KC_Q) || input.IsKeyDown(MOIS.KeyCode.KC_PGDOWN))
            {
                this.GoingDown = true;
            }
            else
            {
                this.GoingDown = false;
            }
            if (input.IsKeyDown(MOIS.KeyCode.KC_LSHIFT) || input.IsKeyDown(MOIS.KeyCode.KC_RSHIFT))
            {
                this.FastMove = true;
            }
            else
            {
                this.FastMove = false;
            }

            this.MouseMovement(input.MouseMoveX, input.MouseMoveY);
        }
Example #7
0
 protected virtual void Shutdown() {
     if (mInput != null) {
         mInput.Shutdown();
         mInput = null;
     }
     if (this.mTrayMgr != null) {
         this.mTrayMgr.destroyAllWidgets();
         //this.mTrayMgr.clearAllTrays();
         this.mTrayMgr = null;
     }
     if (mRoot != null) {
         mRoot.Shutdown();
     }
     mRoot = null;
 }
Example #8
0
        private bool Setup() {
            createLogManager();
            this.mRoot = new Root(PLUGINS_CFG);
            //mOverlaySystem = new Mogre.OverlaySystem();
            setupResources();
            if (!this.Configure())
                return false;

            this.ChooseSceneManager();
            this.CreateCamera();
            this.CreateViewports();
            createCompositor();

            TextureManager.Singleton.DefaultNumMipmaps = 5;

            this.LoadResources();

            this.mInput = new MoisManager();
            int windowHnd;
            this.mWindow.GetCustomAttribute("WINDOW", out windowHnd);
            this.mInput.Startup(windowHnd, this.mWindow.Width, this.mWindow.Height);
            //System.Windows.Forms.Control form = System.Windows.Forms.Form.FromHandle(new IntPtr(windowHnd));
            //form.MinimumSize = new System.Drawing.Size(800, 600);

            this.mTrayMgr = new SdkTrayManager("trayMgr", this.mWindow, this.mInput.Mouse, this);
            this.mTrayMgr.showFrameStats(TrayLocation.TL_BOTTOMLEFT);
            this.mTrayMgr.hideCursor();
            //this.mTrayMgr.hideFrameStats();
            //this.mTrayMgr.showFrameStats(TrayLocation.TL_BOTTOMLEFT);
            //this.mTrayMgr.showLogo(TrayLocation.TL_BOTTOMLEFT);
            //this.mTrayMgr.showOkDialog("context...", "this is a test");
            //this.mTrayMgr.showLoadingBar();


            this.mPanel = this.mTrayMgr.createParamsPanel(TrayLocation.TL_NONE, "DetailsPanel", 200, new string[] { "cam.pX", "cam.pY", "cam.pZ", "cam.oW", "cam.oX", "cam.oY", "cam.oZ", "Filtering", "Poly Mode" });
            this.mPanel.setParamValue(7, "Bilinear");
            this.mPanel.setParamValue(8, "Solid");
            this.mPanel.hide();
            MaterialManager.Singleton.SetDefaultTextureFiltering(TextureFilterOptions.TFO_NONE);
            //
            this.CreateScene();
            //
            this.mTrayMgr._HookMouseEvent();
            this.AddFrameLstn(new RootLstn(RootLstn.TypeLstn.FrameRendering, this.OnFrameRendering));
            return true;
        }