ClearScene() public method

Empties the entire scene, inluding all SceneNodes, Entities, Lights, BillboardSets etc. Cameras are not deleted at this stage since they are still referenced by viewports, which are not destroyed during this process.
public ClearScene ( ) : void
return void
示例#1
0
        public void OnLoad()
        {
            var dir = Directory.GetCurrentDirectory();
            ResourceGroupManager.Instance.AddResourceLocation(dir, "Folder");
            //MaterialManager.Instance.Initialize();

            _scene = _root.CreateSceneManager("DefaultSceneManager", "SLSharpInstance");
            _scene.ClearScene();

            Bindings.Axiom.SLSharp.Init();
            Shader.DebugMode = true;

            //Shader.DebugMode = true;

            _clipmap = new Clipmap(_scene);
            RecalcHeight();

            _camera = _scene.CreateCamera("MainCamera");
            _camera.Position = new Vector3(0, 0, 5);
            _camera.LookAt(Vector3.Zero);
            _camera.Near = 0.001f;
            _camera.Far = 20.0f;
            _camera.AutoAspectRatio = true;

            var vp = _window.AddViewport(_camera);
            vp.BackgroundColor = ColorEx.CornflowerBlue;
        }
示例#2
0
		public void OnLoad()
		{
			//ResourceGroupManager.Instance.AddResourceLocation("media", "Folder", true);

			_root.SceneManager = _sceneManager = _root.CreateSceneManager(SceneType.ExteriorClose);
			_sceneManager.ClearScene();

			_camera = _sceneManager.CreateCamera("MainCamera");

			_camera.Position = new Vector3(0, 0, 500);
			_camera.LookAt(new Vector3(0, 0, -300));
			_camera.Near = 5;
			_camera.AutoAspectRatio = true;
			_camera.FieldOfView = 0.70f;
			_viewport = _renderWindow.AddViewport(_camera, 0, 0, 1.0f, 1.0f, 100);
			_viewport.BackgroundColor = ColorEx.Black; ;

			_light = _sceneManager.CreateLight("light1");
			_light.Type = LightType.Directional;
			_light.Position = new Vector3(0, 150, 300);
			_light.Diffuse = ColorEx.Blue;
			_light.Specular = ColorEx.Blue;
			//_light.Direction = new Vector3(0, 0, -300);
			_sceneManager.AmbientLight = ColorEx.White;// new ColorEx(0.2f, 0.2f, 0.2f);

			ResourceGroupManager.Instance.InitializeAllResourceGroups();


			_inputReader = PlatformManager.Instance.CreateInputReader();
			_inputReader.Initialize(_renderWindow, true, true, false, false);

			_inputReader.UseKeyboardEvents = true;
			_inputReader.UseMouseEvents = false;

			//_renderItems.Add(new BasicCube());
			_renderItems.Add(new CubeBrowser());
			foreach (var i in _renderItems)
			{
				i.Initialise(_root);
			}
		}
示例#3
0
		public override void DestroyInstance( SceneManager instance )
		{
			instance.ClearScene();
		}
示例#4
0
 public virtual void ChooseSceneManager()
 {
     // Get the SceneManager, a generic one by default
     scene = engine.CreateSceneManager("DefaultSceneManager", "TechDemoSMInstance");
     scene.ClearScene();
 }
示例#5
0
        public void InitializeSystem()
        {
            configManager = new Config.DefaultConfigurationManager();
            root = new Root(configManager.LogFilename);
            root.FrameRenderingQueued += RootFrameRenderingQueued;

            // Load Config.
            configManager.RestoreConfiguration(root);

            // Render System.
            if (root.RenderSystem == null)
                renderSystem = root.RenderSystem = root.RenderSystems.First().Value;
            else
                renderSystem = root.RenderSystem;

            // Render Window.
            Root.Instance.Initialize(false);
            var parameterList = new NamedParameterList
            {
                {"vsync", "true"},
                {"Anti aliasing", "Level 2"},
                {"FSAA", 1},
                {"colorDepth", 32},
                {"border", "fixed"}
            };
            window = Root.Instance.CreateRenderWindow("EvolutionWarWindow", Constants.Width, Constants.Height, false, parameterList);
            WindowEventMonitor.Instance.RegisterListener(window, this);

            // Content.
            Constants.Load();
            ResourceGroupManager.Instance.AddResourceLocation("Meshes", "Folder", true);
            ResourceGroupManager.Instance.AddResourceLocation("Fonts", "Folder", true);
            ResourceGroupManager.Instance.InitializeAllResourceGroups();

            // Fonts.
            var font = FontManager.Instance.Create("Candara", ResourceGroupManager.DefaultResourceGroupName) as Font;
            if (font != null)
            {
                font.Type = FontType.TrueType;
                font.Source = "Candarab.ttf";
                font.TrueTypeSize = 36;
                font.TrueTypeResolution = 96;
                font.AntialiasColor = false;
                font.Load();
            }

            // Scene Manager.
            sceneManager = root.CreateSceneManager("DefaultSceneManager", "GameSMInstance");
            sceneManager.ClearScene();
        }
