Correcting update order to fix mouse

This commit is contained in:
Brad Davis 2015-10-18 22:46:14 -07:00
parent 184303d3c9
commit a8e707ced2
2 changed files with 8 additions and 21 deletions

View file

@ -2710,22 +2710,6 @@ void Application::update(float deltaTime) {
auto myAvatar = getMyAvatar();
auto userInputMapper = DependencyManager::get<UserInputMapper>();
userInputMapper->setSensorToWorldMat(myAvatar->getSensorToWorldMatrix());
// userInputMapper->update(deltaTime);
// This needs to go after userInputMapper->update() because of the keyboard
bool jointsCaptured = false;
auto inputPlugins = PluginManager::getInstance()->getInputPlugins();
foreach(auto inputPlugin, inputPlugins) {
QString name = inputPlugin->getName();
QAction* action = Menu::getInstance()->getActionForOption(name);
if (action && action->isChecked()) {
inputPlugin->pluginUpdate(deltaTime, jointsCaptured);
if (inputPlugin->isJointController()) {
jointsCaptured = true;
}
}
}
// Dispatch input events
_controllerScriptingInterface->update();

View file

@ -173,15 +173,18 @@ void ControllerScriptingInterface::update() {
float delta = now - last;
last = now;
for(auto inputPlugin : PluginManager::getInstance()->getInputPlugins()) {
DependencyManager::get<UserInputMapper>()->update(delta);
bool jointsCaptured = false;
for (auto inputPlugin : PluginManager::getInstance()->getInputPlugins()) {
if (inputPlugin->isActive()) {
inputPlugin->pluginUpdate(delta, false);
inputPlugin->pluginUpdate(delta, jointsCaptured);
if (inputPlugin->isJointController()) {
jointsCaptured = true;
}
}
}
auto userInputMapper = DependencyManager::get<UserInputMapper>();
userInputMapper->update(delta);
for (auto entry : _inputControllers) {
entry.second->update();
}