vector4d QML Value Type
Ein Typ vector4d hat die Attribute x, y, z und w. Mehr...
Detaillierte Beschreibung
Ein Typ vector4d
hat die Attribute x
, y
, z
und w
, ansonsten entspricht er dem Typ vector3d
.
Eigenschaften des Typs vector4d
haben standardmäßig einen Nullvektor. Dieser hat x
, y
,z
und w
auf 0
gesetzt.
Weitere Informationen finden Sie in der Dokumentation zum Typ vector3d
.
Um einen vector4d
Wert zu erstellen, geben Sie ihn als "x,y,z,w" String an, oder definieren Sie die Komponenten einzeln, oder setzen Sie ihn mit der Funktion Qt.vector4d() zusammen.
Der Typ vector4d hat die folgenden idempotenten Funktionen, die in QML aufgerufen werden können:
Funktion Signatur | Beschreibung | Beispiel |
---|---|---|
real PunktProdukt(vector4d andere) | Liefert das skalare reelle Ergebnis des Punktprodukts von this vector4d mit other vector4d | |
vector4d times(matrix4x4 matrix) | Gibt das vector4d-Ergebnis der Transformation von this vector4d mit der 4x4 matrix zurück, wobei die Matrix nach dem Vektor angewendet wird | |
vector4d times(vector4d other) | Gibt das vector4d-Ergebnis der Multiplikation von this vector4d mit dem other vector4d zurück | |
vector4d times(real factor) | Liefert das vector4d-Ergebnis der Multiplikation von this vector4d mit dem Skalar factor | var a = Qt.vector4d(1,2,3,4); var b = 4.48; var c = a.times(b); console.log(c.toString()); // QVector3D(4.48, 8.96, 13.44, 17.92) |
vector4d plus(vector4d other) | Gibt das vector4d-Ergebnis der Addition von this vector4d mit dem other vector4d zurück | |
vector4d minus(vector4d andere) | Gibt das vector4d-Ergebnis der Subtraktion von other vector4d von this vector4d zurück | |
vector4d normalisiert() | Gibt die normalisierte Form von this vector zurück | var a = Qt.vector4d(1,2,3,4); var b = a.normalized(); console.log(b.toString()); // QVector4D(0.182574, 0.365148, 0.547723, 0.730297) |
real length() | Gibt den skalaren reellen Wert der Länge von this vector3d zurück | var a = Qt.vector4d(1,2,3,4); var b = a.length(); console.log(b.toString()); // 5.477225575051661 |
vector2d toVector2d() | Gibt das Ergebnis der Konvertierung von this vector4d in einen vector2d zurück | var a = Qt.vector4d(1,2,3,4); var b = a.toVector2d(); console.log(b.toString()); // QVector2D(1, 2) |
vector3d toVector3d() | Liefert das vector3d-Ergebnis der Konvertierung von this vector4d in einen vector3d | var a = Qt.vector4d(1,2,3,4); var b = a.toVector3d(); console.log(b.toString()); // QVector3D(1, 2, 3) |
bool fuzzyEquals(vector4d other, real epsilon) | Gibt true zurück, wenn this vector4d ungefähr gleich dem other vector4d ist. Die Annäherung ist wahr, wenn jedes Attribut von this innerhalb von epsilon von other liegt. Beachten Sie, dass epsilon ein optionales Argument ist, der Standardwert epsilon ist 0,00001. |
Dieser Wertetyp wird durch den QtQuick Import bereitgestellt.
Siehe auch QML-Wertetypen.
© 2025 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.