diff --git a/CMakeLists.txt b/CMakeLists.txt index 7a6118bb87..a0d463b766 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -12,6 +12,10 @@ if (POLICY CMP0043) cmake_policy(SET CMP0043 OLD) endif () +if (POLICY CMP0042) + cmake_policy(SET CMP0042 OLD) +endif () + project(hifi) add_definitions(-DGLM_FORCE_RADIANS) diff --git a/assignment-client/CMakeLists.txt b/assignment-client/CMakeLists.txt index 9d604cd5dd..73dfbe7a8b 100644 --- a/assignment-client/CMakeLists.txt +++ b/assignment-client/CMakeLists.txt @@ -15,4 +15,4 @@ if (UNIX) target_link_libraries(${TARGET_NAME} ${CMAKE_DL_LIBS}) endif (UNIX) -link_shared_dependencies() +include_dependency_includes() diff --git a/cmake/macros/LinkSharedDependencies.cmake b/cmake/macros/IncludeDependencyIncludes.cmake similarity index 86% rename from cmake/macros/LinkSharedDependencies.cmake rename to cmake/macros/IncludeDependencyIncludes.cmake index 9168c5a921..a375404164 100644 --- a/cmake/macros/LinkSharedDependencies.cmake +++ b/cmake/macros/IncludeDependencyIncludes.cmake @@ -1,5 +1,5 @@ # -# LinkSharedDependencies.cmake +# IncludeDependencyIncludes.cmake # cmake/macros # # Copyright 2014 High Fidelity, Inc. @@ -9,7 +9,7 @@ # See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html # -macro(LINK_SHARED_DEPENDENCIES) +macro(INCLUDE_DEPENDENCY_INCLUDES) if (${TARGET_NAME}_DEPENDENCY_INCLUDES) list(REMOVE_DUPLICATES ${TARGET_NAME}_DEPENDENCY_INCLUDES) @@ -19,4 +19,4 @@ macro(LINK_SHARED_DEPENDENCIES) # set the property on this target so it can be retreived by targets linking to us set_target_properties(${TARGET_NAME} PROPERTIES DEPENDENCY_INCLUDES "${${TARGET_NAME}_DEPENDENCY_INCLUDES}") -endmacro(LINK_SHARED_DEPENDENCIES) \ No newline at end of file +endmacro(INCLUDE_DEPENDENCY_INCLUDES) \ No newline at end of file diff --git a/cmake/modules/FindGLUT.cmake b/cmake/modules/FindGLUT.cmake deleted file mode 100644 index e7bf752aca..0000000000 --- a/cmake/modules/FindGLUT.cmake +++ /dev/null @@ -1,47 +0,0 @@ -# -# FindGLUT.cmake -# -# Try to find GLUT library and include path. -# Once done this will define -# -# GLUT_FOUND -# GLUT_INCLUDE_DIRS -# GLUT_LIBRARIES -# -# Created on 2/6/2014 by Stephen Birarda -# Copyright 2014 High Fidelity, Inc. -# -# Adapted from FindGLUT.cmake available in tlorach's OpenGLText Repository -# https://raw.github.com/tlorach/OpenGLText/master/cmake/FindGLUT.cmake -# -# Distributed under the Apache License, Version 2.0. -# See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html -# - -include("${MACRO_DIR}/HifiLibrarySearchHints.cmake") -hifi_library_search_hints("freeglut") - -if (WIN32) - set(GLUT_HINT_DIRS "${FREEGLUT_SEARCH_DIRS} ${OPENGL_INCLUDE_DIR}") - - find_path(GLUT_INCLUDE_DIRS GL/glut.h PATH_SUFFIXES include HINTS ${FREEGLUT_SEARCH_DIRS}) - find_library(GLUT_LIBRARY freeglut PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS}) -else () - find_path(GLUT_INCLUDE_DIRS GL/glut.h PATH_SUFFIXES include HINTS ${FREEGLUT_SEARCH_DIRS}) - find_library(GLUT_LIBRARY glut PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS}) -endif () - -include(FindPackageHandleStandardArgs) - -set(GLUT_LIBRARIES "${GLUT_LIBRARY}" "${XMU_LIBRARY}" "${XI_LIBRARY}") - -if (UNIX) - find_library(XI_LIBRARY Xi PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS}) - find_library(XMU_LIBRARY Xmu PATH_SUFFIXES lib HINTS ${FREEGLUT_SEARCH_DIRS}) - - find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIRS GLUT_LIBRARIES XI_LIBRARY XMU_LIBRARY) -else () - find_package_handle_standard_args(GLUT DEFAULT_MSG GLUT_INCLUDE_DIRS GLUT_LIBRARIES) -endif () - -mark_as_advanced(GLUT_INCLUDE_DIRS GLUT_LIBRARIES GLUT_LIBRARY XI_LIBRARY XMU_LIBRARY FREEGLUT_SEARCH_DIRS) \ No newline at end of file diff --git a/domain-server/CMakeLists.txt b/domain-server/CMakeLists.txt index 482c397b14..421a1da2d4 100644 --- a/domain-server/CMakeLists.txt +++ b/domain-server/CMakeLists.txt @@ -52,4 +52,4 @@ include_directories(SYSTEM "${OPENSSL_INCLUDE_DIR}") # append OpenSSL to our list of libraries to link target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES}) -link_shared_dependencies() \ No newline at end of file +include_dependency_includes() \ No newline at end of file diff --git a/examples/defaultScripts.js b/examples/defaultScripts.js index d39fce0186..cdb8e76c65 100644 --- a/examples/defaultScripts.js +++ b/examples/defaultScripts.js @@ -15,3 +15,4 @@ Script.load("hydraMove.js"); Script.load("headMove.js"); Script.load("inspect.js"); Script.load("lobby.js"); +Script.load("notifications.js"); diff --git a/examples/entityScripts/changeColorOnHover.js b/examples/entityScripts/changeColorOnHover.js index 638c1bece4..0cf08adf1d 100644 --- a/examples/entityScripts/changeColorOnHover.js +++ b/examples/entityScripts/changeColorOnHover.js @@ -13,34 +13,7 @@ // See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html // -(function(){ - this.oldColor = {}; - this.oldColorKnown = false; - this.storeOldColor = function(entityID) { - var oldProperties = Entities.getEntityProperties(entityID); - this.oldColor = oldProperties.color; - this.oldColorKnown = true; - print("storing old color... this.oldColor=" + this.oldColor.red + "," + this.oldColor.green + "," + this.oldColor.blue); - }; - - this.preload = function(entityID) { - print("preload"); - this.storeOldColor(entityID); - }; - - this.hoverEnterEntity = function(entityID, mouseEvent) { - print("hoverEnterEntity"); - if (!this.oldColorKnown) { - this.storeOldColor(entityID); - } - Entities.editEntity(entityID, { color: { red: 0, green: 255, blue: 255} }); - }; - this.hoverLeaveEntity = function(entityID, mouseEvent) { - print("hoverLeaveEntity"); - if (this.oldColorKnown) { - print("leave restoring old color... this.oldColor=" - + this.oldColor.red + "," + this.oldColor.green + "," + this.oldColor.blue); - Entities.editEntity(entityID, { color: this.oldColor }); - } - }; -}) \ No newline at end of file +(function() { + Script.include("changeColorOnHoverClass.js"); + return new ChangeColorOnHover(); +}) diff --git a/examples/entityScripts/changeColorOnHoverClass.js b/examples/entityScripts/changeColorOnHoverClass.js new file mode 100644 index 0000000000..231469f7e8 --- /dev/null +++ b/examples/entityScripts/changeColorOnHoverClass.js @@ -0,0 +1,55 @@ +// +// changeColorOnHover.js +// examples/entityScripts +// +// Created by Brad Hefta-Gaub on 11/1/14. +// Copyright 2014 High Fidelity, Inc. +// +// This is an example of an entity script which when assigned to a non-model entity like a box or sphere, will +// change the color of the entity when you hover over it. This script uses the JavaScript prototype/class functionality +// to construct an object that has methods for hoverEnterEntity and hoverLeaveEntity; +// +// Distributed under the Apache License, Version 2.0. +// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html +// + + +ChangeColorOnHover = function(){ + this.oldColor = {}; + this.oldColorKnown = false; +}; + +ChangeColorOnHover.prototype = { + + storeOldColor: function(entityID) { + var oldProperties = Entities.getEntityProperties(entityID); + this.oldColor = oldProperties.color; + this.oldColorKnown = true; + print("storing old color... this.oldColor=" + this.oldColor.red + "," + this.oldColor.green + "," + this.oldColor.blue); + }, + + preload: function(entityID) { + print("preload"); + this.storeOldColor(entityID); + }, + + hoverEnterEntity: function(entityID, mouseEvent) { + print("hoverEnterEntity"); + if (!this.oldColorKnown) { + this.storeOldColor(entityID); + } + Entities.editEntity(entityID, { color: { red: 0, green: 255, blue: 255} }); + }, + + + hoverLeaveEntity: function(entityID, mouseEvent) { + print("hoverLeaveEntity"); + if (this.oldColorKnown) { + print("leave restoring old color... this.oldColor=" + + this.oldColor.red + "," + this.oldColor.green + "," + this.oldColor.blue); + Entities.editEntity(entityID, { color: this.oldColor }); + } + } +}; + + diff --git a/examples/entityScripts/playSoundOnEnterOrLeave.js b/examples/entityScripts/playSoundOnEnterOrLeave.js index f82c05c580..b95e35ab1d 100644 --- a/examples/entityScripts/playSoundOnEnterOrLeave.js +++ b/examples/entityScripts/playSoundOnEnterOrLeave.js @@ -27,10 +27,12 @@ }; this.enterEntity = function(entityID) { + print("enterEntity("+entityID.id+")"); playSound(); }; this.leaveEntity = function(entityID) { + print("leaveEntity("+entityID.id+")"); playSound(); }; }) diff --git a/ice-server/CMakeLists.txt b/ice-server/CMakeLists.txt index c81ba16248..24e780f9aa 100644 --- a/ice-server/CMakeLists.txt +++ b/ice-server/CMakeLists.txt @@ -6,4 +6,4 @@ setup_hifi_project(Network) # link the shared hifi libraries link_hifi_libraries(networking shared) -link_shared_dependencies() \ No newline at end of file +include_dependency_includes() \ No newline at end of file diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 92c0d03add..a39c3d0c19 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -25,15 +25,15 @@ else () endif () if (APPLE) - set(GL_HEADERS "#include \n#include ") + set(GL_HEADERS "#include ") elseif (UNIX) # include the right GL headers for UNIX - set(GL_HEADERS "#include \n#include \n#include ") + set(GL_HEADERS "#include \n#include ") elseif (WIN32) add_definitions(-D_USE_MATH_DEFINES) # apparently needed to get M_PI and other defines from cmath/math.h add_definitions(-DWINDOWS_LEAN_AND_MEAN) # needed to make sure windows doesn't go to crazy with its defines - set(GL_HEADERS "#include \n#include \n#include \n#include ") + set(GL_HEADERS "#include \n#include \n#include ") endif () # set up the external glm library @@ -194,11 +194,10 @@ if (APPLE) # link in required OS X frameworks and include the right GL headers find_library(CoreAudio CoreAudio) find_library(CoreFoundation CoreFoundation) - find_library(GLUT GLUT) find_library(OpenGL OpenGL) find_library(AppKit AppKit) - target_link_libraries(${TARGET_NAME} ${CoreAudio} ${CoreFoundation} ${GLUT} ${OpenGL} ${AppKit}) + target_link_libraries(${TARGET_NAME} ${CoreAudio} ${CoreFoundation} ${OpenGL} ${AppKit}) # install command for OS X bundle INSTALL(TARGETS ${TARGET_NAME} @@ -214,15 +213,12 @@ else (APPLE) ) find_package(OpenGL REQUIRED) - find_package(GLUT REQUIRED) - - include_directories(SYSTEM "${GLUT_INCLUDE_DIRS}") if (${OPENGL_INCLUDE_DIR}) include_directories(SYSTEM "${OPENGL_INCLUDE_DIR}") endif () - target_link_libraries(${TARGET_NAME} "${OPENGL_LIBRARY}" "${GLUT_LIBRARIES}") + target_link_libraries(${TARGET_NAME} "${OPENGL_LIBRARY}") # link target to external libraries if (WIN32) @@ -232,7 +228,7 @@ else (APPLE) # we're using static GLEW, so define GLEW_STATIC add_definitions(-DGLEW_STATIC) - target_link_libraries(${TARGET_NAME} "${GLEW_LIBRARIES}" "${NSIGHT_LIBRARIES}" wsock32.lib opengl32.lib) + target_link_libraries(${TARGET_NAME} "${GLEW_LIBRARIES}" "${NSIGHT_LIBRARIES}" wsock32.lib opengl32.lib Winmm.lib) # try to find the Nsight package and add it to the build if we find it find_package(NSIGHT) @@ -246,4 +242,4 @@ else (APPLE) endif (APPLE) # link any dependencies bubbled up from our linked dependencies -link_shared_dependencies() +include_dependency_includes() diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 8c482d26ce..bc6c119fe9 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -130,7 +130,7 @@ static QTimer* idleTimer = NULL; const QString CHECK_VERSION_URL = "https://highfidelity.io/latestVersion.xml"; const QString SKIP_FILENAME = QStandardPaths::writableLocation(QStandardPaths::DataLocation) + "/hifi.skipversion"; -const QString DEFAULT_SCRIPTS_JS_URL = "http://public.highfidelity.io/scripts/defaultScripts.js"; +const QString DEFAULT_SCRIPTS_JS_URL = "http://s3.amazonaws.com/hifi-public/scripts/defaultScripts.js"; void messageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) { QString logMessage = LogHandler::getInstance().printMessage((LogMsgType) type, context, message); diff --git a/interface/src/Hair.cpp b/interface/src/Hair.cpp index cb664f39ed..c2d3f78b98 100644 --- a/interface/src/Hair.cpp +++ b/interface/src/Hair.cpp @@ -10,11 +10,14 @@ // // Creates single flexible verlet-integrated strands that can be used for hair/fur/grass -#include "Hair.h" +#include #include "Util.h" #include "world.h" +#include "Hair.h" + + const float HAIR_DAMPING = 0.99f; const float CONSTRAINT_RELAXATION = 10.0f; const float HAIR_ACCELERATION_COUPLING = 0.045f; diff --git a/interface/src/avatar/Avatar.cpp b/interface/src/avatar/Avatar.cpp index 39c528d080..4c309b2c8c 100644 --- a/interface/src/avatar/Avatar.cpp +++ b/interface/src/avatar/Avatar.cpp @@ -669,6 +669,49 @@ glm::vec3 Avatar::getDisplayNamePosition() { return namePosition; } +float Avatar::calculateDisplayNameScaleFactor(const glm::vec3& textPosition, bool inHMD) { + + // We need to compute the scale factor such as the text remains with fixed size respect to window coordinates + // We project a unit vector and check the difference in screen coordinates, to check which is the + // correction scale needed + // save the matrices for later scale correction factor + // The up vector must be relative to the rotation current rotation matrix: + // we set the identity + glm::vec3 testPoint0 = textPosition; + glm::vec3 testPoint1 = textPosition + (Application::getInstance()->getCamera()->getRotation() * IDENTITY_UP); + + double textWindowHeight; + + GLCanvas::SharedPointer glCanvas = DependencyManager::get(); + float windowSizeX = glCanvas->getDeviceWidth(); + float windowSizeY = glCanvas->getDeviceHeight(); + + glm::dmat4 modelViewMatrix; + glm::dmat4 projectionMatrix; + Application::getInstance()->getModelViewMatrix(&modelViewMatrix); + Application::getInstance()->getProjectionMatrix(&projectionMatrix); + + glm::dvec4 p0 = modelViewMatrix * glm::dvec4(testPoint0, 1.0); + p0 = projectionMatrix * p0; + glm::dvec2 result0 = glm::vec2(windowSizeX * (p0.x / p0.w + 1.0f) * 0.5f, windowSizeY * (p0.y / p0.w + 1.0f) * 0.5f); + + glm::dvec4 p1 = modelViewMatrix * glm::dvec4(testPoint1, 1.0); + p1 = projectionMatrix * p1; + glm::vec2 result1 = glm::vec2(windowSizeX * (p1.x / p1.w + 1.0f) * 0.5f, windowSizeY * (p1.y / p1.w + 1.0f) * 0.5f); + textWindowHeight = abs(result1.y - result0.y); + + // need to scale to compensate for the font resolution due to the device + float scaleFactor = QApplication::desktop()->windowHandle()->devicePixelRatio() * + ((textWindowHeight > EPSILON) ? 1.0f / textWindowHeight : 1.0f); + if (inHMD) { + const float HMDMODE_NAME_SCALE = 0.65f; + scaleFactor *= HMDMODE_NAME_SCALE; + } else { + scaleFactor *= Application::getInstance()->getRenderResolutionScale(); + } + return scaleFactor; +} + void Avatar::renderDisplayName() { if (_displayName.isEmpty() || _displayNameAlpha == 0.0f) { @@ -700,78 +743,39 @@ void Avatar::renderDisplayName() { frontAxis = glm::normalize(glm::vec3(frontAxis.z, 0.0f, -frontAxis.x)); float angle = acos(frontAxis.x) * ((frontAxis.z < 0) ? 1.0f : -1.0f); glRotatef(glm::degrees(angle), 0.0f, 1.0f, 0.0f); - - // We need to compute the scale factor such as the text remains with fixed size respect to window coordinates - // We project a unit vector and check the difference in screen coordinates, to check which is the - // correction scale needed - // save the matrices for later scale correction factor - glm::dmat4 modelViewMatrix; - glm::dmat4 projectionMatrix; - GLint viewportMatrix[4]; - Application::getInstance()->getModelViewMatrix(&modelViewMatrix); - Application::getInstance()->getProjectionMatrix(&projectionMatrix); - glGetIntegerv(GL_VIEWPORT, viewportMatrix); - GLdouble result0[3], result1[3]; - - // The up vector must be relative to the rotation current rotation matrix: - // we set the identity - glm::dvec3 testPoint0 = glm::dvec3(textPosition); - glm::dvec3 testPoint1 = glm::dvec3(textPosition) + glm::dvec3(Application::getInstance()->getCamera()->getRotation() * IDENTITY_UP); - bool success; - success = gluProject(testPoint0.x, testPoint0.y, testPoint0.z, - (GLdouble*)&modelViewMatrix, (GLdouble*)&projectionMatrix, viewportMatrix, - &result0[0], &result0[1], &result0[2]); - success = success && - gluProject(testPoint1.x, testPoint1.y, testPoint1.z, - (GLdouble*)&modelViewMatrix, (GLdouble*)&projectionMatrix, viewportMatrix, - &result1[0], &result1[1], &result1[2]); + float scaleFactor = calculateDisplayNameScaleFactor(textPosition, inHMD); + glScalef(scaleFactor, scaleFactor, 1.0); + + glScalef(1.0f, -1.0f, 1.0f); // TextRenderer::draw paints the text upside down in y axis - if (success) { - double textWindowHeight = abs(result1[1] - result0[1]); - // need to scale to compensate for the font resolution due to the device - float scaleFactor = QApplication::desktop()->windowHandle()->devicePixelRatio() * - ((textWindowHeight > EPSILON) ? 1.0f / textWindowHeight : 1.0f); - if (inHMD) { - const float HMDMODE_NAME_SCALE = 0.65f; - scaleFactor *= HMDMODE_NAME_SCALE; - } else { - scaleFactor *= Application::getInstance()->getRenderResolutionScale(); - } - glScalef(scaleFactor, scaleFactor, 1.0); - - glScalef(1.0f, -1.0f, 1.0f); // TextRenderer::draw paints the text upside down in y axis + int text_x = -_displayNameBoundingRect.width() / 2; + int text_y = -_displayNameBoundingRect.height() / 2; - int text_x = -_displayNameBoundingRect.width() / 2; - int text_y = -_displayNameBoundingRect.height() / 2; + // draw a gray background + int left = text_x + _displayNameBoundingRect.x(); + int right = left + _displayNameBoundingRect.width(); + int bottom = text_y + _displayNameBoundingRect.y(); + int top = bottom + _displayNameBoundingRect.height(); + const int border = 8; + bottom -= border; + left -= border; + top += border; + right += border; - // draw a gray background - int left = text_x + _displayNameBoundingRect.x(); - int right = left + _displayNameBoundingRect.width(); - int bottom = text_y + _displayNameBoundingRect.y(); - int top = bottom + _displayNameBoundingRect.height(); - const int border = 8; - bottom -= border; - left -= border; - top += border; - right += border; + // We are drawing coplanar textures with depth: need the polygon offset + glEnable(GL_POLYGON_OFFSET_FILL); + glPolygonOffset(1.0f, 1.0f); - // We are drawing coplanar textures with depth: need the polygon offset - glEnable(GL_POLYGON_OFFSET_FILL); - glPolygonOffset(1.0f, 1.0f); - - glColor4f(0.2f, 0.2f, 0.2f, _displayNameAlpha * DISPLAYNAME_BACKGROUND_ALPHA / DISPLAYNAME_ALPHA); - renderBevelCornersRect(left, bottom, right - left, top - bottom, 3); - - glColor4f(0.93f, 0.93f, 0.93f, _displayNameAlpha); - QByteArray ba = _displayName.toLocal8Bit(); - const char* text = ba.data(); - - glDisable(GL_POLYGON_OFFSET_FILL); - textRenderer(DISPLAYNAME)->draw(text_x, text_y, text); - - - } + glColor4f(0.2f, 0.2f, 0.2f, _displayNameAlpha * DISPLAYNAME_BACKGROUND_ALPHA / DISPLAYNAME_ALPHA); + renderBevelCornersRect(left, bottom, right - left, top - bottom, 3); + + glColor4f(0.93f, 0.93f, 0.93f, _displayNameAlpha); + QByteArray ba = _displayName.toLocal8Bit(); + const char* text = ba.data(); + + glDisable(GL_POLYGON_OFFSET_FILL); + textRenderer(DISPLAYNAME)->draw(text_x, text_y, text); glPopMatrix(); diff --git a/interface/src/avatar/Avatar.h b/interface/src/avatar/Avatar.h index 88ab3b12ca..d862e042c2 100644 --- a/interface/src/avatar/Avatar.h +++ b/interface/src/avatar/Avatar.h @@ -230,6 +230,7 @@ protected: float getPelvisFloatingHeight() const; glm::vec3 getDisplayNamePosition(); + float calculateDisplayNameScaleFactor(const glm::vec3& textPosition, bool inHMD); void renderDisplayName(); virtual void renderBody(RenderMode renderMode, bool postLighting, float glowLevel = 0.0f); virtual bool shouldRenderHead(const glm::vec3& cameraPosition, RenderMode renderMode) const; diff --git a/interface/src/devices/OculusManager.cpp b/interface/src/devices/OculusManager.cpp index 1854c9539d..f59ce639a0 100644 --- a/interface/src/devices/OculusManager.cpp +++ b/interface/src/devices/OculusManager.cpp @@ -582,7 +582,7 @@ void OculusManager::renderDistortionMesh(ovrPosef eyeRenderPose[ovrEye_Count]) { glLoadIdentity(); GLCanvas::SharedPointer glCanvas = DependencyManager::get(); - gluOrtho2D(0, glCanvas->getDeviceWidth(), 0, glCanvas->getDeviceHeight()); + glOrtho(0, glCanvas->getDeviceWidth(), 0, glCanvas->getDeviceHeight(), -1.0, 1.0); glDisable(GL_DEPTH_TEST); diff --git a/interface/src/ui/ApplicationOverlay.cpp b/interface/src/ui/ApplicationOverlay.cpp index ab85da125c..b2ed9fc77d 100644 --- a/interface/src/ui/ApplicationOverlay.cpp +++ b/interface/src/ui/ApplicationOverlay.cpp @@ -180,7 +180,7 @@ void ApplicationOverlay::renderOverlay(bool renderToTexture) { glPushMatrix(); { glLoadIdentity(); - gluOrtho2D(0, glCanvas->width(), glCanvas->height(), 0); + glOrtho(0, glCanvas->width(), glCanvas->height(), 0, -1.0, 1.0); renderAudioMeter(); @@ -224,7 +224,7 @@ void ApplicationOverlay::displayOverlayTexture() { glMatrixMode(GL_PROJECTION); glPushMatrix(); { glLoadIdentity(); - gluOrtho2D(0, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight(), 0); + glOrtho(0, glCanvas->getDeviceWidth(), glCanvas->getDeviceHeight(), 0, -1.0, 1.0); glDisable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); glEnable(GL_BLEND); diff --git a/interface/src/ui/RearMirrorTools.cpp b/interface/src/ui/RearMirrorTools.cpp index fd3fc34adb..37f7c6ae23 100644 --- a/interface/src/ui/RearMirrorTools.cpp +++ b/interface/src/ui/RearMirrorTools.cpp @@ -128,7 +128,7 @@ void RearMirrorTools::displayIcon(QRect bounds, QRect iconBounds, GLuint texture glPushMatrix(); glLoadIdentity(); - gluOrtho2D(bounds.left(), bounds.right(), bounds.bottom(), bounds.top()); + glOrtho(bounds.left(), bounds.right(), bounds.bottom(), bounds.top(), -1.0, 1.0); glDisable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); glEnable(GL_TEXTURE_2D); diff --git a/interface/src/ui/overlays/ImageOverlay.cpp b/interface/src/ui/overlays/ImageOverlay.cpp index f903dfe19c..b14f49737f 100644 --- a/interface/src/ui/overlays/ImageOverlay.cpp +++ b/interface/src/ui/overlays/ImageOverlay.cpp @@ -100,26 +100,31 @@ void ImageOverlay::render(RenderArgs* args) { float w = fromImage.width() / imageWidth; // ?? is this what we want? not sure float h = fromImage.height() / imageHeight; + int left = _bounds.left(); + int right = _bounds.right() + 1; + int top = _bounds.top(); + int bottom = _bounds.bottom() + 1; + glBegin(GL_QUADS); if (_renderImage) { glTexCoord2f(x, 1.0f - y); } - glVertex2f(_bounds.left(), _bounds.top()); + glVertex2f(left, top); if (_renderImage) { glTexCoord2f(x + w, 1.0f - y); } - glVertex2f(_bounds.right(), _bounds.top()); + glVertex2f(right, top); if (_renderImage) { glTexCoord2f(x + w, 1.0f - (y + h)); } - glVertex2f(_bounds.right(), _bounds.bottom()); + glVertex2f(right, bottom); if (_renderImage) { glTexCoord2f(x, 1.0f - (y + h)); } - glVertex2f(_bounds.left(), _bounds.bottom()); + glVertex2f(left, bottom); glEnd(); if (_renderImage) { diff --git a/interface/src/ui/overlays/TextOverlay.cpp b/interface/src/ui/overlays/TextOverlay.cpp index 97d910eb64..03a5c3d846 100644 --- a/interface/src/ui/overlays/TextOverlay.cpp +++ b/interface/src/ui/overlays/TextOverlay.cpp @@ -70,11 +70,16 @@ void TextOverlay::render(RenderArgs* args) { glColor4f(backgroundColor.red / MAX_COLOR, backgroundColor.green / MAX_COLOR, backgroundColor.blue / MAX_COLOR, getBackgroundAlpha()); + int left = _bounds.left(); + int right = _bounds.right() + 1; + int top = _bounds.top(); + int bottom = _bounds.bottom() + 1; + glBegin(GL_QUADS); - glVertex2f(_bounds.left(), _bounds.top()); - glVertex2f(_bounds.right(), _bounds.top()); - glVertex2f(_bounds.right(), _bounds.bottom()); - glVertex2f(_bounds.left(), _bounds.bottom()); + glVertex2f(left, top); + glVertex2f(right, top); + glVertex2f(right, bottom); + glVertex2f(left, bottom); glEnd(); // Same font properties as textSize() diff --git a/libraries/animation/CMakeLists.txt b/libraries/animation/CMakeLists.txt index ee80db7567..4024205f81 100644 --- a/libraries/animation/CMakeLists.txt +++ b/libraries/animation/CMakeLists.txt @@ -5,5 +5,5 @@ setup_hifi_library(Network Script) link_hifi_libraries(shared gpu model fbx) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() \ No newline at end of file +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() \ No newline at end of file diff --git a/libraries/audio/CMakeLists.txt b/libraries/audio/CMakeLists.txt index 6ade1fc423..b08d9e88f4 100644 --- a/libraries/audio/CMakeLists.txt +++ b/libraries/audio/CMakeLists.txt @@ -7,5 +7,5 @@ include_glm() link_hifi_libraries(networking shared) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() \ No newline at end of file +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() \ No newline at end of file diff --git a/libraries/avatars/CMakeLists.txt b/libraries/avatars/CMakeLists.txt index 4c84c542ef..bacae45406 100644 --- a/libraries/avatars/CMakeLists.txt +++ b/libraries/avatars/CMakeLists.txt @@ -5,8 +5,7 @@ setup_hifi_library(Network Script) include_glm() -link_hifi_libraries(shared octree voxels gpu model fbx networking physics) -include_hifi_library_headers(gpu model fbx) +link_hifi_libraries(audio shared octree voxels networking physics gpu model fbx) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() diff --git a/libraries/embedded-webserver/CMakeLists.txt b/libraries/embedded-webserver/CMakeLists.txt index 6e4b92e217..ef2cf1054c 100644 --- a/libraries/embedded-webserver/CMakeLists.txt +++ b/libraries/embedded-webserver/CMakeLists.txt @@ -3,5 +3,5 @@ set(TARGET_NAME embedded-webserver) # use setup_hifi_library macro to setup our project and link appropriate Qt modules setup_hifi_library(Network) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() \ No newline at end of file +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() \ No newline at end of file diff --git a/libraries/entities-renderer/CMakeLists.txt b/libraries/entities-renderer/CMakeLists.txt index 1e77afe544..6d7f5ee960 100644 --- a/libraries/entities-renderer/CMakeLists.txt +++ b/libraries/entities-renderer/CMakeLists.txt @@ -5,7 +5,7 @@ setup_hifi_library(Widgets OpenGL Network Script) include_glm() -link_hifi_libraries(shared gpu script-engine) +link_hifi_libraries(shared gpu script-engine render-utils) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.cpp b/libraries/entities-renderer/src/EntityTreeRenderer.cpp index 7253b96480..9f1185cfb9 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.cpp +++ b/libraries/entities-renderer/src/EntityTreeRenderer.cpp @@ -62,6 +62,7 @@ EntityTreeRenderer::~EntityTreeRenderer() { } void EntityTreeRenderer::clear() { + leaveAllEntities(); foreach (const EntityItemID& entityID, _entityScripts.keys()) { checkAndCallUnload(entityID); } @@ -82,8 +83,7 @@ void EntityTreeRenderer::init() { // make sure our "last avatar position" is something other than our current position, so that on our // first chance, we'll check for enter/leave entity events. - glm::vec3 avatarPosition = _viewState->getAvatarPosition(); - _lastAvatarPosition = avatarPosition + glm::vec3(1.0f, 1.0f, 1.0f); + _lastAvatarPosition = _viewState->getAvatarPosition() + glm::vec3(1.0f, 1.0f, 1.0f); connect(entityTree, &EntityTree::deletingEntity, this, &EntityTreeRenderer::deletingEntity); connect(entityTree, &EntityTree::addingEntity, this, &EntityTreeRenderer::checkAndCallPreload); @@ -97,13 +97,15 @@ QScriptValue EntityTreeRenderer::loadEntityScript(const EntityItemID& entityItem } -QString EntityTreeRenderer::loadScriptContents(const QString& scriptMaybeURLorText) { +QString EntityTreeRenderer::loadScriptContents(const QString& scriptMaybeURLorText, bool& isURL) { QUrl url(scriptMaybeURLorText); // If the url is not valid, this must be script text... if (!url.isValid()) { + isURL = false; return scriptMaybeURLorText; } + isURL = true; QString scriptContents; // assume empty @@ -173,7 +175,8 @@ QScriptValue EntityTreeRenderer::loadEntityScript(EntityItem* entity) { return QScriptValue(); // no script } - QString scriptContents = loadScriptContents(entityScript); + bool isURL = false; // loadScriptContents() will tell us if this is a URL or just text. + QString scriptContents = loadScriptContents(entityScript, isURL); QScriptSyntaxCheckResult syntaxCheck = QScriptEngine::checkSyntax(scriptContents); if (syntaxCheck.state() != QScriptSyntaxCheckResult::Valid) { @@ -184,6 +187,9 @@ QScriptValue EntityTreeRenderer::loadEntityScript(EntityItem* entity) { return QScriptValue(); // invalid script } + if (isURL) { + _entitiesScriptEngine->setParentURL(entity->getScript()); + } QScriptValue entityScriptConstructor = _entitiesScriptEngine->evaluate(scriptContents); if (!entityScriptConstructor.isFunction()) { @@ -197,6 +203,10 @@ QScriptValue EntityTreeRenderer::loadEntityScript(EntityItem* entity) { EntityScriptDetails newDetails = { entityScript, entityScriptObject }; _entityScripts[entityID] = newDetails; + if (isURL) { + _entitiesScriptEngine->setParentURL(""); + } + return entityScriptObject; // newly constructed } @@ -287,6 +297,27 @@ void EntityTreeRenderer::checkEnterLeaveEntities() { } } +void EntityTreeRenderer::leaveAllEntities() { + if (_tree) { + _tree->lockForWrite(); // so that our scripts can do edits if they want + + // for all of our previous containing entities, if they are no longer containing then send them a leave event + foreach(const EntityItemID& entityID, _currentEntitiesInside) { + emit leaveEntity(entityID); + QScriptValueList entityArgs = createEntityArgs(entityID); + QScriptValue entityScript = loadEntityScript(entityID); + if (entityScript.property("leaveEntity").isValid()) { + entityScript.property("leaveEntity").call(entityScript, entityArgs); + } + } + _currentEntitiesInside.clear(); + + // make sure our "last avatar position" is something other than our current position, so that on our + // first chance, we'll check for enter/leave entity events. + _lastAvatarPosition = _viewState->getAvatarPosition() + glm::vec3(1.0f, 1.0f, 1.0f); + _tree->unlock(); + } +} void EntityTreeRenderer::render(RenderArgs::RenderMode renderMode, RenderArgs::RenderSide renderSide) { if (_tree) { Model::startScene(renderSide); diff --git a/libraries/entities-renderer/src/EntityTreeRenderer.h b/libraries/entities-renderer/src/EntityTreeRenderer.h index f23c5286c1..92cc2c4dcc 100644 --- a/libraries/entities-renderer/src/EntityTreeRenderer.h +++ b/libraries/entities-renderer/src/EntityTreeRenderer.h @@ -129,6 +129,7 @@ private: QScriptValueList createEntityArgs(const EntityItemID& entityID); void checkEnterLeaveEntities(); + void leaveAllEntities(); glm::vec3 _lastAvatarPosition; QVector _currentEntitiesInside; @@ -138,7 +139,7 @@ private: QScriptValue loadEntityScript(EntityItem* entity); QScriptValue loadEntityScript(const EntityItemID& entityItemID); QScriptValue getPreviouslyLoadedEntityScript(const EntityItemID& entityItemID); - QString loadScriptContents(const QString& scriptMaybeURLorText); + QString loadScriptContents(const QString& scriptMaybeURLorText, bool& isURL); QScriptValueList createMouseEventArgs(const EntityItemID& entityID, QMouseEvent* event, unsigned int deviceID); QScriptValueList createMouseEventArgs(const EntityItemID& entityID, const MouseEvent& mouseEvent); diff --git a/libraries/entities/CMakeLists.txt b/libraries/entities/CMakeLists.txt index b266050e69..21afff496f 100644 --- a/libraries/entities/CMakeLists.txt +++ b/libraries/entities/CMakeLists.txt @@ -5,7 +5,7 @@ setup_hifi_library(Network Script) include_glm() -link_hifi_libraries(shared octree gpu model fbx networking animation physics) +link_hifi_libraries(avatars shared octree gpu model fbx networking animation physics) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() diff --git a/libraries/fbx/CMakeLists.txt b/libraries/fbx/CMakeLists.txt index fe460c93b5..15d2bbdab6 100644 --- a/libraries/fbx/CMakeLists.txt +++ b/libraries/fbx/CMakeLists.txt @@ -11,5 +11,5 @@ find_package(ZLIB REQUIRED) include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}") target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES}) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() diff --git a/libraries/gpu/CMakeLists.txt b/libraries/gpu/CMakeLists.txt index 340adcc9e6..7f2b475dd2 100644 --- a/libraries/gpu/CMakeLists.txt +++ b/libraries/gpu/CMakeLists.txt @@ -19,7 +19,7 @@ elseif (WIN32) # we're using static GLEW, so define GLEW_STATIC add_definitions(-DGLEW_STATIC) - target_link_libraries(${TARGET_NAME} "${GLEW_LIBRARIES}" opengl32.lib) + target_link_libraries(${TARGET_NAME} ${GLEW_LIBRARIES} opengl32.lib) # need to bubble up the GLEW_INCLUDE_DIRS list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${GLEW_INCLUDE_DIRS}") @@ -44,5 +44,5 @@ else () list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${OPENGL_INCLUDE_DIR}") endif (APPLE) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() diff --git a/libraries/metavoxels/CMakeLists.txt b/libraries/metavoxels/CMakeLists.txt index aab8d2184d..4ead36e51a 100644 --- a/libraries/metavoxels/CMakeLists.txt +++ b/libraries/metavoxels/CMakeLists.txt @@ -10,5 +10,5 @@ link_hifi_libraries(shared networking) include_glm() -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() \ No newline at end of file +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() \ No newline at end of file diff --git a/libraries/model/CMakeLists.txt b/libraries/model/CMakeLists.txt index d9fd4b67a7..309f6c3e6d 100755 --- a/libraries/model/CMakeLists.txt +++ b/libraries/model/CMakeLists.txt @@ -8,4 +8,4 @@ include_glm() link_hifi_libraries(shared gpu) # call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() +include_dependency_includes() diff --git a/libraries/networking/CMakeLists.txt b/libraries/networking/CMakeLists.txt index 934e3e69b9..bc251a42d4 100644 --- a/libraries/networking/CMakeLists.txt +++ b/libraries/networking/CMakeLists.txt @@ -28,5 +28,5 @@ target_link_libraries(${TARGET_NAME} ${OPENSSL_LIBRARIES} ${TBB_LIBRARIES}) # append libcuckoo includes to our list of includes to bubble list(APPEND ${TARGET_NAME}_DEPENDENCY_INCLUDES "${TBB_INCLUDE_DIRS}") -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() \ No newline at end of file +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() \ No newline at end of file diff --git a/libraries/octree/CMakeLists.txt b/libraries/octree/CMakeLists.txt index e8c6554ff4..cd90857637 100644 --- a/libraries/octree/CMakeLists.txt +++ b/libraries/octree/CMakeLists.txt @@ -15,5 +15,5 @@ include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}") # append ZLIB and OpenSSL to our list of libraries to link target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES}) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() diff --git a/libraries/physics/CMakeLists.txt b/libraries/physics/CMakeLists.txt index 5270f08730..4f74038ff5 100644 --- a/libraries/physics/CMakeLists.txt +++ b/libraries/physics/CMakeLists.txt @@ -15,5 +15,5 @@ link_hifi_libraries(shared) ## append BULLET to our list of libraries to link #list(APPEND ${TARGET_NAME}_LIBRARIES_TO_LINK "${BULLET_LIBRARIES}") -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() diff --git a/libraries/render-utils/CMakeLists.txt b/libraries/render-utils/CMakeLists.txt index a6943addcc..97dc9c7bc8 100644 --- a/libraries/render-utils/CMakeLists.txt +++ b/libraries/render-utils/CMakeLists.txt @@ -5,12 +5,7 @@ setup_hifi_library(Widgets OpenGL Network Script) include_glm() -link_hifi_libraries(shared gpu) +link_hifi_libraries(animation fbx shared gpu) -if (WIN32) - find_package(GLUT REQUIRED) - include_directories(SYSTEM "${GLUT_INCLUDE_DIRS}") -endif () - -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() diff --git a/libraries/script-engine/CMakeLists.txt b/libraries/script-engine/CMakeLists.txt index d5c5aac39a..84aca5d2bb 100644 --- a/libraries/script-engine/CMakeLists.txt +++ b/libraries/script-engine/CMakeLists.txt @@ -5,7 +5,7 @@ setup_hifi_library(Gui Network Script Widgets) include_glm() -link_hifi_libraries(shared octree voxels gpu model fbx entities animation audio physics) +link_hifi_libraries(shared octree voxels gpu model fbx entities animation audio physics metavoxels) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() +# call macro to include our dependency includes and bubble them up via a property on our target +gpu model () diff --git a/libraries/script-engine/src/ScriptEngine.cpp b/libraries/script-engine/src/ScriptEngine.cpp index 7cd6ea07ee..ac6291469e 100644 --- a/libraries/script-engine/src/ScriptEngine.cpp +++ b/libraries/script-engine/src/ScriptEngine.cpp @@ -601,16 +601,20 @@ void ScriptEngine::stopTimer(QTimer *timer) { } QUrl ScriptEngine::resolvePath(const QString& include) const { - // first lets check to see if it's already a full URL QUrl url(include); + // first lets check to see if it's already a full URL if (!url.scheme().isEmpty()) { return url; } // we apparently weren't a fully qualified url, so, let's assume we're relative // to the original URL of our script - QUrl parentURL(_fileNameString); - + QUrl parentURL; + if (_parentURL.isEmpty()) { + parentURL = QUrl(_fileNameString); + } else { + parentURL = QUrl(_parentURL); + } // if the parent URL's scheme is empty, then this is probably a local file... if (parentURL.scheme().isEmpty()) { parentURL = QUrl::fromLocalFile(_fileNameString); @@ -643,6 +647,7 @@ void ScriptEngine::include(const QString& includeFile) { #else QString fileName = url.toLocalFile(); #endif + QFile scriptFile(fileName); if (scriptFile.open(QFile::ReadOnly | QFile::Text)) { qDebug() << "Including file:" << fileName; diff --git a/libraries/script-engine/src/ScriptEngine.h b/libraries/script-engine/src/ScriptEngine.h index 3b074d7c73..7474ac8725 100644 --- a/libraries/script-engine/src/ScriptEngine.h +++ b/libraries/script-engine/src/ScriptEngine.h @@ -89,6 +89,8 @@ public: void setUserLoaded(bool isUserLoaded) { _isUserLoaded = isUserLoaded; } bool isUserLoaded() const { return _isUserLoaded; } + void setParentURL(const QString& parentURL) { _parentURL = parentURL; } + public slots: void loadURL(const QUrl& scriptURL); void stop(); @@ -120,6 +122,7 @@ signals: protected: QString _scriptContents; + QString _parentURL; bool _isFinished; bool _isRunning; bool _isInitialized; diff --git a/libraries/shared/CMakeLists.txt b/libraries/shared/CMakeLists.txt index 17ccbdc6ce..4b271bfeda 100644 --- a/libraries/shared/CMakeLists.txt +++ b/libraries/shared/CMakeLists.txt @@ -1,7 +1,8 @@ set(TARGET_NAME shared) # use setup_hifi_library macro to setup our project and link appropriate Qt modules -setup_hifi_library(Network Widgets) +# TODO: there isn't really a good reason to have Script linked here - let's get what is requiring it out (RegisteredMetaTypes.cpp) +setup_hifi_library(Network Script Widgets) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() \ No newline at end of file +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() \ No newline at end of file diff --git a/libraries/shared/src/StreamUtils.cpp b/libraries/shared/src/StreamUtils.cpp index 85b800efbe..47bb8dd4e4 100644 --- a/libraries/shared/src/StreamUtils.cpp +++ b/libraries/shared/src/StreamUtils.cpp @@ -98,6 +98,14 @@ std::ostream& operator<<(std::ostream& s, const CapsuleShape& capsule) { #ifndef QT_NO_DEBUG_STREAM #include +QDebug& operator<<(QDebug& dbg, const glm::vec2& v) { + dbg.nospace() << "{type='glm::vec2'" + ", x=" << v.x << + ", y=" << v.y << + "}"; + return dbg; +} + QDebug& operator<<(QDebug& dbg, const glm::vec3& v) { dbg.nospace() << "{type='glm::vec3'" ", x=" << v.x << diff --git a/libraries/shared/src/StreamUtils.h b/libraries/shared/src/StreamUtils.h index 6d00c0e354..d176d68e45 100644 --- a/libraries/shared/src/StreamUtils.h +++ b/libraries/shared/src/StreamUtils.h @@ -49,6 +49,7 @@ std::ostream& operator<<(std::ostream& s, const CapsuleShape& capsule); #ifndef QT_NO_DEBUG_STREAM class QDebug; // Add support for writing these to qDebug(). +QDebug& operator<<(QDebug& s, const glm::vec2& v); QDebug& operator<<(QDebug& s, const glm::vec3& v); QDebug& operator<<(QDebug& s, const glm::quat& q); QDebug& operator<<(QDebug& s, const glm::mat4& m); diff --git a/libraries/voxels/CMakeLists.txt b/libraries/voxels/CMakeLists.txt index 7980094884..75b5143321 100644 --- a/libraries/voxels/CMakeLists.txt +++ b/libraries/voxels/CMakeLists.txt @@ -14,5 +14,5 @@ include_directories(SYSTEM "${ZLIB_INCLUDE_DIRS}") # add it to our list of libraries to link target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES}) -# call macro to link our dependencies and bubble them up via a property on our target -link_shared_dependencies() \ No newline at end of file +# call macro to include our dependency includes and bubble them up via a property on our target +include_dependency_includes() \ No newline at end of file diff --git a/tests/audio/CMakeLists.txt b/tests/audio/CMakeLists.txt index 974b4dcd09..fb6b9c2e11 100644 --- a/tests/audio/CMakeLists.txt +++ b/tests/audio/CMakeLists.txt @@ -7,4 +7,4 @@ include_glm() # link in the shared libraries link_hifi_libraries(shared audio networking) -link_shared_dependencies() \ No newline at end of file +include_dependency_includes() \ No newline at end of file diff --git a/tests/jitter/CMakeLists.txt b/tests/jitter/CMakeLists.txt index d0b366e7ef..93f7caefdd 100644 --- a/tests/jitter/CMakeLists.txt +++ b/tests/jitter/CMakeLists.txt @@ -5,4 +5,4 @@ setup_hifi_project() # link in the shared libraries link_hifi_libraries(shared networking) -link_shared_dependencies() \ No newline at end of file +include_dependency_includes() \ No newline at end of file diff --git a/tests/metavoxels/CMakeLists.txt b/tests/metavoxels/CMakeLists.txt index 732c974f95..7524c5c87c 100644 --- a/tests/metavoxels/CMakeLists.txt +++ b/tests/metavoxels/CMakeLists.txt @@ -9,4 +9,4 @@ setup_hifi_project(Network Script Widgets) # link in the shared libraries link_hifi_libraries(metavoxels networking shared) -link_shared_dependencies() \ No newline at end of file +include_dependency_includes() \ No newline at end of file diff --git a/tests/networking/CMakeLists.txt b/tests/networking/CMakeLists.txt index a7293226b3..113a75ab50 100644 --- a/tests/networking/CMakeLists.txt +++ b/tests/networking/CMakeLists.txt @@ -5,4 +5,4 @@ setup_hifi_project() # link in the shared libraries link_hifi_libraries(shared networking) -link_shared_dependencies() \ No newline at end of file +include_dependency_includes() \ No newline at end of file diff --git a/tests/octree/CMakeLists.txt b/tests/octree/CMakeLists.txt index d4ca79fa1c..5a025a3a0e 100644 --- a/tests/octree/CMakeLists.txt +++ b/tests/octree/CMakeLists.txt @@ -7,4 +7,4 @@ include_glm() # link in the shared libraries link_hifi_libraries(shared octree voxels gpu model fbx metavoxels networking entities avatars audio animation script-engine physics) -link_shared_dependencies() +include_dependency_includes() diff --git a/tests/physics/CMakeLists.txt b/tests/physics/CMakeLists.txt index d47b979459..31c741eecf 100644 --- a/tests/physics/CMakeLists.txt +++ b/tests/physics/CMakeLists.txt @@ -7,4 +7,4 @@ include_glm() # link in the shared libraries link_hifi_libraries(shared physics) -link_shared_dependencies() +include_dependency_includes() diff --git a/tests/shared/CMakeLists.txt b/tests/shared/CMakeLists.txt index fe3843e9eb..f067fa52b5 100644 --- a/tests/shared/CMakeLists.txt +++ b/tests/shared/CMakeLists.txt @@ -7,4 +7,4 @@ include_glm() # link in the shared libraries link_hifi_libraries(shared) -link_shared_dependencies() \ No newline at end of file +include_dependency_includes() \ No newline at end of file diff --git a/tools/bitstream2json/CMakeLists.txt b/tools/bitstream2json/CMakeLists.txt index bc23a1e193..2e8bb213be 100644 --- a/tools/bitstream2json/CMakeLists.txt +++ b/tools/bitstream2json/CMakeLists.txt @@ -5,4 +5,4 @@ include_glm() link_hifi_libraries(metavoxels) -link_shared_dependencies() \ No newline at end of file +include_dependency_includes() \ No newline at end of file diff --git a/tools/json2bitstream/CMakeLists.txt b/tools/json2bitstream/CMakeLists.txt index 91b56c18fd..283d450e11 100644 --- a/tools/json2bitstream/CMakeLists.txt +++ b/tools/json2bitstream/CMakeLists.txt @@ -5,4 +5,4 @@ include_glm() link_hifi_libraries(metavoxels) -link_shared_dependencies() \ No newline at end of file +include_dependency_includes() \ No newline at end of file diff --git a/tools/mtc/CMakeLists.txt b/tools/mtc/CMakeLists.txt index 4dfa8421ff..06b9f86d06 100644 --- a/tools/mtc/CMakeLists.txt +++ b/tools/mtc/CMakeLists.txt @@ -1,4 +1,4 @@ set(TARGET_NAME mtc) setup_hifi_project() -link_shared_dependencies() \ No newline at end of file +include_dependency_includes() \ No newline at end of file