コード例 #1
0
ファイル: Program.cs プロジェクト: andyhebear/mogresdk
        void SceneCreating(OgreWindow win)
        {
            win.SceneManager.SetWorldGeometry("terrain.cfg");

             //win.SceneManager.SetSkyBox(true, "Examples/SpaceSkyBox");
             //win.SceneManager.SetSkyBox(true, "Examples/SpaceSkyBox", 10);
             //win.SceneManager.SetSkyBox(true, "Examples/SpaceSkyBox", 5000, false);
             //win.SceneManager.SetSkyBox(true, "Examples/SpaceSkyBox", 100, true);

             //win.SceneManager.SetSkyDome(true, "Examples/CloudySky", 5, 8);
             //win.SceneManager.SetSkyDome(false, "");

             Plane plane;
             plane.d = 1000;
             plane.normal = Vector3.NEGATIVE_UNIT_Y;

             //win.SceneManager.SetSkyPlane(true, plane, "Examples/SpaceSkyPlane", 1500, 75);
             //win.SceneManager.SetSkyPlane(true, plane, "Examples/SpaceSkyPlane", 1500, 50, true, 1.5f, 150, 150);
             //win.SceneManager.SetSkyPlane(true, plane, "Examples/CloudySky", 1500, 40, true, 1.5f, 150, 150);
             //win.SceneManager.SetSkyPlane(false, new Plane(), "");

             //ColourValue fadeColour = new ColourValue(0.9f, 0.9f, 0.9f);
             //win.Viewport.BackgroundColour = fadeColour;

             //win.SceneManager.SetFog(FogMode.FOG_LINEAR, fadeColour, 0, 50, 500);
             //win.SceneManager.SetFog(FogMode.FOG_EXP, fadeColour, 0.005f);
             //win.SceneManager.SetFog(FogMode.FOG_EXP, fadeColour, 0.003f);
        }
コード例 #2
0
ファイル: newroom.cs プロジェクト: andyhebear/extramegablob
 public override void sceneHook(OgreWindow win)
 {
     this.win = win;
     ent1 = win.mSceneMgr.CreateEntity("zeliard", "zeliard.mesh");
     ent1.CastShadows = true;
     sn1 = win.mSceneMgr.RootSceneNode.CreateChildSceneNode();
     sn1.AttachObject(ent1);
     sn1.Position -= new Mogre.Vector3(3f, 6f, 14f);
 }
コード例 #3
0
ファイル: Program.cs プロジェクト: andyhebear/mogresdk
        void SceneCreating(OgreWindow win)
        {
            // Set the ambient light and shadow technique
             SceneManager mgr = win.SceneManager;
             mgr.SetShadowUseInfiniteFarPlane(false);
             mgr.AmbientLight = ColourValue.Black;
             mgr.ShadowTechnique = ShadowTechnique.SHADOWTYPE_STENCIL_ADDITIVE;

             // Create a ninja
             Entity ent = mgr.CreateEntity("ninja", "ninja.mesh");
             ent.CastShadows = true;
             mgr.RootSceneNode.CreateChildSceneNode().AttachObject(ent);

             // Define a ground plane
             Plane plane = new Plane(Vector3.UNIT_Y, 0);
             MeshManager.Singleton.CreatePlane("ground", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME,
                 plane, 1500, 1500, 20, 20, true, 1, 5, 5, Vector3.UNIT_Z);

             // Create a ground plane
             ent = mgr.CreateEntity("GroundEntity", "ground");
             mgr.RootSceneNode.CreateChildSceneNode().AttachObject(ent);

             ent.SetMaterialName("Examples/Rockwall");
             ent.CastShadows = false;

            // Create the first light
             Light light;
             light = mgr.CreateLight("Light1");
             light.Type = Light.LightTypes.LT_POINT;
             light.Position = new Vector3(0, 150, 250);
             light.DiffuseColour = ColourValue.Red;
             light.SpecularColour = ColourValue.Red;

             // Create the second light
             light = mgr.CreateLight("Light2");
             light.Type = Light.LightTypes.LT_DIRECTIONAL;
             light.DiffuseColour = new ColourValue(.25f, .25f, 0);
             light.SpecularColour = new ColourValue(.25f, .25f, 0);
             light.Direction = new Vector3(0, -1, -1);

             // Create the third light
             light = mgr.CreateLight("Light3");
             light.Type = Light.LightTypes.LT_SPOTLIGHT;
             light.DiffuseColour = ColourValue.Blue;
             light.SpecularColour = ColourValue.Blue;
             light.Direction = new Vector3(-1, -1, 0);
             light.Position = new Vector3(300, 300, 0);
             light.SetSpotlightRange(new Degree(35), new Degree(50));
        }
