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

KonstruktorBeschreibung
Quaternion(double w, double x, double y, double z)Initialisiert eine neue Instanz der Quaternion-Klasse.
Quaternion()

Felder

FeldBeschreibung
IDENTITYDer Identitäts-Quaternion.
wDie w‑Komponente.
xDie x‑Komponente.
yDie y‑Komponente.
zDie z‑Komponente.

Methoden

MethodeBeschreibung
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:

ParameterTypBeschreibung
wdoublew‑Komponente des Quaternion
xdoublex‑Komponente des Quaternion
ydoubley‑Komponente des Quaternion
zdoublez‑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:

ParameterTypBeschreibung
lhsQuaternionLinkes Quaternion
rhsQuaternionRechtes 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:

ParameterTypBeschreibung
rhsQuaternion

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:

ParameterTypBeschreibung
srcQuaternion

div(Quaternion lhs, double rhs)

public static Quaternion div(Quaternion lhs, double rhs)

Operatorüberladung für /

Parameters:

ParameterTypBeschreibung
lhsQuaternionLinkes Quaternion
rhsdoubleRechtes Quaternion

Returns: Quaternion - Result quaternion

dot(Quaternion q)

public double dot(Quaternion q)

Skalarprodukt

Parameters:

ParameterTypBeschreibung
qQuaternionDas Quaternion

Returns: double - Punktwert

equals(Object obj)

public boolean equals(Object obj)

Prüft, ob zwei Quaternionen gleich sind

Parameters:

ParameterTypBeschreibung
objjava.lang.ObjectDas 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:

ParameterTypBeschreibung
adoubleUhrzeigersinn‑Drehung in Radiant
axisVector3Achse

Returns: Quaternion - Created quaternion

fromEulerAngle(Vector3 eulerAngle)

public static Quaternion fromEulerAngle(Vector3 eulerAngle)

Erstellt einen Quaternion aus dem gegebenen Euler-Winkel

Parameters:

ParameterTypBeschreibung
eulerAngleVector3Euler‑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:

ParameterTypBeschreibung
NeigungdoubleNeigung in Radiant
GierdoubleGier in Radiant
RolldoubleRoll 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:

ParameterTypBeschreibung
origVector3Ursprüngliche Richtung
destVector3Zielrichtung

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:

ParameterTypBeschreibung
tfloatDer Koeffizient zum Interpolieren.
fromQuaternionQuell‑Quaternion.
toQuaternionZiel‑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:

ParameterTypBeschreibung
lhsQuaternionLinkes Quaternion
rhsQuaternionRechtes Quaternion

Returns: Quaternion - Result quaternion

mul(Quaternion q, Vector3 v)

public static Vector3 mul(Quaternion q, Vector3 v)

Operatorüberladung für *

Parameters:

ParameterTypBeschreibung
qQuaternionDas Rotations‑Quaternion
vVector3Vektor zum Drehen

Returns: Vector3 - Rotated vector

mul(Quaternion q, Vector4 v)

public static Vector4 mul(Quaternion q, Vector4 v)

Operatorüberladung für *

Parameters:

ParameterTypBeschreibung
qQuaternionDas Rotations‑Quaternion
vVector4Vektor zum Drehen

Returns: Vector4 - Rotated vector

mul(Quaternion lhs, double rhs)

public static Quaternion mul(Quaternion lhs, double rhs)

Operatorüberladung für *

Parameters:

ParameterTypBeschreibung
lhsQuaternionLinkes Quaternion
rhsdoubleRechtes Quaternion

Returns: Quaternion - Result quaternion

mul(Vector3 v, Quaternion q)

public static Vector3 mul(Vector3 v, Quaternion q)

Operatorüberladung für *

Parameters:

ParameterTypBeschreibung
vVector3Das Rotations‑Quaternion
qQuaternionVektor 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:

ParameterTypBeschreibung
lhsQuaternionLinker Handwert.
rhsQuaternionRechter 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:

ParameterTypBeschreibung
lhsQuaternionLinker Handwert.
rhsQuaternionRechter 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:

ParameterTypBeschreibung
tdoublet liegt zwischen 0 und 1
v1QuaternionErster Wert
v2QuaternionZweiter Wert

Returns: Quaternion

toAngleAxis(double[] angle, Vector3 axis)

public void toAngleAxis(double[] angle, Vector3 axis)

Zerlegt den Quaternion in Winkel und Achse

Parameters:

ParameterTypBeschreibung
angledouble[]Der Winkel zum Drehen, in Radiant.
axisVector3Die 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:

ParameterTypBeschreibung
translationVector3Der 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:

ParameterTypBeschreibung
arg0long

wait(long arg0, int arg1)

public final void wait(long arg0, int arg1)

Parameters:

ParameterTypBeschreibung
arg0long
arg1int