summaryrefslogtreecommitdiffstats
path: root/src/gui/doc/snippets/code/src_gui_math3d_qquaternion.cpp
blob: 6f27ba9db92539b21a5be3b35c27639331bc2786 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
// Copyright (C) 2018 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#include <QQuaternion>
#include <QVector3D>


namespace src_gui_math3d_qquaternion {
QQuaternion q;
QVector3D vector;
void wrapper0() {

//! [0]
QVector3D result = q.rotatedVector(vector);
//! [0]

Q_UNUSED(result);
} // wrapper0


void wrapper1() {

//! [1]
QVector3D result = (q * QQuaternion(0, vector) * q.conjugated()).vector();
//! [1]

Q_UNUSED(result);
} // wrapper1
} // src_gui_math3d_qquaternion