From fe9babf02dba80e330a3d98ecf477654a7966708 Mon Sep 17 00:00:00 2001 From: ksuprynowicz Date: Sun, 14 May 2023 23:49:47 +0200 Subject: [PATCH] Scripting-related cleanup --- interface/src/RefreshRateManager.h | 2 +- interface/src/raypick/ParabolaPointer.cpp | 13 +- interface/src/raypick/StylusPointer.cpp | 4 - interface/src/ui/overlays/Overlays.cpp | 1289 ----------------- interface/src/ui/overlays/Overlays.h | 72 +- libraries/entities/src/EntityEditFilters.cpp | 11 - libraries/script-engine/src/ScriptManager.cpp | 1 + 7 files changed, 4 insertions(+), 1388 deletions(-) diff --git a/interface/src/RefreshRateManager.h b/interface/src/RefreshRateManager.h index f7414c57e9..4b91f0c45e 100644 --- a/interface/src/RefreshRateManager.h +++ b/interface/src/RefreshRateManager.h @@ -118,7 +118,7 @@ private: mutable int _activeRefreshRate { 20 }; RefreshRateProfile _refreshRateProfile { RefreshRateProfile::INTERACTIVE}; RefreshRateRegime _refreshRateRegime { RefreshRateRegime::STARTUP }; - UXMode _uxMode { UXMode::UX_NUM }; + UXMode _uxMode { UXMode::DESKTOP }; mutable ReadWriteLockable _refreshRateProfileSettingLock; Setting::Handle _refreshRateProfileSetting { "refreshRateProfile", RefreshRateProfile::INTERACTIVE }; diff --git a/interface/src/raypick/ParabolaPointer.cpp b/interface/src/raypick/ParabolaPointer.cpp index 4f65480191..63a17b217c 100644 --- a/interface/src/raypick/ParabolaPointer.cpp +++ b/interface/src/raypick/ParabolaPointer.cpp @@ -249,18 +249,7 @@ std::shared_ptr ParabolaPointer::buildRenderState(const QVa bool isVisibleInSecondaryCamera = RenderState::ParabolaRenderItem::DEFAULT_PARABOLA_ISVISIBLEINSECONDARYCAMERA; bool drawInFront = RenderState::ParabolaRenderItem::DEFAULT_PARABOLA_DRAWINFRONT; bool enabled = false; - /*if (propMap["pathPropertyIndex"].isValid()) { - int pathPropertyIndex = propMap["pathPropertyIndex"].toInt(); - if (pathPropertyIndex >= 0 && pathPropertyIndex < entityProperties.length()) { - const EntityItemProperties &pathProperties(entityProperties[pathPropertyIndex]); - enabled = true; - color = pathProperties.getColor(); - alpha = pathProperties.getAlpha(); - //V8TODO I'm not sure how to do this one - //width = pathProperties.getWidth; - drawInFront = (pathProperties.getRenderLayer() == RenderLayer::FRONT); - } - }*/ + if (propMap["path"].isValid()) { enabled = true; QVariantMap pathMap = propMap["path"].toMap(); diff --git a/interface/src/raypick/StylusPointer.cpp b/interface/src/raypick/StylusPointer.cpp index 0e19b0fe6b..8a6097816e 100644 --- a/interface/src/raypick/StylusPointer.cpp +++ b/interface/src/raypick/StylusPointer.cpp @@ -85,13 +85,9 @@ QUuid StylusPointer::buildStylus(const QVariantMap& properties) { entityProperties.setType(EntityTypes::Model); entityProperties.setName("stylus"); entityProperties.setModelURL(modelURL); - // V8TODO: I can't find equivalent for entities - //propertiesMap["loadPriority"] = 10.0f; entityProperties.setPrimitiveMode(PrimitiveMode::SOLID); entityProperties.setVisible(true); entityProperties.setIgnorePickIntersection(true); - // V8TODO: I can't find equivalent for entities but shouldn't be necessary - //propertiesMap["drawInFront"] = false; return DependencyManager::get()->addEntityInternal(entityProperties, entity::HostType::LOCAL); } diff --git a/interface/src/ui/overlays/Overlays.cpp b/interface/src/ui/overlays/Overlays.cpp index 721632c6c7..e245acfd40 100644 --- a/interface/src/ui/overlays/Overlays.cpp +++ b/interface/src/ui/overlays/Overlays.cpp @@ -195,588 +195,8 @@ QString Overlays::entityToOverlayType(const QString& type) { return "unknown"; } -/*QString Overlays::overlayToEntityType(const QString& type) { - auto iter = _overlayToEntityTypes.find(type); - if (iter != _overlayToEntityTypes.end()) { - return iter->second; - } - return "Unknown"; -}*/ - -#define SET_OVERLAY_PROP_DEFAULT(o, d) \ - { \ - if (add && !overlayProps.contains(#o)) { \ - overlayProps[#o] = d; \ - } \ - } - -#define RENAME_PROP(o, e) \ - { \ - auto iter = overlayProps.find(#o); \ - if (iter != overlayProps.end() && \ - !overlayProps.contains(#e)) { \ - overlayProps[#e] = iter.value(); \ - } \ - } - -#define RENAME_PROP_CONVERT(o, e, C) \ - { \ - auto iter = overlayProps.find(#o); \ - if (iter != overlayProps.end()) { \ - overlayProps[#e] = C(iter.value()); \ - } \ - } - -#define OVERLAY_TO_GROUP_ENTITY_PROP(o, g, e) \ - { \ - auto iter = overlayProps.find(#o); \ - if (iter != overlayProps.end()) { \ - if (!overlayProps.contains(#g)) { \ - overlayProps[#g] = QVariantMap(); \ - } \ - auto map = overlayProps[#g].toMap(); \ - map[#e] = iter.value(); \ - overlayProps[#g] = map; \ - } \ - } - -#define OVERLAY_TO_GROUP_ENTITY_PROP_DEFAULT(o, g, e, d) \ - { \ - auto iter = overlayProps.find(#o); \ - if (iter != overlayProps.end()) { \ - if (!overlayProps.contains(#g)) { \ - overlayProps[#g] = QVariantMap(); \ - } \ - auto map = overlayProps[#g].toMap(); \ - map[#e] = iter.value(); \ - overlayProps[#g] = map; \ - } else if (add) { \ - if (!overlayProps.contains(#g)) { \ - overlayProps[#g] = QVariantMap(); \ - } \ - auto map = overlayProps[#g].toMap(); \ - map[#e] = d; \ - overlayProps[#g] = map; \ - } \ - } - -#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 if (add) { \ - overlayProps[#e] = C(d); \ - } \ - } - -#define OVERLAY_TO_GROUP_ENTITY_PROP_CONVERT(o, g, e, C) \ - { \ - auto iter = overlayProps.find(#o); \ - if (iter != overlayProps.end()) { \ - if (!overlayProps.contains(#g)) { \ - overlayProps[#g] = QVariantMap(); \ - } \ - auto map = overlayProps[#g].toMap(); \ - map[#e] = C(iter.value()); \ - overlayProps[#g] = map; \ - } \ - } - -#define GROUP_ENTITY_TO_OVERLAY_PROP(g, e, o) \ - { \ - auto iter = overlayProps.find(#g); \ - if (iter != overlayProps.end()) { \ - auto map = iter.value().toMap(); \ - auto iter2 = map.find(#e); \ - if (iter2 != map.end()) { \ - overlayProps[#o] = iter2.value(); \ - } \ - } \ - } - -#define GROUP_ENTITY_TO_OVERLAY_PROP_CONVERT(g, e, o, C) \ - { \ - auto iter = overlayProps.find(#g); \ - if (iter != overlayProps.end()) { \ - auto map = iter.value().toMap(); \ - auto iter2 = map.find(#e); \ - if (iter2 != map.end()) { \ - overlayProps[#o] = C(iter2.value()); \ - } \ - } \ - } - static QHash> savedRotations = QHash>(); -// V8TODO: This can be safely removed as soon as 3D overlays are not used anymore by default scripts -/*EntityItemProperties Overlays::convertOverlayToEntityProperties(QVariantMap& overlayProps, std::pair& rotationToSave, const QString& type, bool add, const QUuid& id) { - overlayProps["type"] = type; - - SET_OVERLAY_PROP_DEFAULT(alpha, 0.7); - if (type != "PolyLine") { - RENAME_PROP(p1, position); - RENAME_PROP(start, position); - } - RENAME_PROP(point, position); - if (type != "Model") { - RENAME_PROP(scale, dimensions); - } else { - RENAME_PROP(scale, modelScale); - } - RENAME_PROP(size, dimensions); - RENAME_PROP(orientation, rotation); - RENAME_PROP(localOrientation, localRotation); - RENAME_PROP(ignoreRayIntersection, ignorePickIntersection); - - RENAME_PROP_CONVERT(drawInFront, renderLayer, [](const QVariant& v) { return v.toBool() ? "front" : "world"; }); - RENAME_PROP_CONVERT(drawHUDLayer, renderLayer, [=](const QVariant& v) { - bool f = v.toBool(); - if (f) { - return QVariant("hud"); - } else if (overlayProps.contains("renderLayer")) { - return overlayProps["renderLayer"]; - } - return QVariant("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"; - }); - - RENAME_PROP_CONVERT(textures, textures, [](const QVariant& v) { - auto map = v.toMap(); - if (!map.isEmpty()) { - auto json = QJsonDocument::fromVariant(map); - if (!json.isNull()) { - return QVariant(QString(json.toJson())); - } - } - return v; - }); - - if (type == "Shape" || type == "Box" || type == "Sphere" || type == "Gizmo") { - RENAME_PROP(solid, isSolid); - RENAME_PROP(isFilled, isSolid); - RENAME_PROP(filled, isSolid); - OVERLAY_TO_ENTITY_PROP_CONVERT_DEFAULT(isSolid, primitiveMode, false, [](const QVariant& v) { return v.toBool() ? "solid" : "lines"; }); - - RENAME_PROP(wire, isWire); - RENAME_PROP_CONVERT(isWire, primitiveMode, [](const QVariant& v) { return v.toBool() ? "lines" : "solid"; }); - } - - if (type == "Shape") { - SET_OVERLAY_PROP_DEFAULT(shape, "Hexagon"); - } else if (type == "Model") { - RENAME_PROP(url, modelURL); - RENAME_PROP(animationSettings, animation); - } else if (type == "Image") { - RENAME_PROP(url, imageURL); - } else if (type == "Text") { - RENAME_PROP(color, textColor); - } else if (type == "Web") { - RENAME_PROP(url, sourceUrl); - RENAME_PROP_CONVERT(inputMode, inputMode, [](const QVariant& v) { return v.toString() == "Mouse" ? "mouse" : "touch"; }); - } else if (type == "Gizmo") { - RENAME_PROP(radius, outerRadius); - if (add || overlayProps.contains("outerRadius")) { - 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()); - } else if (!add) { - EntityPropertyFlags desiredProperties; - desiredProperties += PROP_DIMENSIONS; - dimensions = DependencyManager::get()->getEntityProperties(id, desiredProperties).getDimensions(); - } - } - overlayProps["dimensions"] = vec3toVariant(ratio * dimensions); - } - - if (add && !overlayProps.contains("rotation") && !overlayProps.contains("localRotation")) { - overlayProps["rotation"] = quatToVariant(glm::angleAxis(-(float)M_PI_2, Vectors::RIGHT)); - } else if (overlayProps.contains("rotation")) { - glm::quat rotation = quatFromVariant(overlayProps["rotation"]); - overlayProps["rotation"] = quatToVariant(glm::angleAxis(-(float)M_PI_2, rotation * Vectors::RIGHT) * rotation); - } else if (overlayProps.contains("localRotation")) { - glm::quat rotation = quatFromVariant(overlayProps["localRotation"]); - overlayProps["localRotation"] = quatToVariant(glm::angleAxis(-(float)M_PI_2, rotation * Vectors::RIGHT) * rotation); - } - - { - RENAME_PROP(color, innerStartColor); - RENAME_PROP(color, innerEndColor); - RENAME_PROP(color, outerStartColor); - RENAME_PROP(color, outerEndColor); - - RENAME_PROP(startColor, innerStartColor); - RENAME_PROP(startColor, outerStartColor); - - RENAME_PROP(endColor, innerEndColor); - RENAME_PROP(endColor, outerEndColor); - - RENAME_PROP(innerColor, innerStartColor); - RENAME_PROP(innerColor, innerEndColor); - - RENAME_PROP(outerColor, outerStartColor); - RENAME_PROP(outerColor, outerEndColor); - } - - { - RENAME_PROP(alpha, innerStartAlpha); - RENAME_PROP(alpha, innerEndAlpha); - RENAME_PROP(alpha, outerStartAlpha); - RENAME_PROP(alpha, outerEndAlpha); - - RENAME_PROP(startAlpha, innerStartAlpha); - RENAME_PROP(startAlpha, outerStartAlpha); - - RENAME_PROP(endAlpha, innerEndAlpha); - RENAME_PROP(endAlpha, outerEndAlpha); - - RENAME_PROP(innerAlpha, innerStartAlpha); - RENAME_PROP(innerAlpha, innerEndAlpha); - - RENAME_PROP(outerAlpha, outerStartAlpha); - RENAME_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 (type == "PolyLine") { - RENAME_PROP(startPoint, p1); - RENAME_PROP(start, p1); - RENAME_PROP(endPoint, p2); - RENAME_PROP(end, p2); - - RENAME_PROP(p1, position); - RENAME_PROP_CONVERT(p1, p1, [](const QVariant& v) { return vec3toVariant(glm::vec3(0.0f)); }); - RENAME_PROP_CONVERT(p2, p2, [=](const QVariant& v) { - glm::vec3 position; - bool hasPosition = false; - glm::quat rotation; - bool hasRotation = false; - - auto iter2 = overlayProps.find("position"); - if (iter2 != overlayProps.end()) { - position = vec3FromVariant(iter2.value()); - hasPosition = true; - } - iter2 = overlayProps.find("rotation"); - if (iter2 != overlayProps.end()) { - rotation = quatFromVariant(iter2.value()); - hasRotation = true; - } - - if (!add && !(hasPosition && hasRotation)) { - auto entity = DependencyManager::get()->getEntity(id); - if (entity) { - if (!hasPosition) { - position = entity->getWorldPosition(); - } - if (!hasRotation) { - rotation = entity->getWorldOrientation(); - } - } - } - - return vec3toVariant(glm::inverse(rotation) * (vec3FromVariant(v) - position)); - }); - - RENAME_PROP(localStart, p1); - RENAME_PROP(localEnd, p2); - - { - QVariantList points; - { - auto iter = overlayProps.find("p1"); - if (iter != overlayProps.end()) { - points.push_back(iter.value()); - } - } - { - auto iter = overlayProps.find("p2"); - if (iter != overlayProps.end()) { - points.push_back(iter.value()); - } - } - overlayProps["linePoints"] = points; - } - { - auto iter = overlayProps.find("lineWidth"); - if (iter != overlayProps.end()) { - QVariantList widths; - QVariant width = iter.value(); - widths.append(width); - widths.append(width); - overlayProps["strokeWidths"] = widths; - } - } - - RENAME_PROP_CONVERT(glow, glow, [](const QVariant& v) { return v.toFloat() > 0.0f ? true : false; }); - SET_OVERLAY_PROP_DEFAULT(faceCamera, true); - { - QVariantList normals; - normals.append(vec3toVariant(Vectors::UP)); - normals.append(vec3toVariant(Vectors::UP)); - SET_OVERLAY_PROP_DEFAULT(normals, normals); - } - - SET_OVERLAY_PROP_DEFAULT(textures, PathUtils::resourcesUrl() + "images/whitePixel.png"); - } - - if (type == "Text" || type == "Image" || type == "Grid" || type == "Web") { - glm::quat originalRotation = ENTITY_ITEM_DEFAULT_ROTATION; - bool local = false; - { - auto iter = overlayProps.find("rotation"); - if (iter != overlayProps.end()) { - originalRotation = quatFromVariant(iter.value()); - local = false; - } else { - iter = overlayProps.find("localRotation"); - if (iter != overlayProps.end()) { - originalRotation = quatFromVariant(iter.value()); - local = true; - } else if (!add) { - auto iter2 = savedRotations.find(id); - if (iter2 != savedRotations.end()) { - originalRotation = iter2.value().first; - local = iter2.value().second; - } - } - } - } - - if (!add) { - savedRotations[id] = { originalRotation, local }; - } else { - rotationToSave = { originalRotation, local }; - } - - glm::vec3 dimensions = ENTITY_ITEM_DEFAULT_DIMENSIONS; - { - auto iter = overlayProps.find("dimensions"); - if (iter != overlayProps.end()) { - bool valid = false; - dimensions = vec3FromVariant(iter.value(), valid); - if (!valid) { - dimensions = glm::vec3(vec2FromVariant(iter.value()), 0.0f); - } - } else if (!add) { - EntityPropertyFlags desiredProperties; - desiredProperties += PROP_DIMENSIONS; - dimensions = DependencyManager::get()->getEntityProperties(id, desiredProperties).getDimensions(); - } - } - - bool rotateX = dimensions.y < 0.0f; - bool rotateY = dimensions.x < 0.0f; - - { - glm::quat rotation = originalRotation; - if (rotateX) { - rotation = glm::angleAxis((float)M_PI, rotation * Vectors::RIGHT) * rotation; - } - if (rotateY) { - rotation = glm::angleAxis((float)M_PI, rotation * Vectors::UP) * rotation; - } - - if (local) { - overlayProps["localRotation"] = quatToVariant(rotation); - } else { - overlayProps["rotation"] = quatToVariant(rotation); - } - overlayProps["dimensions"] = vec3toVariant(glm::abs(dimensions)); - } - } - - ScriptEnginePointer scriptEngine = newScriptEngine(); - ScriptValue props = variantMapToScriptValue(overlayProps, *scriptEngine); - //qDebug() << "Overlay props: " << scriptEngine->scriptValueDebugDetails(props); - EntityItemProperties toReturn; - EntityItemPropertiesFromScriptValueHonorReadOnly(props, toReturn); - return toReturn; -}*/ - -// V8TODO: This can be safely removed once scripts don't use 3D overlays -/*QVariantMap Overlays::convertEntityToOverlayProperties(const EntityItemProperties& properties) { - ScriptEnginePointer scriptEngine = newScriptEngine(); - QVariantMap overlayProps = EntityItemPropertiesToScriptValue(scriptEngine.get(), properties).toVariant().toMap(); - - QString type = overlayProps["type"].toString(); - overlayProps["type"] = entityToOverlayType(type); - - if (type != "PolyLine") { - RENAME_PROP(position, p1); - RENAME_PROP(position, start); - } - RENAME_PROP(position, point); - if (type != "Model") { - RENAME_PROP(dimensions, scale); - } else { - RENAME_PROP(modelScale, scale); - } - RENAME_PROP(dimensions, size); - RENAME_PROP(ignorePickIntersection, ignoreRayIntersection); - - { - RENAME_PROP_CONVERT(primitiveMode, isSolid, [](const QVariant& v) { return v.toString() == "solid" ? true : false; }); - RENAME_PROP(isSolid, solid); - RENAME_PROP(isSolid, isFilled); - RENAME_PROP(isSolid, filled); - - RENAME_PROP_CONVERT(primitiveMode, isWire, [](const QVariant& v) { return v.toString() == "lines" ? true : false; }); - RENAME_PROP(isWire, wire); - } - - RENAME_PROP_CONVERT(renderLayer, drawInFront, [](const QVariant& v) { return v.toString() == "front" ? true : false; }); - RENAME_PROP_CONVERT(renderLayer, drawHUDLayer, [](const QVariant& v) { return v.toString() == "hud" ? true : false; }); - - GROUP_ENTITY_TO_OVERLAY_PROP(grab, grabbable, grabbable); - - GROUP_ENTITY_TO_OVERLAY_PROP(pulse, min, pulseMin); - GROUP_ENTITY_TO_OVERLAY_PROP(pulse, max, pulseMax); - GROUP_ENTITY_TO_OVERLAY_PROP(pulse, period, pulsePeriod); - GROUP_ENTITY_TO_OVERLAY_PROP_CONVERT(pulse, colorMode, colorPulse, [](const QVariant& v) { - QString f = v.toString(); - if (f == "in") { - return 1.0f; - } else if (f == "out") { - return -1.0f; - } - return 0.0f; - }); - GROUP_ENTITY_TO_OVERLAY_PROP_CONVERT(pulse, alphaMode, alphaPulse, [](const QVariant& v) { - QString f = v.toString(); - if (f == "in") { - return 1.0f; - } else if (f == "out") { - return -1.0f; - } - return 0.0f; - }); - - if (type == "Model") { - RENAME_PROP(modelURL, url); - RENAME_PROP(animation, animationSettings); - } else if (type == "Image") { - RENAME_PROP(imageURL, url); - } else if (type == "Text") { - RENAME_PROP(textColor, color); - } else if (type == "Web") { - RENAME_PROP(sourceUrl, url); - RENAME_PROP_CONVERT(inputMode, inputMode, [](const QVariant& v) { return v.toString() == "mouse" ? "Mouse" : "Touch"; }); - } else if (type == "Gizmo") { - RENAME_PROP_CONVERT(dimensions, outerRadius, [](const QVariant& v) { return 2.0f * vec3FromVariant(v).x; }); - RENAME_PROP(outerRadius, radius); - - RENAME_PROP_CONVERT(rotation, rotation, [](const QVariant& v) { - glm::quat rot = quatFromVariant(v); - return quatToVariant(glm::angleAxis((float)M_PI_2, rot * Vectors::RIGHT) * rot); - }); - RENAME_PROP_CONVERT(localRotation, localRotation, [](const QVariant& v) { - glm::quat rot = quatFromVariant(v); - return quatToVariant(glm::angleAxis((float)M_PI_2, rot * Vectors::RIGHT) * rot); - }); - - GROUP_ENTITY_TO_OVERLAY_PROP(ring, startAngle, startAt); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, endAngle, endAt); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, innerRadius, innerRadius); - - GROUP_ENTITY_TO_OVERLAY_PROP(ring, innerStartColor, innerStartColor); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, innerEndColor, innerEndColor); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, outerStartColor, outerStartColor); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, outerEndColor, outerEndColor); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, innerStartAlpha, innerStartAlpha); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, innerEndAlpha, innerEndAlpha); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, outerStartAlpha, outerStartAlpha); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, outerEndAlpha, outerEndAlpha); - - GROUP_ENTITY_TO_OVERLAY_PROP(ring, hasTickMarks, hasTickMarks); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, majorTickMarksAngle, majorTickMarksAngle); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, minorTickMarksAngle, minorTickMarksAngle); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, majorTickMarksLength, majorTickMarksLength); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, minorTickMarksLength, minorTickMarksLength); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, majorTickMarksColor, majorTickMarksColor); - GROUP_ENTITY_TO_OVERLAY_PROP(ring, minorTickMarksColor, minorTickMarksColor); - } else if (type == "PolyLine") { - QVector points = qVectorVec3FromScriptValue(scriptEngine->newVariant(overlayProps["linePoints"])); - glm::vec3 position = vec3FromVariant(overlayProps["position"]); - if (points.length() > 1) { - overlayProps["p1"] = vec3toVariant(points[0] + position); - overlayProps["p2"] = vec3toVariant(points[1] + position); - - overlayProps["localStart"] = vec3toVariant(points[0]); - overlayProps["localEnd"] = vec3toVariant(points[1]); - } - - RENAME_PROP(p1, startPoint); - RENAME_PROP(p1, start); - RENAME_PROP(p2, endPoint); - RENAME_PROP(p2, end); - - QVector widths = qVectorFloatFromScriptValue(scriptEngine->newVariant(overlayProps["strokeWidths"])); - if (widths.length() > 0) { - overlayProps["lineWidth"] = widths[0]; - } - - RENAME_PROP_CONVERT(glow, glow, [](const QVariant& v) { return v.toBool() ? 1.0f : 0.0f; }); - } - - // Do at the end, in case this type was rotated above - RENAME_PROP(rotation, orientation); - RENAME_PROP(localRotation, localOrientation); - - return overlayProps; -}*/ - QUuid Overlays::addOverlay(const QString& type, const QVariant& properties) { if (_shuttingDown) { return UNKNOWN_ENTITY_ID; @@ -986,51 +406,6 @@ QUuid Overlays::getOverlayAtPoint(const glm::vec2& point) { return bestID; } -QVariant Overlays::getProperty(const QUuid& id, const QString& property) { - /*Overlay::Pointer overlay = get2DOverlay(id); - if (overlay) { - // We don't support getting properties from QML Overlays right now - return QVariant(); - } - - QVariantMap overlayProperties = convertEntityToOverlayProperties(DependencyManager::get()->getEntityProperties(id)); - auto propIter = overlayProperties.find(property); - if (propIter != overlayProperties.end()) { - return propIter.value(); - }*/ - qDebug() << "Overlays::getProperty is not supported anymore"; - return QVariant(); -} - -QVariantMap Overlays::getProperties(const QUuid& id, const QStringList& properties) { - /*Overlay::Pointer overlay = get2DOverlay(id); - QVariantMap result; - if (overlay) { - // We don't support getting properties from QML Overlays right now - return QVariantMap(); - } - - QVariantMap overlayProperties = convertEntityToOverlayProperties(DependencyManager::get()->getEntityProperties(id)); - for (const auto& property : properties) { - auto propIter = overlayProperties.find(property); - if (propIter != overlayProperties.end()) { - result.insert(property, propIter.value()); - } - }*/ - qDebug() << "Overlays::getProperties is not supported anymore"; - QVariantMap result; - return result; -} - -QVariantMap Overlays::getOverlaysProperties(const QVariant& propertiesById) { - QVariantMap map = propertiesById.toMap(); - QVariantMap result; - for (const auto& key : map.keys()) { - result[key] = getProperties(QUuid(key), map[key].toStringList()); - } - return result; -} - RayToOverlayIntersectionResult Overlays::findRayIntersection(const PickRay& ray, bool precisionPicking, const ScriptValue& overlayIDsToInclude, const ScriptValue& overlayIDsToDiscard, @@ -1339,53 +714,10 @@ QVector Overlays::findOverlays(const glm::vec3& center, float radius) { * {@link Overlays.OverlayProperties-Text|OverlayProperties-Text} * "cube"3D *

A cube. A "shape" overlay can also be used to create a cube.

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Cube|OverlayProperties-Cube} - * "sphere"3D - *

A sphere. A "shape" overlay can also be used to create a sphere.

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Sphere|OverlayProperties-Sphere} - * "shape"3D - *

A geometric shape, such as a cube, sphere, or cylinder.

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Shape|OverlayProperties-Shape} - * "model"3D - *

