Vector2データ型
データ型日本語解説は準備中
ひとことで言うと
Vector2は、ロブロックス(Roblox)のデータ型です。くわしい日本語解説は準備中のため、下に公式の説明(英語)を載せています。
公式の説明(英語):Represents a 2D value with direction and magnitude.
コンストラクター(作り方)(1)
| 名前と書き方 | 説明 |
|---|---|
newVector2.new(x: number, y: number) | Returns a Vector2 from the given x and y components. |
プロパティ(4)
| 名前と書き方 | 説明 |
|---|---|
XVector2.X: number | The x-coordinate of the Vector2. |
YVector2.Y: number | The y-coordinate of the Vector2. |
MagnitudeVector2.Magnitude: number | The length of the Vector2. |
UnitVector2.Unit: Vector2 | A normalized copy of the Vector2. |
メソッド(11)
| 名前と書き方 | 説明 |
|---|---|
CrossVector2:Cross(other: Vector2): number | Returns the cross product of the two vectors. |
AbsVector2:Abs(): Vector2 | Returns a new vector from the absolute values of the original's components. |
CeilVector2:Ceil(): Vector2 | Returns a new vector from the ceiling of the original's components. |
FloorVector2:Floor(): Vector2 | Returns a new vector from the floor of the original's components. |
SignVector2:Sign(): Vector2 | Returns a new vector from the sign (-1, 0, or 1) of the original's components. |
AngleVector2:Angle(other: Vector2, isSigned: boolean): number | Returns the angle in radians between the two vectors. |
DotVector2:Dot(v: Vector2): number | Returns a scalar dot product of the two vectors. |
LerpVector2:Lerp(v: Vector2, alpha: number): Vector2 | Returns a Vector2 linearly interpolated between this Vector2 and the given goal by the given alpha. |
MaxVector2:Max(others...: Tuple): Vector2 | Returns a Vector2 with each component as the highest among the respective components of the provided Vector2 objects. |
MinVector2:Min(others...: Tuple): Vector2 | Returns a Vector2 with each component as the lowest among the respective components of the provided Vector2 objects. |
FuzzyEqVector2:FuzzyEq(other: Vector2, epsilon: number): bool | Returns true if the X and Y components of the other Vector2 are within epsilon units of each corresponding component of this Vector2. |
英語の説明とメンバーの一覧は、Roblox Creator Documentation(Vector2)をもとにしています(CC BY 4.0)。日本語の解説は、このサイトで独自に書いたものです。