2018-10-25 00:19:38 +00:00
|
|
|
#ifndef DUST3D_SKELETON_IK_MOVER_H
|
|
|
|
#define DUST3D_SKELETON_IK_MOVER_H
|
2018-05-24 01:44:40 +00:00
|
|
|
#include <QObject>
|
|
|
|
#include <vector>
|
|
|
|
#include <QVector3D>
|
|
|
|
#include <QUuid>
|
|
|
|
|
|
|
|
struct SkeletonIkNode
|
|
|
|
{
|
|
|
|
QUuid id;
|
|
|
|
QVector3D position;
|
|
|
|
QVector3D newPosition;
|
|
|
|
};
|
|
|
|
|
|
|
|
class SkeletonIkMover : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
SkeletonIkMover();
|
|
|
|
~SkeletonIkMover();
|
|
|
|
void setTarget(const QVector3D &target);
|
|
|
|
void setUpdateVersion(unsigned long long version);
|
|
|
|
unsigned long long getUpdateVersion();
|
|
|
|
void addNode(QUuid id, QVector3D position);
|
|
|
|
const std::vector<SkeletonIkNode> &ikNodes();
|
|
|
|
signals:
|
|
|
|
void finished();
|
|
|
|
public slots:
|
|
|
|
void process();
|
|
|
|
private:
|
|
|
|
void resolve();
|
|
|
|
private:
|
|
|
|
unsigned long long m_updateVersion;
|
|
|
|
std::vector<SkeletonIkNode> m_ikNodes;
|
|
|
|
QVector3D m_target;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|