當前位置: 首頁>>代碼示例>>C#>>正文


C# Camera.Update方法代碼示例

本文整理匯總了C#中Camera.Update方法的典型用法代碼示例。如果您正苦於以下問題:C# Camera.Update方法的具體用法?C# Camera.Update怎麽用?C# Camera.Update使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Camera的用法示例。


在下文中一共展示了Camera.Update方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Run

        public static void Run(int value, Camera camera, List<Figure> objects, List<Light> lights)
        {
            foreach (Figure figure in objects)
                figure.Update(value);

            camera.Update(value);
        }
開發者ID:cristiandonosoc,項目名稱:Scene-Editor,代碼行數:7,代碼來源:Update.cs

示例2: Setup

		public void Setup()
		{
			var viewport = new Viewport {Width = 640, Height = 480};
			var camera = new Camera {Target = Vector.Forward, Position = Vector.Zero};
			camera.Prepare(viewport);
			camera.Update();
			_frustum = new Frustum();
			_frustum.SetCameraDefinition(camera);
		}
開發者ID:tekbob27,項目名稱:Balder,代碼行數:9,代碼來源:FrustumTests.cs

示例3: GettingObjectAtCenterOfScreenWithSingleObjectAtCenterOfSceneShouldReturnTheObject

        public void GettingObjectAtCenterOfScreenWithSingleObjectAtCenterOfSceneShouldReturnTheObject()
        {
            var viewport = new Viewport {Width = 640, Height = 480};
            var scene = new Scene();
            var camera = new Camera(viewport) {Position = {Z = -10}};
            camera.Update();

            var node = new Geometry
                       	{
                       		BoundingSphere = new BoundingSphere(Vector.Zero, 10f)
                       	};
            scene.AddNode(node);

            var nodeAtCoordinate = scene.GetNodeAtScreenCoordinate(viewport, viewport.Width / 2, viewport.Height / 2);
            Assert.That(nodeAtCoordinate, Is.Not.Null);
            Assert.That(nodeAtCoordinate, Is.EqualTo(node));
        }
開發者ID:Conn,項目名稱:Balder,代碼行數:17,代碼來源:SceneTests.cs

示例4: InitializeScene

		private static void InitializeScene(IceScene _scene)
		{
			_scene.InitializeContent(Game.Instance.Services);
			// Create a default full sized camera            
			Camera camera = new Camera();
			camera.Position = Vector2.Zero;
			camera.Update(1/60f);
			_scene.ActiveCameras.Add(camera);
			
			// Load Materials
			foreach (Material _material in _scene.Materials)
			{
				_material.Texture = _scene._content.Load<Texture2D>(_material.Filename.Substring(0, _material.Filename.Length - 4));
				_material.Scope = AssetScope.Local;
			}
			// Load Fonts
			foreach (IceFont _font in _scene.Fonts)
			{
				_font.Font = _scene._content.Load<SpriteFont>(_font.Filename.Replace(".spritefont", ""));
			}
			#if !XNATOUCH
			foreach (IceEffect _effect in _scene.Effects)
			{
				if (_effect.Effects != null)
				{
					continue;
				}
				// removing ".fx" from the name
				string name = _effect.Filename.Substring(0, _effect.Filename.Length - 3);
				_effect.Load(GlobalDataHolder.ContentManager, new string[] { name });
			}
			#endif
			//Load Scene Components
			foreach (IceSceneComponent _comp in _scene.SceneComponents)
			{
				_comp.SetOwner(_scene);
				_comp.OnRegister();
			}
			//Register Scene Items 
			for (int i = 0; i < _scene.SceneItems.Count; i++)
			{
				SceneItem item = _scene.SceneItems[i];
				item.SceneParent = _scene;
				if (item.IsRegistered == false)
				{
					item.OnRegister();
				}
			}
		}
開發者ID:eickegao,項目名稱:tiny2d,代碼行數:49,代碼來源:SceneManager.cs


注:本文中的Camera.Update方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。