mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 14:43:12 +02:00
When PrioVR is connected but head rotation is unavailable, use Faceshift
rotation.
This commit is contained in:
parent
565f6b9491
commit
f28ba72f75
3 changed files with 10 additions and 3 deletions
|
@ -237,7 +237,7 @@ void MyAvatar::simulate(float deltaTime) {
|
|||
void MyAvatar::updateFromTrackers(float deltaTime) {
|
||||
glm::vec3 estimatedPosition, estimatedRotation;
|
||||
|
||||
if (Application::getInstance()->getPrioVR()->isActive()) {
|
||||
if (Application::getInstance()->getPrioVR()->hasHeadRotation()) {
|
||||
estimatedRotation = glm::degrees(safeEulerAngles(Application::getInstance()->getPrioVR()->getHeadRotation()));
|
||||
estimatedRotation.x *= -1.0f;
|
||||
estimatedRotation.z *= -1.0f;
|
||||
|
|
|
@ -62,8 +62,13 @@ PrioVR::~PrioVR() {
|
|||
#endif
|
||||
}
|
||||
|
||||
glm::quat PrioVR::getHeadRotation() const {
|
||||
const int HEAD_ROTATION_INDEX = 0;
|
||||
const int HEAD_ROTATION_INDEX = 0;
|
||||
|
||||
bool PrioVR::hasHeadRotation() const {
|
||||
return _humanIKJointIndices.size() > HEAD_ROTATION_INDEX && _humanIKJointIndices.at(HEAD_ROTATION_INDEX) != -1;
|
||||
}
|
||||
|
||||
glm::quat PrioVR::getHeadRotation() const {
|
||||
return _jointRotations.size() > HEAD_ROTATION_INDEX ? _jointRotations.at(HEAD_ROTATION_INDEX) : glm::quat();
|
||||
}
|
||||
|
||||
|
|
|
@ -35,6 +35,8 @@ public:
|
|||
|
||||
bool isActive() const { return !_jointRotations.isEmpty(); }
|
||||
|
||||
bool hasHeadRotation() const;
|
||||
|
||||
glm::quat getHeadRotation() const;
|
||||
glm::quat getTorsoRotation() const;
|
||||
|
||||
|
|
Loading…
Reference in a new issue