Vector3

パブリック クラス Vector3

3 つの浮動小数点数を持つ Vector。

フィールド

public float x
public float y
public float z

パブリック コンストラクタ

Vector3()
Vector3 を作成し、すべての値にゼロを割り当てる
Vector3(float x、float y、float z)
Vector3 を作成し、各値を割り当てる
Vector3Vector3 v)
Vector3 を作成し、値をコピーする

パブリック メソッド

static Vector3
addVector3 lhs、Vector3 rhs)
2 つの Vector3 を追加する
static float
angleBetweenVectors(Vector3 a, Vector3 b)
2 つのベクトル間の最短角度を度数で返します。
static Vector3
back()
(0, 0, 1) に設定された Vector3 を取得します
static Vector3
cross(Vector3 lhs, Vector3 rhs)
2 つの Vector3 のクロス積を取得
static float
dotVector3 lhs、Vector3 rhs)
2 つの Vector3 のドット積を取得する
static Vector3
down()
(0, -1, 0) に設定された Vector3 を取得します
static ブール値
equals(Vector3 lhs, Vector3 rhs)
各コンポーネントが許容範囲内で等しい場合、2 つの Vector3 が等しいことを比較します。
ブール値
equalsObject other)
他のオブジェクトが Vector3 であり、各コンポーネントが許容範囲内で等しい場合は true を返します。
static Vector3
forward()
(0, 0, -1) に設定された Vector3 を取得します
static Vector3
left()
(-1、0、0)に設定された Vector3 を取得します。
浮動小数点数
length()
浮動小数点数
static Vector3
lerpVector3 a、Vector3 b、float t)
a と b との間の線形補間を行います。
static Vector3
maxVector3 lh、Vector3 rhs)
各値を要素ごとに最大 2 つの Vector3' 値に設定して、Vector3 を取得します。
static Vector3
minVector3 lhs、Vector3 rhs)
各値を要素単位の 2 つ以上の Vector3' 値に設定して、Vector3 を取得します
Vector3
negated()
Vector3 を否定する
Vector3
正規化()
Vector3 を単位の長さにスケーリングします
static Vector3
one()
すべての値を 1 に設定した Vector3 を取得します
static Vector3
right()
(1, 0, 0) に設定された Vector3 を取得します
Vector3
によりスケーリング(浮動小数点数 a)
Vector3 を均一にスケーリングします。
void
setVector3 v)
別の Vector3 の値をこの Vector3 にコピーします。
void
set(float vx、float vy、float vz)
それぞれの値を設定
static Vector3
subtractVector3 lhs、Vector3 rhs)
2 つの Vector3 を引きます
文字列
static Vector3
up()
(0, 1, 0) に設定された Vector3 を取得します
static Vector3
zero()
すべての値が 0 に設定された Vector3 を取得します

継承されるメソッド

フィールド

public-float x

public-float y

public-float z

パブリック コンストラクタ

public Vector3 ()

Vector3 を作成し、すべての値にゼロを割り当てる

public Vector3 (float x、float y、float z)

Vector3 を作成し、各値を割り当てる

パラメータ
x
y
z

public Vector3 Vector3 v)

Vector3 を作成し、値をコピーする

パラメータ
v

パブリック メソッド

public static Vector3 add (Vector3 lhs, Vector3 rhs)

2 つの Vector3 を追加する

パラメータ
Lhs
RHH
戻り値
  • Vector3 を組み合わせた場合

public static float angleBetweenVectors (Vector3 a, Vector3 b)

2 つのベクトル間の最短角度を度数で返します。結果は、180 度を超えることはありません。

パラメータ
a
b

public static Vector3 back ()

(0, 0, 1) に設定された Vector3 を取得します

public static Vector3 cross (Vector3 lhs, Vector3 rhs)

2 つの Vector3 のクロス積を取得

パラメータ
Lhs
RHH
戻り値
  • Vector3 に垂直な Vector3

public static float dot (Vector3 lhs, Vector3 rhs)

2 つの Vector3 のドット積を取得する

パラメータ
Lhs
RHH
戻り値
  • Vector3 のスカラー積

public static Vector3 down ()

(0, -1, 0) に設定された Vector3 を取得します

public static boolean equals (Vector3 lhs, Vector3 rhs)

各コンポーネントが許容範囲内で等しい場合、2 つの Vector3 が等しいことを比較します。

パラメータ
Lhs
RHH

public boolean equals (Object other)

他のオブジェクトが Vector3 であり、各コンポーネントが許容範囲内で等しい場合は true を返します。

パラメータ
その他

public static Vector3 forward ()

(0, 0, -1) に設定された Vector3 を取得します

public static Vector3 left ()

(-1、0、0)に設定された Vector3 を取得します。

public float length ()

public float lengthSquared ()

public static Vector3 lerp (Vector3 a、Vector3 b、float t)

a と b との間の線形補間を行います。

パラメータ
a 開始値
b 終了値
t 2 つの浮動小数点数の間の比率。
戻り値
  • 2 つの浮動小数点数間で補間される値

public static Vector3 max (Vector3 lhs、Vector3 rhs)

各値を要素ごとに最大 2 つの Vector3' 値に設定して、Vector3 を取得します。

パラメータ
Lhs
RHH

public static Vector3 min (Vector3 lhs、Vector3 rhs)

各値を要素単位の 2 つ以上の Vector3' 値に設定して、Vector3 を取得します

パラメータ
Lhs
RHH

public Vector3 negated ()

Vector3 を否定する

戻り値
  • 逆方向の Vector3

public Vector3 正規化 ()

Vector3 を単位の長さにスケーリングします

public static Vector3 one ()

すべての値を 1 に設定した Vector3 を取得します

public static Vector3 right ()

(1, 0, 0) に設定された Vector3 を取得します

public Vector3 scaled (float a)

Vector3 を均一にスケーリングします。

パラメータ
a
戻り値
  • Vector3 にスカラー量を掛けた値

public void set (Vector3 v)

別の Vector3 の値をこの Vector3 にコピーします。

パラメータ
v

public void set (float vx、float vy、float vz)

それぞれの値を設定

パラメータ
vx
vy
VZ

public static Vector3 減算 (Vector3 lhs, Vector3 rhs)

2 つの Vector3 を引きます

パラメータ
Lhs
RHH
戻り値
  • Vector3 を組み合わせた場合

public String toString ()

public static Vector3 up ()

(0, 1, 0) に設定された Vector3 を取得します

public static Vector3 zero ()

すべての値が 0 に設定された Vector3 を取得します