/usr/include/marble/Quaternion.h is in libmarble-dev 4:17.12.3-0ubuntu1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
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 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 | //
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2004-2007 Torsten Rahn <tackat@kde.org>
// Copyright 2007 Inge Wallin <ingwa@kde.org>
// Copyright 2011 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
// Copyright 2014 Dennis Nienhüser <nienhueser@kde.org>
//
//
// Quaternions provides a class that deals with quaternion operations.
// krazy:excludeall=dpointer,inline
#ifndef MARBLE_QUATERNION_H
#define MARBLE_QUATERNION_H
#include "marble_export.h"
#include <cmath>
#include <QtGlobal>
namespace Marble
{
enum
{
Q_X = 0,
Q_Y = 1,
Q_Z = 2,
Q_W = 3
};
typedef qreal xmmfloat[4];
typedef xmmfloat matrix[3];
class MARBLE_EXPORT Quaternion
{
public:
Quaternion();
Quaternion(qreal w, qreal x, qreal y, qreal z);
/*!\brief used to generate Quaternion from longitude and latitude
*
* \param lon longitude
* \param lat latitude
*/
static Quaternion fromSpherical(qreal lon, qreal lat);
static Quaternion fromEuler(qreal pitch, qreal yaw, qreal roll);
static Quaternion slerp(const Quaternion &q1, const Quaternion &q2, qreal t);
static Quaternion nlerp(const Quaternion &q1, const Quaternion &q2, qreal t);
// Operators
Quaternion operator*(const Quaternion &q) const;
Quaternion operator+(const Quaternion &q) const;
Quaternion operator*(qreal factor) const;
bool operator==(const Quaternion &q) const;
Quaternion& operator*=(const Quaternion &q);
Quaternion& operator*=(qreal);
void getSpherical(qreal &lon, qreal &lat) const;
void normalize();
qreal length() const;
Quaternion inverse() const;
Quaternion log() const;
Quaternion exp() const;
qreal pitch() const;
qreal yaw() const;
qreal roll() const;
void rotateAroundAxis(const Quaternion &q);
void toMatrix(matrix &m) const;
void rotateAroundAxis(const matrix &m);
// TODO: Better add accessors...
xmmfloat v;
};
}
#ifndef QT_NO_DEBUG_STREAM
MARBLE_EXPORT QDebug operator<<(QDebug, const Marble::Quaternion &);
#endif
#endif // MARBLE_QUATERNION_H
|