Version: 2021.2
言語: 日本語

Vector3

struct in UnityEngine

マニュアルに切り替える

説明

3D ベクトルと位置の表現

This structure is used throughout Unity to pass 3D positions and directions around. It also contains functions for doing common vector operations.

Besides the functions listed below, other classes can be used to manipulate vectors and points as well. For example the Quaternion and the Matrix4x4 classes are useful for rotating or transforming vectors and points.

Static 変数

back Vector3(0, 0, -1) と同じ意味
down Vector3(0, -1, 0) と同じ意味
forward Vector3(0, 0, 1) と同じ意味
left Vector3(-1, 0, 0) と同じ意味
negativeInfinityShorthand for writing Vector3(float.NegativeInfinity, float.NegativeInfinity, float.NegativeInfinity).
one Vector3(1, 1, 1) と同じ意味
positiveInfinityShorthand for writing Vector3(float.PositiveInfinity, float.PositiveInfinity, float.PositiveInfinity).
right Vector3(1, 0, 0) と同じ意味
up Vector3(0, 1, 0) と同じ意味
zero Vector3(0, 0, 0) と同じ意味

変数

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

コンストラクタ

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

Public 関数

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

Static 関数

AngleCalculates the angle between vectors from and.
ClampMagnitude大きさを maxLength までに制限した vector のコピーを返します
Cross2 つのベクトルの外積
Distance a と b の間の距離を返します
Dot2 つのベクトルの内積
LerpLinearly interpolates between two points.
LerpUnclamped直線上にある 2 つのベクトル間を補間します
Max2 つのベクトルで各成分の一番大きな値を使用してベクトルを作成します
Min2 つのベクトルで各成分の一番小さな値を使用してベクトルを作成します
MoveTowardsCalculate a position between the points specified by current and target, moving no farther than the distance specified by maxDistanceDelta.
Normalize magnitude を 1 としたベクトルを作成します
OrthoNormalizeベクトルが正規化され他のベクトルと直交するようにします
Projectベクトルを別のベクトルに投影します。
ProjectOnPlane平面に垂直な法線ベクトルによって定義される平面上にベクトルを射影します。
Reflect法線で定義された平面でベクトルを反射します。
RotateTowards現在の位置 current から target に向けてベクトルを回転します。
Scale2 つのベクトルの各成分を乗算します
SignedAngleCalculates the signed angle between vectors from and to in relation to axis.
Slerp球状に 2 つのベクトル間を補間します
SlerpUnclamped球状に 2 つのベクトル間を補間します
SmoothDamp目的地に向かって時間の経過とともに徐々にベクトルを変化させます

Operator

operator -別のベクトルと減算を行います
operator !=Returns true if vectors are different.
operator *数字とベクターで乗算します
operator /数字で Vector を除法します
operator +2 つのベクトルを加算します
operator ==Returns true if two vectors are approximately equal.