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

CreateCamera() public method

Creates a camera to be managed by this scene manager.
This camera can be added to the scene at a later time using the AttachObject method of the SceneNode class.
public CreateCamera ( string name ) : Camera
name string
return Camera
		public virtual Camera CreateCamera( string name )
		{
			if ( this.cameraList.ContainsKey( name ) )
			{
				throw new AxiomException( string.Format( "A camera with the name '{0}' already exists in the scene.",
														 name ) );
			}

			// create the camera and add it to our local list
			Camera camera = new Camera( name, this );
			this.cameraList.Add( camera );

			return camera;
		}

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::CreateCamera
SceneManager