クォータニオン
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.threed.Struct, java.io.Serializable
public final class Quaternion implements Struct<Quaternion>, Serializable
クォータニオンは通常、コンピュータグラフィックスで回転を実行するために使用されます。
コンストラクタ
| コンストラクタ | 説明 |
|---|---|
| Quaternion(double w, double x, double y, double z) | 新しい Quaternion クラスのインスタンスを初期化します。 |
| Quaternion() |
フィールド
| フィールド | 説明 |
|---|---|
| IDENTITY | 単位クォータニオンです。 |
| w | w コンポーネント。 |
| x | x 成分。 |
| y | y 成分。 |
| z | z 成分。 |
メソッド
Quaternion(double w, double x, double y, double z)
public Quaternion(double w, double x, double y, double z)
新しい Quaternion クラスのインスタンスを初期化します。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| w | double | クォータニオンの w 成分 |
| x | double | クォータニオンの x 成分 |
| y | double | クォータニオンの y 成分 |
| z | double | クォータニオンの z 成分 |
Quaternion()
public Quaternion()
IDENTITY
public static final Quaternion IDENTITY
単位クォータニオンです。
w
public double w
w コンポーネント。
x
public double x
x 成分。
y
public double y
y 成分。
z
public double z
z 成分。
add(Quaternion lhs, Quaternion rhs)
public static Quaternion add(Quaternion lhs, Quaternion rhs)
- の演算子オーバーロード
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| lhs | Quaternion | 左クォータニオン |
| rhs | Quaternion | 右クォータニオン |
Returns: Quaternion - Result quaternion
clone()
public Quaternion clone()
現在のインスタンスをクローンする
Returns: Quaternion
concat(Quaternion rhs)
public Quaternion concat(Quaternion rhs)
2つのクォータニオンを連結する
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| rhs | Quaternion |
Returns: Quaternion
conjugate()
public Quaternion conjugate()
現在のクォータニオンの共役クォータニオンを返します
Returns: Quaternion - The conjugate quaternion.
copyFrom(Quaternion src)
public void copyFrom(Quaternion src)
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| src | Quaternion |
div(Quaternion lhs, double rhs)
public static Quaternion div(Quaternion lhs, double rhs)
/ の演算子オーバーロード
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| lhs | Quaternion | 左クォータニオン |
| rhs | double | 右クォータニオン |
Returns: Quaternion - Result quaternion
dot(Quaternion q)
public double dot(Quaternion q)
ドット積
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| q | Quaternion | クォータニオン |
Returns: double - ドット値
equals(Object obj)
public boolean equals(Object obj)
2つのクォータニオンが等しいか確認する
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| obj | java.lang.Object | 等価性をチェックするオブジェクト。 |
Returns: boolean - すべてのコンポーネントが完全に等しい場合は true。
eulerAngles()
public Vector3 eulerAngles()
クォータニオンをオイラー角で表される回転に変換します。すべての成分はラジアンです。
Returns: Vector3 - Result vector
fromAngleAxis(double a, Vector3 axis)
public static Quaternion fromAngleAxis(double a, Vector3 axis)
指定された軸の周りにクォータニオンを作成し、時計回りに回転させます
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| a | double | ラジアン単位の時計回り回転 |
| axis | Vector3 | 軸 |
Returns: Quaternion - Created quaternion
fromEulerAngle(Vector3 eulerAngle)
public static Quaternion fromEulerAngle(Vector3 eulerAngle)
指定されたオイラー角からクォータニオンを作成します
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| eulerAngle | Vector3 | ラジアン単位のオイラー角 |
Returns: Quaternion - Created quaternion
fromEulerAngle(double pitch, double yaw, double roll)
public static Quaternion fromEulerAngle(double pitch, double yaw, double roll)
指定されたオイラー角からクォータニオンを作成します
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| ピッチ | double | ラジアン単位のピッチ |
| ヨー | double | ラジアン単位のヨー |
| ロール | double | ラジアン単位のロール |
Returns: Quaternion - Created quaternion
fromRotation(Vector3 orig, Vector3 dest)
public static Quaternion fromRotation(Vector3 orig, Vector3 dest)
元の方向から目的方向へ回転するクォータニオンを作成します
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| orig | Vector3 | 元の方向 |
| dest | Vector3 | 目的地の方向 |
Returns: Quaternion - Created quaternion
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getLength()
public double getLength()
クォータニオンの長さを取得します
Returns: double - クォータニオンの長さ
hashCode()
public int hashCode()
クォータニオンのハッシュコードを取得します
Returns: int - Quaternion のハッシュコード
interpolate(float t, Quaternion from, Quaternion to)
public static Quaternion interpolate(float t, Quaternion from, Quaternion to)
このクォータニオンを、from と to の間の t に対して、与えられたクォータニオン引数間の補間値で設定します。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| t | float | 補間係数。 |
| from | Quaternion | ソースクォータニオン。 |
| to | Quaternion | ターゲットクォータニオン。 |
Returns: Quaternion - The interpolated quaternion.
inverse()
public Quaternion inverse()
現在のクォータニオンの逆クォータニオンを返します
Returns: Quaternion - Inverse quaternion.
mul(Quaternion lhs, Quaternion rhs)
public static Quaternion mul(Quaternion lhs, Quaternion rhs)
* の演算子オーバーロード
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| lhs | Quaternion | 左クォータニオン |
| rhs | Quaternion | 右クォータニオン |
Returns: Quaternion - Result quaternion
mul(Quaternion q, Vector3 v)
public static Vector3 mul(Quaternion q, Vector3 v)
* の演算子オーバーロード
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| q | Quaternion | 回転クォータニオン |
| v | Vector3 | 回転させるベクトル |
Returns: Vector3 - Rotated vector
mul(Quaternion q, Vector4 v)
public static Vector4 mul(Quaternion q, Vector4 v)
* の演算子オーバーロード
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| q | Quaternion | 回転クォータニオン |
| v | Vector4 | 回転させるベクトル |
Returns: Vector4 - Rotated vector
mul(Quaternion lhs, double rhs)
public static Quaternion mul(Quaternion lhs, double rhs)
* の演算子オーバーロード
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| lhs | Quaternion | 左クォータニオン |
| rhs | double | 右クォータニオン |
Returns: Quaternion - Result quaternion
mul(Vector3 v, Quaternion q)
public static Vector3 mul(Vector3 v, Quaternion q)
* の演算子オーバーロード
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| v | Vector3 | 回転クォータニオン |
| q | Quaternion | 回転させるベクトル |
Returns: Vector3 - Rotated vector
normalize()
public Quaternion normalize()
クォータニオンを正規化します
Returns: Quaternion - Normalized quaternion.
notify()
public final native void notify()
notifyAll()
public final native void notifyAll()
op_eq(Quaternion lhs, Quaternion rhs)
public static boolean op_eq(Quaternion lhs, Quaternion rhs)
クォータニオンの等価演算子
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| lhs | Quaternion | 左側の値。 |
| rhs | Quaternion | 右側の値。 |
Returns: boolean - すべてのコンポーネントが完全に等しい場合は true。
op_ne(Quaternion lhs, Quaternion rhs)
public static boolean op_ne(Quaternion lhs, Quaternion rhs)
クォータニオンの非等価演算子
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| lhs | Quaternion | 左側の値。 |
| rhs | Quaternion | 右側の値。 |
Returns: boolean - 2つのクォータニオンが等しくない場合は True。
slerp(double t, Quaternion v1, Quaternion v2)
public static Quaternion slerp(double t, Quaternion v1, Quaternion v2)
2つの値間で球面線形補間を実行します
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| t | double | t は 0 から 1 の間です |
| v1 | Quaternion | 最初の値 |
| v2 | Quaternion | 2番目の値 |
Returns: Quaternion
toAngleAxis(double[] angle, Vector3 axis)
public void toAngleAxis(double[] angle, Vector3 axis)
クォータニオンを角度と軸に分解します
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| 角度 | double[] | 回転角度(ラジアン単位)。 |
| axis | Vector3 | 回転軸。 |
toMatrix()
public Matrix4 toMatrix()
クォータニオンで表される回転を変換行列に変換します。
Returns: Matrix4 - The matrix representation of current quaternion.
toMatrix(Vector3 translation)
public Matrix4 toMatrix(Vector3 translation)
クォータニオンで表される回転を変換行列に変換します。
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| translation | Vector3 | 行列の平行移動部分。 |
Returns: Matrix4 - The matrix representation of current quaternion.
toString()
public String toString()
クォータニオンの文字列表現を取得します
Returns: java.lang.String - オブジェクト文字列
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
| パラメーター | 型 | 説明 |
|---|---|---|
| arg0 | long | |
| arg1 | int |