当前位置: 首页>>代码示例>>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;未经允许,请勿转载。