mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-10 04:18:28 +02:00
Rework FaceTracker
This commit is contained in:
parent
cfa6352c3a
commit
8eb4abc49c
2 changed files with 19 additions and 10 deletions
|
@ -11,7 +11,6 @@
|
||||||
|
|
||||||
#include "FaceTracker.h"
|
#include "FaceTracker.h"
|
||||||
|
|
||||||
FaceTracker::FaceTracker() :
|
inline float FaceTracker::getBlendshapeCoefficient(int index) const {
|
||||||
_estimatedEyePitch(0.0f),
|
return isValidBlendshapeIndex(index) ? _blendshapeCoefficients[index] : 0.0f;
|
||||||
_estimatedEyeYaw(0.0f) {
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -18,13 +18,17 @@
|
||||||
#include <glm/glm.hpp>
|
#include <glm/glm.hpp>
|
||||||
#include <glm/gtc/quaternion.hpp>
|
#include <glm/gtc/quaternion.hpp>
|
||||||
|
|
||||||
/// Base class for face trackers (Faceshift, Visage).
|
/// Base class for face trackers (Faceshift, Visage, DDE).
|
||||||
class FaceTracker : public QObject {
|
class FaceTracker : public QObject {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
FaceTracker();
|
virtual bool isActive() const { return false; }
|
||||||
virtual ~FaceTracker() {}
|
virtual bool isTracking() const { return false; }
|
||||||
|
|
||||||
|
virtual void init() {}
|
||||||
|
virtual void update(float deltaTime) {}
|
||||||
|
virtual void reset() {}
|
||||||
|
|
||||||
const glm::vec3& getHeadTranslation() const { return _headTranslation; }
|
const glm::vec3& getHeadTranslation() const { return _headTranslation; }
|
||||||
const glm::quat& getHeadRotation() const { return _headRotation; }
|
const glm::quat& getHeadRotation() const { return _headRotation; }
|
||||||
|
@ -32,15 +36,21 @@ public:
|
||||||
float getEstimatedEyePitch() const { return _estimatedEyePitch; }
|
float getEstimatedEyePitch() const { return _estimatedEyePitch; }
|
||||||
float getEstimatedEyeYaw() const { return _estimatedEyeYaw; }
|
float getEstimatedEyeYaw() const { return _estimatedEyeYaw; }
|
||||||
|
|
||||||
|
int getNumBlendshapes() const { return _blendshapeCoefficients.size(); }
|
||||||
|
bool isValidBlendshapeIndex(int index) const { return index >= 0 && index < getNumBlendshapes(); }
|
||||||
const QVector<float>& getBlendshapeCoefficients() const { return _blendshapeCoefficients; }
|
const QVector<float>& getBlendshapeCoefficients() const { return _blendshapeCoefficients; }
|
||||||
|
float getBlendshapeCoefficient(int index) const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
glm::vec3 _headTranslation;
|
|
||||||
glm::quat _headRotation;
|
glm::vec3 _headTranslation = glm::vec3(0.0f);
|
||||||
float _estimatedEyePitch;
|
glm::quat _headRotation = glm::quat();
|
||||||
float _estimatedEyeYaw;
|
float _estimatedEyePitch = 0.0f;
|
||||||
|
float _estimatedEyeYaw = 0.0f;
|
||||||
QVector<float> _blendshapeCoefficients;
|
QVector<float> _blendshapeCoefficients;
|
||||||
|
|
||||||
|
float _fadeCoefficient = 0.0f;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_FaceTracker_h
|
#endif // hifi_FaceTracker_h
|
||||||
|
|
Loading…
Reference in a new issue