A model.

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Model|OverlayProperties-Model} - * "image3d"3D - *

An image. Synonym: "billboard".

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Image3D|OverlayProperties-Image3D} - * "rectangle3d"3D - *

A rectangle.

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Rectangle3D|OverlayProperties-Rectangle3D} - * "text3d"3D - *

Some text.

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Text3D|OverlayProperties-Text3D} - * "web3d"3D - *

Web content.

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Web3D|OverlayProperties-Web3D} - * "line3d"3D - *

A line.

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Line3D|OverlayProperties-Line3D} - * "grid"3D - *

A grid of lines in a plane.

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Grid|OverlayProperties-Grid} - * "circle3d"3D - *

A circle.

- *

Deprecated.

- * {@link Overlays.OverlayProperties-Circle3D|OverlayProperties-Circle3D} * * *

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.

- *

3D overlays are deprecated. Use local {@link Entities} instead.

* @typedef {string} Overlays.OverlayType */ @@ -1401,17 +733,6 @@ QVector Overlays::findOverlays(const glm::vec3& center, float radius) { * @see {@link Overlays.OverlayProperties-Rectangle|OverlayProperties-Rectangle} * @see {@link Overlays.OverlayProperties-Image|OverlayProperties-Image} * @see {@link Overlays.OverlayProperties-Text|OverlayProperties-Text} - * @see {@link Overlays.OverlayProperties-Cube|OverlayProperties-Cube} — Deprecated. - * @see {@link Overlays.OverlayProperties-Sphere|OverlayProperties-Sphere} — Deprecated. - * @see {@link Overlays.OverlayProperties-Shape|OverlayProperties-Shape} — Deprecated. - * @see {@link Overlays.OverlayProperties-Model|OverlayProperties-Model} — Deprecated. - * @see {@link Overlays.OverlayProperties-Rectangle3D|OverlayProperties-Rectangle3D} — Deprecated. - * @see {@link Overlays.OverlayProperties-Image3D|OverlayProperties-Image3D} — Deprecated. - * @see {@link Overlays.OverlayProperties-Text3D|OverlayProperties-Text3D} — Deprecated. - * @see {@link Overlays.OverlayProperties-Web3D|OverlayProperties-Web3D} — Deprecated. - * @see {@link Overlays.OverlayProperties-Line3D|OverlayProperties-Line3D} — Deprecated. - * @see {@link Overlays.OverlayProperties-Grid|OverlayProperties-Grid} — Deprecated. - * @see {@link Overlays.OverlayProperties-Circle3D|OverlayProperties-Circle3D} — Deprecated. */ /*@jsdoc @@ -1478,613 +799,3 @@ QVector Overlays::findOverlays(const glm::vec3& center, float radius) { * @property {number} borderAlpha=1.0 - The opacity of the border, 0.01.0. * Write-only. */ - -/*@jsdoc - * The "cube" {@link Overlays.OverlayType|OverlayType} is for 3D cubes. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-Box|Box} entity. - *

Deprecated: Use local {@link Entities} instead.

- * @typedef {object} Overlays.OverlayProperties-Cube - * @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.01.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 - true if the overlay is rendered as a solid, false if it is - * rendered as a wire frame. - * Synonyms: solid, isFilled, and filled. - * Antonyms: isWire and wire. - * @property {boolean} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - */ - -/*@jsdoc - * The "sphere" {@link Overlays.OverlayType|OverlayType} is for 3D spheres. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-Sphere|Sphere} entity. - *

Deprecated: Use local {@link Entities} instead.

- * @typedef {object} Overlays.OverlayProperties-Sphere - * @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.01.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 - true if the overlay is rendered as a solid, false if it is - * rendered as a wire frame. - * Synonyms: solid, isFilled, and filled. - * Antonyms: isWire and wire. - * @property {boolean} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - */ - -/*@jsdoc - * The "rectangle3D" {@link Overlays.OverlayType|OverlayType} is for 3D rectangles. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-Shape|Shape} entity, with the shape - * property value being "Quad". - *

Deprecated: Use local {@link Entities} instead.

- * @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.01.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 - true if the overlay is rendered as a solid, false if it is - * rendered as a wire frame. - * Synonyms: solid, isFilled, and filled. - * Antonyms: isWire and wire. - * @property {boolean} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - */ - -/*@jsdoc - *

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

- * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - * - *
ValueDimensionsDescription
"Circle"2DA circle oriented in 3D.
"Cone"3D
"Cube"3D
"Cylinder"3D
"Dodecahedron"3D
"Hexagon"3DA hexagonal prism.
"Icosahedron"3D
"Octagon"3DAn octagonal prism.
"Octahedron"3D
"Quad"2DA square oriented in 3D.
"Sphere"3D
"Tetrahedron"3D
"Torus"3DNot implemented.
"Triangle"3DA triangular prism.
- * @typedef {string} Overlays.Shape - */ - -/*@jsdoc - * The "shape" {@link Overlays.OverlayType|OverlayType} is for 3D shapes. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-Shape|Shape} entity. - *

Deprecated: Use local {@link Entities} instead.

- * @typedef {object} Overlays.OverlayProperties-Shape - * @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.01.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 - true if the overlay is rendered as a solid, false if it is - * rendered as a wire frame. - * Synonyms: solid, isFilled, and filled. - * Antonyms: isWire and wire. - * @property {boolean} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - * - * @property {Overlays.Shape} shape=Hexagon - The geometrical shape of the overlay. - */ - -/*@jsdoc - * The "model" {@link Overlays.OverlayType|OverlayType} is for 3D models. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-Model|Model} entity. - *

Deprecated: Use local {@link Entities} instead.

- * @typedef {object} Overlays.OverlayProperties-Model - * @property {string} name - The name of the overlay. - * - * @property {Vec3} position - The position of the overlay center. Synonyms: p1, point, and - * start. - * @property {Vec3} dimensions - The dimensions of the overlay. Synonyms: size. - * @property {Vec3} scale - The scale factor applied to the model's dimensions. - * @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} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - * - * @property {string} url - The URL of the glTF, FBX, or OBJ model used for the overlay. glTF models may be in JSON or binary - * format (".gltf" or ".glb" URLs respectively). Baked models' URLs have ".baked" before the file type. Model files may - * also be compressed in GZ format, in which case the URL ends in ".gz". - * @property {number} loadPriority=0.0 - The priority for loading and displaying the overlay. Overlays with higher values load - * first. Currently not used. - * @property {Object.|string} textures - Texture name, URL pairs used when rendering the model in place of the - * model's original textures, per the {@link Entities.EntityProperties-Model} property of the same name. - *

The value can be an object or a JSON string when setting the value; it is a JSON string when getting the value.

- * @property {Entities.AnimationProperties} animationSettings - An animation to play on the model. - */ - -/*@jsdoc - * The "text3D" {@link Overlays.OverlayType|OverlayType} is for 3D text. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-Text|Text} entity. - *

Deprecated: Use local {@link Entities} instead.

- * @typedef {object} Overlays.OverlayProperties-Text3D - * @property {string} name - The name of the overlay. - * @property {Color} color=255,255,255 - The color of the overlay text. Synonym: textColor. - * @property {number} alpha=0.7 - The opacity of the overlay text, 0.01.0. - *

Currently not used; use textAlpha instead.

- * @comment CURRENTLY BROKEN - * @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} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - */ - -/*@jsdoc - * The "image3D" {@link Overlays.OverlayType|OverlayType} is for 3D images. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-Image|Image} entity. - *

Deprecated: Use local {@link Entities} instead.

- * @typedef {object} Overlays.OverlayProperties-Image3D - * @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.01.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} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - * - * @property {string} url - The URL of the image to display. - */ - -/*@jsdoc - * The "web3d" {@link Overlays.OverlayType|OverlayType} is for 3D web surfaces. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-Web|Web} entity. - *

Deprecated: Use local {@link Entities} instead.

- * @typedef {object} Overlays.OverlayProperties-Web3D - * @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.01.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} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - * - * @property {string} url - The URL of the web page to display. - */ - -/*@jsdoc - * The "line3d" {@link Overlays.OverlayType|OverlayType} is for 3D lines. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-PolyLine|PolyLine} entity. - *

Deprecated: Use local {@link Entities} instead.

- * @typedef {object} Overlays.OverlayProperties-Line3D - * @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.01.0. - * - * @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} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - *

Currently doesn't work.

- * @comment CURRENTLY BROKEN - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - * - * @property {Uuid} endParentID=null - The avatar, entity, or overlay that the end point of the line is parented to. - *

Currently doesn't work.

- * @comment CURRENTLY BROKEN - * @property {number} endParentJointIndex=65535 - Integer value specifying the skeleton joint that the end point of the line is - * attached to if parentID is an avatar skeleton. A value of 65535 means "no joint". - *

Currently doesn't work.

- * @comment CURRENTLY BROKEN - - * @property {Vec3} start - The start point of the line. Synonyms: startPoint and p1. - *

Note: If parentID is set, use localStart to set the local position of the - * start point.

- * @property {Vec3} end - The end point of the line. Synonyms: endPoint and p2. - *

Note: If parentID is set, use localEnd to set the local position of the - * end point.

- - * @property {Vec3} localStart - The local position of the overlay relative to its parent if the overlay has a - * parentID set, otherwise the same value as start. - *

Currently doesn't work.

- * @comment CURRENTLY BROKEN - * @property {Vec3} localEnd - The local position of the overlay relative to its parent if the overlay has a - * endParentID set, otherwise the same value as end. - *

Currently doesn't work.

- * @comment CURRENTLY BROKEN - - * @property {number} length - The length of the line, in meters. This can be set after creating a line with start and end - * points. - *

Currently doesn't work.

- * @comment CURRENTLY BROKEN - - * @property {number} glow=0 - If glow > 0, the line is rendered with a glow. - * @property {number} lineWidth=0.02 - Width of the line, in meters. - *

You can set this property's value but currently cannot retrieve its value. Use the strokeWidths - * property to retrieve its value instead.

- */ - -/*@jsdoc - * The "grid" {@link Overlays.OverlayType|OverlayType} is for 3D grids. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-Grid|Grid} entity. - *

Deprecated: Use local {@link Entities} instead.

- * @typedef {object} Overlays.OverlayProperties-Grid - * @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.01.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} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - */ - -/*@jsdoc - * The "circle3d" {@link Overlays.OverlayType|OverlayType} is for 3D circles. - * It has properties in addition to the common {@link Overlays.OverlayProperties|OverlayProperties}. - * It additionally has properties per the {@link Entities.EntityProperties-Gizmo|Gizmo} entity, with the - * gizmoType property value being "ring". - *

Deprecated: Use local {@link Entities} instead.

- * @typedef {object} Overlays.OverlayProperties-Circle3D - * @property {string} name - The name of the overlay. - * @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. - * Read-only. - * @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 - true if the overlay is rendered as a solid, false if it is - * rendered as a wire frame. - * Synonyms: solid, isFilled, and filled. - * Antonyms: isWire and wire. - * @property {boolean} ignorePickIntersection=false - true if {@link Picks} ignore the overlay, false - * if they don't. - * Synonym: ignoreRayIntersection. - * @property {boolean} drawInFront=false - true if the overlay is rendered on top of the world layer but behind - * the HUD surface. - * @property {boolean} drawHUDLayer=false - true if the overlay is rendered in front of everything, including the - * HUD surface. - * @property {boolean} grabbable=false - true if the overlay can be grabbed, false if it can't be. - * @property {Uuid} parentID=null - The avatar, entity, or overlay that the overlay is parented to. - * @property {number} parentJointIndex=65535 - Integer value specifying the joint of the entity or avatar that the entity is - * parented to if parentID is set. Use 65535 or -1 to parent to the parent's position and orientation rather - * than a joint. - * - * @property {number} startAt=0 - The counter-clockwise angle from the overlay's x-axis that drawing starts at, in degrees. - * @property {number} endAt=360 - The counter-clockwise angle from the overlay's x-axis that drawing ends at, in degrees. - * @property {number} outerRadius=1 - The outer radius of the overlay in meters. Synonym: radius. - * @property {number} innerRadius=0 - The inner radius of the overlay in meters. - * @property {Color} color - Sets the color of the overlay. Setting this value sets the values of innerStartColor, - * innerEndColor, outerStartColor, and outerEndColor. - * Write-only. - * @property {Color} startColor - Sets the values of innerStartColor and outerStartColor. - * Write-only. - * @property {Color} endColor - Sets the values of innerEndColor and outerEndColor. - * Write-only. - * @property {Color} innerColor - Sets the values of innerStartColor and innerEndColor. - * Write-only. - * @property {Color} outerColor - Sets the values of outerStartColor and outerEndColor. - * Write-only. - * @property {Color} innerStartcolor=255,255,255 - The color at the inner start point of the overlay. - * @property {Color} innerEndColor=255,255,255 - The color at the inner end point of the overlay. - * @property {Color} outerStartColor=255,255,255 - The color at the outer start point of the overlay. - * @property {Color} outerEndColor=255,255,255 - The color at the outer end point of the overlay. - * @property {number} alpha - Sets the opacity of the overlay, 0.01.0. Setting this value - * sets the values of innerStartAlpha, innerEndAlpha, outerStartAlpha, and - * outerEndAlpha. Synonym: Alpha. - * @property {number} startAlpha - Sets the values of innerStartAlpha and outerStartAlpha. - * Write-only. - * @property {number} endAlpha - Sets the values of innerEndAlpha and outerEndAlpha. - * Write-only. - * @property {number} innerAlpha - Sets the values of innerStartAlpha and innerEndAlpha. - * Write-only. - * @property {number} outerAlpha - Sets the values of outerStartAlpha and outerEndAlpha. - * Write-only. - * @property {number} innerStartAlpha=0.7 - The opacity at the inner start point of the overlay, 0.0 – - * 1.0. - * @property {number} innerEndAlpha=0.7 - The opacity at the inner end point of the overlay, 0.0 – - * 1.0. - * @property {number} outerStartAlpha=0.7 - The opacity at the outer start point of the overlay, 0.0 – - * 1.0. - * @property {number} outerEndAlpha=0.7 - The opacity at the outer end point of the overlay, 0.0 – - * 1.0. - * - * @property {boolean} hasTickMarks=false - true if tick marks are drawn, false if they aren't. - * @property {number} majorTickMarksAngle=0 - The angle between major tick marks, in degrees. - * @property {number} minorTickMarksAngle=0 - The angle between minor tick marks, in degrees. - * @property {number} majorTickMarksLength=0 - The length of the major tick marks, in meters. A positive value draws tick marks - * outwards from the inner radius; a negative value draws tick marks inwards from the outer radius. - * @property {number} minorTickMarksLength=0 - The length of the minor tick marks, in meters. A positive value draws tick marks - * outwards from the inner radius; a negative value draws tick marks inwards from the outer radius. - * @property {Color} majorTickMarksColor=0,0,0 - The color of the major tick marks. - * @property {Color} minorTickMarksColor=0,0,0 - The color of the minor tick marks. - */ diff --git a/interface/src/ui/overlays/Overlays.h b/interface/src/ui/overlays/Overlays.h index f96424553e..5f3d631a36 100644 --- a/interface/src/ui/overlays/Overlays.h +++ b/interface/src/ui/overlays/Overlays.h @@ -77,8 +77,6 @@ public: *

Note: 3D overlays are local {@link Entities}, internally, so many of the methods also work with * entities.

* - *

3D overlays are deprecated: Use local {@link Entities} for these instead.

- * * @namespace Overlays * * @hifi-interface @@ -311,75 +309,7 @@ public slots: * }); */ QUuid getOverlayAtPoint(const glm::vec2& point); - - /*@jsdoc - * Gets a specified property value of a 3D overlay (or entity). - *

Note: 2D overlays' property values cannot be retrieved.

- * @function Overlays.getProperty - * @param {Uuid} id - The ID of the 3D overlay (or entity). - * @param {string} property - The name of the property to get the value of. - * @returns {object} The value of the property if the 3D overlay and property can be found, otherwise - * undefined. - * @example Create an overlay in front of your avatar then report its alpha property value. - * var overlay = Overlays.addOverlay("cube", { - * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })), - * rotation: MyAvatar.orientation, - * dimensions: { x: 0.3, y: 0.3, z: 0.3 }, - * solid: true - * }); - * var alpha = Overlays.getProperty(overlay, "alpha"); - * print("Overlay alpha: " + alpha); - */ - QVariant getProperty(const QUuid& id, const QString& property); - - /*@jsdoc - * Gets specified property values of a 3D overlay (or entity). - *

Note: 2D overlays' property values cannot be retrieved.

- * @function Overlays.getProperties - * @param {Uuid} id - The ID of the overlay (or entity). - * @param {Array.} properties - The names of the properties to get the values of. - * @returns {Overlays.OverlayProperties} The values of valid properties if the overlay can be found, otherwise an empty - * object. - * @example Create an overlay in front of your avatar then report some of its properties. - * var overlay = Overlays.addOverlay("cube", { - * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0, y: 0, z: -3 })), - * rotation: MyAvatar.orientation, - * dimensions: { x: 0.3, y: 0.3, z: 0.3 }, - * solid: true - * }); - * var properties = Overlays.getProperties(overlay, ["color", "alpha", "grabbable"]); - * print("Overlay properties: " + JSON.stringify(properties)); - */ - QVariantMap getProperties(const QUuid& id, const QStringList& properties); - - /*@jsdoc - * Gets the values of multiple overlays' (or entities') properties. - * @function Overlays.getOverlaysProperties - * @param propertiesById {object.>} - An object with overlay (or entity) IDs as keys and arrays of the - * names of properties to get for each as values. - * @returns {object.} An object with overlay (or entity) IDs as keys and - * {@link Overlays.OverlayProperties|OverlayProperties} as values. - * @example Create two cube overlays in front of your avatar then get some of their properties. - * var overlayA = Overlays.addOverlay("cube", { - * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: -0.3, y: 0, z: -3 })), - * rotation: MyAvatar.orientation, - * dimensions: { x: 0.3, y: 0.3, z: 0.3 }, - * solid: true - * }); - * var overlayB = Overlays.addOverlay("cube", { - * position: Vec3.sum(MyAvatar.position, Vec3.multiplyQbyV(MyAvatar.orientation, { x: 0.3, y: 0, z: -3 })), - * rotation: MyAvatar.orientation, - * dimensions: { x: 0.3, y: 0.3, z: 0.3 }, - * solid: true - * }); - * var propertiesToGet = {}; - * propertiesToGet[overlayA] = ["color", "alpha"]; - * propertiesToGet[overlayB] = ["dimensions"]; - * var properties = Overlays.getOverlaysProperties(propertiesToGet); - * print("Overlays properties: " + JSON.stringify(properties)); - */ - QVariantMap getOverlaysProperties(const QVariant& overlaysProperties); - + /*@jsdoc * Finds the closest 3D overlay (or local entity) intersected by a {@link PickRay}. * @function Overlays.findRayIntersection diff --git a/libraries/entities/src/EntityEditFilters.cpp b/libraries/entities/src/EntityEditFilters.cpp index 3f31a6739a..1c5744fddc 100644 --- a/libraries/entities/src/EntityEditFilters.cpp +++ b/libraries/entities/src/EntityEditFilters.cpp @@ -232,19 +232,8 @@ static bool hasCorrectSyntax(const ScriptProgramPointer& program) { } static bool hadUncaughtExceptions(ScriptEngine& engine, const QString& fileName) { if (engine.hasUncaughtException()) { - //const auto backtrace = engine.uncaughtException().backtrace; - //const auto exception = engine.uncaughtException().toString(); - //const auto line = QString::number(engine.uncaughtExceptionLineNumber()); qCritical() << engine.uncaughtException(); engine.clearExceptions(); - - //static const QString SCRIPT_EXCEPTION_FORMAT = "[UncaughtException] %1 in %2:%3"; - //auto message = QString(SCRIPT_EXCEPTION_FORMAT).arg(exception, fileName, line); - //if (!backtrace.empty()) { - // static const auto lineSeparator = "\n "; - // message += QString("\n[Backtrace]%1%2").arg(lineSeparator, backtrace.join(lineSeparator)); - //} - //qCritical() << qPrintable(message); return true; } return false; diff --git a/libraries/script-engine/src/ScriptManager.cpp b/libraries/script-engine/src/ScriptManager.cpp index 07df59bf7b..a34a622e1c 100644 --- a/libraries/script-engine/src/ScriptManager.cpp +++ b/libraries/script-engine/src/ScriptManager.cpp @@ -2059,6 +2059,7 @@ void ScriptManager::entityScriptContentAvailable(const EntityItemID& entityID, c exception = testConstructor; } } else { + // V8TODO: re-enable entity script whitelist // ENTITY SCRIPT WHITELIST STARTS HERE auto nodeList = DependencyManager::get(); bool passList = false; // assume unsafe