mirror of
https://github.com/overte-org/overte.git
synced 2025-04-15 17:20:12 +02:00
Code review
This commit is contained in:
parent
24dcc8788c
commit
7898aa2c4b
1 changed files with 11 additions and 10 deletions
|
@ -163,15 +163,13 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
}
|
||||
};
|
||||
|
||||
this.updateDoesHover = function(handLaser) {
|
||||
this.updateDoesHover = function(handLaser, doesHover) {
|
||||
if (handLaser.doesHover !== undefined) {
|
||||
if (handLaser.hand === LEFT_HAND
|
||||
&& _this.leftPointerDoesHover !== handLaser.doesHover) {
|
||||
_this.leftPointerDoesHover = handLaser.doesHover;
|
||||
if (handLaser.hand === LEFT_HAND && _this.leftPointerDoesHover !== doesHover) {
|
||||
_this.leftPointerDoesHover = doesHover;
|
||||
_this.leftPointerDoesHoverChanged = true;
|
||||
} else if (handLaser.hand === RIGHT_HAND
|
||||
&& _this.rightPointerDoesHover !== handLaser.doesHover) {
|
||||
_this.rightPointerDoesHover = handLaser.doesHover;
|
||||
} else if (handLaser.hand === RIGHT_HAND && _this.rightPointerDoesHover !== doesHover) {
|
||||
_this.rightPointerDoesHover = doesHover;
|
||||
_this.rightPointerDoesHoverChanged = true;
|
||||
}
|
||||
}
|
||||
|
@ -359,7 +357,8 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
_this.runningPluginNames[orderedPluginName] = true;
|
||||
_this.markSlots(candidatePlugin, orderedPluginName);
|
||||
_this.pointerManager.makePointerVisible(candidatePlugin.parameters.handLaser);
|
||||
_this.updateDoesHover(candidatePlugin.parameters.handLaser);
|
||||
_this.updateDoesHover(candidatePlugin.parameters.handLaser,
|
||||
candidatePlugin.parameters.handLaser.doesHover);
|
||||
if (DEBUG) {
|
||||
print("controllerDispatcher running " + orderedPluginName);
|
||||
}
|
||||
|
@ -389,14 +388,16 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
|||
if (PROFILE) {
|
||||
Script.beginProfileRange("dispatch.run." + runningPluginName);
|
||||
}
|
||||
_this.updateDoesHover(plugin.parameters.handLaser);
|
||||
var runningness = plugin.run(controllerData, deltaTime);
|
||||
if (!runningness.active) {
|
||||
if (runningness.active) {
|
||||
_this.updateDoesHover(plugin.parameters.handLaser, plugin.parameters.handLaser.doesHover);
|
||||
} else {
|
||||
// plugin is finished running, for now. remove it from the list
|
||||
// of running plugins and mark its activity-slots as "not in use"
|
||||
delete _this.runningPluginNames[runningPluginName];
|
||||
_this.markSlots(plugin, false);
|
||||
_this.pointerManager.makePointerInvisible(plugin.parameters.handLaser);
|
||||
_this.updateDoesHover(plugin.parameters.handLaser, true);
|
||||
if (DEBUG) {
|
||||
print("controllerDispatcher stopping " + runningPluginName);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue