PrioVR tweaks.

This commit is contained in:
Andrzej Kapolka 2014-05-14 13:36:26 -07:00
parent c99f3edbd8
commit cf230d1cc3
4 changed files with 14 additions and 5 deletions

View file

@ -239,7 +239,9 @@ void MyAvatar::updateFromTrackers(float deltaTime) {
if (Application::getInstance()->getPrioVR()->isActive()) { if (Application::getInstance()->getPrioVR()->isActive()) {
estimatedRotation = glm::degrees(safeEulerAngles(Application::getInstance()->getPrioVR()->getHeadRotation())); estimatedRotation = glm::degrees(safeEulerAngles(Application::getInstance()->getPrioVR()->getHeadRotation()));
estimatedRotation.x *= -1.0f;
estimatedRotation.z *= -1.0f;
} else { } else {
FaceTracker* tracker = Application::getInstance()->getActiveFaceTracker(); FaceTracker* tracker = Application::getInstance()->getActiveFaceTracker();
if (tracker) { if (tracker) {

View file

@ -200,7 +200,7 @@ void SkeletonModel::updateJointState(int index) {
} }
void SkeletonModel::maybeUpdateLeanRotation(const JointState& parentState, const FBXJoint& joint, JointState& state) { void SkeletonModel::maybeUpdateLeanRotation(const JointState& parentState, const FBXJoint& joint, JointState& state) {
if (!_owningAvatar->isMyAvatar()) { if (!_owningAvatar->isMyAvatar() || Application::getInstance()->getPrioVR()->isActive()) {
return; return;
} }
// get the rotation axes in joint space and use them to adjust the rotation // get the rotation axes in joint space and use them to adjust the rotation

View file

@ -22,8 +22,8 @@ const unsigned int SERIAL_LIST[] = { 0x00000001, 0x00000000, 0x00000008, 0x00000
const unsigned char AXIS_LIST[] = { 9, 43, 37, 37, 37, 13, 13, 13, 52, 52, 28, 28 }; const unsigned char AXIS_LIST[] = { 9, 43, 37, 37, 37, 13, 13, 13, 52, 52, 28, 28 };
const int LIST_LENGTH = sizeof(SERIAL_LIST) / sizeof(SERIAL_LIST[0]); const int LIST_LENGTH = sizeof(SERIAL_LIST) / sizeof(SERIAL_LIST[0]);
const char* JOINT_NAMES[] = { "Head", "Spine", "LeftArm", "LeftForeArm", "LeftHand", "RightArm", const char* JOINT_NAMES[] = { "Neck", "Spine", "LeftArm", "LeftForeArm", "LeftHand", "RightArm",
"RightForeArm", "RightHand", "LeftUpLeg", "LeftLeg", "RightUpLeft", "RightLeg" }; "RightForeArm", "RightHand", "LeftUpLeg", "LeftLeg", "RightUpLeg", "RightLeg" };
#ifdef HAVE_PRIOVR #ifdef HAVE_PRIOVR
static int indexOfHumanIKJoint(const char* jointName) { static int indexOfHumanIKJoint(const char* jointName) {
@ -80,6 +80,12 @@ void PrioVR::update() {
unsigned int timestamp; unsigned int timestamp;
yei_getLastStreamDataAll(_skeletalDevice, (char*)_jointRotations.data(), yei_getLastStreamDataAll(_skeletalDevice, (char*)_jointRotations.data(),
_jointRotations.size() * sizeof(glm::quat), &timestamp); _jointRotations.size() * sizeof(glm::quat), &timestamp);
// convert to our expected coordinate system
for (int i = 0; i < _jointRotations.size(); i++) {
_jointRotations[i].y *= -1.0f;
_jointRotations[i].z *= -1.0f;
}
#endif #endif
} }

View file

@ -55,7 +55,8 @@ Visage::Visage() :
Visage::~Visage() { Visage::~Visage() {
#ifdef HAVE_VISAGE #ifdef HAVE_VISAGE
_tracker->stop(); _tracker->stop();
delete _tracker; // deleting the tracker crashes windows; disable for now
//delete _tracker;
delete _data; delete _data;
#endif #endif
} }