mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-09 18:26:26 +02:00
Replace Pointers API function setNonHoverItems() with setDoesHover()
This commit is contained in:
parent
403dd3d7d0
commit
e0e6fc711b
8 changed files with 77 additions and 83 deletions
|
@ -24,10 +24,6 @@ void PointerScriptingInterface::setIncludeItems(unsigned int uid, const QScriptV
|
||||||
DependencyManager::get<PointerManager>()->setIncludeItems(uid, qVectorQUuidFromScriptValue(includeItems));
|
DependencyManager::get<PointerManager>()->setIncludeItems(uid, qVectorQUuidFromScriptValue(includeItems));
|
||||||
}
|
}
|
||||||
|
|
||||||
void PointerScriptingInterface::setNonHoverItems(unsigned int uid, const QScriptValue& nonHoverItems) const {
|
|
||||||
DependencyManager::get<PointerManager>()->setNonHoverItems(uid, qVectorQUuidFromScriptValue(nonHoverItems));
|
|
||||||
}
|
|
||||||
|
|
||||||
unsigned int PointerScriptingInterface::createPointer(const PickQuery::PickType& type, const QVariant& properties) {
|
unsigned int PointerScriptingInterface::createPointer(const PickQuery::PickType& type, const QVariant& properties) {
|
||||||
// Interaction with managers should always happen on the main thread
|
// Interaction with managers should always happen on the main thread
|
||||||
if (QThread::currentThread() != qApp->thread()) {
|
if (QThread::currentThread() != qApp->thread()) {
|
||||||
|
@ -179,4 +175,8 @@ QVariantMap PointerScriptingInterface::getPrevPickResult(unsigned int uid) const
|
||||||
result = pickResult->toVariantMap();
|
result = pickResult->toVariantMap();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PointerScriptingInterface::setDoesHover(unsigned int uid, bool hover) const {
|
||||||
|
DependencyManager::get<PointerManager>()->setDoesHover(uid, hover);
|
||||||
|
}
|
||||||
|
|
|
@ -191,14 +191,6 @@ public:
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void setIncludeItems(unsigned int uid, const QScriptValue& includeEntities) const;
|
Q_INVOKABLE void setIncludeItems(unsigned int uid, const QScriptValue& includeEntities) const;
|
||||||
|
|
||||||
/**jsdoc
|
|
||||||
* Sets a list of Entity IDs, Overlay IDs, and/or Avatar IDs that the pointer should not send hover events to.
|
|
||||||
* @function Pointers.setNonHoverItems
|
|
||||||
* @param {number} uid - The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
|
||||||
* @param {Uuid[]} nonHoverItems - A list of IDs to that hover events should not be sent to.
|
|
||||||
*/
|
|
||||||
Q_INVOKABLE void setNonHoverItems(unsigned int uid, const QScriptValue& nonHoverItems) const;
|
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Lock a Pointer onto a specific object (overlay, entity, or avatar). Optionally, provide an offset in object-space, otherwise the Pointer will lock on to the center of the object.
|
* Lock a Pointer onto a specific object (overlay, entity, or avatar). Optionally, provide an offset in object-space, otherwise the Pointer will lock on to the center of the object.
|
||||||
* Not used by Stylus Pointers.
|
* Not used by Stylus Pointers.
|
||||||
|
@ -210,6 +202,14 @@ public:
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE void setLockEndUUID(unsigned int uid, const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const { DependencyManager::get<PointerManager>()->setLockEndUUID(uid, objectID, isOverlay, offsetMat); }
|
Q_INVOKABLE void setLockEndUUID(unsigned int uid, const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const { DependencyManager::get<PointerManager>()->setLockEndUUID(uid, objectID, isOverlay, offsetMat); }
|
||||||
|
|
||||||
|
/**jsdoc
|
||||||
|
* Sets whether or not a pointer should generate hover events.
|
||||||
|
* @function Pointers.setDoesHover
|
||||||
|
* @param {boolean} uid - The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
||||||
|
* @param {boolean} hover - If <code>true</code> then the pointer generates hover events, otherwise it does not.
|
||||||
|
*/
|
||||||
|
Q_INVOKABLE void setDoesHover(unsigned int uid, bool hove) const;
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Check if a Pointer is associated with the left hand.
|
* Check if a Pointer is associated with the left hand.
|
||||||
* @function Pointers.isLeftHand
|
* @function Pointers.isLeftHand
|
||||||
|
|
|
@ -52,12 +52,6 @@ void Pointer::setIncludeItems(const QVector<QUuid>& includeItems) const {
|
||||||
DependencyManager::get<PickManager>()->setIncludeItems(_pickUID, includeItems);
|
DependencyManager::get<PickManager>()->setIncludeItems(_pickUID, includeItems);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Pointer::setNonHoverItems(const QVector<QUuid>& nonHoverItems) {
|
|
||||||
withWriteLock([&] {
|
|
||||||
_nonHoverItems = nonHoverItems;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
bool Pointer::isLeftHand() const {
|
bool Pointer::isLeftHand() const {
|
||||||
return DependencyManager::get<PickManager>()->isLeftHand(_pickUID);
|
return DependencyManager::get<PickManager>()->isLeftHand(_pickUID);
|
||||||
}
|
}
|
||||||
|
@ -70,6 +64,12 @@ bool Pointer::isMouse() const {
|
||||||
return DependencyManager::get<PickManager>()->isMouse(_pickUID);
|
return DependencyManager::get<PickManager>()->isMouse(_pickUID);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Pointer::setDoesHover(bool doesHover) {
|
||||||
|
withWriteLock([&] {
|
||||||
|
_hover = doesHover;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
void Pointer::update(unsigned int pointerID) {
|
void Pointer::update(unsigned int pointerID) {
|
||||||
// This only needs to be a read lock because update won't change any of the properties that can be modified from scripts
|
// This only needs to be a read lock because update won't change any of the properties that can be modified from scripts
|
||||||
withReadLock([&] {
|
withReadLock([&] {
|
||||||
|
@ -101,11 +101,7 @@ void Pointer::generatePointerEvents(unsigned int pointerID, const PickResultPoin
|
||||||
}
|
}
|
||||||
|
|
||||||
// Hover events
|
// Hover events
|
||||||
bool doHover = shouldHover(pickResult);
|
bool doHover = _hover && shouldHover(pickResult);
|
||||||
|
|
||||||
auto pickResultMap = pickResult->toVariantMap();
|
|
||||||
auto uuid = QUuid(pickResultMap.value("objectID", "").toString());
|
|
||||||
doHover = doHover && !_nonHoverItems.contains(uuid);
|
|
||||||
|
|
||||||
Pointer::PickedObject hoveredObject = getHoveredObject(pickResult);
|
Pointer::PickedObject hoveredObject = getHoveredObject(pickResult);
|
||||||
PointerEvent hoveredEvent = buildPointerEvent(hoveredObject, pickResult);
|
PointerEvent hoveredEvent = buildPointerEvent(hoveredObject, pickResult);
|
||||||
|
@ -240,7 +236,7 @@ void Pointer::generatePointerEvents(unsigned int pointerID, const PickResultPoin
|
||||||
}
|
}
|
||||||
|
|
||||||
// if we disable the pointer or disable hovering, send hoverEnd events after triggerEnd
|
// if we disable the pointer or disable hovering, send hoverEnd events after triggerEnd
|
||||||
if (_hover && ((!_enabled && _prevEnabled) || (!doHover && _prevDoHover))) {
|
if ((_hover || _prevHover) && ((!_enabled && _prevEnabled) || (!doHover && _prevDoHover))) {
|
||||||
if (_prevHoveredObject.type == ENTITY) {
|
if (_prevHoveredObject.type == ENTITY) {
|
||||||
emit pointerManager->hoverEndEntity(_prevHoveredObject.objectID, hoveredEvent);
|
emit pointerManager->hoverEndEntity(_prevHoveredObject.objectID, hoveredEvent);
|
||||||
} else if (_prevHoveredObject.type == OVERLAY) {
|
} else if (_prevHoveredObject.type == OVERLAY) {
|
||||||
|
@ -253,6 +249,7 @@ void Pointer::generatePointerEvents(unsigned int pointerID, const PickResultPoin
|
||||||
_prevHoveredObject = hoveredObject;
|
_prevHoveredObject = hoveredObject;
|
||||||
_prevButtons = buttons;
|
_prevButtons = buttons;
|
||||||
_prevEnabled = _enabled;
|
_prevEnabled = _enabled;
|
||||||
|
_prevHover = _hover;
|
||||||
_prevDoHover = doHover;
|
_prevDoHover = doHover;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -54,8 +54,6 @@ public:
|
||||||
virtual void setIgnoreItems(const QVector<QUuid>& ignoreItems) const;
|
virtual void setIgnoreItems(const QVector<QUuid>& ignoreItems) const;
|
||||||
virtual void setIncludeItems(const QVector<QUuid>& includeItems) const;
|
virtual void setIncludeItems(const QVector<QUuid>& includeItems) const;
|
||||||
|
|
||||||
void setNonHoverItems(const QVector<QUuid>& nonHoverItems);
|
|
||||||
|
|
||||||
bool isLeftHand() const;
|
bool isLeftHand() const;
|
||||||
bool isRightHand() const;
|
bool isRightHand() const;
|
||||||
bool isMouse() const;
|
bool isMouse() const;
|
||||||
|
@ -64,6 +62,8 @@ public:
|
||||||
virtual void setLength(float length) {}
|
virtual void setLength(float length) {}
|
||||||
virtual void setLockEndUUID(const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) {}
|
virtual void setLockEndUUID(const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) {}
|
||||||
|
|
||||||
|
void setDoesHover(bool hover);
|
||||||
|
|
||||||
void update(unsigned int pointerID);
|
void update(unsigned int pointerID);
|
||||||
virtual void updateVisuals(const PickResultPointer& pickResult) = 0;
|
virtual void updateVisuals(const PickResultPointer& pickResult) = 0;
|
||||||
void generatePointerEvents(unsigned int pointerID, const PickResultPointer& pickResult);
|
void generatePointerEvents(unsigned int pointerID, const PickResultPointer& pickResult);
|
||||||
|
@ -99,12 +99,11 @@ private:
|
||||||
PickedObject _prevHoveredObject;
|
PickedObject _prevHoveredObject;
|
||||||
Buttons _prevButtons;
|
Buttons _prevButtons;
|
||||||
bool _prevEnabled { false };
|
bool _prevEnabled { false };
|
||||||
|
bool _prevHover { false };
|
||||||
bool _prevDoHover { false };
|
bool _prevDoHover { false };
|
||||||
std::unordered_map<std::string, PickedObject> _triggeredObjects;
|
std::unordered_map<std::string, PickedObject> _triggeredObjects;
|
||||||
|
|
||||||
PointerEvent::Button chooseButton(const std::string& button);
|
PointerEvent::Button chooseButton(const std::string& button);
|
||||||
|
|
||||||
QVector<QUuid> _nonHoverItems;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_Pick_h
|
#endif // hifi_Pick_h
|
||||||
|
|
|
@ -108,13 +108,6 @@ void PointerManager::setIncludeItems(unsigned int uid, const QVector<QUuid>& inc
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PointerManager::setNonHoverItems(unsigned int uid, const QVector<QUuid>& nonHoverItems) const {
|
|
||||||
auto pointer = find(uid);
|
|
||||||
if (pointer) {
|
|
||||||
pointer->setNonHoverItems(nonHoverItems);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void PointerManager::setLength(unsigned int uid, float length) const {
|
void PointerManager::setLength(unsigned int uid, float length) const {
|
||||||
auto pointer = find(uid);
|
auto pointer = find(uid);
|
||||||
if (pointer) {
|
if (pointer) {
|
||||||
|
@ -129,6 +122,13 @@ void PointerManager::setLockEndUUID(unsigned int uid, const QUuid& objectID, boo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void PointerManager::setDoesHover(unsigned int uid, bool hover) const {
|
||||||
|
auto pointer = find(uid);
|
||||||
|
if (pointer) {
|
||||||
|
pointer->setDoesHover(hover);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool PointerManager::isLeftHand(unsigned int uid) {
|
bool PointerManager::isLeftHand(unsigned int uid) {
|
||||||
auto pointer = find(uid);
|
auto pointer = find(uid);
|
||||||
if (pointer) {
|
if (pointer) {
|
||||||
|
|
|
@ -34,10 +34,10 @@ public:
|
||||||
void setPrecisionPicking(unsigned int uid, bool precisionPicking) const;
|
void setPrecisionPicking(unsigned int uid, bool precisionPicking) const;
|
||||||
void setIgnoreItems(unsigned int uid, const QVector<QUuid>& ignoreEntities) const;
|
void setIgnoreItems(unsigned int uid, const QVector<QUuid>& ignoreEntities) const;
|
||||||
void setIncludeItems(unsigned int uid, const QVector<QUuid>& includeEntities) const;
|
void setIncludeItems(unsigned int uid, const QVector<QUuid>& includeEntities) const;
|
||||||
void setNonHoverItems(unsigned int uid, const QVector<QUuid>& nonHoverItems) const;
|
|
||||||
|
|
||||||
void setLength(unsigned int uid, float length) const;
|
void setLength(unsigned int uid, float length) const;
|
||||||
void setLockEndUUID(unsigned int uid, const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const;
|
void setLockEndUUID(unsigned int uid, const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const;
|
||||||
|
void setDoesHover(unsigned int uid, bool hover) const;
|
||||||
|
|
||||||
void update();
|
void update();
|
||||||
|
|
||||||
|
|
|
@ -46,10 +46,10 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
this.tabletID = null;
|
this.tabletID = null;
|
||||||
this.TABLET_UI_UUIDS = [];
|
this.TABLET_UI_UUIDS = [];
|
||||||
this.blacklist = [];
|
this.blacklist = [];
|
||||||
this.leftPointerNonHoverItem = null;
|
this.leftPointerDoesHover = true;
|
||||||
this.leftPointerNonHoverItemChanged = false;
|
this.leftPointerDoesHoverChanged = false;
|
||||||
this.rightPointerNonHoverItem = null;
|
this.rightPointerDoesHover = true;
|
||||||
this.rightPointerNonHoverItemChanged = false;
|
this.rightPointerDoesHoverChanged = false;
|
||||||
this.pointerManager = new PointerManager();
|
this.pointerManager = new PointerManager();
|
||||||
|
|
||||||
// a module can occupy one or more "activity" slots while it's running. If all the required slots for a module are
|
// a module can occupy one or more "activity" slots while it's running. If all the required slots for a module are
|
||||||
|
@ -163,26 +163,14 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setNonHoverItems = function () {
|
this.updateHovering = function () {
|
||||||
if (_this.leftPointerNonHoverItemChanged) {
|
if (_this.leftPointerDoesHoverChanged) {
|
||||||
if (_this.leftPointerNonHoverItem === null) {
|
Pointers.setDoesHover(_this.leftPointer, _this.leftPointerDoesHover);
|
||||||
Pointers.setNonHoverItems(_this.leftPointer, []);
|
_this.leftPointerDoesHoverChanged = false;
|
||||||
} else if (_this.isTabletID(_this.leftPointerNonHoverItem)) {
|
|
||||||
Pointers.setNonHoverItems(_this.leftPointer, _this.TABLET_UI_UUIDS);
|
|
||||||
} else {
|
|
||||||
Pointers.setNonHoverItems(_this.leftPointer, [_this.leftPointerNonHoverItem]);
|
|
||||||
}
|
|
||||||
_this.leftPointerNonHoverItemChanged = false;
|
|
||||||
}
|
}
|
||||||
if (_this.rightPointerNonHoverItemChanged) {
|
if (_this.rightPointerDoesHoverChanged) {
|
||||||
if (_this.rightPointerNonHoverItem === null) {
|
Pointers.setDoesHover(_this.rightPointer, _this.rightPointerDoesHover);
|
||||||
Pointers.setNonHoverItems(_this.rightPointer, []);
|
_this.rightPointerDoesHoverChanged = false;
|
||||||
} else if (_this.isTabletID(_this.rightPointerNonHoverItem)) {
|
|
||||||
Pointers.setNonHoverItems(_this.rightPointer, _this.TABLET_UI_UUIDS);
|
|
||||||
} else {
|
|
||||||
Pointers.setNonHoverItems(_this.rightPointer, [_this.rightPointerNonHoverItem]);
|
|
||||||
}
|
|
||||||
_this.rightPointerNonHoverItemChanged = false;
|
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -358,15 +346,15 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
_this.markSlots(candidatePlugin, orderedPluginName);
|
_this.markSlots(candidatePlugin, orderedPluginName);
|
||||||
_this.pointerManager.makePointerVisible(candidatePlugin.parameters.handLaser);
|
_this.pointerManager.makePointerVisible(candidatePlugin.parameters.handLaser);
|
||||||
|
|
||||||
if (candidatePlugin.parameters.handLaser.nonHoverItem !== undefined) {
|
if (candidatePlugin.parameters.handLaser.doesHover !== undefined) {
|
||||||
if (candidatePlugin.parameters.handLaser.hand === LEFT_HAND
|
if (candidatePlugin.parameters.handLaser.hand === LEFT_HAND
|
||||||
&& _this.leftPointerNonHoverItem !== candidatePlugin.parameters.handLaser.nonHoverItem) {
|
&& _this.leftPointerDoesHover !== candidatePlugin.parameters.handLaser.doesHover) {
|
||||||
_this.leftPointerNonHoverItem = candidatePlugin.parameters.handLaser.nonHoverItem;
|
_this.leftPointerDoesHover = candidatePlugin.parameters.handLaser.doesHover;
|
||||||
_this.leftPointerNonHoverItemChanged = true;
|
_this.leftPointerDoesHoverChanged = true;
|
||||||
} else if (candidatePlugin.parameters.handLaser.hand === RIGHT_HAND
|
} else if (candidatePlugin.parameters.handLaser.hand === RIGHT_HAND
|
||||||
&& _this.rightPointerNonHoverItem !== candidatePlugin.parameters.handLaser.nonHoverItem) {
|
&& _this.rightPointerDoesHover !== candidatePlugin.parameters.handLaser.doesHover) {
|
||||||
_this.rightPointerNonHoverItem = candidatePlugin.parameters.handLaser.nonHoverItem;
|
_this.rightPointerDoesHover = candidatePlugin.parameters.handLaser.doesHover;
|
||||||
_this.rightPointerNonHoverItemChanged = true;
|
_this.rightPointerDoesHoverChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -402,15 +390,15 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
var runningness = plugin.run(controllerData, deltaTime);
|
var runningness = plugin.run(controllerData, deltaTime);
|
||||||
|
|
||||||
if (runningness.active) {
|
if (runningness.active) {
|
||||||
if (plugin.parameters.handLaser.nonHoverItem !== undefined) {
|
if (plugin.parameters.handLaser.doesHover !== undefined) {
|
||||||
if (plugin.parameters.handLaser.hand === LEFT_HAND
|
if (plugin.parameters.handLaser.hand === LEFT_HAND
|
||||||
&& _this.leftPointerNonHoverItem !== plugin.parameters.handLaser.nonHoverItem) {
|
&& _this.leftPointerDoesHover !== plugin.parameters.handLaser.doesHover) {
|
||||||
_this.leftPointerNonHoverItem = plugin.parameters.handLaser.nonHoverItem;
|
_this.leftPointerDoesHover = plugin.parameters.handLaser.doesHover;
|
||||||
_this.leftPointerNonHoverItemChanged = true;
|
_this.leftPointerDoesHoverChanged = true;
|
||||||
} else if (plugin.parameters.handLaser.hand === RIGHT_HAND
|
} else if (plugin.parameters.handLaser.hand === RIGHT_HAND
|
||||||
&& _this.rightPointerNonHoverItem !== plugin.parameters.handLaser.nonHoverItem) {
|
&& _this.rightPointerDoesHover !== plugin.parameters.handLaser.doesHover) {
|
||||||
_this.rightPointerNonHoverItem = plugin.parameters.handLaser.nonHoverItem;
|
_this.rightPointerDoesHover = plugin.parameters.handLaser.doesHover;
|
||||||
_this.rightPointerNonHoverItemChanged = true;
|
_this.rightPointerDoesHoverChanged = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -421,6 +409,17 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
delete _this.runningPluginNames[runningPluginName];
|
delete _this.runningPluginNames[runningPluginName];
|
||||||
_this.markSlots(plugin, false);
|
_this.markSlots(plugin, false);
|
||||||
_this.pointerManager.makePointerInvisible(plugin.parameters.handLaser);
|
_this.pointerManager.makePointerInvisible(plugin.parameters.handLaser);
|
||||||
|
|
||||||
|
if (plugin.parameters.handLaser.doesHover !== undefined) {
|
||||||
|
if (plugin.parameters.handLaser.hand === LEFT_HAND && !_this.leftPointerDoesHover) {
|
||||||
|
_this.leftPointerDoesHover = true;
|
||||||
|
_this.leftPointerDoesHoverChanged = true;
|
||||||
|
} else if (plugin.parameters.handLaser.hand === RIGHT_HAND && !_this.rightPointerDoesHover) {
|
||||||
|
_this.rightPointerDoesHover = true;
|
||||||
|
_this.rightPointerDoesHoverChanged = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (DEBUG) {
|
if (DEBUG) {
|
||||||
print("controllerDispatcher stopping " + runningPluginName);
|
print("controllerDispatcher stopping " + runningPluginName);
|
||||||
}
|
}
|
||||||
|
@ -433,8 +432,7 @@ Script.include("/~/system/libraries/controllerDispatcherUtils.js");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_this.pointerManager.updatePointersRenderState(controllerData.triggerClicks, controllerData.triggerValues);
|
_this.pointerManager.updatePointersRenderState(controllerData.triggerClicks, controllerData.triggerValues);
|
||||||
|
_this.updateHovering();
|
||||||
_this.setNonHoverItems();
|
|
||||||
|
|
||||||
if (PROFILE) {
|
if (PROFILE) {
|
||||||
Script.endProfileRange("dispatch.run");
|
Script.endProfileRange("dispatch.run");
|
||||||
|
|
|
@ -90,7 +90,7 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
this.hoverItem = null;
|
this.hoverItem = null;
|
||||||
|
|
||||||
this.isTabletID = function (uuid) {
|
this.isTabletID = function (uuid) {
|
||||||
return [HMD.tabletID, HMD.tabletScreenID, HMD.homeButtonID, HMD.homeButtonHightlightID].indexOf(uuid) !== -1;
|
return [HMD.tabletID, HMD.tabletScreenID, HMD.homeButtonID, HMD.homeButtonHighlightID].indexOf(uuid) !== -1;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.isReady = function(controllerData) {
|
this.isReady = function(controllerData) {
|
||||||
|
@ -105,19 +105,19 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pointingAt !== this.getOtherModule().hoverItem) {
|
if (pointingAt !== this.getOtherModule().hoverItem) {
|
||||||
|
this.parameters.handLaser.doesHover = true;
|
||||||
this.hoverItem = pointingAt;
|
this.hoverItem = pointingAt;
|
||||||
this.getOtherModule().parameters.handLaser.nonHoverItem = pointingAt;
|
|
||||||
} else {
|
} else {
|
||||||
|
this.parameters.handLaser.doesHover = false;
|
||||||
this.hoverItem = null;
|
this.hoverItem = null;
|
||||||
this.getOtherModule().parameters.handLaser.nonHoverItem = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return makeRunningValues(true, [], []);
|
return makeRunningValues(true, [], []);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.parameters.handLaser.doesHover = false;
|
||||||
this.hoverItem = null;
|
this.hoverItem = null;
|
||||||
this.getOtherModule().parameters.handLaser.nonHoverItem = null;
|
|
||||||
|
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
};
|
};
|
||||||
|
@ -135,11 +135,11 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pointingAt !== this.getOtherModule().hoverItem || isTriggerPressed) {
|
if (pointingAt !== this.getOtherModule().hoverItem || isTriggerPressed) {
|
||||||
|
this.parameters.handLaser.doesHover = true;
|
||||||
this.hoverItem = pointingAt;
|
this.hoverItem = pointingAt;
|
||||||
this.getOtherModule().parameters.handLaser.nonHoverItem = pointingAt;
|
|
||||||
} else {
|
} else {
|
||||||
|
this.parameters.handLaser.doesHover = false;
|
||||||
this.hoverItem = null;
|
this.hoverItem = null;
|
||||||
this.getOtherModule().parameters.handLaser.nonHoverItem = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return makeRunningValues(true, [], []);
|
return makeRunningValues(true, [], []);
|
||||||
|
@ -147,8 +147,8 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
this.deleteContextOverlay();
|
this.deleteContextOverlay();
|
||||||
this.running = false;
|
this.running = false;
|
||||||
|
|
||||||
|
this.parameters.handLaser.doesHover = false;
|
||||||
this.hoverItem = null;
|
this.hoverItem = null;
|
||||||
this.getOtherModule().parameters.handLaser.nonHoverItem = null;
|
|
||||||
|
|
||||||
return makeRunningValues(false, [], []);
|
return makeRunningValues(false, [], []);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue