言語: 日本語
  • C#
  • JS
  • Boo

スクリプト言語

お好みのスクリプト言語を選択すると、サンプルコードがその言語で表示されます。

Vector4

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Sumbission failed

For some reason your suggested change could not be submitted. Please try again in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

4次元ベクトルの表現

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

Static Variables

one Vector4(1,1,1,1) と同じ意味
zero Vector4(0,0,0,0) と同じ意味

Variables

magnitude ベクトルの長さを返します (Read Only)
normalized magnitude を1としたベルトル (Read Only)
sqrMagnitude ベクトルの2乗の長さを返します (Read Only)
this[int] [0]、[1]、[2]、[3]を使用して x 、 y 、 z 、 w 成分にアクセスします
w ベクトルのW成分
x ベクトルのX成分
y ベクトルのY成分
z ベクトルのZ成分

Constructors

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

Functions

Set 既存のVector4にx、y、z、wの成分を設定します
ToString ベクトルの値を見やすくフォーマットされた文字列

Static Functions

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

Operators

operator - 別のベクトルと減算を行います
operator != ベクトルが異なる場合、trueを返します
operator * 数字とベクターで乗算します
operator / 数字でVectorを除法します
operator + 2つのベクトルを加算します
operator == ベクターが等しい場合はtrueを返します
Vector2 Vector4をVector2に変換します
Vector3 Vector4をVector3に変換します
Vector4 Vector3をVector4に変換します
Vector4 Vector2をVector4に変換します