📄 firstpersoncameragamecomponent.cs
字号:
#region Using Statements
using System;
using System.Collections.Generic;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Graphics;
#endregion
namespace SceneryComponent.Components
{
/// <summary>
/// This is a game component that implements IUpdateable.
/// </summary>
public partial class FirstPersonCameraGameComponent : BaseCameraGameComponent
{
/// <summary>
/// Constructor
/// </summary>
/// <param name="game">Juego</param>
public FirstPersonCameraGameComponent(Game game)
: base(game)
{
}
/// <summary>
/// Allows the game component to update itself.
/// </summary>
/// <param name="gameTime">Provides a snapshot of timing values.</param>
public override void Update(GameTime gameTime)
{
// Obtener la direcci髇 fw de la matriz de rotaci髇 actual
m_Direction = gRotationMatrix.Forward;
// Calcular la matriz de vista
m_ViewMatrix = Matrix.CreateLookAt(
m_Position,
m_Position + m_Direction,
Vector3.Up);
}
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -