diff --git a/interface/src/devices/DdeFaceTracker.cpp b/interface/src/devices/DdeFaceTracker.cpp index fed5b702cb..c123585afa 100644 --- a/interface/src/devices/DdeFaceTracker.cpp +++ b/interface/src/devices/DdeFaceTracker.cpp @@ -633,12 +633,8 @@ void DdeFaceTracker::calibrate() { _calibrationCount = 0; _calibrationMessage = CALIBRATION_INSTRUCTION_MESSAGE + "\n\n"; + // FIXME: this overlay probably doesn't work anymore _calibrationBillboard = new TextOverlay(); - _calibrationBillboard->setTopMargin(CALIBRATION_BILLBOARD_TOP_MARGIN); - _calibrationBillboard->setLeftMargin(CALIBRATION_BILLBOARD_LEFT_MARGIN); - _calibrationBillboard->setFontSize(CALIBRATION_BILLBOARD_FONT_SIZE); - _calibrationBillboard->setText(CALIBRATION_INSTRUCTION_MESSAGE); - _calibrationBillboard->setAlpha(CALIBRATION_BILLBOARD_ALPHA); glm::vec2 viewport = qApp->getCanvasSize(); _calibrationBillboard->setX((viewport.x - CALIBRATION_BILLBOARD_WIDTH) / 2); _calibrationBillboard->setY((viewport.y - CALIBRATION_BILLBOARD_HEIGHT) / 2); @@ -658,10 +654,10 @@ void DdeFaceTracker::addCalibrationDatum() { int samplesLeft = CALIBRATION_SAMPLES - _calibrationCount; if (samplesLeft % LARGE_TICK_INTERVAL == 0) { _calibrationMessage += QString::number(samplesLeft / LARGE_TICK_INTERVAL); - _calibrationBillboard->setText(_calibrationMessage); + // FIXME: set overlay text } else if (samplesLeft % SMALL_TICK_INTERVAL == 0) { _calibrationMessage += "."; - _calibrationBillboard->setText(_calibrationMessage); + // FIXME: set overlay text } for (int i = 0; i < NUM_FACESHIFT_BLENDSHAPES; i++) { diff --git a/interface/src/ui/overlays/Overlays.cpp b/interface/src/ui/overlays/Overlays.cpp index 14328a349a..9dd85db43f 100644 --- a/interface/src/ui/overlays/Overlays.cpp +++ b/interface/src/ui/overlays/Overlays.cpp @@ -27,13 +27,14 @@ #include "RectangleOverlay.h" #include +#include #include +#include "VariantMapToScriptValue.h" #include "ui/Keyboard.h" #include -#include Q_LOGGING_CATEGORY(trace_render_overlays, "trace.render.overlays") @@ -51,10 +52,12 @@ Overlays::Overlays() { ADD_TYPE_MAP(Box, cube); ADD_TYPE_MAP(Sphere, sphere); + _overlayToEntityTypes["rectangle"] = "Shape"; ADD_TYPE_MAP(Shape, shape); ADD_TYPE_MAP(Model, model); ADD_TYPE_MAP(Text, text3d); ADD_TYPE_MAP(Image, image3d); + _overlayToEntityTypes["billboard"] = "Image"; ADD_TYPE_MAP(Web, web3d); ADD_TYPE_MAP(PolyLine, line3d); ADD_TYPE_MAP(Grid, grid); @@ -138,8 +141,6 @@ void Overlays::enable() { _enabled = true; } -// Note, can't be invoked by scripts, but can be called by the InterfaceParentFinder -// class on packet processing threads Overlay::Pointer Overlays::get2DOverlay(const QUuid& id) const { if (_shuttingDown) { return nullptr; @@ -165,19 +166,266 @@ QString Overlays::overlayToEntityType(const QString& type) { auto iter = _overlayToEntityTypes.find(type); if (iter != _overlayToEntityTypes.end()) { return iter->second; - } else if (type == "billboard") { - return "Image"; } return "Unknown"; } -EntityItemProperties convertOverlayToEntityProperties(const QVariantMap& overlayProps) { - EntityItemProperties props; +#define SET_OVERLAY_PROP_DEFAULT(o, d) \ + { \ + auto iter = overlayProps.find(#o); \ + if (iter == overlayProps.end()) { \ + overlayProps[#o] = d; \ + } \ + } - return props; +#define OVERLAY_TO_ENTITY_PROP(o, e) \ + { \ + auto iter = overlayProps.find(#o); \ + if (iter != overlayProps.end()) { \ + overlayProps[#e] = iter.value(); \ + } \ + } + +#define OVERLAY_TO_GROUP_ENTITY_PROP(o, g, e) \ + { \ + auto iter = overlayProps.find(#o); \ + if (iter != overlayProps.end()) { \ + auto iter2 = overlayProps.find(#g); \ + if (iter2 == overlayProps.end()) { \ + overlayProps[#g] = QVariantMap(); \ + } \ + overlayProps[#g].toMap()[#e] = iter.value(); \ + } \ + } + +#define OVERLAY_TO_GROUP_ENTITY_PROP_DEFAULT(o, g, e, d) \ + { \ + auto iter = overlayProps.find(#o); \ + if (iter != overlayProps.end()) { \ + auto iter2 = overlayProps.find(#g); \ + if (iter2 == overlayProps.end()) { \ + overlayProps[#g] = QVariantMap(); \ + } \ + overlayProps[#g].toMap()[#e] = iter.value(); \ + } else { \ + auto iter2 = overlayProps.find(#g); \ + if (iter2 == overlayProps.end()) { \ + overlayProps[#g] = QVariantMap(); \ + } \ + overlayProps[#g].toMap()[#e] = d; \ + } \ + } + +#define OVERLAY_TO_ENTITY_PROP_CONVERT(o, e, C) \ + { \ + auto iter = overlayProps.find(#o); \ + if (iter != overlayProps.end()) { \ + overlayProps[#e] = C(iter.value()); \ + } \ + } + +#define OVERLAY_TO_ENTITY_PROP_CONVERT_DEFAULT(o, e, d, C) \ + { \ + auto iter = overlayProps.find(#o); \ + if (iter != overlayProps.end()) { \ + overlayProps[#e] = C(iter.value()); \ + } else { \ + overlayProps[#e] = C(d); \ + } \ + } + +#define OVERLAY_TO_GROUP_ENTITY_PROP_CONVERT(o, g, e, C) \ + { \ + auto iter = overlayProps.find(#o); \ + if (iter != overlayProps.end()) { \ + auto iter2 = overlayProps.find(#g); \ + if (iter2 == overlayProps.end()) { \ + overlayProps[#g] = QVariantMap(); \ + } \ + overlayProps[#g].toMap()[#e] = C(iter.value()); \ + } \ + } + +EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& overlayProps) { + SET_OVERLAY_PROP_DEFAULT(alpha, 0.7); + if (overlayProps["type"] != "PolyLine") { + OVERLAY_TO_ENTITY_PROP(p1, position); + OVERLAY_TO_ENTITY_PROP(start, position); + } + OVERLAY_TO_ENTITY_PROP(point, position); + OVERLAY_TO_ENTITY_PROP(scale, dimensions); + OVERLAY_TO_ENTITY_PROP(size, dimensions); + OVERLAY_TO_ENTITY_PROP(orientation, rotation); + OVERLAY_TO_ENTITY_PROP(localOrientation, localRotation); + OVERLAY_TO_ENTITY_PROP(ignoreRayIntersection, ignorePickIntersection); + + { + OVERLAY_TO_ENTITY_PROP(solid, isSolid); + OVERLAY_TO_ENTITY_PROP(isFilled, isSolid); + OVERLAY_TO_ENTITY_PROP(filled, isSolid); + OVERLAY_TO_ENTITY_PROP_CONVERT_DEFAULT(isSolid, primitiveMode, false, [](const QVariant& v) { return v.toBool() ? "solid" : "lines"; }); + + OVERLAY_TO_ENTITY_PROP(wire, isWire); + OVERLAY_TO_ENTITY_PROP_CONVERT(isWire, primitiveMode, [](const QVariant& v) { return v.toBool() ? "lines" : "solid"; }); + } + + OVERLAY_TO_ENTITY_PROP_CONVERT(drawInFront, renderLayer, [](const QVariant& v) { return v.toBool() ? "front" : "world"; }); + OVERLAY_TO_ENTITY_PROP_CONVERT(drawHUDLayer, renderLayer, [](const QVariant& v) { return v.toBool() ? "hud" : "world"; }); + + OVERLAY_TO_GROUP_ENTITY_PROP_DEFAULT(grabbable, grab, grabbable, false); + + OVERLAY_TO_GROUP_ENTITY_PROP(pulseMin, pulse, min); + OVERLAY_TO_GROUP_ENTITY_PROP(pulseMax, pulse, max); + OVERLAY_TO_GROUP_ENTITY_PROP(pulsePeriod, pulse, period); + OVERLAY_TO_GROUP_ENTITY_PROP_CONVERT(colorPulse, pulse, colorMode, [](const QVariant& v) { + float f = v.toFloat(); + if (f > 0.0f) { + return "in"; + } else if (f < 0.0f) { + return "out"; + } + return "none"; + }); + OVERLAY_TO_GROUP_ENTITY_PROP_CONVERT(alphaPulse, pulse, alphaMode, [](const QVariant& v) { + float f = v.toFloat(); + if (f > 0.0f) { + return "in"; + } else if (f < 0.0f) { + return "out"; + } + return "none"; + }); + + if (overlayProps["type"] == "Shape") { + SET_OVERLAY_PROP_DEFAULT(shape, "Hexagon"); + } else if (overlayProps["type"] == "Model") { + OVERLAY_TO_ENTITY_PROP(url, modelURL); + OVERLAY_TO_ENTITY_PROP(animationSettings, animation); + } else if (overlayProps["type"] == "Image") { + OVERLAY_TO_ENTITY_PROP(url, imageURL); + } else if (overlayProps["type"] == "Web") { + OVERLAY_TO_ENTITY_PROP(url, sourceUrl); + OVERLAY_TO_ENTITY_PROP_CONVERT(inputMode, inputMode, [](const QVariant& v) { return v.toString() == "Mouse" ? "mouse" : "touch"; }); + } else if (overlayProps["type"] == "Gizmo") { + { + float ratio = 2.0f; + { + auto iter = overlayProps.find("outerRadius"); + if (iter != overlayProps.end()) { + ratio = iter.value().toFloat() / 0.5f; + } + } + glm::vec3 dimensions = glm::vec3(1.0f); + { + auto iter = overlayProps.find("dimensions"); + if (iter != overlayProps.end()) { + dimensions = vec3FromVariant(iter.value()); + } + } + overlayProps["dimensions"] = vec3toVariant(ratio * dimensions); + } + + { + OVERLAY_TO_ENTITY_PROP(color, innerStartColor); + OVERLAY_TO_ENTITY_PROP(color, innerEndColor); + OVERLAY_TO_ENTITY_PROP(color, outerStartColor); + OVERLAY_TO_ENTITY_PROP(color, outerEndColor); + + OVERLAY_TO_ENTITY_PROP(startColor, innerStartColor); + OVERLAY_TO_ENTITY_PROP(startColor, outerStartColor); + + OVERLAY_TO_ENTITY_PROP(endColor, innerEndColor); + OVERLAY_TO_ENTITY_PROP(endColor, outerEndColor); + + OVERLAY_TO_ENTITY_PROP(innerColor, innerStartColor); + OVERLAY_TO_ENTITY_PROP(innerColor, innerEndColor); + + OVERLAY_TO_ENTITY_PROP(outerColor, outerStartColor); + OVERLAY_TO_ENTITY_PROP(outerColor, outerEndColor); + } + + { + OVERLAY_TO_ENTITY_PROP(alpha, innerStartAlpha); + OVERLAY_TO_ENTITY_PROP(alpha, innerEndAlpha); + OVERLAY_TO_ENTITY_PROP(alpha, outerStartAlpha); + OVERLAY_TO_ENTITY_PROP(alpha, outerEndAlpha); + + OVERLAY_TO_ENTITY_PROP(startAlpha, innerStartAlpha); + OVERLAY_TO_ENTITY_PROP(startAlpha, outerStartAlpha); + + OVERLAY_TO_ENTITY_PROP(endAlpha, innerEndAlpha); + OVERLAY_TO_ENTITY_PROP(endAlpha, outerEndAlpha); + + OVERLAY_TO_ENTITY_PROP(innerAlpha, innerStartAlpha); + OVERLAY_TO_ENTITY_PROP(innerAlpha, innerEndAlpha); + + OVERLAY_TO_ENTITY_PROP(outerAlpha, outerStartAlpha); + OVERLAY_TO_ENTITY_PROP(outerAlpha, outerEndAlpha); + } + + OVERLAY_TO_GROUP_ENTITY_PROP(startAt, ring, startAngle); + OVERLAY_TO_GROUP_ENTITY_PROP(endAt, ring, endAngle); + OVERLAY_TO_GROUP_ENTITY_PROP(innerRadius, ring, innerRadius); + + OVERLAY_TO_GROUP_ENTITY_PROP(innerStartColor, ring, innerStartColor); + OVERLAY_TO_GROUP_ENTITY_PROP(innerEndColor, ring, innerEndColor); + OVERLAY_TO_GROUP_ENTITY_PROP(outerStartColor, ring, outerStartColor); + OVERLAY_TO_GROUP_ENTITY_PROP(outerEndColor, ring, outerEndColor); + OVERLAY_TO_GROUP_ENTITY_PROP(innerStartAlpha, ring, innerStartAlpha); + OVERLAY_TO_GROUP_ENTITY_PROP(innerEndAlpha, ring, innerEndAlpha); + OVERLAY_TO_GROUP_ENTITY_PROP(outerStartAlpha, ring, outerStartAlpha); + OVERLAY_TO_GROUP_ENTITY_PROP(outerEndAlpha, ring, outerEndAlpha); + + OVERLAY_TO_GROUP_ENTITY_PROP(hasTickMarks, ring, hasTickMarks); + OVERLAY_TO_GROUP_ENTITY_PROP(majorTickMarksAngle, ring, majorTickMarksAngle); + OVERLAY_TO_GROUP_ENTITY_PROP(minorTickMarksAngle, ring, minorTickMarksAngle); + OVERLAY_TO_GROUP_ENTITY_PROP(majorTickMarksLength, ring, majorTickMarksLength); + OVERLAY_TO_GROUP_ENTITY_PROP(minorTickMarksLength, ring, minorTickMarksLength); + OVERLAY_TO_GROUP_ENTITY_PROP(majorTickMarksColor, ring, majorTickMarksColor); + OVERLAY_TO_GROUP_ENTITY_PROP(minorTickMarksColor, ring, minorTickMarksColor); + } else if (overlayProps["type"] == "PolyLine") { + OVERLAY_TO_ENTITY_PROP(startPoint, start); + OVERLAY_TO_ENTITY_PROP(p1, start); + OVERLAY_TO_ENTITY_PROP(localStart, start); + OVERLAY_TO_ENTITY_PROP(endPoint, end); + OVERLAY_TO_ENTITY_PROP(p2, end); + OVERLAY_TO_ENTITY_PROP(localEnd, end); + + { + QVariantList points; + { + auto iter = overlayProps.find("start"); + if (iter != overlayProps.end()) { + points.push_back(iter.value()); + } + } + { + auto iter = overlayProps.find("end"); + if (iter != overlayProps.end()) { + points.push_back(iter.value()); + } + } + overlayProps["linePoints"] = points; + } + { + auto iter = overlayProps.find("lineWidth"); + if (iter != overlayProps.end()) { + QVariantList widths; + widths.append(iter.value()); + overlayProps["strokeWidths"] = widths; + } + } + } + + EntityItemProperties toReturn; + EntityItemPropertiesFromScriptValueHonorReadOnly(variantMapToScriptValue(overlayProps, _scriptEngine), toReturn); + return toReturn; } -QVariantMap convertEntityToOverlayProperties(const EntityItemProperties& entityProps) { +QVariantMap Overlays::convertEntityToOverlayProperties(const EntityItemProperties& entityProps) { + QScriptValue entityProperties; + EntityItemPropertiesToScriptValue(&_scriptEngine, entityProps); + QVariantMap props; return props; @@ -195,63 +443,6 @@ QUuid Overlays::addOverlay(const QString& type, const QVariant& properties) { return result; } - /**jsdoc - *

An overlay may be one of the following types:

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
Value2D/3DDescription
image2DAn image. Synonym: billboard.
rectangle2DA rectangle.
text2DText.
circle3d3DA circle.
cube3DA cube. Can also use a shape overlay to create a - * cube.
grid3DA grid of lines in a plane.
image3d3DAn image.
line3d3DA line.
model3DA model.
rectangle3d3DA rectangle.
shape3DA geometric shape, such as a cube, sphere, or cylinder.
sphere3DA sphere. Can also use a shape overlay to create a - * sphere.
text3d3DText.
web3d3DWeb content.
- *

2D overlays are rendered on the display surface in desktop mode and on the HUD surface in HMD mode. 3D overlays are - * rendered at a position and orientation in-world, but are deprecated (use local entities instead).

- *

Each overlay type has different {@link Overlays.OverlayProperties|OverlayProperties}.

- * @typedef {string} Overlays.OverlayType - */ - - /**jsdoc - *

Different overlay types have different properties:

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
{@link Overlays.OverlayType|OverlayType}Overlay Properties
image{@link Overlays.ImageProperties|ImageProperties}
rectangle{@link Overlays.RectangleProperties|RectangleProperties}
text{@link Overlays.TextProperties|TextProperties}
circle3d{@link Overlays.Circle3DProperties|Circle3DProperties}
cube{@link Overlays.CubeProperties|CubeProperties}
grid{@link Overlays.GridProperties|GridProperties}
image3d{@link Overlays.Image3DProperties|Image3DProperties}
line3d{@link Overlays.Line3DProperties|Line3DProperties}
model{@link Overlays.ModelProperties|ModelProperties}
rectangle3d{@link Overlays.Rectangle3DProperties|Rectangle3DProperties}
shape{@link Overlays.ShapeProperties|ShapeProperties}
sphere{@link Overlays.SphereProperties|SphereProperties}
text3d{@link Overlays.Text3DProperties|Text3DProperties}
web3d{@link Overlays.Web3DProperties|Web3DProperties}
- * @typedef {object} Overlays.OverlayProperties - */ - Overlay::Pointer overlay; if (type == ImageOverlay::TYPE) { #if !defined(DISABLE_QML) @@ -271,13 +462,15 @@ QUuid Overlays::addOverlay(const QString& type, const QVariant& properties) { } QString entityType = overlayToEntityType(type); - if (entityType == "Unknown") { return UNKNOWN_ENTITY_ID; } QVariantMap propertyMap = properties.toMap(); propertyMap["type"] = entityType; + if (type == "rectangle") { + propertyMap["shape"] = "Quad"; + } return DependencyManager::get()->addEntity(convertOverlayToEntityProperties(propertyMap), "local"); } @@ -942,14 +1135,44 @@ QVector Overlays::findOverlays(const glm::vec3& center, float radius) { return result; } + + +/**jsdoc + *

An overlay may be one of the following types:

+ * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + *
Value2D/3DDescription
image2DAn image. Synonym: billboard.
rectangle2DA rectangle.
text2DText.
cube3DA cube. Can also use a shape overlay to create a cube.
sphere3DA sphere. Can also use a shape overlay to create a sphere.
rectangle3d3DA rectangle.
shape3DA geometric shape, such as a cube, sphere, or cylinder.
model3DA model.
text3d3DText.
image3d3DAn image.
web3d3DWeb content.
line3d3DA line.
grid3DA grid of lines in a plane.
circle3d3DA circle.
+ *

2D overlays are rendered on the display surface in desktop mode and on the HUD surface in HMD mode. 3D overlays are + * rendered at a position and orientation in-world, but are deprecated (use local entities instead).

+ *

Each overlay type has different {@link Overlays.OverlayProperties|OverlayProperties}.

+ * @typedef {string} Overlays.OverlayType + */ + /**jsdoc * Different overlay types have different properties: some common to all overlays (listed below) and some specific to each * {@link Overlays.OverlayType|OverlayType} (linked to below). The properties are accessed as an object of property names and - * values. + * values. 3D Overlays are local entities, internally, so they also support the corresponding entity properties. * * @typedef {object} Overlays.OverlayProperties * @property {Uuid} id - The ID of the overlay. Read-only. - * @property {string} type=TODO - Has the value "TODO". Read-only. * @property {Overlays.OverlayType} type - The overlay type. Read-only. * @property {boolean} visible=true - If true, the overlay is rendered, otherwise it is not rendered. * @@ -959,6 +1182,7 @@ QVector Overlays::findOverlays(const glm::vec3& center, float radius) { * @see {@link Overlays.OverlayProperties-Rectangle|OverlayProperties-Rectangle} * @see {@link Overlays.OverlayProperties-Cube|OverlayProperties-Cube} * @see {@link Overlays.OverlayProperties-Sphere|OverlayProperties-Sphere} + * @see {@link Overlays.OverlayProperties-Rectangle3D|OverlayProperties-Rectangle3D} * @see {@link Overlays.OverlayProperties-Shape|OverlayProperties-Shape} * @see {@link Overlays.OverlayProperties-Model|OverlayProperties-Model} * @see {@link Overlays.OverlayProperties-Text3D|OverlayProperties-Text3D} @@ -1014,7 +1238,7 @@ QVector Overlays::findOverlays(const glm::vec3& center, float radius) { */ /**jsdoc - * The "Text" {@link Overlays.OverlayType|OverlayType} is for 2D rectangles. + * The "Rectangle" {@link Overlays.OverlayType|OverlayType} is for 2D rectangles. * @typedef {object} Overlays.OverlayProperties-Rectangle * @property {Rect} bounds - The position and size of the rectangle, in pixels. Write-only. * @property {number} x - Integer left, x-coordinate value = bounds.x. Write-only. @@ -1110,6 +1334,45 @@ QVector Overlays::findOverlays(const glm::vec3& center, float radius) { * */ +/**jsdoc + * The "Rectangle3D" {@link Overlays.OverlayType|OverlayType} is for 3D rectangles. + * @typedef {object} Overlays.OverlayProperties-Rectangle3D + * @property {string} name - The name of the overlay. + * @property {Color} color=255,255,255 - The color of the overlay. + * @property {number} alpha=0.7 - The opacity of the overlay, 0.0 - 1.0. + * @property {number} pulseMax=0 - The maximum value of the pulse multiplier. + * @property {number} pulseMin=0 - The minimum value of the pulse multiplier. + * @property {number} pulsePeriod=1 - The duration of the color and alpha pulse, in seconds. A pulse multiplier value goes from + * pulseMin to pulseMax, then pulseMax to pulseMin in one period. + * @property {number} alphaPulse=0 - If non-zero, the alpha of the overlay is pulsed: the alpha value is multiplied by the + * current pulse multiplier value each frame. If > 0 the pulse multiplier is applied in phase with the pulse period; if < 0 + * the pulse multiplier is applied out of phase with the pulse period. (The magnitude of the property isn't otherwise + * used.) + * @property {number} colorPulse=0 - If non-zero, the color of the overlay is pulsed: the color value is multiplied by the + * current pulse multiplier value each frame. If > 0 the pulse multiplier is applied in phase with the pulse period; if < 0 + * the pulse multiplier is applied out of phase with the pulse period. (The magnitude of the property isn't otherwise + * used.) + * + * @property {Vec3} position - The position of the overlay center. Synonyms: p1, point, and + * start. + * @property {Vec3} dimensions - The dimensions of the overlay. Synonyms: scale, size. + * @property {Quat} rotation - The orientation of the overlay. Synonym: orientation. + * @property {Vec3} localPosition - The local position of the overlay relative to its parent if the overlay has a + * parentID set, otherwise the same value as position. + * @property {Quat} localRotation - The orientation of the overlay relative to its parent if the overlay has a + * parentID set, otherwise the same value as rotation. Synonym: localOrientation. + * @property {boolean} isSolid=false - Synonyms: solid, isFilled, and filled. + * Antonyms: isWire and wire. + * @property {boolean} ignorePickIntersection=false - If true, picks ignore the overlay. ignoreRayIntersection is a synonym. + * @property {boolean} drawInFront=false - If true, the overlay is rendered in front of objects in the world, but behind the HUD. + * @property {boolean} drawHUDLayer=false - If true, the overlay is rendered in front of everything, including the HUD. + * @property {boolean} grabbable=false - Signal to grabbing scripts whether or not this overlay can be grabbed. + * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. + * @property {number} parentJointIndex=65535 - Integer value specifying the skeleton joint that the overlay is attached to if + * parentID is an avatar skeleton. A value of 65535 means "no joint". + * + */ + /**jsdoc *

A shape {@link Overlays.OverlayType|OverlayType} may display as one of the following geometrical shapes:

* diff --git a/interface/src/ui/overlays/Overlays.h b/interface/src/ui/overlays/Overlays.h index a9d3cffe41..fb6fb024aa 100644 --- a/interface/src/ui/overlays/Overlays.h +++ b/interface/src/ui/overlays/Overlays.h @@ -26,8 +26,6 @@ #include "Overlay.h" -#include "PanelAttachable.h" - #include class PickRay; @@ -119,6 +117,8 @@ public: void cleanupAllOverlays(); + mutable QScriptEngine _scriptEngine; + public slots: /**jsdoc * Add an overlay to the scene. @@ -723,6 +723,9 @@ private: static std::unordered_map _entityToOverlayTypes; static std::unordered_map _overlayToEntityTypes; + QVariantMap convertEntityToOverlayProperties(const EntityItemProperties& entityProps); + EntityItemProperties convertOverlayToEntityProperties(QVariantMap& overlayProps); + private slots: void mousePressPointerEvent(const QUuid& id, const PointerEvent& event); void mouseMovePointerEvent(const QUuid& id, const PointerEvent& event); diff --git a/interface/src/ui/overlays/QmlOverlay.cpp b/interface/src/ui/overlays/QmlOverlay.cpp index 2a583e0450..537c421ca7 100644 --- a/interface/src/ui/overlays/QmlOverlay.cpp +++ b/interface/src/ui/overlays/QmlOverlay.cpp @@ -26,8 +26,8 @@ QmlOverlay::QmlOverlay(const QUrl& url) { buildQmlElement(url); } -QmlOverlay::QmlOverlay(const QUrl& url, const QmlOverlay* textOverlay) - : Overlay2D(textOverlay) { +QmlOverlay::QmlOverlay(const QUrl& url, const QmlOverlay* overlay) + : Overlay2D(overlay) { buildQmlElement(url); } diff --git a/interface/src/ui/overlays/QmlOverlay.h b/interface/src/ui/overlays/QmlOverlay.h index ce25ee75ba..0951a04772 100644 --- a/interface/src/ui/overlays/QmlOverlay.h +++ b/interface/src/ui/overlays/QmlOverlay.h @@ -22,7 +22,7 @@ class QmlOverlay : public Overlay2D { public: QmlOverlay(const QUrl& url); - QmlOverlay(const QUrl& url, const QmlOverlay* textOverlay); + QmlOverlay(const QUrl& url, const QmlOverlay* overlay); ~QmlOverlay(); bool supportsGetProperty() const override { return false; } diff --git a/libraries/entities/src/EntityEditPacketSender.h b/libraries/entities/src/EntityEditPacketSender.h index a4ec2c45f9..99a5202986 100644 --- a/libraries/entities/src/EntityEditPacketSender.h +++ b/libraries/entities/src/EntityEditPacketSender.h @@ -56,6 +56,5 @@ private: private: std::mutex _mutex; AvatarData* _myAvatar { nullptr }; - QScriptEngine _scriptEngine; }; #endif // hifi_EntityEditPacketSender_h