mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 21:12:53 +02:00
Fixed index of out bounds error, issue with head not being tracked in
PrioVR.
This commit is contained in:
parent
e5ef65242f
commit
e415006526
2 changed files with 3 additions and 1 deletions
|
@ -150,7 +150,8 @@ int ControllerScriptingInterface::getNumberOfJoysticks() const {
|
||||||
glm::vec2 ControllerScriptingInterface::getJoystickPosition(int joystickIndex) const {
|
glm::vec2 ControllerScriptingInterface::getJoystickPosition(int joystickIndex) const {
|
||||||
// we know there's one joystick per palm, so the joystickIndex is the palm Index
|
// we know there's one joystick per palm, so the joystickIndex is the palm Index
|
||||||
int managedJoystickIndex = joystickIndex - getNumberOfActivePalms();
|
int managedJoystickIndex = joystickIndex - getNumberOfActivePalms();
|
||||||
if (managedJoystickIndex >= 0) {
|
if (managedJoystickIndex >= 0 && managedJoystickIndex <
|
||||||
|
Application::getInstance()->getJoystickManager()->getJoystickStates().size()) {
|
||||||
const JoystickState& state = Application::getInstance()->getJoystickManager()->getJoystickStates().at(
|
const JoystickState& state = Application::getInstance()->getJoystickManager()->getJoystickStates().at(
|
||||||
managedJoystickIndex);
|
managedJoystickIndex);
|
||||||
return glm::vec2(state.axes.size() > 0 ? state.axes.at(0) : 0.0f, state.axes.size() > 1 ? state.axes.at(1) : 0.0f);
|
return glm::vec2(state.axes.size() > 0 ? state.axes.at(0) : 0.0f, state.axes.size() > 1 ? state.axes.at(1) : 0.0f);
|
||||||
|
|
|
@ -585,6 +585,7 @@ const char* HUMANIK_JOINTS[] = {
|
||||||
"LeftArm",
|
"LeftArm",
|
||||||
"LeftForeArm",
|
"LeftForeArm",
|
||||||
"LeftHand",
|
"LeftHand",
|
||||||
|
"Neck",
|
||||||
"Spine",
|
"Spine",
|
||||||
"Hips",
|
"Hips",
|
||||||
"RightUpLeg",
|
"RightUpLeg",
|
||||||
|
|
Loading…
Reference in a new issue