diff --git a/interface/src/avatar/MyAvatar.h b/interface/src/avatar/MyAvatar.h index 20dc2ae42b..3ebde748b1 100644 --- a/interface/src/avatar/MyAvatar.h +++ b/interface/src/avatar/MyAvatar.h @@ -136,7 +136,7 @@ class MyAvatar : public Avatar { * your avatar when rolling your HMD in degrees per second. * @property {number} userHeight=1.75 - The height of the user in sensor space. * @property {number} userEyeHeight=1.65 - The estimated height of the user's eyes in sensor space. Read-only. - * @property {Uuid} SELF_ID - UUID representing "my avatar". Only use for local-only entities and overlays in situations + * @property {Uuid} SELF_ID - UUID representing "my avatar". Only use for local-only entities in situations * where MyAvatar.sessionUUID is not available (e.g., if not connected to a domain). Note: Likely to be deprecated. * Read-only. * @property {number} walkSpeed diff --git a/interface/src/avatar/OtherAvatar.cpp b/interface/src/avatar/OtherAvatar.cpp index 1f4fdc5e52..409fa51388 100644 --- a/interface/src/avatar/OtherAvatar.cpp +++ b/interface/src/avatar/OtherAvatar.cpp @@ -54,44 +54,47 @@ OtherAvatar::~OtherAvatar() { void OtherAvatar::removeOrb() { if (!_otherAvatarOrbMeshPlaceholderID.isNull()) { - qApp->getOverlays().deleteOverlay(_otherAvatarOrbMeshPlaceholderID); - _otherAvatarOrbMeshPlaceholderID = UNKNOWN_OVERLAY_ID; + DependencyManager::get()->deleteEntity(_otherAvatarOrbMeshPlaceholderID); + _otherAvatarOrbMeshPlaceholderID = UNKNOWN_ENTITY_ID; } } void OtherAvatar::updateOrbPosition() { - if (_otherAvatarOrbMeshPlaceholder != nullptr) { - _otherAvatarOrbMeshPlaceholder->setWorldPosition(getHead()->getPosition()); - if (_otherAvatarOrbMeshPlaceholderID.isNull()) { - _otherAvatarOrbMeshPlaceholderID = qApp->getOverlays().addOverlay(_otherAvatarOrbMeshPlaceholder); - } + if (_otherAvatarOrbMeshPlaceholderID.isNull()) { + EntityItemProperties properties; + properties.setPosition(getHead()->getPosition()); + DependencyManager::get()->editEntity(_otherAvatarOrbMeshPlaceholderID, properties); } } void OtherAvatar::createOrb() { if (_otherAvatarOrbMeshPlaceholderID.isNull()) { - _otherAvatarOrbMeshPlaceholder = std::make_shared(); - _otherAvatarOrbMeshPlaceholder->setAlpha(1.0f); - _otherAvatarOrbMeshPlaceholder->setColor(getLoadingOrbColor(_loadingStatus)); - _otherAvatarOrbMeshPlaceholder->setIsSolid(false); - _otherAvatarOrbMeshPlaceholder->setPulseMin(0.5); - _otherAvatarOrbMeshPlaceholder->setPulseMax(1.0); - _otherAvatarOrbMeshPlaceholder->setColorPulse(1.0); - _otherAvatarOrbMeshPlaceholder->setIgnorePickIntersection(true); - _otherAvatarOrbMeshPlaceholder->setDrawInFront(false); - _otherAvatarOrbMeshPlaceholderID = qApp->getOverlays().addOverlay(_otherAvatarOrbMeshPlaceholder); - // Position focus - _otherAvatarOrbMeshPlaceholder->setWorldOrientation(glm::quat(0.0f, 0.0f, 0.0f, 1.0)); - _otherAvatarOrbMeshPlaceholder->setWorldPosition(getHead()->getPosition()); - _otherAvatarOrbMeshPlaceholder->setDimensions(glm::vec3(0.5f, 0.5f, 0.5f)); - _otherAvatarOrbMeshPlaceholder->setVisible(true); + EntityItemProperties properties; + properties.setType(EntityTypes::Sphere); + properties.setAlpha(1.0f); + properties.setColor(getLoadingOrbColor(_loadingStatus)); + properties.setPrimitiveMode(PrimitiveMode::LINES); + properties.getPulse().setMin(0.5f); + properties.getPulse().setMax(1.0f); + properties.getPulse().setColorMode(PulseMode::IN_PHASE); + properties.setIgnorePickIntersection(true); + + properties.setPosition(getHead()->getPosition()); + properties.setRotation(glm::quat(0.0f, 0.0f, 0.0f, 1.0)); + properties.setDimensions(glm::vec3(0.5f, 0.5f, 0.5f)); + properties.setVisible(true); + + _otherAvatarOrbMeshPlaceholderID = DependencyManager::get()->addEntity(properties, "local"); } } void OtherAvatar::indicateLoadingStatus(LoadingStatus loadingStatus) { Avatar::indicateLoadingStatus(loadingStatus); - if (_otherAvatarOrbMeshPlaceholder) { - _otherAvatarOrbMeshPlaceholder->setColor(getLoadingOrbColor(_loadingStatus)); + + if (_otherAvatarOrbMeshPlaceholderID != UNKNOWN_ENTITY_ID) { + EntityItemProperties properties; + properties.setColor(getLoadingOrbColor(_loadingStatus)); + DependencyManager::get()->editEntity(_otherAvatarOrbMeshPlaceholderID, properties); } } diff --git a/interface/src/avatar/OtherAvatar.h b/interface/src/avatar/OtherAvatar.h index a1dc5724a9..8e31609e3e 100644 --- a/interface/src/avatar/OtherAvatar.h +++ b/interface/src/avatar/OtherAvatar.h @@ -17,7 +17,6 @@ #include "InterfaceLogging.h" #include "ui/overlays/Overlays.h" -#include "ui/overlays/Sphere3DOverlay.h" class AvatarManager; class AvatarMotionState; @@ -59,8 +58,7 @@ protected: void onRemoveAttachedAvatarEntity(const QUuid& id); std::vector _attachedAvatarEntities; - std::shared_ptr _otherAvatarOrbMeshPlaceholder { nullptr }; - OverlayID _otherAvatarOrbMeshPlaceholderID { UNKNOWN_OVERLAY_ID }; + QUuid _otherAvatarOrbMeshPlaceholderID { UNKNOWN_ENTITY_ID }; AvatarMotionState* _motionState { nullptr }; int32_t _spaceIndex { -1 }; uint8_t _workloadRegion { workload::Region::INVALID }; diff --git a/interface/src/devices/DdeFaceTracker.cpp b/interface/src/devices/DdeFaceTracker.cpp index ed52083d77..fed5b702cb 100644 --- a/interface/src/devices/DdeFaceTracker.cpp +++ b/interface/src/devices/DdeFaceTracker.cpp @@ -194,7 +194,6 @@ DdeFaceTracker::DdeFaceTracker(const QHostAddress& host, quint16 serverPort, qui _calibrationCount(0), _calibrationValues(), _calibrationBillboard(NULL), - _calibrationBillboardID(UNKNOWN_OVERLAY_ID), _calibrationMessage(QString()), _isCalibrated(false) { diff --git a/interface/src/devices/DdeFaceTracker.h b/interface/src/devices/DdeFaceTracker.h index 4fe36b582e..c74f0f9cd0 100644 --- a/interface/src/devices/DdeFaceTracker.h +++ b/interface/src/devices/DdeFaceTracker.h @@ -168,7 +168,7 @@ private: int _calibrationCount; QVector _calibrationValues; TextOverlay* _calibrationBillboard; - OverlayID _calibrationBillboardID; + QUuid _calibrationBillboardID; QString _calibrationMessage; bool _isCalibrated; void addCalibrationDatum(); diff --git a/interface/src/raypick/CollisionPick.cpp b/interface/src/raypick/CollisionPick.cpp index d30f98051e..82d75257df 100644 --- a/interface/src/raypick/CollisionPick.cpp +++ b/interface/src/raypick/CollisionPick.cpp @@ -409,10 +409,6 @@ PickResultPointer CollisionPick::getEntityIntersection(const CollisionRegion& pi return std::make_shared(pick, entityIntersections, std::vector()); } -PickResultPointer CollisionPick::getOverlayIntersection(const CollisionRegion& pick) { - return std::make_shared(pick, std::vector(), std::vector()); -} - PickResultPointer CollisionPick::getAvatarIntersection(const CollisionRegion& pick) { if (!pick.loaded) { // Cannot compute result diff --git a/interface/src/raypick/CollisionPick.h b/interface/src/raypick/CollisionPick.h index 92aa415f9e..c742c089b4 100644 --- a/interface/src/raypick/CollisionPick.h +++ b/interface/src/raypick/CollisionPick.h @@ -54,7 +54,6 @@ public: return std::make_shared(pickVariant, std::vector(), std::vector()); } PickResultPointer getEntityIntersection(const CollisionRegion& pick) override; - PickResultPointer getOverlayIntersection(const CollisionRegion& pick) override; PickResultPointer getAvatarIntersection(const CollisionRegion& pick) override; PickResultPointer getHUDIntersection(const CollisionRegion& pick) override; Transform getResultTransform() const override; diff --git a/interface/src/raypick/LaserPointer.cpp b/interface/src/raypick/LaserPointer.cpp index 236512f2fe..3319f01b57 100644 --- a/interface/src/raypick/LaserPointer.cpp +++ b/interface/src/raypick/LaserPointer.cpp @@ -17,6 +17,8 @@ #include "PickManager.h" #include "RayPick.h" +#include "PolyLineEntityItem.h" + LaserPointer::LaserPointer(const QVariant& rayProps, const RenderStateMap& renderStates, const DefaultRenderStateMap& defaultRenderStates, bool hover, const PointerTriggers& triggers, bool faceAvatar, bool followNormal, float followNormalTime, bool centerEndY, bool lockEnd, bool distanceScaleEnd, bool scaleWithParent, bool enabled) : @@ -28,7 +30,7 @@ LaserPointer::LaserPointer(const QVariant& rayProps, const RenderStateMap& rende void LaserPointer::editRenderStatePath(const std::string& state, const QVariant& pathProps) { auto renderState = std::static_pointer_cast(_renderStates[state]); if (renderState) { - updateRenderStateOverlay(renderState->getPathID(), pathProps); + updateRenderState(renderState->getPathID(), pathProps); QVariant lineWidth = pathProps.toMap()["lineWidth"]; if (lineWidth.isValid()) { renderState->setLineWidth(lineWidth.toFloat()); @@ -121,48 +123,61 @@ void LaserPointer::setVisualPickResultInternal(PickResultPointer pickResult, Int } } -LaserPointer::RenderState::RenderState(const OverlayID& startID, const OverlayID& pathID, const OverlayID& endID) : +LaserPointer::RenderState::RenderState(const QUuid& startID, const QUuid& pathID, const QUuid& endID) : StartEndRenderState(startID, endID), _pathID(pathID) { - if (!_pathID.isNull()) { - _pathIgnoreRays = qApp->getOverlays().getProperty(_pathID, "ignorePickIntersection").value.toBool(); - _lineWidth = qApp->getOverlays().getProperty(_pathID, "lineWidth").value.toFloat(); + if (!getPathID().isNull()) { + auto entityScriptingInterface = DependencyManager::get(); + { + EntityPropertyFlags desiredProperties; + desiredProperties += PROP_IGNORE_PICK_INTERSECTION; + _pathIgnorePicks = entityScriptingInterface->getEntityProperties(getPathID(), desiredProperties).getIgnorePickIntersection(); + } + { + EntityPropertyFlags desiredProperties; + desiredProperties += PROP_STROKE_WIDTHS; + auto widths = entityScriptingInterface->getEntityProperties(getPathID(), desiredProperties).getStrokeWidths(); + _lineWidth = widths.length() == 0 ? PolyLineEntityItem::DEFAULT_LINE_WIDTH : widths[0]; + } } } void LaserPointer::RenderState::cleanup() { StartEndRenderState::cleanup(); - if (!_pathID.isNull()) { - qApp->getOverlays().deleteOverlay(_pathID); + if (!getPathID().isNull()) { + DependencyManager::get()->deleteEntity(getPathID()); } } void LaserPointer::RenderState::disable() { StartEndRenderState::disable(); if (!getPathID().isNull()) { - QVariantMap pathProps; - pathProps.insert("visible", false); - pathProps.insert("ignorePickIntersection", true); - qApp->getOverlays().editOverlay(getPathID(), pathProps); + EntityItemProperties properties; + properties.setVisible(false); + properties.setIgnorePickIntersection(true); + DependencyManager::get()->editEntity(getPathID(), properties); } } void LaserPointer::RenderState::update(const glm::vec3& origin, const glm::vec3& end, const glm::vec3& surfaceNormal, float parentScale, bool distanceScaleEnd, bool centerEndY, bool faceAvatar, bool followNormal, float followNormalStrength, float distance, const PickResultPointer& pickResult) { StartEndRenderState::update(origin, end, surfaceNormal, parentScale, distanceScaleEnd, centerEndY, faceAvatar, followNormal, followNormalStrength, distance, pickResult); - QVariant endVariant = vec3toVariant(end); if (!getPathID().isNull()) { - QVariantMap pathProps; - pathProps.insert("start", vec3toVariant(origin)); - pathProps.insert("end", endVariant); - pathProps.insert("visible", true); - pathProps.insert("ignorePickIntersection", doesPathIgnoreRays()); - pathProps.insert("lineWidth", getLineWidth() * parentScale); - qApp->getOverlays().editOverlay(getPathID(), pathProps); + EntityItemProperties properties; + QVector points; + points.append(origin); + points.append(end); + properties.setLinePoints(points); + properties.setVisible(true); + properties.setIgnorePickIntersection(doesPathIgnorePicks()); + QVector widths; + widths.append(getLineWidth() * parentScale); + DependencyManager::get()->editEntity(getPathID(), properties); } } std::shared_ptr LaserPointer::buildRenderState(const QVariantMap& propMap) { + // FIXME: we have to keep using the Overlays interface here, because existing scripts use overlay properties to define pointers QUuid startID; if (propMap["start"].isValid()) { QVariantMap startMap = propMap["start"].toMap(); @@ -233,8 +248,6 @@ glm::vec3 LaserPointer::findIntersection(const PickedObject& pickedObject, const switch (pickedObject.type) { case ENTITY: return RayPick::intersectRayWithEntityXYPlane(pickedObject.objectID, origin, direction); - case OVERLAY: - return RayPick::intersectRayWithOverlayXYPlane(pickedObject.objectID, origin, direction); default: return glm::vec3(NAN); } diff --git a/interface/src/raypick/LaserPointer.h b/interface/src/raypick/LaserPointer.h index bcd4bb607d..13d108baee 100644 --- a/interface/src/raypick/LaserPointer.h +++ b/interface/src/raypick/LaserPointer.h @@ -19,10 +19,10 @@ public: class RenderState : public StartEndRenderState { public: RenderState() {} - RenderState(const OverlayID& startID, const OverlayID& pathID, const OverlayID& endID); + RenderState(const QUuid& startID, const QUuid& pathID, const QUuid& endID); - const OverlayID& getPathID() const { return _pathID; } - const bool& doesPathIgnoreRays() const { return _pathIgnoreRays; } + const QUuid& getPathID() const { return _pathID; } + const bool& doesPathIgnorePicks() const { return _pathIgnorePicks; } void setLineWidth(float width) { _lineWidth = width; } float getLineWidth() const { return _lineWidth; } @@ -33,9 +33,9 @@ public: bool faceAvatar, bool followNormal, float followNormalStrength, float distance, const PickResultPointer& pickResult) override; private: - OverlayID _pathID; - bool _pathIgnoreRays; + QUuid _pathID; + bool _pathIgnorePicks; float _lineWidth; }; diff --git a/interface/src/raypick/LaserPointerScriptingInterface.h b/interface/src/raypick/LaserPointerScriptingInterface.h index d85e329e9a..326917f62d 100644 --- a/interface/src/raypick/LaserPointerScriptingInterface.h +++ b/interface/src/raypick/LaserPointerScriptingInterface.h @@ -111,10 +111,10 @@ public: * @function LaserPointers.setLockEndUUID * @param {number} id * @param {Uuid} itemID - * @param {boolean} isOverlay + * @param {boolean} isAvatar * @param {Mat4} [offsetMat] */ - Q_INVOKABLE void setLockEndUUID(unsigned int uid, const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) const { DependencyManager::get()->setLockEndUUID(uid, objectID, isOverlay, offsetMat); } + Q_INVOKABLE void setLockEndUUID(unsigned int uid, const QUuid& objectID, bool isAvatar, const glm::mat4& offsetMat = glm::mat4()) const { DependencyManager::get()->setLockEndUUID(uid, objectID, isAvatar, offsetMat); } /**jsdoc diff --git a/interface/src/raypick/ParabolaPick.cpp b/interface/src/raypick/ParabolaPick.cpp index b93ced17c6..5349f8a113 100644 --- a/interface/src/raypick/ParabolaPick.cpp +++ b/interface/src/raypick/ParabolaPick.cpp @@ -10,7 +10,6 @@ #include "Application.h" #include "EntityScriptingInterface.h" #include "PickScriptingInterface.h" -#include "ui/overlays/Overlays.h" #include "avatar/AvatarManager.h" #include "scripting/HMDScriptingInterface.h" #include "DependencyManager.h" @@ -74,19 +73,6 @@ PickResultPointer ParabolaPick::getEntityIntersection(const PickParabola& pick) return std::make_shared(pick.toVariantMap()); } -PickResultPointer ParabolaPick::getOverlayIntersection(const PickParabola& pick) { - if (glm::length2(pick.acceleration) > EPSILON && glm::length2(pick.velocity) > EPSILON) { - bool precisionPicking = !(getFilter().isCoarse() || DependencyManager::get()->getForceCoarsePicking()); - ParabolaToOverlayIntersectionResult overlayRes = - qApp->getOverlays().findParabolaIntersectionVector(pick, precisionPicking, - getIncludeItemsAs(), getIgnoreItemsAs(), !getFilter().doesPickInvisible(), !getFilter().doesPickNonCollidable()); - if (overlayRes.intersects) { - return std::make_shared(IntersectionType::OVERLAY, overlayRes.overlayID, overlayRes.distance, overlayRes.parabolicDistance, overlayRes.intersection, pick, overlayRes.surfaceNormal, overlayRes.extraInfo); - } - } - return std::make_shared(pick.toVariantMap()); -} - PickResultPointer ParabolaPick::getAvatarIntersection(const PickParabola& pick) { if (glm::length2(pick.acceleration) > EPSILON && glm::length2(pick.velocity) > EPSILON) { ParabolaToAvatarIntersectionResult avatarRes = DependencyManager::get()->findParabolaIntersectionVector(pick, getIncludeItemsAs(), getIgnoreItemsAs()); diff --git a/interface/src/raypick/ParabolaPick.h b/interface/src/raypick/ParabolaPick.h index 8cbbc79bf5..0adbb01954 100644 --- a/interface/src/raypick/ParabolaPick.h +++ b/interface/src/raypick/ParabolaPick.h @@ -12,7 +12,6 @@ #include class EntityItemID; -class OverlayID; class ParabolaPickResult : public PickResult { public: @@ -80,7 +79,6 @@ public: PickResultPointer getDefaultResult(const QVariantMap& pickVariant) const override { return std::make_shared(pickVariant); } PickResultPointer getEntityIntersection(const PickParabola& pick) override; - PickResultPointer getOverlayIntersection(const PickParabola& pick) override; PickResultPointer getAvatarIntersection(const PickParabola& pick) override; PickResultPointer getHUDIntersection(const PickParabola& pick) override; Transform getResultTransform() const override; diff --git a/interface/src/raypick/ParabolaPointer.cpp b/interface/src/raypick/ParabolaPointer.cpp index e45b11b479..771d5c20de 100644 --- a/interface/src/raypick/ParabolaPointer.cpp +++ b/interface/src/raypick/ParabolaPointer.cpp @@ -149,7 +149,7 @@ void ParabolaPointer::setVisualPickResultInternal(PickResultPointer pickResult, } } -ParabolaPointer::RenderState::RenderState(const OverlayID& startID, const OverlayID& endID, const glm::vec3& pathColor, float pathAlpha, float pathWidth, +ParabolaPointer::RenderState::RenderState(const QUuid& startID, const QUuid& endID, const glm::vec3& pathColor, float pathAlpha, float pathWidth, bool isVisibleInSecondaryCamera, bool drawInFront, bool pathEnabled) : StartEndRenderState(startID, endID) { @@ -230,6 +230,7 @@ void ParabolaPointer::RenderState::update(const glm::vec3& origin, const glm::ve } std::shared_ptr ParabolaPointer::buildRenderState(const QVariantMap& propMap) { + // FIXME: we have to keep using the Overlays interface here, because existing scripts use overlay properties to define pointers QUuid startID; if (propMap["start"].isValid()) { QVariantMap startMap = propMap["start"].toMap(); @@ -322,8 +323,6 @@ glm::vec3 ParabolaPointer::findIntersection(const PickedObject& pickedObject, co switch (pickedObject.type) { case ENTITY: //return ParabolaPick::intersectParabolaWithEntityXYPlane(pickedObject.objectID, origin, velocity, acceleration); - case OVERLAY: - //return ParabolaPick::intersectParabolaWithOverlayXYPlane(pickedObject.objectID, origin, velocity, acceleration); default: return glm::vec3(NAN); } diff --git a/interface/src/raypick/ParabolaPointer.h b/interface/src/raypick/ParabolaPointer.h index 3e9a22db4f..5594f101d0 100644 --- a/interface/src/raypick/ParabolaPointer.h +++ b/interface/src/raypick/ParabolaPointer.h @@ -79,7 +79,7 @@ public: }; RenderState() {} - RenderState(const OverlayID& startID, const OverlayID& endID, const glm::vec3& pathColor, float pathAlpha, float parentScale, + RenderState(const QUuid& startID, const QUuid& endID, const glm::vec3& pathColor, float pathAlpha, float parentScale, bool isVisibleInSecondaryCamera, bool drawInFront, bool pathEnabled); void setPathWidth(float width) { _pathWidth = width; } diff --git a/interface/src/raypick/PathPointer.cpp b/interface/src/raypick/PathPointer.cpp index ae0ce4671b..3cd444c0b3 100644 --- a/interface/src/raypick/PathPointer.cpp +++ b/interface/src/raypick/PathPointer.cpp @@ -73,10 +73,10 @@ void PathPointer::setLength(float length) { }); } -void PathPointer::setLockEndUUID(const QUuid& objectID, const bool isOverlay, const glm::mat4& offsetMat) { +void PathPointer::setLockEndUUID(const QUuid& objectID, bool isAvatar, const glm::mat4& offsetMat) { withWriteLock([&] { _lockEndObject.id = objectID; - _lockEndObject.isOverlay = isOverlay; + _lockEndObject.isAvatar = isAvatar; _lockEndObject.offsetMat = offsetMat; }); } @@ -97,12 +97,8 @@ PickResultPointer PathPointer::getVisualPickResult(const PickResultPointer& pick glm::quat rot; glm::vec3 dim; glm::vec3 registrationPoint; - if (_lockEndObject.isOverlay) { - pos = vec3FromVariant(qApp->getOverlays().getProperty(_lockEndObject.id, "position").value); - rot = quatFromVariant(qApp->getOverlays().getProperty(_lockEndObject.id, "rotation").value); - dim = vec3FromVariant(qApp->getOverlays().getProperty(_lockEndObject.id, "dimensions").value); - registrationPoint = glm::vec3(0.5f); - } else { + // TODO: use isAvatar + { EntityItemProperties props = DependencyManager::get()->getEntityProperties(_lockEndObject.id); glm::mat4 entityMat = createMatFromQuatAndPos(props.getRotation(), props.getPosition()); glm::mat4 finalPosAndRotMat = entityMat * _lockEndObject.offsetMat; @@ -117,7 +113,7 @@ PickResultPointer PathPointer::getVisualPickResult(const PickResultPointer& pick distance = glm::distance(origin, endVec); glm::vec3 normalizedDirection = glm::normalize(direction); - type = _lockEndObject.isOverlay ? IntersectionType::OVERLAY : IntersectionType::ENTITY; + type = IntersectionType::ENTITY; id = _lockEndObject.id; intersection = endVec; surfaceNormal = -normalizedDirection; @@ -126,8 +122,6 @@ PickResultPointer PathPointer::getVisualPickResult(const PickResultPointer& pick id = getPickedObjectID(pickResult); if (type == IntersectionType::ENTITY) { endVec = DependencyManager::get()->getEntityTransform(id)[3]; - } else if (type == IntersectionType::OVERLAY) { - endVec = vec3FromVariant(qApp->getOverlays().getProperty(id, "position").value); } else if (type == IntersectionType::AVATAR) { endVec = DependencyManager::get()->getAvatar(id)->getPosition(); } @@ -184,8 +178,8 @@ void PathPointer::editRenderState(const std::string& state, const QVariant& star withWriteLock([&] { auto renderState = _renderStates.find(state); if (renderState != _renderStates.end()) { - updateRenderStateOverlay(renderState->second->getStartID(), startProps); - updateRenderStateOverlay(renderState->second->getEndID(), endProps); + updateRenderState(renderState->second->getStartID(), startProps); + updateRenderState(renderState->second->getEndID(), endProps); QVariant startDim = startProps.toMap()["dimensions"]; if (startDim.isValid()) { renderState->second->setStartDim(vec3FromVariant(startDim)); @@ -204,7 +198,7 @@ void PathPointer::editRenderState(const std::string& state, const QVariant& star }); } -void PathPointer::updateRenderStateOverlay(const OverlayID& id, const QVariant& props) { +void PathPointer::updateRenderState(const QUuid& id, const QVariant& props) { if (!id.isNull() && props.isValid()) { QVariantMap propMap = props.toMap(); propMap.remove("visible"); diff --git a/interface/src/raypick/PathPointer.h b/interface/src/raypick/PathPointer.h index 1aa4165c87..759d46842e 100644 --- a/interface/src/raypick/PathPointer.h +++ b/interface/src/raypick/PathPointer.h @@ -19,20 +19,20 @@ struct LockEndObject { QUuid id { QUuid() }; - bool isOverlay { false }; + bool isAvatar { false }; glm::mat4 offsetMat { glm::mat4() }; }; class StartEndRenderState { public: StartEndRenderState() {} - StartEndRenderState(const OverlayID& startID, const OverlayID& endID); + StartEndRenderState(const QUuid& startID, const QUuid& endID); virtual ~StartEndRenderState() = default; - const OverlayID& getStartID() const { return _startID; } - const OverlayID& getEndID() const { return _endID; } - const bool& doesStartIgnoreRays() const { return _startIgnoreRays; } - const bool& doesEndIgnoreRays() const { return _endIgnoreRays; } + const QUuid& getStartID() const { return _startID; } + const QUuid& getEndID() const { return _endID; } + const bool& doesStartIgnorePicks() const { return _startIgnorePicks; } + const bool& doesEndIgnorePicks() const { return _endIgnorePicks; } void setStartDim(const glm::vec3& startDim) { _startDim = startDim; } const glm::vec3& getStartDim() const { return _startDim; } @@ -51,10 +51,10 @@ public: bool isEnabled() const { return _enabled; } protected: - OverlayID _startID; - OverlayID _endID; - bool _startIgnoreRays; - bool _endIgnoreRays; + QUuid _startID; + QUuid _endID; + bool _startIgnorePicks; + bool _endIgnorePicks; glm::vec3 _startDim; glm::vec3 _endDim; @@ -82,7 +82,7 @@ public: void editRenderState(const std::string& state, const QVariant& startProps, const QVariant& pathProps, const QVariant& endProps) override; void setLength(float length) override; - void setLockEndUUID(const QUuid& objectID, bool isOverlay, const glm::mat4& offsetMat = glm::mat4()) override; + void setLockEndUUID(const QUuid& objectID, bool isAvatar, const glm::mat4& offsetMat = glm::mat4()) override; void updateVisuals(const PickResultPointer& prevRayPickResult) override; diff --git a/libraries/entities-renderer/src/RenderableTextEntityItem.cpp b/libraries/entities-renderer/src/RenderableTextEntityItem.cpp index d5f0843049..94ecf5d4eb 100644 --- a/libraries/entities-renderer/src/RenderableTextEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableTextEntityItem.cpp @@ -199,7 +199,7 @@ void TextEntityRenderer::doRender(RenderArgs* args) { geometryCache->bindSimpleProgram(batch, false, backgroundColor.a < 1.0f, false, false, false); geometryCache->renderQuad(batch, minCorner, maxCorner, backgroundColor, _geometryID); - // FIXME: Factor out textRenderer so that Text3DOverlay overlay parts can be grouped by pipeline for a gpu performance increase. + // FIXME: Factor out textRenderer so that text parts can be grouped by pipeline for a gpu performance increase. float scale = _lineHeight / _textRenderer->getFontSize(); transformToTopLeft.setScale(scale); // Scale to have the correct line height batch.setModelTransform(transformToTopLeft); diff --git a/libraries/entities/src/EntityItemProperties.cpp b/libraries/entities/src/EntityItemProperties.cpp index 0f77bd6bc7..ad5c9660f4 100644 --- a/libraries/entities/src/EntityItemProperties.cpp +++ b/libraries/entities/src/EntityItemProperties.cpp @@ -945,12 +945,9 @@ EntityPropertyFlags EntityItemProperties::getChangedProperties() const { */ /**jsdoc - * The "Material" {@link Entities.EntityType|EntityType} modifies the existing materials on - * {@link Entities.EntityType|Model} entities, {@link Entities.EntityType|Shape} entities (albedo only), - * {@link Overlays.OverlayType|model overlays}, and avatars. + * The "Material" {@link Entities.EntityType|EntityType} modifies the existing materials on entities and avatars. * It has properties in addition to the common {@link Entities.EntityProperties|EntityProperties}.
- * To apply a material to an entity or overlay, set the material entity's parentID property to the entity or - * overlay's ID. + * To apply a material to an entity, set the material entity's parentID property to the entity ID. * To apply a material to an avatar, set the material entity's parentID property to the avatar's session UUID. * To apply a material to your avatar such that it persists across domains and log-ins, create the material as an avatar entity * by setting the entityHostType parameter in {@link Entities.addEntity} to "avatar". diff --git a/libraries/entities/src/EntityTypes.h b/libraries/entities/src/EntityTypes.h index 8ad654c638..91b71513dc 100644 --- a/libraries/entities/src/EntityTypes.h +++ b/libraries/entities/src/EntityTypes.h @@ -84,8 +84,7 @@ public: * {@link Entities.EntityProperties-Light|EntityProperties-Light} * "Zone"A volume of lighting effects and avatar permissions. * {@link Entities.EntityProperties-Zone|EntityProperties-Zone} - * "Material"Modifies the existing materials on Model entities, Shape entities, - * {@link Overlays.OverlayType|model overlays}, and avatars. + * "Material"Modifies the existing materials on entities and avatars. * {@link Entities.EntityProperties-Material|EntityProperties-Material} * * diff --git a/libraries/entities/src/LineEntityItem.cpp b/libraries/entities/src/LineEntityItem.cpp index 12d1178690..acb5bc08f6 100644 --- a/libraries/entities/src/LineEntityItem.cpp +++ b/libraries/entities/src/LineEntityItem.cpp @@ -23,7 +23,6 @@ const int LineEntityItem::MAX_POINTS_PER_LINE = 70; - EntityItemPointer LineEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) { EntityItemPointer entity(new LineEntityItem(entityID), [](EntityItem* ptr) { ptr->deleteLater(); }); entity->setProperties(properties); diff --git a/libraries/entities/src/MaterialEntityItem.cpp b/libraries/entities/src/MaterialEntityItem.cpp index cec602a5e1..1baa0b213a 100644 --- a/libraries/entities/src/MaterialEntityItem.cpp +++ b/libraries/entities/src/MaterialEntityItem.cpp @@ -310,7 +310,7 @@ void MaterialEntityItem::removeMaterial() { return; } - // Our parent could be an entity, an avatar, or an overlay + // Our parent could be an entity or an avatar if (EntityTree::removeMaterialFromEntity(parentID, material, getParentMaterialName().toStdString())) { return; } @@ -319,10 +319,6 @@ void MaterialEntityItem::removeMaterial() { return; } - if (EntityTree::removeMaterialFromOverlay(parentID, material, getParentMaterialName().toStdString())) { - return; - } - // if a remove fails, our parent is gone, so we don't need to retry } @@ -349,7 +345,7 @@ void MaterialEntityItem::applyMaterial() { graphics::MaterialLayer materialLayer = graphics::MaterialLayer(material, getPriority()); - // Our parent could be an entity, an avatar, or an overlay + // Our parent could be an entity or an avatar if (EntityTree::addMaterialToEntity(parentID, materialLayer, getParentMaterialName().toStdString())) { return; } @@ -358,10 +354,6 @@ void MaterialEntityItem::applyMaterial() { return; } - if (EntityTree::addMaterialToOverlay(parentID, materialLayer, getParentMaterialName().toStdString())) { - return; - } - // if we've reached this point, we couldn't find our parent, so we need to try again later _retryApply = true; } diff --git a/libraries/graphics-scripting/src/graphics-scripting/Forward.h b/libraries/graphics-scripting/src/graphics-scripting/Forward.h index 104674eddc..90bd083d02 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/Forward.h +++ b/libraries/graphics-scripting/src/graphics-scripting/Forward.h @@ -149,7 +149,7 @@ namespace scriptable { // QVariantMap armature; }; - // mixin class for Avatar/Entity/Overlay Rendering that expose their in-memory graphics::Meshes + // mixin class for Avatar + Entity Rendering that expose their in-memory graphics::Meshes class ModelProvider { public: NestableType modelProviderType; diff --git a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h index 1ec60c4244..f99d6438e4 100644 --- a/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h +++ b/libraries/graphics-scripting/src/graphics-scripting/GraphicsScriptingInterface.h @@ -38,13 +38,13 @@ public: public slots: /**jsdoc - * Returns a model reference object associated with the specified UUID ({@link EntityID}, {@link OverlayID}, or {@link AvatarID}). + * Returns a model reference object associated with the specified UUID ({@link EntityID} or {@link AvatarID}). * * @function Graphics.getModel * @param {UUID} entityID - The objectID of the model whose meshes are to be retrieved. * @returns {Graphics.Model} the resulting Model object */ - scriptable::ScriptableModelPointer getModel(QUuid uuid); + scriptable::ScriptableModelPointer getModel(const QUuid& uuid); /**jsdoc * @function Graphics.updateModel @@ -52,7 +52,7 @@ public slots: * @param {Graphics.Model} model * @returns {boolean} */ - bool updateModel(QUuid uuid, const scriptable::ScriptableModelPointer& model); + bool updateModel(const QUuid& uuid, const scriptable::ScriptableModelPointer& model); /**jsdoc * @function Graphics.canUpdateModel @@ -61,7 +61,7 @@ public slots: * @param {number} [partNumber=-1] * @returns {boolean} */ - bool canUpdateModel(QUuid uuid, int meshIndex = -1, int partNumber = -1); + bool canUpdateModel(const QUuid& uuid, int meshIndex = -1, int partNumber = -1); /**jsdoc * @function Graphics.newModel @@ -94,7 +94,7 @@ public slots: QString exportModelToOBJ(const scriptable::ScriptableModel& in); private: - scriptable::ModelProviderPointer getModelProvider(QUuid uuid); + scriptable::ModelProviderPointer getModelProvider(const QUuid& uuid); void jsThrowError(const QString& error); scriptable::MeshPointer getMeshPointer(scriptable::ScriptableMeshPointer meshProxy); scriptable::MeshPointer getMeshPointer(scriptable::ScriptableMesh& meshProxy); diff --git a/libraries/pointers/src/Pick.h b/libraries/pointers/src/Pick.h index 857a72caa8..2db8aa95f5 100644 --- a/libraries/pointers/src/Pick.h +++ b/libraries/pointers/src/Pick.h @@ -23,7 +23,6 @@ enum IntersectionType { NONE = 0, ENTITY, - OVERLAY, AVATAR, HUD };