示例#6
0
        public void OnLoad()
        {
            // Create patch with positions, normals, and 1 set of texcoords
            var patchDeclaration = HardwareBufferManager.Instance.CreateVertexDeclaration();
            patchDeclaration.AddElement(0, 0, VertexElementType.Float3, VertexElementSemantic.Position);
            patchDeclaration.AddElement(0, 12, VertexElementType.Float3, VertexElementSemantic.Normal);
            patchDeclaration.AddElement(0, 24, VertexElementType.Float2, VertexElementSemantic.TexCoords, 0);

            var patchVertices = new PatchVertex[9];

            patchVertices[0].X = -500;
            patchVertices[0].Y = 200;
            patchVertices[0].Z = -500;
            patchVertices[0].Nx = -0.5f;
            patchVertices[0].Ny = 0.5f;
            patchVertices[0].Nz = 0;
            patchVertices[0].U = 0;
            patchVertices[0].V = 0;

            patchVertices[1].X = 0;
            patchVertices[1].Y = 500;
            patchVertices[1].Z = -750;
            patchVertices[1].Nx = 0;
            patchVertices[1].Ny = 0.5f;
            patchVertices[1].Nz = 0;
            patchVertices[1].U = 0.5f;
            patchVertices[1].V = 0;

            patchVertices[2].X = 500;
            patchVertices[2].Y = 1000;
            patchVertices[2].Z = -500;
            patchVertices[2].Nx = 0.5f;
            patchVertices[2].Ny = 0.5f;
            patchVertices[2].Nz = 0;
            patchVertices[2].U = 1;
            patchVertices[2].V = 0;

            patchVertices[3].X = -500;
            patchVertices[3].Y = 0;
            patchVertices[3].Z = 0;
            patchVertices[3].Nx = -0.5f;
            patchVertices[3].Ny = 0.5f;
            patchVertices[3].Nz = 0;
            patchVertices[3].U = 0;
            patchVertices[3].V = 0.5f;

            patchVertices[4].X = 0;
            patchVertices[4].Y = 500;
            patchVertices[4].Z = 0;
            patchVertices[4].Nx = 0;
            patchVertices[4].Ny = 0.5f;
            patchVertices[4].Nz = 0;
            patchVertices[4].U = 0.5f;
            patchVertices[4].V = 0.5f;

            patchVertices[5].X = 500;
            patchVertices[5].Y = -50;
            patchVertices[5].Z = 0;
            patchVertices[5].Nx = 0.5f;
            patchVertices[5].Ny = 0.5f;
            patchVertices[5].Nz = 0;
            patchVertices[5].U = 1;
            patchVertices[5].V = 0.5f;

            patchVertices[6].X = -500;
            patchVertices[6].Y = 0;
            patchVertices[6].Z = 500;
            patchVertices[6].Nx = -0.5f;
            patchVertices[6].Ny = 0.5f;
            patchVertices[6].Nz = 0;
            patchVertices[6].U = 0;
            patchVertices[6].V = 1;

            patchVertices[7].X = 0;
            patchVertices[7].Y = 500;
            patchVertices[7].Z = 500;
            patchVertices[7].Nx = 0;
            patchVertices[7].Ny = 0.5f;
            patchVertices[7].Nz = 0;
            patchVertices[7].U = 0.5f;
            patchVertices[7].V = 1;

            patchVertices[8].X = 500;
            patchVertices[8].Y = 200;
            patchVertices[8].Z = 800;
            patchVertices[8].Nx = 0.5f;
            patchVertices[8].Ny = 0.5f;
            patchVertices[8].Nz = 0;
            patchVertices[8].U = 1;
            patchVertices[8].V = 1;

            _patch = MeshManager.Instance.CreateBezierPatch("Bezier1", ResourceGroupManager.DefaultResourceGroupName, patchVertices, patchDeclaration, 3, 3, 5, 5, VisibleSide.Both, BufferUsage.StaticWriteOnly, BufferUsage.DynamicWriteOnly, true, true);
            _patch.Subdivision = 1.0f;

            _scene = _root.CreateSceneManager("DefaultSceneManager", "SLSharpInstance");
            _scene.ClearScene();

            _patchEntity = _scene.CreateEntity("Entity1", "Bezier1");
            _camera = _scene.CreateCamera("MainCamera");



            var mat = (Material)MaterialManager.Instance.Create("test", ResourceGroupManager.DefaultResourceGroupName);
            var pass = mat.GetTechnique(0).GetPass(0);
            pass.LightingEnabled = false;


            _patchEntity.MaterialName = mat.Name;

            _scene.RootSceneNode.AttachObject(_patchEntity);

            _camera.LookAt(Vector3.Zero);
            _camera.Near = 5;
            _camera.AutoAspectRatio = true;

            var vp = _root.AutoWindow.AddViewport(_camera, 0, 0, 1.0f, 1.0f, 100);
            vp.BackgroundColor = ColorEx.CornflowerBlue;

        }
示例#7
0
文件: Game.cs 项目: WolfgangSt/axiom
		public virtual void CreateSceneManager()
		{
			// Get the SceneManager, a generic one by default
			SceneManager = Engine.CreateSceneManager( "DefaultSceneManager", "GameSMInstance" );
			SceneManager.ClearScene();
		}