本文整理汇总了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);
}
示例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);
}
示例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));
}
示例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();
}
}
}