表示テーマ
Transform
位置・回転・拡縮と親子関係を保持します。すべての通常GameObjectに付いています。
型の情報
- 名前空間:
NEMEngine - 型:
NEMEngine.Transform(Class) - 継承元:NEMEngine.Component
- Inspector:Transform
FromEntity
csharp
public static Transform FromEntity(GameObject gameObject)既にComponentを持つGameObjectから操作用の参照を作ります。Componentを追加する操作ではありません。
| 引数 | 型 | 既定値 |
|---|---|---|
gameObject | NEMEngine.GameObject | 必須 |
戻り値:NEMEngine.Transform。
GetChild
csharp
public Transform GetChild(int index)指定した子を取得し、範囲外は呼出し元へ返す
| 引数 | 型 | 既定値 |
|---|---|---|
index | int | 必須 |
戻り値:NEMEngine.Transform。
InverseTransformDirection
csharp
public Vector3 InverseTransformDirection(Vector3 direction)world direction をローカル空間へ戻す。
| 引数 | 型 | 既定値 |
|---|---|---|
direction | NEMEngine.Vector3 | 必須 |
戻り値:NEMEngine.Vector3。
InverseTransformPoint
csharp
public Vector3 InverseTransformPoint(Vector3 point)world point をこの Transform のローカル空間へ戻す。
| 引数 | 型 | 既定値 |
|---|---|---|
point | NEMEngine.Vector3 | 必須 |
戻り値:NEMEngine.Vector3。
LookAt
csharp
public void LookAt(Vector3 target)target を向く world 回転を設定する。target が現在位置とほぼ同じなら何もしない(ゼロ長 direction 対策)。
| 引数 | 型 | 既定値 |
|---|---|---|
target | NEMEngine.Vector3 | 必須 |
Rotate
csharp
public void Rotate(Quaternion rotation, Space space = Self)クォータニオンで回転を加える。Unity と同じく Self は localRotationdelta、World は deltarotation。
| 引数 | 型 | 既定値 |
|---|---|---|
rotation | NEMEngine.Quaternion | 必須 |
space | NEMEngine.Space | 0 |
Rotate
csharp
public void Rotate(Vector3 eulerAngles, Space space = Self)オイラー角(度)で回転を加える。Space.Self はローカル回転へ後乗算、Space.World はワールド回転へ前乗算。
| 引数 | 型 | 既定値 |
|---|---|---|
eulerAngles | NEMEngine.Vector3 | 必須 |
space | NEMEngine.Space | 0 |
SetParent
csharp
public void SetParent(Transform? parent, bool worldPositionStays = true)親の変更後もworld座標を保つか指定する
| 引数 | 型 | 既定値 |
|---|---|---|
parent | NEMEngine.Transform? | 必須 |
worldPositionStays | bool | True |
SetPositionAndRotation
csharp
public void SetPositionAndRotation(Vector3 position, Quaternion rotation)world position と world rotation を一括設定する(個別 setter と同じ内部実装へ委譲)。
| 引数 | 型 | 既定値 |
|---|---|---|
position | NEMEngine.Vector3 | 必須 |
rotation | NEMEngine.Quaternion | 必須 |
TransformDirection
csharp
public Vector3 TransformDirection(Vector3 direction)direction を world 回転で写す(位置・scale の影響は受けない)。
| 引数 | 型 | 既定値 |
|---|---|---|
direction | NEMEngine.Vector3 | 必須 |
戻り値:NEMEngine.Vector3。
TransformPoint
csharp
public Vector3 TransformPoint(Vector3 point)position を world 空間の point として変換する(lossyScale → world 回転 → world 位置)。
| 引数 | 型 | 既定値 |
|---|---|---|
point | NEMEngine.Vector3 | 必須 |
戻り値:NEMEngine.Vector3。
Translate
csharp
public void Translate(Vector3 translation, Space space = Self)translation 分だけ移動する。Space.Self は自身の回転を掛けたローカル軸方向、Space.World はワールド軸方向。
| 引数 | 型 | 既定値 |
|---|---|---|
translation | NEMEngine.Vector3 | 必須 |
space | NEMEngine.Space | 0 |
childCount
csharp
public int childCount子の数。firstChild / nextSibling を辿って数える(hierarchy は native 側が一貫管理)
操作:読取専用。
componentTypeID
csharp
public static int componentTypeID組み込みComponentの接続識別子です。通常のゲームコードではGetComponentで取得します。
操作:読取専用。
eulerAngles
csharp
public Vector3 eulerAnglesワールド回転をZXYの角度で扱う
操作:読取・変更。
forward
csharp
public Vector3 forwardworld 回転を基準にした各方向ベクトル
操作:読取専用。
ignoreParentRotation
csharp
public bool ignoreParentRotation親(エンティティ階層 / スキンメッシュのジョイント)追従で回転を無視するか。座標は常に追従する
操作:読取・変更。
ignoreParentScale
csharp
public bool ignoreParentScale親追従でスケールを無視するか
操作:読取・変更。
localEulerAngles
csharp
public Vector3 localEulerAnglesローカル回転をZXYの角度で扱う
操作:読取・変更。
localPosition
csharp
public Vector3 localPosition親に対するローカル位置です。
操作:読取・変更。
localRotation
csharp
public Quaternion localRotation親に対する回転Quaternionです。
操作:読取・変更。
localScale
csharp
public Vector3 localScale親に対する拡縮倍率です。
操作:読取・変更。
lossyScale
csharp
public Vector3 lossyScaleworld(lossy) scale。親階層の継承設定を反映した成分積の近似値(読み取り専用)
操作:読取専用。
parent
csharp
public Transform? parent親TransformまたはPhaseの追従設定です。
操作:読取・変更。
position
csharp
public Vector3 positionワールド空間の位置です。
操作:読取・変更。
right
csharp
public Vector3 right右方向の単位ベクトルです。
操作:読取専用。
rotation
csharp
public Quaternion rotationworld回転。親階層の継承設定を反映し、setも同じ親回転でlocalへ変換される
操作:読取・変更。
up
csharp
public Vector3 up上方向の単位ベクトルです。
操作:読取専用。
実行時の扱い
Nativeと接続する操作は、Scriptが実行される有効なWorld内で使用します。破棄したGameObjectやComponentへのアクセスは避けてください。設定Snapshotは取得・編集・反映を1組で扱います。