コード例 #4
0
        public DefaultInputHandler(OgreWindow win)
        {
            mWindow = win;

            win.KeyDown   += new KeyEventHandler(HandleKeyDown);
            win.KeyUp     += new KeyEventHandler(HandleKeyUp);
            win.MouseDown += new MouseEventHandler(HandleMouseDown);
            win.MouseUp   += new MouseEventHandler(HandleMouseUp);
            win.Disposed  += new EventHandler(win_Disposed);
            win.LostFocus += new EventHandler(win_LostFocus);
            win.GotFocus  += new EventHandler(win_GotFocus);

            mTimer.Interval = INTERVAL;
            mTimer.Enabled  = true;
            mTimer.Tick    += new EventHandler(Timer_Tick);
        }
コード例 #5
0
ファイル: DefaultInputHandler.cs プロジェクト: asdlei00/mygui
        public DefaultInputHandler(OgreWindow win)
        {
            mWindow = win;

            win.KeyDown += new KeyEventHandler(HandleKeyDown);
            win.KeyUp += new KeyEventHandler(HandleKeyUp);
            win.MouseDown += new MouseEventHandler(HandleMouseDown);
            win.MouseUp += new MouseEventHandler(HandleMouseUp);
            win.Disposed += new EventHandler(win_Disposed);
            win.LostFocus += new EventHandler(win_LostFocus);
            win.GotFocus += new EventHandler(win_GotFocus);

            mTimer.Interval = INTERVAL;
            mTimer.Enabled = true;
            mTimer.Tick += new EventHandler(Timer_Tick);
        }
コード例 #6
0
ファイル: Program.cs プロジェクト: nero201/CityMania
        static void Main()
        {
            OgreWindow win = new OgreWindow();

            try
            {
                win.Go();
            }
            catch (System.Runtime.InteropServices.SEHException)
            {
                if (OgreException.IsThrown)
                    MessageBox.Show(OgreException.LastException.FullDescription,
                                    "An Ogre exception has occurred!");
                else
                    throw;
            }
        }
コード例 #7
0
ファイル: Program.cs プロジェクト: andyhebear/mogresdk
        void SceneCreating(OgreWindow win)
        {
            win.SceneManager.AmbientLight = new ColourValue(0.25f, 0.25f, 0.25f);

             Entity ent = win.SceneManager.CreateEntity("Ninja", "ninja.mesh");
             win.SceneManager.RootSceneNode.CreateChildSceneNode().AttachObject(ent);

             Light light = win.SceneManager.CreateLight("Light");
             light.Type = Light.LightTypes.LT_POINT;
             light.Position = new Vector3(250, 150, 250);
             light.DiffuseColour = ColourValue.White;
             light.SpecularColour = ColourValue.White;

             win.Camera.Position = new Vector3(0, 200, 400);
             win.Camera.LookAt(ent.BoundingBox.Center);
        }
コード例 #8
0
ファイル: Program.cs プロジェクト: andyhebear/mogresdk
 public SceneCreator(OgreWindow win)
 {
     win.SceneCreating += new OgreWindow.SceneEventHandler(SceneCreating);
 }
コード例 #9
0
ファイル: Program.cs プロジェクト: asdlei00/mygui
        void SceneCreating(OgreWindow win)
        {
            mWindow = win;

            Export.CreateGUI();
            Export.SetRenderWindow(win.RenderWindow);
            Export.SetSceneManager(win.SceneManager);
            Export.SetActiveViewport(0);

            PointerManager.Instance.Visible = false;

            MyGUI.Managed.Button button = Gui.Instance.CreateWidget<MyGUI.Managed.Button>("Button", new IntCoord(10, 10, 100, 24), Align.Default, "Main");
            button.Caption = "Quit";
            button.EventMouseButtonClick += button_EventMouseButtonClick;
        }
