mirror of
https://github.com/lubosz/overte.git
synced 2025-04-10 15:57:39 +02:00
Include the teleporter target in the occlusion
This commit is contained in:
parent
29dbc01361
commit
5be945715f
10 changed files with 63 additions and 3 deletions
|
@ -350,4 +350,19 @@ glm::vec2 PathPointer::findPos2D(const PickedObject& pickedObject, const glm::ve
|
|||
default:
|
||||
return glm::vec2(NAN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QVector<QUuid> PathPointer::getOverlayIDs() {
|
||||
QVector<QUuid> result;
|
||||
for (auto& state : _renderStates) {
|
||||
QUuid uuid = state.second->getStartID();
|
||||
if (!uuid.isNull()) {
|
||||
result.append(uuid);
|
||||
}
|
||||
uuid = state.second->getEndID();
|
||||
if (!uuid.isNull()) {
|
||||
result.append(uuid);
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -76,6 +76,8 @@ public:
|
|||
// You cannot use editRenderState to change the type of any part of the pointer. You can only edit the properties of the existing overlays.
|
||||
void editRenderState(const std::string& state, const QVariant& startProps, const QVariant& pathProps, const QVariant& endProps) override;
|
||||
|
||||
QVector<QUuid> getOverlayIDs() override;
|
||||
|
||||
void setLength(float length) override;
|
||||
void setLockEndUUID(const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) override;
|
||||
|
||||
|
|
|
@ -374,4 +374,8 @@ QVariantMap PointerScriptingInterface::getPrevPickResult(unsigned int uid) const
|
|||
result = pickResult->toVariantMap();
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
QVector<QUuid> PointerScriptingInterface::getOverlayIDs(unsigned int uid) {
|
||||
return DependencyManager::get<PointerManager>()->getOverlayIDs(uid);
|
||||
}
|
|
@ -203,6 +203,13 @@ public:
|
|||
*/
|
||||
Q_INVOKABLE bool isMouse(unsigned int uid) { return DependencyManager::get<PointerManager>()->isMouse(uid); }
|
||||
|
||||
/**jsdoc
|
||||
* Get the IDs of the overlays used by a Pointer.
|
||||
* @function Pointers.getOverlayIDs
|
||||
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
||||
* @returns {Uuid[]} The overlay IDs used by the Pointer.
|
||||
*/
|
||||
Q_INVOKABLE QVector<QUuid> getOverlayIDs(unsigned int uid);
|
||||
};
|
||||
|
||||
#endif // hifi_PointerScriptingInterface_h
|
||||
|
|
|
@ -225,4 +225,10 @@ glm::vec2 StylusPointer::findPos2D(const PickedObject& pickedObject, const glm::
|
|||
default:
|
||||
return glm::vec2(NAN);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
QVector<QUuid> StylusPointer::getOverlayIDs() {
|
||||
QVector<QUuid> result;
|
||||
result.append(_stylusOverlay);
|
||||
return result;
|
||||
}
|
||||
|
|
|
@ -33,6 +33,8 @@ public:
|
|||
void setRenderState(const std::string& state) override;
|
||||
void editRenderState(const std::string& state, const QVariant& startProps, const QVariant& pathProps, const QVariant& endProps) override {}
|
||||
|
||||
QVector<QUuid> getOverlayIDs() override;
|
||||
|
||||
static OverlayID buildStylusOverlay(const QVariantMap& properties);
|
||||
|
||||
protected:
|
||||
|
|
|
@ -50,6 +50,8 @@ public:
|
|||
virtual void setRenderState(const std::string& state) = 0;
|
||||
virtual void editRenderState(const std::string& state, const QVariant& startProps, const QVariant& pathProps, const QVariant& endProps) = 0;
|
||||
|
||||
virtual QVector<QUuid> getOverlayIDs() = 0;
|
||||
|
||||
virtual void setPrecisionPicking(bool precisionPicking);
|
||||
virtual void setIgnoreItems(const QVector<QUuid>& ignoreItems) const;
|
||||
virtual void setIncludeItems(const QVector<QUuid>& includeItems) const;
|
||||
|
|
|
@ -144,4 +144,13 @@ bool PointerManager::isMouse(unsigned int uid) {
|
|||
return pointer->isMouse();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
QVector<QUuid> PointerManager::getOverlayIDs(unsigned int uid) {
|
||||
auto pointer = find(uid);
|
||||
if (pointer) {
|
||||
return pointer->getOverlayIDs();
|
||||
}
|
||||
QVector<QUuid> empty;
|
||||
return empty;
|
||||
}
|
||||
|
|
|
@ -44,6 +44,8 @@ public:
|
|||
bool isRightHand(unsigned int uid);
|
||||
bool isMouse(unsigned int uid);
|
||||
|
||||
QVector<QUuid> getOverlayIDs(unsigned int uid);
|
||||
|
||||
static const unsigned int MOUSE_POINTER_ID { PointerEvent::INVALID_POINTER_ID + 1 };
|
||||
|
||||
private:
|
||||
|
|
|
@ -199,6 +199,17 @@ Script.include("/~/system/libraries/controllers.js");
|
|||
maxDistance: 8.0
|
||||
});
|
||||
|
||||
this.addToSelectedItemsList = function (overlays) {
|
||||
for (var i = 0, length = overlays.length; i < length; i++) {
|
||||
Selection.addToSelectedItemsList(this.teleporterSelectionName, "overlay", overlays[i]);
|
||||
}
|
||||
};
|
||||
|
||||
this.addToSelectedItemsList(Pointers.getOverlayIDs(this.teleportParabolaHandVisible));
|
||||
this.addToSelectedItemsList(Pointers.getOverlayIDs(this.teleportParabolaHandInvisible));
|
||||
this.addToSelectedItemsList(Pointers.getOverlayIDs(this.teleportParabolaHeadVisible));
|
||||
this.addToSelectedItemsList(Pointers.getOverlayIDs(this.teleportParabolaHeadInvisible));
|
||||
|
||||
|
||||
this.PLAY_AREA_OVERLAY_MODEL = Script.resolvePath("../../assets/models/trackingSpacev2.fbx");
|
||||
this.PLAY_AREA_OVERLAY_MODEL_DIMENSIONS = { x: 2, y: 0.2, z: 2 };
|
||||
|
|
Loading…
Reference in a new issue