Axiom.Core.SceneManager.ClearScene C# (CSharp) Method

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
		public virtual void ClearScene()
		{
			DestroyAllStaticGeometry();
			this.DestroyAllMovableObjects();

			if ( this.rootSceneNode != null )
			{
				this.rootSceneNode.RemoveAllChildren();
				this.rootSceneNode.DetachAllObjects();
			}

			// Delete all SceneNodes, except root that is
			foreach ( Node node in sceneNodeList )
			{
				foreach ( SceneNode currentNode in this.sceneNodeList.Values )
				{
					if ( !currentNode.IsDisposed )
						currentNode.Dispose();
				}
			}
			this.sceneNodeList.Clear();

			if ( this.autoTrackingSceneNodes != null )
			{
				this.autoTrackingSceneNodes.Clear();
			}

			// Clear animations
			this.DestroyAllAnimations();

			// Remove sky nodes since they've been deleted
			this.skyBoxNode = this.skyPlaneNode = this.skyDomeNode = null;
			this.isSkyBoxEnabled = this.isSkyPlaneEnabled = this.isSkyDomeEnabled = false;

			if ( renderQueue != null )
				renderQueue.Clear();
		}

Usage Example

Beispiel #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;
        }
All Usage Examples Of Axiom.Core.SceneManager::ClearScene
SceneManager