Revision 8999b0bc5b9ad2a29d852e212afdda5d44636a07 authored by jingma-git on 16 November 2021, 15:16:38 UTC, committed by jingma-git on 16 November 2021, 15:16:38 UTC
1 parent 6ea6874
trackball.h
#pragma once
#include <QVector3D>
#include <QQuaternion>
#include <QTime>
#include <cmath>
class TrackBall
{
public:
TrackBall();
void mouseMove(const QVector3D &p);
void mousePress(const QVector3D &p);
void mouseRelease(const QVector3D &p);
void resizeViewport(int width, int height);
QQuaternion getRotation();
private:
QQuaternion rotation;
QVector3D axis;
double velocity;
QVector3D lastPos3D;
QTime lastTime;
bool trackingMouse;
double viewportWidth;
double viewportHeight;
const double rad2deg;
};
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...