Skip to content

Camera ​

GameViewカメラの座標変換とレイ生成、前フレーム描画時点のスナップショットを参照する

使い方と前提条件 · C# API一覧

型の情報 ​

  • 名前空間:NEMEngine
  • 型:NEMEngine.Camera(Class)

ScreenPointToRay ​

csharp
public static bool ScreenPointToRay(Vector2 screenPos, out Ray ray)

GameViewピクセル座標(描画解像度基準・左上原点)からワールドレイを作る。カメラ未解決はfalse

引数型既定値
screenPosNEMEngine.Vector2必須
rayOut NEMEngine.Ray必須

戻り値:bool。

TryGetMousePositionInView ​

csharp
public static bool TryGetMousePositionInView(out Vector2 position)

GameView内のマウス座標を描画解像度基準で取得する。View外はfalse

引数型既定値
positionOut NEMEngine.Vector2必須

戻り値:bool。

TryGetMouseRay ​

csharp
public static bool TryGetMouseRay(out Ray ray)

マウス位置からワールドレイを作る。GameView外やカメラ未解決はfalse

引数型既定値
rayOut NEMEngine.Ray必須

戻り値:bool。

TryWorldToScreenPoint ​

csharp
public static bool TryWorldToScreenPoint(Vector3 worldPosition, out Vector2 screenPosition)

ワールド座標をGameViewピクセル座標へ変換しXYのみ返す

引数型既定値
worldPositionNEMEngine.Vector3必須
screenPositionOut NEMEngine.Vector2必須

戻り値:bool。

TryWorldToScreenPoint ​

csharp
public static bool TryWorldToScreenPoint(Vector3 worldPosition, out Vector3 screenPosition)

ワールド座標をGameViewピクセル座標へ変換する、Zはカメラ前方距離

引数型既定値
worldPositionNEMEngine.Vector3必須
screenPositionOut NEMEngine.Vector3必須

戻り値:bool。

WorldToScreenPoint ​

csharp
public static Vector3 WorldToScreenPoint(Vector3 worldPosition)

ワールド座標をGameViewピクセル座標へ変換する、失敗時はゼロを返す

引数型既定値
worldPositionNEMEngine.Vector3必須

戻り値:NEMEngine.Vector3。

WorldToScreenPoint2D ​

csharp
public static Vector2 WorldToScreenPoint2D(Vector3 worldPosition)

ワールド座標をGameViewピクセル座標へ変換しXYのみ返す

引数型既定値
worldPositionNEMEngine.Vector3必須

戻り値:NEMEngine.Vector2。

実行時の扱い ​

Nativeと接続する操作は、Scriptが実行される有効なWorld内で使用します。破棄したGameObjectやComponentへのアクセスは避けてください。設定Snapshotは取得・編集・反映を1組で扱います。

現行版マニュアル · 8ea58ba2 · 2026-10-28確認