コード例 #1
0
 NameValuePairList mInfo = new NameValuePairList();                // custom sample info
 public SinbadState()
 {
     m_bQuit         = false;
     m_pDetailsPanel = null;
     m_pCamera       = null;
     m_pCameraMan    = null;
     m_pChara        = null;
 }
コード例 #2
0
        public void createScene()
        {
            // set background and some fog
            AdvancedMogreFramework.Singleton.m_pViewport.BackgroundColour = new ColourValue(1.0f, 1.0f, 0.8f);
            m_pSceneMgr.SetFog(FogMode.FOG_LINEAR, new ColourValue(1.0f, 1.0f, 0.8f), 0, 15, 100);

            // set shadow properties
            m_pSceneMgr.ShadowTechnique = ShadowTechnique.SHADOWTYPE_TEXTURE_MODULATIVE;
            m_pSceneMgr.ShadowColour    = new ColourValue(0.5f, 0.5f, 0.5f);
            m_pSceneMgr.SetShadowTextureSize(1024);
            m_pSceneMgr.ShadowTextureCount = 1;

            // disable default camera control so the character can do its own
            m_pCameraMan.setStyle(CameraStyle.CS_MANUAL);
            // use a small amount of ambient lighting
            m_pSceneMgr.AmbientLight = new ColourValue(0.3f, 0.3f, 0.3f);

            // add a bright light above the scene
            Light light = m_pSceneMgr.CreateLight();

            light.Type           = (Light.LightTypes.LT_POINT);
            light.Position       = new Mogre.Vector3(-10, 40, 20);
            light.SpecularColour = ColourValue.White;

            // create a floor mesh resource
            MeshManager.Singleton.CreatePlane("floor", ResourceGroupManager.DEFAULT_RESOURCE_GROUP_NAME,
                                              new Plane(Mogre.Vector3.UNIT_Y, 0), 100, 100, 10, 10, true, 1, 10, 10, Mogre.Vector3.UNIT_Z);

            // create a floor entity, give it a material, and place it at the origin
            Entity floor = m_pSceneMgr.CreateEntity("Floor", "floor");

            floor.SetMaterialName("Examples/Rockwall");
            floor.CastShadows = (false);
            m_pSceneMgr.RootSceneNode.AttachObject(floor);

            // create our character controller
            m_pChara = new SinbadCharacterController(m_pCamera);

            AdvancedMogreFramework.Singleton.m_pTrayMgr.toggleAdvancedFrameStats();

            StringVector items = new StringVector();

            items.Insert(items.Count, "Help");
            ParamsPanel help = AdvancedMogreFramework.Singleton.m_pTrayMgr.createParamsPanel(TrayLocation.TL_TOPLEFT, "HelpMessage", 100, items);

            help.setParamValue("Help", "H / F1");
        }