From 4254c19cf6364afed31e9448b3c20b7267d1a12d Mon Sep 17 00:00:00 2001 From: ksuprynowicz Date: Thu, 29 Jun 2023 17:30:49 +0200 Subject: [PATCH] Fixed laser pointer blinking issue --- interface/src/raypick/LaserPointer.cpp | 15 +++++++++------ interface/src/raypick/ParabolaPointer.cpp | 10 ++++++---- scripts/system/controllers/controllerScripts.js | 3 +-- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/interface/src/raypick/LaserPointer.cpp b/interface/src/raypick/LaserPointer.cpp index 8d18479091..ce44d3011c 100644 --- a/interface/src/raypick/LaserPointer.cpp +++ b/interface/src/raypick/LaserPointer.cpp @@ -197,8 +197,9 @@ std::shared_ptr LaserPointer::buildRenderState(const QVaria if (propMap["startPropertyIndex"].isValid()) { int startPropertyIndex = propMap["startPropertyIndex"].toInt(); if (startPropertyIndex >= 0 && startPropertyIndex < entityProperties.length()) { - //startMap.remove("visible"); - startID = DependencyManager::get()->addEntityInternal(entityProperties[startPropertyIndex], entity::HostType::LOCAL); + EntityItemProperties startProperties(entityProperties[startPropertyIndex]); + startProperties.getGrab().setGrabbable(false); + startID = DependencyManager::get()->addEntityInternal(startProperties, entity::HostType::LOCAL); } } @@ -207,9 +208,10 @@ std::shared_ptr LaserPointer::buildRenderState(const QVaria // laser paths must be PolyLine int pathPropertyIndex = propMap["pathPropertyIndex"].toInt(); if (pathPropertyIndex >= 0 && pathPropertyIndex < entityProperties.length()) { - //startMap.remove("visible"); //pathMap["type"].toString() == "PolyLine" - pathID = DependencyManager::get()->addEntityInternal(entityProperties[pathPropertyIndex], entity::HostType::LOCAL); + EntityItemProperties pathProperties(entityProperties[pathPropertyIndex]); + pathProperties.getGrab().setGrabbable(false); + pathID = DependencyManager::get()->addEntityInternal(pathProperties, entity::HostType::LOCAL); } } @@ -217,8 +219,9 @@ std::shared_ptr LaserPointer::buildRenderState(const QVaria if (propMap["endPropertyIndex"].isValid()) { int endPropertyIndex = propMap["endPropertyIndex"].toInt(); if (endPropertyIndex >= 0 && endPropertyIndex < entityProperties.length()) { - //startMap.remove("visible"); - endID = DependencyManager::get()->addEntityInternal(entityProperties[endPropertyIndex], entity::HostType::LOCAL); + EntityItemProperties endProperties(entityProperties[endPropertyIndex]); + endProperties.getGrab().setGrabbable(false); + endID = DependencyManager::get()->addEntityInternal(endProperties, entity::HostType::LOCAL); } } diff --git a/interface/src/raypick/ParabolaPointer.cpp b/interface/src/raypick/ParabolaPointer.cpp index 63a17b217c..5f045c5504 100644 --- a/interface/src/raypick/ParabolaPointer.cpp +++ b/interface/src/raypick/ParabolaPointer.cpp @@ -238,8 +238,9 @@ std::shared_ptr ParabolaPointer::buildRenderState(const QVa if (propMap["startPropertyIndex"].isValid()) { int startPropertyIndex = propMap["startPropertyIndex"].toInt(); if (startPropertyIndex >= 0 && startPropertyIndex < entityProperties.length()) { - //startMap.remove("visible"); - startID = DependencyManager::get()->addEntityInternal(entityProperties[startPropertyIndex], entity::HostType::LOCAL); + EntityItemProperties startProperties(entityProperties[startPropertyIndex]); + startProperties.getGrab().setGrabbable(false); + startID = DependencyManager::get()->addEntityInternal(startProperties, entity::HostType::LOCAL); } } @@ -278,8 +279,9 @@ std::shared_ptr ParabolaPointer::buildRenderState(const QVa if (propMap["endPropertyIndex"].isValid()) { int endPropertyIndex = propMap["endPropertyIndex"].toInt(); if (endPropertyIndex >= 0 && endPropertyIndex < entityProperties.length()) { - //endMap.remove("visible"); - endID = DependencyManager::get()->addEntityInternal(entityProperties[endPropertyIndex], entity::HostType::LOCAL); + EntityItemProperties endProperties(entityProperties[endPropertyIndex]); + endProperties.getGrab().setGrabbable(false); + endID = DependencyManager::get()->addEntityInternal(endProperties, entity::HostType::LOCAL); } } diff --git a/scripts/system/controllers/controllerScripts.js b/scripts/system/controllers/controllerScripts.js index 928d1fef86..de185e3fe0 100644 --- a/scripts/system/controllers/controllerScripts.js +++ b/scripts/system/controllers/controllerScripts.js @@ -17,9 +17,8 @@ var CONTOLLER_SCRIPTS = [ "squeezeHands.js", "controllerDisplayManager.js", "grab.js", - //"toggleAdvancedMovementForHandControllers.js", + "toggleAdvancedMovementForHandControllers.js", "handTouch.js", - //"controllerDispatcher.js", "controllerModules/nearParentGrabOverlay.js", "controllerModules/stylusInput.js", "controllerModules/equipEntity.js",