History

exposing palm velocity and angular velocity to js

Sam Gondelman committed 11 years ago

Commit 113c4ea1 parent d415ee14 files · +60 −5Browse files

Showing the changes to interface/src/scripting/ControllerScriptingInterface.cpp (1 of 4 files). Show all

Unified · Split

interface/src/scripting/ControllerScriptingInterface.cpp+12−0
@@ -472,6 +472,18 @@ float ControllerScriptingInterface::getActionValue(int action) { · 471 unmodified lines
472 return DependencyManager::get<UserInputMapper>()->getActionState(UserInputMapper::Action(action));472 return DependencyManager::get<UserInputMapper>()->getActionState(UserInputMapper::Action(action));
473}473}
474 474
475int ControllerScriptingInterface::findAction(QString actionName) {
476 auto userInputMapper = DependencyManager::get<UserInputMapper>();
477 auto actions = getAllActions();
478 for (auto action : actions) {
479 if (userInputMapper->getActionName(action) == actionName) {
480 return action;
481 }
482 }
483 // If the action isn't found, return -1
484 return -1;
485}
486
475InputController::InputController(int deviceTrackerId, int subTrackerId, QObject* parent) :487InputController::InputController(int deviceTrackerId, int subTrackerId, QObject* parent) :
476 AbstractInputController(),488 AbstractInputController(),
477 _deviceTrackerId(deviceTrackerId),489 _deviceTrackerId(deviceTrackerId),