Merge branch 'master' of https://github.com/highfidelity/hifi into controllers

This commit is contained in:
samcake 2015-10-30 17:33:38 -07:00
commit 78e6fe5563
2 changed files with 8 additions and 3 deletions

View file

@ -366,5 +366,10 @@ AvatarSharedPointer AvatarManager::getAvatarBySessionID(const QUuid& sessionID)
return std::static_pointer_cast<Avatar>(_myAvatar); return std::static_pointer_cast<Avatar>(_myAvatar);
} }
QReadLocker locker(&_hashLock); QReadLocker locker(&_hashLock);
return _avatarHash[sessionID]; auto iter = _avatarHash.find(sessionID);
if (iter != _avatarHash.end()) {
return iter.value();
} else {
return AvatarSharedPointer();
}
} }

View file

@ -254,7 +254,7 @@ void ViveControllerManager::update(float deltaTime, bool jointsCaptured) {
} }
numTrackedControllers++; numTrackedControllers++;
bool left = numTrackedControllers == 1; bool left = numTrackedControllers == 2;
const mat4& mat = _trackedDevicePoseMat4[device]; const mat4& mat = _trackedDevicePoseMat4[device];
@ -307,13 +307,13 @@ void ViveControllerManager::focusOutEvent() {
// These functions do translation from the Steam IDs to the standard controller IDs // These functions do translation from the Steam IDs to the standard controller IDs
void ViveControllerManager::handleAxisEvent(uint32_t axis, float x, float y, bool left) { void ViveControllerManager::handleAxisEvent(uint32_t axis, float x, float y, bool left) {
#ifdef Q_OS_WIN #ifdef Q_OS_WIN
//FIX ME? It enters here every frame: probably we want to enter only if an event occurs
axis += vr::k_EButton_Axis0; axis += vr::k_EButton_Axis0;
using namespace controller; using namespace controller;
if (axis == vr::k_EButton_SteamVR_Touchpad) { if (axis == vr::k_EButton_SteamVR_Touchpad) {
_axisStateMap[left ? LX : RX] = x; _axisStateMap[left ? LX : RX] = x;
_axisStateMap[left ? LY : RY] = y; _axisStateMap[left ? LY : RY] = y;
} else if (axis == vr::k_EButton_SteamVR_Trigger) { } else if (axis == vr::k_EButton_SteamVR_Trigger) {
//FIX ME: Seems that enters here everytime
_axisStateMap[left ? LT : RT] = x; _axisStateMap[left ? LT : RT] = x;
} }
#endif #endif