Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquick3dquaternionutils_p.h
Go to the documentation of this file.
1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QQUICK3DQUATERNIONUTILS_H
7#define QQUICK3DQUATERNIONUTILS_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3D/private/qtquick3dglobal_p.h>
21
22#include <QtCore/QObject>
23#include <QtGui/QQuaternion>
24#include <QtGui/QVector3D>
25#include <QtQml/qqml.h>
26
28
29class Q_QUICK3D_EXPORT QQuick3DQuaternionUtils : public QObject
30{
31 Q_OBJECT
32
33 QML_NAMED_ELEMENT(Quaternion)
34 QML_SINGLETON
35
36public:
37 explicit QQuick3DQuaternionUtils(QObject *parent = nullptr);
38
39 Q_INVOKABLE static QQuaternion fromAxesAndAngles(const QVector3D &axis1,
40 float angle1,
41 const QVector3D &axis2,
42 float angle2,
43 const QVector3D &axis3,
44 float angle3);
45 Q_INVOKABLE static QQuaternion fromAxesAndAngles(const QVector3D &axis1,
46 float angle1,
47 const QVector3D &axis2,
48 float angle2);
49 Q_INVOKABLE static QQuaternion fromAxisAndAngle(float x, float y, float z, float angle);
50 Q_INVOKABLE static QQuaternion fromAxisAndAngle(const QVector3D &axis, float angle);
51 Q_INVOKABLE static QQuaternion fromEulerAngles(float x, float y, float z);
52 Q_INVOKABLE static QQuaternion fromEulerAngles(const QVector3D &eulerAngles);
53
54 Q_INVOKABLE static QQuaternion lookAt(const QVector3D &sourcePosition,
55 const QVector3D &targetPosition,
56 const QVector3D &forwardDirection = QVector3D(0, 0, -1),
57 const QVector3D &upDirection = QVector3D(0, 1, 0));
58
59};
60
61QT_END_NAMESPACE
62
63#endif // QQUICK3DQUATERNIONUTILS_H
Combined button and popup list for selecting options.