mirror of
https://github.com/overte-org/overte.git
synced 2025-04-21 22:44:15 +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 {
|
||||
// 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);
|
||||
|
|
|
@ -585,6 +585,7 @@ const char* HUMANIK_JOINTS[] = {
|
|||
"LeftArm",
|
||||
"LeftForeArm",
|
||||
"LeftHand",
|
||||
"Neck",
|
||||
"Spine",
|
||||
"Hips",
|
||||
"RightUpLeg",
|
||||
|
|
Loading…
Reference in a new issue