コード例 #10
0
ファイル: Program.cs プロジェクト: asdlei00/mygui
 public SceneCreator(OgreWindow win)
 {
     win.SceneCreating += new OgreWindow.SceneEventHandler(SceneCreating);
     win.Disposed += new EventHandler(win_Disposed);
 }
コード例 #11
0
ファイル: zeliard.cs プロジェクト: andyhebear/extramegablob
 public override void sceneHook(OgreWindow win)
 {
     this.win = win;
     //// Create a slot machine barrel
     //ent_zelbox = win.mSceneMgr.CreateEntity("zelbox_" + collisionPrevention, "zeliard.mesh");
     //ent_zelbox.CastShadows = true;
     //sn_zelbox = win.mSceneMgr.RootSceneNode.CreateChildSceneNode();
     //sn_zelbox.AttachObject(ent_zelbox);
     //sn_zelbox.Position -= new Mogre.Vector3(4f, 4f, 12f);
     //sn_zelbox.Rotate(new Quaternion(.28f, 0f, -.95f, .16f));
 }
コード例 #12
0
ファイル: Room.cs プロジェクト: andyhebear/extramegablob
 public abstract void sceneHook(OgreWindow mainwindow);
コード例 #13
0
 public override void setWindow(OgreWindow win)
 {
     this.win = win;
     //// Create a slot machine barrel
     entity_myentity = win.mSceneMgr.CreateEntity("cylinder123", "cylinder.mesh");
     entity_myentity.CastShadows = true;
     sn_barrel1 = win.mSceneMgr.RootSceneNode.CreateChildSceneNode();
     sn_barrel1.AttachObject(entity_myentity);
     sn_barrel1.Position -= new Mogre.Vector3(8f, 6f, 14f);
     sn_barrel1.Rotate(new Mogre.Vector3(0.0f, 0.0f, 1.0f), new Radian(1.55f));
     //// Create a slot machine barrel
     entity_myentity2 = win.mSceneMgr.CreateEntity("cylinder2", "cylinder.mesh");
     entity_myentity2.CastShadows = true;
     sn_barrel2 = win.mSceneMgr.RootSceneNode.CreateChildSceneNode();
     sn_barrel2.AttachObject(entity_myentity2);
     sn_barrel2.Position -= new Mogre.Vector3(7.42f, 6f, 14f);
     sn_barrel2.Rotate(new Mogre.Vector3(0.0f, 0.0f, 1.0f), new Radian(1.55f));
     //// Create a slot machine barrel
     entity_myentity3 = win.mSceneMgr.CreateEntity("cylinder3", "cylinder.mesh");
     entity_myentity3.CastShadows = true;
     sn_barrel3 = win.mSceneMgr.RootSceneNode.CreateChildSceneNode();
     sn_barrel3.AttachObject(entity_myentity3);
     sn_barrel3.Position -= new Mogre.Vector3(6.84f, 6f, 14f);
     sn_barrel3.Rotate(new Mogre.Vector3(0.0f, 0.0f, 1.0f), new Radian(1.55f));
     //// Create a slot machine barrel
     entity_myentity4 = win.mSceneMgr.CreateEntity("cylinder4", "cylinder.mesh");
     entity_myentity4.CastShadows = true;
     sn_barrel4 = win.mSceneMgr.RootSceneNode.CreateChildSceneNode();
     sn_barrel4.AttachObject(entity_myentity4);
     sn_barrel4.Position -= new Mogre.Vector3(6.26f, 6f, 14f);
     sn_barrel4.Rotate(new Mogre.Vector3(0.0f, 0.0f, 1.0f), new Radian(1.55f));
     ent1 = win.mSceneMgr.CreateEntity("border", "border.mesh");
     ent1.CastShadows = true;
     sn1 = win.mSceneMgr.RootSceneNode.CreateChildSceneNode();
     sn1.AttachObject(ent1);
     sn1.Position -= new Mogre.Vector3(8.14f, 6f, 14f);
     //ent1 = win.mSceneMgr.CreateEntity("zeliard", "zeliard.mesh");
     //ent1.CastShadows = true;
     //sn1 = win.mSceneMgr.RootSceneNode.CreateChildSceneNode();
     //sn1.AttachObject(ent1);
     //sn1.Position -= new Mogre.Vector3(3f, 6f, 14f);
 }
コード例 #14
0
 public override void sceneHook(OgreWindow win)
 {
     this.win = win;
 }