more working on integrating hand poses

This commit is contained in:
Sam Gondelman 2015-07-01 10:32:18 -07:00
parent a154c809c0
commit ab50e58cac
2 changed files with 12 additions and 0 deletions

View file

@ -301,6 +301,8 @@ void ViveControllerManager::assignDefaultInputMapping(UserInputMapper& mapper) {
// mapper.addInputChannel(UserInputMapper::ACTION1, makeInput(BUTTON_4, 0));
// mapper.addInputChannel(UserInputMapper::ACTION2, makeInput(BUTTON_4, 1));
mapper.addInputChannel(UserInputMapper::LEFT_HAND, makeInput(LEFT_HAND));
mapper.addInputChannel(UserInputMapper::RIGHT_HAND, makeInput(RIGHT_HAND));
}
float ViveControllerManager::getButton(int channel) const {
@ -341,3 +343,7 @@ UserInputMapper::Input ViveControllerManager::makeInput(ViveControllerManager::J
return UserInputMapper::Input(0);
// return UserInputMapper::Input(_deviceID, axis | (index == 0 ? LEFT_MASK : RIGHT_MASK), UserInputMapper::ChannelType::AXIS);
}
UserInputMapper::Input ViveControllerManager::makeInput(JointChannel joint) {
return UserInputMapper::Input(_deviceID, joint, UserInputMapper::ChannelType::POSE);
}

View file

@ -31,6 +31,11 @@ public:
BACK_TRIGGER = 1U << 6,
};
enum JointChannel {
LEFT_HAND = 0,
RIGHT_HAND,
};
void focusOutEvent();
void update();
@ -47,6 +52,7 @@ public:
UserInputMapper::Input makeInput(unsigned int button, int index);
UserInputMapper::Input makeInput(JoystickAxisChannel axis, int index);
UserInputMapper::Input makeInput(JointChannel joint);
void registerToUserInputMapper(UserInputMapper& mapper);
void assignDefaultInputMapping(UserInputMapper& mapper);