mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Remove superseded Pointers API functions
This commit is contained in:
parent
4927ffece3
commit
90ef109476
10 changed files with 12 additions and 124 deletions
|
@ -360,32 +360,3 @@ glm::vec2 PathPointer::findPos2D(const PickedObject& pickedObject, const glm::ve
|
||||||
return glm::vec2(NAN);
|
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;
|
|
||||||
}
|
|
||||||
|
|
||||||
QUuid PathPointer::getStartOverlayID(const QString& state) {
|
|
||||||
if (_renderStates.find(_currentRenderState) != _renderStates.end()) {
|
|
||||||
return _renderStates[_currentRenderState]->getStartID();
|
|
||||||
}
|
|
||||||
return QUuid();
|
|
||||||
}
|
|
||||||
|
|
||||||
QUuid PathPointer::getEndOverlayID(const QString& state) {
|
|
||||||
if (_renderStates.find(_currentRenderState) != _renderStates.end()) {
|
|
||||||
return _renderStates[_currentRenderState]->getEndID();
|
|
||||||
}
|
|
||||||
return QUuid();
|
|
||||||
}
|
|
||||||
|
|
|
@ -80,10 +80,6 @@ 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.
|
// 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;
|
void editRenderState(const std::string& state, const QVariant& startProps, const QVariant& pathProps, const QVariant& endProps) override;
|
||||||
|
|
||||||
QVector<QUuid> getOverlayIDs() override;
|
|
||||||
QUuid getStartOverlayID(const QString& state) override;
|
|
||||||
QUuid getEndOverlayID(const QString& state) override;
|
|
||||||
|
|
||||||
void setLength(float length) override;
|
void setLength(float length) override;
|
||||||
void setLockEndUUID(const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) override;
|
void setLockEndUUID(const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) override;
|
||||||
|
|
||||||
|
|
|
@ -394,15 +394,3 @@ QVariantMap PointerScriptingInterface::getPrevPickResult(unsigned int uid) const
|
||||||
QVariantMap PointerScriptingInterface::getPointerProperties(unsigned int uid) const {
|
QVariantMap PointerScriptingInterface::getPointerProperties(unsigned int uid) const {
|
||||||
return DependencyManager::get<PointerManager>()->getPointerProperties(uid);
|
return DependencyManager::get<PointerManager>()->getPointerProperties(uid);
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QUuid> PointerScriptingInterface::getOverlayIDs(unsigned int uid) {
|
|
||||||
return DependencyManager::get<PointerManager>()->getOverlayIDs(uid);
|
|
||||||
}
|
|
||||||
|
|
||||||
QUuid PointerScriptingInterface::getStartOverlayID(unsigned int uid, const QString& state) {
|
|
||||||
return DependencyManager::get<PointerManager>()->getStartOverlayID(uid, state);
|
|
||||||
}
|
|
||||||
|
|
||||||
QUuid PointerScriptingInterface::getEndOverlayID(unsigned int uid, const QString& state) {
|
|
||||||
return DependencyManager::get<PointerManager>()->getEndOverlayID(uid, state);
|
|
||||||
}
|
|
||||||
|
|
|
@ -205,39 +205,12 @@ public:
|
||||||
|
|
||||||
/**jsdoc
|
/**jsdoc
|
||||||
* Returns information about an existing Pointer
|
* Returns information about an existing Pointer
|
||||||
* @function Pointers.getPointerState
|
* @function Pointers.getPointerProperties
|
||||||
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
||||||
* @returns {Pointers.LaserPointerProperties|Pointers.StylusPointerProperties|Pointers.ParabolaPointerProperties} The information about the Pointer.
|
* @returns {Pointers.LaserPointerProperties|Pointers.StylusPointerProperties|Pointers.ParabolaPointerProperties} The information about the Pointer.
|
||||||
* Currently only includes renderStates and defaultRenderStates with associated overlay IDs.
|
* Currently only includes renderStates and defaultRenderStates with associated overlay IDs.
|
||||||
*/
|
*/
|
||||||
Q_INVOKABLE QVariantMap getPointerProperties(unsigned int uid) const;
|
Q_INVOKABLE QVariantMap getPointerProperties(unsigned int uid) const;
|
||||||
/**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 if a {@link PickType|Parabola}, otherwise null.
|
|
||||||
*/
|
|
||||||
Q_INVOKABLE QVector<QUuid> getOverlayIDs(unsigned int uid);
|
|
||||||
|
|
||||||
/**jsdoc
|
|
||||||
* Get the ID of the start overlay for a particular state used by a {@link PickType|Path} or {@link PickType|Parabola}
|
|
||||||
* Pointer.
|
|
||||||
* @function Pointers.getStartOverlayID
|
|
||||||
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
|
||||||
* @returns {Uuid} The ID of the start overlay used by the Pointer if a {@link PickType|Path} or {@link PickType|Parabola},
|
|
||||||
* otherwise Uuid.NULL.
|
|
||||||
*/
|
|
||||||
Q_INVOKABLE QUuid getStartOverlayID(unsigned int uid, const QString& state);
|
|
||||||
|
|
||||||
/**jsdoc
|
|
||||||
* Get the ID of the end overlay for a particular state used by a {@link PickType|Path} or {@link PickType|Parabola}
|
|
||||||
* Pointer.
|
|
||||||
* @function Pointers.getEndOverlayID
|
|
||||||
* @param {number} uid The ID of the Pointer, as returned by {@link Pointers.createPointer}.
|
|
||||||
* @returns {Uuid} The ID of the end overlay used by the Pointer if a {@link PickType|Path} or {@link PickType|Parabola},
|
|
||||||
* otherwise Uuid.NULL.
|
|
||||||
*/
|
|
||||||
Q_INVOKABLE QUuid getEndOverlayID(unsigned int uid, const QString& state);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // hifi_PointerScriptingInterface_h
|
#endif // hifi_PointerScriptingInterface_h
|
||||||
|
|
|
@ -234,9 +234,3 @@ glm::vec2 StylusPointer::findPos2D(const PickedObject& pickedObject, const glm::
|
||||||
return glm::vec2(NAN);
|
return glm::vec2(NAN);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QUuid> StylusPointer::getOverlayIDs() {
|
|
||||||
QVector<QUuid> result;
|
|
||||||
result.append(_stylusOverlay);
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
|
@ -35,10 +35,6 @@ public:
|
||||||
|
|
||||||
QVariantMap toVariantMap() const override;
|
QVariantMap toVariantMap() const override;
|
||||||
|
|
||||||
QVector<QUuid> getOverlayIDs() override;
|
|
||||||
QUuid getStartOverlayID(const QString& state) override { return QUuid(); };
|
|
||||||
QUuid getEndOverlayID(const QString& state) override { return QUuid(); };;
|
|
||||||
|
|
||||||
static OverlayID buildStylusOverlay(const QVariantMap& properties);
|
static OverlayID buildStylusOverlay(const QVariantMap& properties);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
|
@ -52,10 +52,6 @@ public:
|
||||||
|
|
||||||
virtual QVariantMap toVariantMap() const = 0;
|
virtual QVariantMap toVariantMap() const = 0;
|
||||||
|
|
||||||
virtual QVector<QUuid> getOverlayIDs() = 0;
|
|
||||||
virtual QUuid getStartOverlayID(const QString& state) = 0;
|
|
||||||
virtual QUuid getEndOverlayID(const QString& state) = 0;
|
|
||||||
|
|
||||||
virtual void setPrecisionPicking(bool precisionPicking);
|
virtual void setPrecisionPicking(bool precisionPicking);
|
||||||
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;
|
||||||
|
|
|
@ -154,28 +154,3 @@ bool PointerManager::isMouse(unsigned int uid) {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
QVector<QUuid> PointerManager::getOverlayIDs(unsigned int uid) {
|
|
||||||
auto pointer = find(uid);
|
|
||||||
if (pointer) {
|
|
||||||
return pointer->getOverlayIDs();
|
|
||||||
}
|
|
||||||
QVector<QUuid> empty;
|
|
||||||
return empty;
|
|
||||||
}
|
|
||||||
|
|
||||||
QUuid PointerManager::getStartOverlayID(unsigned int uid, const QString& state) {
|
|
||||||
auto pointer = find(uid);
|
|
||||||
if (pointer) {
|
|
||||||
return pointer->getStartOverlayID(state);
|
|
||||||
}
|
|
||||||
return QUuid();
|
|
||||||
}
|
|
||||||
|
|
||||||
QUuid PointerManager::getEndOverlayID(unsigned int uid, const QString& state) {
|
|
||||||
auto pointer = find(uid);
|
|
||||||
if (pointer) {
|
|
||||||
return pointer->getEndOverlayID(state);
|
|
||||||
}
|
|
||||||
return QUuid();
|
|
||||||
}
|
|
||||||
|
|
|
@ -45,10 +45,6 @@ public:
|
||||||
bool isRightHand(unsigned int uid);
|
bool isRightHand(unsigned int uid);
|
||||||
bool isMouse(unsigned int uid);
|
bool isMouse(unsigned int uid);
|
||||||
|
|
||||||
QVector<QUuid> getOverlayIDs(unsigned int uid);
|
|
||||||
QUuid getStartOverlayID(unsigned int uid, const QString& state);
|
|
||||||
QUuid getEndOverlayID(unsigned int uid, const QString& state);
|
|
||||||
|
|
||||||
static const unsigned int MOUSE_POINTER_ID { PointerEvent::INVALID_POINTER_ID + 1 };
|
static const unsigned int MOUSE_POINTER_ID { PointerEvent::INVALID_POINTER_ID + 1 };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
|
@ -259,9 +259,12 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
isOutlineSmooth: false
|
isOutlineSmooth: false
|
||||||
};
|
};
|
||||||
|
|
||||||
this.addToSelectedItemsList = function (overlays) {
|
this.addToSelectedItemsList = function (properties) {
|
||||||
for (var i = 0, length = overlays.length; i < length; i++) {
|
for (var i = 0, length = teleportRenderStates.length; i < length; i++) {
|
||||||
Selection.addToSelectedItemsList(this.teleporterSelectionName, "overlay", overlays[i]);
|
var state = properties.renderStates[teleportRenderStates[i].name];
|
||||||
|
if (state && state.end) {
|
||||||
|
Selection.addToSelectedItemsList(this.teleporterSelectionName, "overlay", state.end);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -345,10 +348,10 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
maxDistance: 8.0
|
maxDistance: 8.0
|
||||||
});
|
});
|
||||||
|
|
||||||
_this.addToSelectedItemsList(Pointers.getOverlayIDs(_this.teleportParabolaHandVisuals));
|
_this.addToSelectedItemsList(Pointers.getPointerProperties(_this.teleportParabolaHandVisuals));
|
||||||
_this.addToSelectedItemsList(Pointers.getOverlayIDs(_this.teleportParabolaHandCollisions));
|
_this.addToSelectedItemsList(Pointers.getPointerProperties(_this.teleportParabolaHandCollisions));
|
||||||
_this.addToSelectedItemsList(Pointers.getOverlayIDs(_this.teleportParabolaHeadVisuals));
|
_this.addToSelectedItemsList(Pointers.getPointerProperties(_this.teleportParabolaHeadVisuals));
|
||||||
_this.addToSelectedItemsList(Pointers.getOverlayIDs(_this.teleportParabolaHeadCollisions));
|
_this.addToSelectedItemsList(Pointers.getPointerProperties(_this.teleportParabolaHeadCollisions));
|
||||||
|
|
||||||
|
|
||||||
var capsuleData = MyAvatar.getCollisionCapsule();
|
var capsuleData = MyAvatar.getCollisionCapsule();
|
||||||
|
@ -776,7 +779,7 @@ Script.include("/~/system/libraries/controllers.js");
|
||||||
Pointers.setRenderState(_this.teleportParabolaHandCollisions, invisibleState);
|
Pointers.setRenderState(_this.teleportParabolaHandCollisions, invisibleState);
|
||||||
pointerID = _this.teleportParabolaHandVisuals;
|
pointerID = _this.teleportParabolaHandVisuals;
|
||||||
}
|
}
|
||||||
this.setPlayAreaVisible(visible, Pointers.getEndOverlayID(pointerID, "teleport"), true);
|
this.setPlayAreaVisible(visible, Pointers.getPointerProperties(pointerID).renderStates.teleport.end, true);
|
||||||
this.setTeleportVisible(visible, mode);
|
this.setTeleportVisible(visible, mode);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue