diff --git a/interface/CMakeLists.txt b/interface/CMakeLists.txt index 32e75c9f34..a0a9033187 100644 --- a/interface/CMakeLists.txt +++ b/interface/CMakeLists.txt @@ -161,7 +161,7 @@ if (VISAGE_FOUND AND NOT DISABLE_VISAGE) SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-comment -isystem ${VISAGE_INCLUDE_DIRS}") find_library(AVFoundation AVFoundation) find_library(CoreMedia CoreMedia) - find_library(NEW_STD_LIBRARY libc++abi.dylib /usr/lib/) + find_library(NEW_STD_LIBRARY libc++.dylib /usr/lib/) target_link_libraries(${TARGET_NAME} ${AVFoundation} ${CoreMedia} ${NEW_STD_LIBRARY}) endif (APPLE) target_link_libraries(${TARGET_NAME} ${VISAGE_LIBRARIES}) diff --git a/interface/src/devices/Visage.cpp b/interface/src/devices/Visage.cpp index 26e7993ecb..c3dfeab6b2 100644 --- a/interface/src/devices/Visage.cpp +++ b/interface/src/devices/Visage.cpp @@ -30,12 +30,14 @@ using namespace VisageSDK; const glm::vec3 DEFAULT_HEAD_ORIGIN(0.0f, 0.0f, 0.7f); Visage::Visage() : +#ifdef HAVE_VISAGE + _leftInnerBrowIndex(0), + _rightInnerBrowIndex(0), +#endif _active(false), _headOrigin(DEFAULT_HEAD_ORIGIN), _estimatedEyePitch(0.0f), - _estimatedEyeYaw(0.0f), - _leftInnerBrowIndex(0), - _rightInnerBrowIndex(0) { + _estimatedEyeYaw(0.0f) { #ifdef HAVE_VISAGE switchToResourcesParentIfRequired(); @@ -62,6 +64,7 @@ Visage::~Visage() { #endif } +#ifdef HAVE_VISAGE static int leftEyeBlinkIndex = 0; static int rightEyeBlinkIndex = 1; static int centerBrowIndex = 16; @@ -74,14 +77,12 @@ static QHash createBlendshapeIndices() { blendshapeMap.insert("JawOpen", "au_jaw_drop"); blendshapeMap.insert("LipsLowerDown", "au_lower_lip_drop"); blendshapeMap.insert("LipsUpperUp", "au_upper_lip_raiser"); - blendshapeMap.insert("LipsStretch_L", "au_lip_stretcher_left"); - blendshapeMap.insert("BrowsU_L", "au_left_outer_brow_raiser"); - blendshapeMap.insert("BrowsU_C", "au_left_inner_brow_raiser"); - blendshapeMap.insert("BrowsD_L", "au_left_brow_lowerer"); - blendshapeMap.insert("LipsStretch_R", "au_lip_stretcher_right"); - blendshapeMap.insert("BrowsU_R", "au_right_outer_brow_raiser"); - blendshapeMap.insert("BrowsU_C", "au_right_inner_brow_raiser"); - blendshapeMap.insert("BrowsD_R", "au_right_brow_lowerer"); + blendshapeMap.insert("LipsStretch_R", "au_lip_stretcher_left"); + blendshapeMap.insert("BrowsU_R", "au_left_outer_brow_raiser"); + blendshapeMap.insert("BrowsD_R", "au_left_brow_lowerer"); + blendshapeMap.insert("LipsStretch_L", "au_lip_stretcher_right"); + blendshapeMap.insert("BrowsU_L", "au_right_outer_brow_raiser"); + blendshapeMap.insert("BrowsD_L", "au_right_brow_lowerer"); QHash blendshapeIndices; for (int i = 0;; i++) { @@ -111,6 +112,7 @@ static const QHash& getBlendshapeIndices() { static QHash blendshapeIndices = createBlendshapeIndices(); return blendshapeIndices; } +#endif const float TRANSLATION_SCALE = 20.0f; diff --git a/interface/src/devices/Visage.h b/interface/src/devices/Visage.h index 124ef29e3b..a5c826d1bf 100644 --- a/interface/src/devices/Visage.h +++ b/interface/src/devices/Visage.h @@ -42,9 +42,14 @@ public: void reset(); private: - + +#ifdef HAVE_VISAGE VisageSDK::VisageTracker2* _tracker; VisageSDK::FaceData* _data; + int _leftInnerBrowIndex; + int _rightInnerBrowIndex; + QVector _blendshapeIndices; +#endif bool _active; glm::quat _headRotation; @@ -56,10 +61,6 @@ private: float _estimatedEyeYaw; std::vector _blendshapeCoefficients; - - QVector _blendshapeIndices; - int _leftInnerBrowIndex; - int _rightInnerBrowIndex; }; #endif /* defined(__interface__Visage__) */ diff --git a/interface/src/renderer/Model.cpp b/interface/src/renderer/Model.cpp index 48e1d0f70c..f1916db4d1 100644 --- a/interface/src/renderer/Model.cpp +++ b/interface/src/renderer/Model.cpp @@ -421,6 +421,7 @@ void Model::setURL(const QUrl& url, const QUrl& fallback) { _dilatedTextures.clear(); _lodHysteresis = NetworkGeometry::NO_HYSTERESIS; + // we retain a reference to the base geometry so that its reference count doesn't fall to zero _baseGeometry = _geometry = Application::getInstance()->getGeometryCache()->getGeometry(url, fallback); } diff --git a/interface/src/renderer/Model.h b/interface/src/renderer/Model.h index 1d1cdc22a7..28189d0379 100644 --- a/interface/src/renderer/Model.h +++ b/interface/src/renderer/Model.h @@ -227,7 +227,7 @@ private: void deleteGeometry(); void renderMeshes(float alpha, bool translucent); - QSharedPointer _baseGeometry; + QSharedPointer _baseGeometry; ///< reference required to prevent collection of base float _lodHysteresis; float _pupilDilation;