History

DEV-2840: Fix z-fighting issues in Smartboard and enable quicker positional iteration in the future

Zach Fox committed 6 years ago

Commit 8be866e1 parent 52205d22 files · +16 −2Browse files

Showing the changes to interface/src/scripting/ScreenshareScriptingInterface.cpp (1 of 2 files). Show all

Unified · Split

interface/src/scripting/ScreenshareScriptingInterface.cpp+5−2
@@ -90,7 +90,8 @@ static const EntityTypes::EntityType LOCAL_SCREENSHARE_WEB_ENTITY_TYPE = EntityT · 89 unmodified lines
9090 static const uint8_t LOCAL_SCREENSHARE_WEB_ENTITY_FPS = 30;
9191 // This is going to be a good amount of work to make this work dynamically for any screensize.
9292 // V1 will have only hardcoded values.
93−static const glm::vec3 LOCAL_SCREENSHARE_WEB_ENTITY_LOCAL_POSITION(0.0128f, -0.0918f, 0.0711f);
93+// The `z` value here is dynamic.
94+static const glm::vec3 LOCAL_SCREENSHARE_WEB_ENTITY_LOCAL_POSITION(0.0128f, -0.0918f, 0.0f);
9495 static const glm::vec3 LOCAL_SCREENSHARE_WEB_ENTITY_DIMENSIONS(3.6790f, 2.0990f, 0.0100f);
9596 static const QString LOCAL_SCREENSHARE_WEB_ENTITY_URL =
9697 "https://content.highfidelity.com/Experiences/Releases/usefulUtilities/smartBoard/screenshareViewer/screenshareClient.html";
@@ -241,7 +242,9 @@ void ScreenshareScriptingInterface::handleSuccessfulScreenshareInfoGet(QNetworkR · 144 unmodified lines
241242 EntityItemProperties localScreenshareWebEntityProps;
242243 localScreenshareWebEntityProps.setType(LOCAL_SCREENSHARE_WEB_ENTITY_TYPE);
243244 localScreenshareWebEntityProps.setMaxFPS(LOCAL_SCREENSHARE_WEB_ENTITY_FPS);
244− localScreenshareWebEntityProps.setLocalPosition(LOCAL_SCREENSHARE_WEB_ENTITY_LOCAL_POSITION);
245+ glm::vec3 localPosition(LOCAL_SCREENSHARE_WEB_ENTITY_LOCAL_POSITION);
246+ localPosition.z = _localWebEntityZOffset;
247+ localScreenshareWebEntityProps.setLocalPosition(localPosition);
245248 localScreenshareWebEntityProps.setSourceUrl(LOCAL_SCREENSHARE_WEB_ENTITY_URL);
246249 localScreenshareWebEntityProps.setParentID(_smartboardEntityID);
247250 localScreenshareWebEntityProps.setDimensions(LOCAL_SCREENSHARE_WEB_ENTITY_DIMENSIONS);