代码拉取完成,页面将自动刷新
#ifndef TRACKBALL_H
#define TRACKBALL_H
#include <QtWidgets>
#include <QtGui/qvector3d.h>
#include <QtGui/qquaternion.h>
class TrackBall
{
public:
enum TrackMode
{
Plane,
Sphere,
};
TrackBall(TrackMode mode = Sphere);
TrackBall(float angularVelocity, const QVector3D& axis, TrackMode mode = Sphere);
// coordinates in [-1,1]x[-1,1]
void push(const QPointF& p, const QQuaternion &transformation);
void move(const QPointF& p, const QQuaternion &transformation);
void release(const QPointF& p, const QQuaternion &transformation);
void start(); // starts clock
void stop(); // stops clock
QQuaternion rotation() const;
private:
QQuaternion m_rotation;
QVector3D m_axis;
float m_angularVelocity;
QPointF m_lastPos;
QTime m_lastTime;
bool m_paused;
bool m_pressed;
TrackMode m_mode;
};
#endif
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。