From e41500652606212d0bf865706ff754eb60ff2cbc Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Thu, 15 May 2014 18:22:57 -0700 Subject: [PATCH] Fixed index of out bounds error, issue with head not being tracked in PrioVR. --- interface/src/scripting/ControllerScriptingInterface.cpp | 3 ++- libraries/fbx/src/FBXReader.cpp | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/interface/src/scripting/ControllerScriptingInterface.cpp b/interface/src/scripting/ControllerScriptingInterface.cpp index 929be1df5e..df97af1a16 100644 --- a/interface/src/scripting/ControllerScriptingInterface.cpp +++ b/interface/src/scripting/ControllerScriptingInterface.cpp @@ -150,7 +150,8 @@ int ControllerScriptingInterface::getNumberOfJoysticks() const { glm::vec2 ControllerScriptingInterface::getJoystickPosition(int joystickIndex) const { // we know there's one joystick per palm, so the joystickIndex is the palm Index int managedJoystickIndex = joystickIndex - getNumberOfActivePalms(); - if (managedJoystickIndex >= 0) { + if (managedJoystickIndex >= 0 && managedJoystickIndex < + Application::getInstance()->getJoystickManager()->getJoystickStates().size()) { const JoystickState& state = Application::getInstance()->getJoystickManager()->getJoystickStates().at( managedJoystickIndex); return glm::vec2(state.axes.size() > 0 ? state.axes.at(0) : 0.0f, state.axes.size() > 1 ? state.axes.at(1) : 0.0f); diff --git a/libraries/fbx/src/FBXReader.cpp b/libraries/fbx/src/FBXReader.cpp index 264f58f0d4..44ef3f3aab 100644 --- a/libraries/fbx/src/FBXReader.cpp +++ b/libraries/fbx/src/FBXReader.cpp @@ -585,6 +585,7 @@ const char* HUMANIK_JOINTS[] = { "LeftArm", "LeftForeArm", "LeftHand", + "Neck", "Spine", "Hips", "RightUpLeg",