2018-05-07 16:08:19 +00:00
|
|
|
#ifndef DUST3D_UTIL_H
|
|
|
|
#define DUST3D_UTIL_H
|
2018-04-07 08:44:39 +00:00
|
|
|
#include <QString>
|
|
|
|
#include <map>
|
2018-04-12 08:34:00 +00:00
|
|
|
#include <cmath>
|
2018-04-30 11:31:09 +00:00
|
|
|
#include <QVector3D>
|
2018-06-15 05:34:41 +00:00
|
|
|
#include <QQuaternion>
|
2018-04-12 08:34:00 +00:00
|
|
|
|
|
|
|
#ifndef M_PI
|
|
|
|
#define M_PI 3.14159265358979323846
|
|
|
|
#endif
|
2018-04-07 08:44:39 +00:00
|
|
|
|
|
|
|
QString valueOfKeyInMapOrEmpty(const std::map<QString, QString> &map, const QString &key);
|
|
|
|
bool isTrueValueString(const QString &str);
|
|
|
|
bool isFloatEqual(float a, float b);
|
2018-04-13 00:04:18 +00:00
|
|
|
void qNormalizeAngle(int &angle);
|
2018-06-28 13:17:21 +00:00
|
|
|
QVector3D pointInHermiteCurve(float t, QVector3D p0, QVector3D m0, QVector3D p1, QVector3D m1);
|
2018-06-30 10:46:23 +00:00
|
|
|
float angleInRangle360BetweenTwoVectors(QVector3D a, QVector3D b, QVector3D planeNormal);
|
|
|
|
QVector3D projectLineOnPlane(QVector3D line, QVector3D planeNormal);
|
2018-09-21 07:10:18 +00:00
|
|
|
QString unifiedWindowTitle(const QString &text);
|
2018-10-02 04:59:30 +00:00
|
|
|
QQuaternion quaternionOvershootSlerp(const QQuaternion &q0, const QQuaternion &q1, float t);
|
2018-10-20 08:42:29 +00:00
|
|
|
float radianBetweenVectors(const QVector3D &first, const QVector3D &second);
|
|
|
|
float angleBetweenVectors(const QVector3D &first, const QVector3D &second);
|
|
|
|
float areaOfTriangle(const QVector3D &a, const QVector3D &b, const QVector3D &c);
|
2018-10-28 05:22:10 +00:00
|
|
|
QQuaternion eulerAnglesToQuaternion(double pitch, double yaw, double roll);
|
|
|
|
void quaternionToEulerAngles(const QQuaternion &q, double *pitch, double *yaw, double *roll);
|
|
|
|
void quaternionToEulerAnglesXYZ(const QQuaternion &q, double *pitch, double *yaw, double *roll);
|
2018-04-07 08:44:39 +00:00
|
|
|
|
|
|
|
#endif
|