「MonoGameのカメラを作る」の版間の差分
imported>Administrator 細 Administrator がページ「MonoGame/カメラを作る」を「MonoGameのカメラを作る」に移動しました |
imported>Administrator |
||
| (同じ利用者による、間の5版が非表示) | |||
| 2行目: | 2行目: | ||
<source lang="csharp"> | <source lang="csharp"> | ||
using System; | using System; | ||
using System.Collections.Generic; | using System.Collections.Generic; | ||
using System.Text; | using System.Text; | ||
using Microsoft.Xna.Framework; | using Microsoft.Xna.Framework; | ||
using Microsoft.Xna.Framework.Input; | using Microsoft.Xna.Framework.Input; | ||
public class Camera : GameComponent | public class Camera : GameComponent | ||
{ | { | ||
| 25行目: | 23行目: | ||
/// カメラの位置 | /// カメラの位置 | ||
/// </summary> | /// </summary> | ||
public Vector3 Position = new Vector3(0, 10, 10); | public Vector3 Position | ||
{ | |||
get { return _position; } | |||
set { _position = value; UpdateView(); } | |||
} | |||
private Vector3 _position = new Vector3(0, 10, 10); | |||
/// <summary> | /// <summary> | ||
/// カメラの焦点 | /// カメラの焦点 | ||
/// </summary> | /// </summary> | ||
public Vector3 Target = Vector3.Zero; | public Vector3 Target | ||
{ | |||
get { return _target; } | |||
set { _target = value; UpdateView(); } | |||
} | |||
private Vector3 _target = Vector3.Zero; | |||
/// <summary> | /// <summary> | ||
| 51行目: | 61行目: | ||
/// <summary> | /// <summary> | ||
/// カメラの上(傾き) | /// カメラの上(傾き) | ||
/// | /// フライトシミュレーターなどで飛行機が傾けばカメラも傾くアレ。 | ||
/// ラジアンではなく度で指定する。 | /// ラジアンではなく度で指定する。 | ||
/// </summary> | /// </summary> | ||
public float Angle = 0; | public float Angle { | ||
get { return _angle; } | |||
set { _angle = value; UpdateView(); } | |||
} | |||
private float _angle = 0; | |||
/// <summary> | /// <summary> | ||
| 171行目: | 186行目: | ||
} | } | ||
} | } | ||
</source> | </source> | ||
== 関連項目 == | |||
* [[MonoGameの3Dモデルを管理描画するクラスを作る]] | |||
* [[MacOS版のMonoGameのPipeline.appで3Dモデルをビルドできない]] | |||
* [[MonoGameで使う3DモデルをFusion360で作成する]] | |||
* [[MonoGameで外部のXNBファイルを読み込む]] | |||
* [[MonoGameでピクセルシェーダーを使ってテクスチャを貼る]] | |||
[[category: MonoGame]] | [[category: MonoGame]] | ||