Quaternion
Inheritance: java.lang.Object
All Implemented Interfaces: com.aspose.threed.Struct, java.io.Serializable
public final class Quaternion implements Struct<Quaternion>, Serializable
Quaternion wird üblicherweise verwendet, um Rotationen in der Computergrafik durchzuführen.
Konstruktoren
| Konstruktor | Beschreibung |
|---|---|
| Quaternion(double w, double x, double y, double z) | Initialisiert eine neue Instanz der Quaternion-Klasse. |
| Quaternion() |
Felder
| Feld | Beschreibung |
|---|---|
| IDENTITY | Der Identitäts-Quaternion. |
| w | Die w‑Komponente. |
| x | Die x‑Komponente. |
| y | Die y‑Komponente. |
| z | Die z‑Komponente. |
Methoden
| Methode | Beschreibung |
|---|---|
| add(Quaternion lhs, Quaternion rhs) | Operatorüberladung für + |
| clone() | |
| concat(Quaternion rhs) | Verkettet zwei Quaternionen |
| conjugate() | Gibt einen konjugierten Quaternion des aktuellen Quaternion zurück |
| copyFrom(Quaternion src) | |
| div(Quaternion lhs, double rhs) | Operatorüberladung für / |
| dot(Quaternion q) | Skalarprodukt |
| equals(Object obj) | Prüft, ob zwei Quaternionen gleich sind |
| eulerAngles() | Konvertiert den Quaternion in eine Rotation, die durch Euler-Winkel dargestellt wird. Alle Komponenten sind in Radiant. |
| fromAngleAxis(double a, Vector3 axis) | Erstellt einen Quaternion um die gegebene Achse und rotiert im Uhrzeigersinn |
| fromEulerAngle(Vector3 eulerAngle) | Erstellt einen Quaternion aus dem gegebenen Euler-Winkel |
| fromEulerAngle(double pitch, double yaw, double roll) | Erstellt einen Quaternion aus dem gegebenen Euler-Winkel |
| fromRotation(Vector3 orig, Vector3 dest) | Erstellt einen Quaternion, der von der ursprünglichen zur Zielrichtung rotiert |
| getClass() | |
| getLength() | Gibt die Länge des Quaternion zurück |
| hashCode() | Gibt den Hashcode des Quaternion zurück |
| interpolate(float t, Quaternion from, Quaternion to) | Füllt diesen Quaternion mit dem interpolierten Wert zwischen den angegebenen Quaternion-Argumenten für ein t zwischen von und bis. |
| inverse() | Gibt einen inversen Quaternion des aktuellen Quaternion zurück |
| mul(Quaternion lhs, Quaternion rhs) | Operatorüberladung für * |
| mul(Quaternion q, Vector3 v) | Operatorüberladung für * |
| mul(Quaternion q, Vector4 v) | Operatorüberladung für * |
| mul(Quaternion lhs, double rhs) | Operatorüberladung für * |
| mul(Vector3 v, Quaternion q) | Operatorüberladung für * |
| normalize() | Normalisiert den Quaternion |
| notify() | |
| notifyAll() | |
| op_eq(Quaternion lhs, Quaternion rhs) | Gleichheitsoperator für Quaternion |
| op_ne(Quaternion lhs, Quaternion rhs) | Ungleichheitsoperator für Quaternion |
| slerp(double t, Quaternion v1, Quaternion v2) | Führt eine sphärische lineare Interpolation zwischen zwei Werten durch |
| toAngleAxis(double[] angle, Vector3 axis) | Zerlegt den Quaternion in Winkel und Achse |
| toMatrix() | Konvertiert die durch den Quaternion dargestellte Rotation in eine Transformationsmatrix. |
| toMatrix(Vector3 translation) | Konvertiert die durch den Quaternion dargestellte Rotation in eine Transformationsmatrix. |
| toString() | Gibt die Darstellung des Quaternion als Zeichenkette zurück |
| wait() | |
| wait(long arg0) | |
| wait(long arg0, int arg1) |
Quaternion(double w, double x, double y, double z)
public Quaternion(double w, double x, double y, double z)
Initialisiert eine neue Instanz der Quaternion-Klasse.
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| w | double | w‑Komponente des Quaternion |
| x | double | x‑Komponente des Quaternion |
| y | double | y‑Komponente des Quaternion |
| z | double | z‑Komponente des Quaternion |
Quaternion()
public Quaternion()
IDENTITY
public static final Quaternion IDENTITY
Der Identitäts-Quaternion.
w
public double w
Die w‑Komponente.
x
public double x
Die x‑Komponente.
y
public double y
Die y‑Komponente.
z
public double z
Die z‑Komponente.
add(Quaternion lhs, Quaternion rhs)
public static Quaternion add(Quaternion lhs, Quaternion rhs)
Operatorüberladung für +
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| lhs | Quaternion | Linkes Quaternion |
| rhs | Quaternion | Rechtes Quaternion |
Returns: Quaternion - Result quaternion
clone()
public Quaternion clone()
Klone aktuelle Instanz
Returns: Quaternion
concat(Quaternion rhs)
public Quaternion concat(Quaternion rhs)
Verkettet zwei Quaternionen
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| rhs | Quaternion |
Returns: Quaternion
conjugate()
public Quaternion conjugate()
Gibt einen konjugierten Quaternion des aktuellen Quaternion zurück
Returns: Quaternion - The conjugate quaternion.
copyFrom(Quaternion src)
public void copyFrom(Quaternion src)
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| src | Quaternion |
div(Quaternion lhs, double rhs)
public static Quaternion div(Quaternion lhs, double rhs)
Operatorüberladung für /
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| lhs | Quaternion | Linkes Quaternion |
| rhs | double | Rechtes Quaternion |
Returns: Quaternion - Result quaternion
dot(Quaternion q)
public double dot(Quaternion q)
Skalarprodukt
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| q | Quaternion | Das Quaternion |
Returns: double - Punktwert
equals(Object obj)
public boolean equals(Object obj)
Prüft, ob zwei Quaternionen gleich sind
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| obj | java.lang.Object | Das Objekt zum Prüfen der Gleichheit. |
Returns: boolean - Wahr, wenn alle Komponenten identisch gleich sind.
eulerAngles()
public Vector3 eulerAngles()
Konvertiert den Quaternion in eine Rotation, die durch Euler-Winkel dargestellt wird. Alle Komponenten sind in Radiant.
Returns: Vector3 - Result vector
fromAngleAxis(double a, Vector3 axis)
public static Quaternion fromAngleAxis(double a, Vector3 axis)
Erstellt einen Quaternion um die gegebene Achse und rotiert im Uhrzeigersinn
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| a | double | Uhrzeigersinn‑Drehung in Radiant |
| axis | Vector3 | Achse |
Returns: Quaternion - Created quaternion
fromEulerAngle(Vector3 eulerAngle)
public static Quaternion fromEulerAngle(Vector3 eulerAngle)
Erstellt einen Quaternion aus dem gegebenen Euler-Winkel
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| eulerAngle | Vector3 | Euler‑Winkel in Radiant |
Returns: Quaternion - Created quaternion
fromEulerAngle(double pitch, double yaw, double roll)
public static Quaternion fromEulerAngle(double pitch, double yaw, double roll)
Erstellt einen Quaternion aus dem gegebenen Euler-Winkel
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| Neigung | double | Neigung in Radiant |
| Gier | double | Gier in Radiant |
| Roll | double | Roll in Radiant |
Returns: Quaternion - Created quaternion
fromRotation(Vector3 orig, Vector3 dest)
public static Quaternion fromRotation(Vector3 orig, Vector3 dest)
Erstellt einen Quaternion, der von der ursprünglichen zur Zielrichtung rotiert
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| orig | Vector3 | Ursprüngliche Richtung |
| dest | Vector3 | Zielrichtung |
Returns: Quaternion - Created quaternion
getClass()
public final native Class<?> getClass()
Returns: java.lang.Class
getLength()
public double getLength()
Gibt die Länge des Quaternion zurück
Returns: double - die Länge des Quaternion
hashCode()
public int hashCode()
Gibt den Hashcode des Quaternion zurück
Returns: int - Der Hashcode des Quaternion
interpolate(float t, Quaternion from, Quaternion to)
public static Quaternion interpolate(float t, Quaternion from, Quaternion to)
Füllt diesen Quaternion mit dem interpolierten Wert zwischen den angegebenen Quaternion-Argumenten für ein t zwischen von und bis.
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| t | float | Der Koeffizient zum Interpolieren. |
| from | Quaternion | Quell‑Quaternion. |
| to | Quaternion | Ziel‑Quaternion. |
Returns: Quaternion - The interpolated quaternion.
inverse()
public Quaternion inverse()
Gibt einen inversen Quaternion des aktuellen Quaternion zurück
Returns: Quaternion - Inverse quaternion.
mul(Quaternion lhs, Quaternion rhs)
public static Quaternion mul(Quaternion lhs, Quaternion rhs)
Operatorüberladung für *
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| lhs | Quaternion | Linkes Quaternion |
| rhs | Quaternion | Rechtes Quaternion |
Returns: Quaternion - Result quaternion
mul(Quaternion q, Vector3 v)
public static Vector3 mul(Quaternion q, Vector3 v)
Operatorüberladung für *
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| q | Quaternion | Das Rotations‑Quaternion |
| v | Vector3 | Vektor zum Drehen |
Returns: Vector3 - Rotated vector
mul(Quaternion q, Vector4 v)
public static Vector4 mul(Quaternion q, Vector4 v)
Operatorüberladung für *
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| q | Quaternion | Das Rotations‑Quaternion |
| v | Vector4 | Vektor zum Drehen |
Returns: Vector4 - Rotated vector
mul(Quaternion lhs, double rhs)
public static Quaternion mul(Quaternion lhs, double rhs)
Operatorüberladung für *
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| lhs | Quaternion | Linkes Quaternion |
| rhs | double | Rechtes Quaternion |
Returns: Quaternion - Result quaternion
mul(Vector3 v, Quaternion q)
public static Vector3 mul(Vector3 v, Quaternion q)
Operatorüberladung für *
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| v | Vector3 | Das Rotations‑Quaternion |
| q | Quaternion | Vektor zum Drehen |
Returns: Vector3 - Rotated vector
normalize()
public Quaternion normalize()
Normalisiert den Quaternion
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)
Gleichheitsoperator für Quaternion
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| lhs | Quaternion | Linker Handwert. |
| rhs | Quaternion | Rechter Handwert. |
Returns: boolean - Wahr, wenn alle Komponenten identisch gleich sind.
op_ne(Quaternion lhs, Quaternion rhs)
public static boolean op_ne(Quaternion lhs, Quaternion rhs)
Ungleichheitsoperator für Quaternion
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| lhs | Quaternion | Linker Handwert. |
| rhs | Quaternion | Rechter Handwert. |
Returns: boolean – Wahr, wenn zwei Quaternionen nicht gleich sind.
slerp(double t, Quaternion v1, Quaternion v2)
public static Quaternion slerp(double t, Quaternion v1, Quaternion v2)
Führt eine sphärische lineare Interpolation zwischen zwei Werten durch
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| t | double | t liegt zwischen 0 und 1 |
| v1 | Quaternion | Erster Wert |
| v2 | Quaternion | Zweiter Wert |
Returns: Quaternion
toAngleAxis(double[] angle, Vector3 axis)
public void toAngleAxis(double[] angle, Vector3 axis)
Zerlegt den Quaternion in Winkel und Achse
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| angle | double[] | Der Winkel zum Drehen, in Radiant. |
| axis | Vector3 | Die Achse, um die rotiert wird. |
toMatrix()
public Matrix4 toMatrix()
Konvertiert die durch den Quaternion dargestellte Rotation in eine Transformationsmatrix.
Returns: Matrix4 - The matrix representation of current quaternion.
toMatrix(Vector3 translation)
public Matrix4 toMatrix(Vector3 translation)
Konvertiert die durch den Quaternion dargestellte Rotation in eine Transformationsmatrix.
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| translation | Vector3 | Der Translationsanteil der Matrix. |
Returns: Matrix4 - The matrix representation of current quaternion.
toString()
public String toString()
Gibt die Darstellung des Quaternion als Zeichenkette zurück
Returns: java.lang.String - Objektzeichenkette
wait()
public final void wait()
wait(long arg0)
public final void wait(long arg0)
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| arg0 | long |
wait(long arg0, int arg1)
public final void wait(long arg0, int arg1)
Parameters:
| Parameter | Typ | Beschreibung |
|---|---|---|
| arg0 | long | |
| arg1 | int |