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
472472 return DependencyManager::get<UserInputMapper>()->getActionState(UserInputMapper::Action(action));
473473 }
474474
475+int 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+
475487 InputController::InputController(int deviceTrackerId, int subTrackerId, QObject* parent) :
476488 AbstractInputController(),
477489 _deviceTrackerId(deviceTrackerId),