Version: 2021.2
言語: 日本語

Vector4

struct in UnityEngine

マニュアルに切り替える

説明

4 次元ベクトルの表現

この構造体は 4 成分のベクトル(例: メッシュの接線、シェーダーのパラメーター)を表現するために使用します。 他のほとんどのケースでは Vector3 を使用します。

Static 変数

negativeInfinityShorthand for writing Vector4(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity).
one Vector4(1, 1, 1, 1) と同じ意味
positiveInfinityShorthand for writing Vector4(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity).
zero Vector4(0, 0, 0, 0) と同じ意味

変数

magnitudeこのベクトルの長さを返します (読み取り専用)。
normalized magnitude を 1 としたベクトル(読み取り専用)
sqrMagnitudeベクトルの 2 乗の長さを返します(読み取り専用)
this[int]イデックスによって x、y、z、w にアクセスする。
wベクトルの W 成分
xベクトルの X 成分
yベクトルの Y 成分
zベクトルの Z 成分

コンストラクタ

Vector4与えられた x、y、z、w 成分で新規のベクトルを作成します

Public 関数

EqualsReturns true if the given vector is exactly equal to this vector.
Set既存の Vector4 に x、y、z、w の成分を設定します
ToStringReturns a formatted string for this vector.

Static 関数

Distance a と b の間の距離を返します
Dot2 つのベクトルの内積
Lerp直線上にある 2 つのベクトル間を補間します
LerpUnclamped直線上にある 2 つのベクトル間を補間します
Max2 つのベクトルで各成分の一番大きな値を使用してベクトルを作成します
Min2 つのベクトルで各成分の一番小さな値を使用してベクトルを作成します
MoveTowards現在の位置 current から target に向けて移動します
Normalize
Projectベクトルを別のベクトルに投影します。
Scale2 つのベクトルの各成分を乗算します

Operator

operator -別のベクトルと減算を行います
operator *数字とベクターで乗算します
operator /数字で Vector を除法します
operator +2 つのベクトルを加算します
operator ==Returns true if two vectors are approximately equal.
Vector2Converts a Vector4 to a Vector2.
Vector3Vector4 を Vector3 に変換します
Vector4 Vector3 を Vector4 に変換します
Vector4 Vector2 を Vector4 に変換します