├── externals ├── glm │ ├── gtx │ │ ├── vec1.inl │ │ ├── ocl_type.inl │ │ ├── simd_vec4.hpp │ │ ├── std_based_type.inl │ │ ├── number_precision.inl │ │ ├── unsigned_int.inl │ │ ├── raw_data.inl │ │ ├── perpendicular.inl │ │ ├── projection.inl │ │ ├── int_10_10_10_2.inl │ │ ├── normal.inl │ │ ├── mixed_product.inl │ │ ├── log_base.inl │ │ ├── noise.inl │ │ ├── handed_coordinate_space.inl │ │ ├── orthonormalize.inl │ │ ├── matrix_cross_product.inl │ │ ├── vector_access.inl │ │ ├── closest_point.inl │ │ ├── polar_coordinates.inl │ │ ├── unsigned_int.hpp │ │ ├── extend.inl │ │ ├── gradient_paint.inl │ │ ├── optimum_pow.inl │ │ └── vector_angle.inl │ ├── core │ │ ├── func_common.hpp │ │ ├── func_common.inl │ │ ├── type_half.inl │ │ ├── func_integer.hpp │ │ ├── type_mat.inl │ │ ├── type_vec.inl │ │ ├── intrinsic_exponential.inl │ │ └── intrinsic_trigonometric.inl │ └── gtc │ │ └── type_precision.inl └── stk │ ├── lib │ ├── UNIX │ │ └── libstk.a │ └── MacOS │ │ └── libstk.a │ └── include │ ├── Function.h │ ├── WvIn.h │ ├── Vector3D.h │ └── Generator.h ├── LICENSE ├── interface ├── interface.icns ├── resources │ ├── images │ │ └── iris.png │ ├── info │ │ └── ApplicationInfo.ini │ └── shaders │ │ ├── ambient_occlusion.vert │ │ ├── face.frag │ │ ├── glow_add.frag │ │ ├── glow_add_separate.frag │ │ ├── perlin_modulate.vert │ │ ├── occlusion_blur.frag │ │ ├── iris.frag │ │ ├── diffuse.frag │ │ ├── horizontal_blur.frag │ │ ├── vertical_blur.frag │ │ ├── face.vert │ │ ├── skin_voxels.vert │ │ ├── face_textured.vert │ │ ├── iris.vert │ │ └── vertical_blur_add.frag ├── external │ ├── LibOVR │ │ ├── Lib │ │ │ ├── MacOS │ │ │ │ └── libovr.a │ │ │ ├── Win32 │ │ │ │ └── libovr.lib │ │ │ └── x64 │ │ │ │ └── libovr64.lib │ │ ├── Include │ │ │ ├── OVRVersion.h │ │ │ └── OVR.h │ │ └── Src │ │ │ ├── OVR_Win32_SensorDevice.h │ │ │ ├── OVR_HIDDeviceBase.h │ │ │ ├── OVR_DeviceConstants.h │ │ │ └── Kernel │ │ │ └── OVR_Color.h │ ├── LibVPX │ │ ├── lib │ │ │ ├── MacOS │ │ │ │ └── libvpx.a │ │ │ └── UNIX │ │ │ │ └── libvpx.a │ │ ├── include │ │ │ ├── vpx_codec_impl_bottom.h │ │ │ ├── vpx_codec_impl_top.h │ │ │ └── vpx_integer.h │ │ ├── PATENTS │ │ └── LICENSE │ ├── glut │ │ ├── Release │ │ │ ├── freeglut.lib │ │ │ ├── glew32.lib │ │ │ ├── lodepng.lib │ │ │ ├── lodepngd.lib │ │ │ └── pthread_lib.lib │ │ └── include │ │ │ └── GL │ │ │ ├── glut.h │ │ │ └── freeglut.h │ ├── OpenCV │ │ ├── lib │ │ │ ├── UNIX │ │ │ │ ├── libopencv_ml.a │ │ │ │ ├── libopencv_core.a │ │ │ │ ├── libopencv_calib3d.a │ │ │ │ ├── libopencv_contrib.a │ │ │ │ ├── libopencv_flann.a │ │ │ │ ├── libopencv_highgui.a │ │ │ │ ├── libopencv_imgproc.a │ │ │ │ ├── libopencv_photo.a │ │ │ │ ├── libopencv_video.a │ │ │ │ ├── libopencv_objdetect.a │ │ │ │ └── libopencv_features2d.a │ │ │ └── MacOS │ │ │ │ ├── libopencv_ml.a │ │ │ │ ├── libopencv_core.a │ │ │ │ ├── libopencv_flann.a │ │ │ │ ├── libopencv_photo.a │ │ │ │ ├── libopencv_video.a │ │ │ │ ├── libopencv_calib3d.a │ │ │ │ ├── libopencv_contrib.a │ │ │ │ ├── libopencv_highgui.a │ │ │ │ ├── libopencv_imgproc.a │ │ │ │ ├── libopencv_features2d.a │ │ │ │ └── libopencv_objdetect.a │ │ └── include │ │ │ └── opencv2 │ │ │ └── flann │ │ │ └── dummy.h │ ├── quazip │ │ ├── lib │ │ │ └── MacOS │ │ │ │ └── libquazip.a │ │ └── include │ │ │ ├── quacrc32.h │ │ │ ├── quaadler32.h │ │ │ └── quachecksum32.h │ ├── PortAudio │ │ └── lib │ │ │ ├── MacOS │ │ │ └── libportaudio.a │ │ │ └── UNIX │ │ │ └── libportaudio.a │ ├── faceshift │ │ ├── lib │ │ │ ├── MacOS │ │ │ │ └── libfaceshift.a │ │ │ └── UNIX │ │ │ │ └── libfaceshift.a │ │ └── CMakeLists.txt │ ├── MotionDriver │ │ ├── lib │ │ │ ├── MacOS │ │ │ │ └── libMotionDriver.a │ │ │ └── UNIX │ │ │ │ └── libMotionDriver.a │ │ ├── CMakeLists.txt │ │ └── include │ │ │ └── inv_tty.h │ ├── UVCCameraControl │ │ ├── lib │ │ │ └── libUVCCameraControl.a │ │ └── include │ │ │ └── UVCCameraControl.hpp │ ├── fervor │ │ ├── fvplatform.h │ │ ├── fvignoredversions.h │ │ ├── fvupdatedownloadprogress.h │ │ ├── fvupdatedownloadprogress.cpp │ │ ├── fvversioncomparator.h │ │ ├── fvupdatewindow.h │ │ ├── CMakeLists.txt │ │ └── fvavailableupdate.h │ └── Leap │ │ ├── stubs │ │ └── include │ │ │ └── Leap.h │ │ └── readme.txt ├── src │ ├── starfield │ │ ├── CMakeLists.txt │ │ ├── data │ │ │ ├── Tile.h │ │ │ ├── GpuVertex.h │ │ │ └── InputVertex.h │ │ └── renderer │ │ │ └── VertexOrder.h │ ├── Physics.h │ ├── world.h │ ├── renderer │ │ ├── RenderUtil.h │ │ ├── ProgramObject.cpp │ │ ├── RenderUtil.cpp │ │ ├── ProgramObject.h │ │ ├── GeometryCache.h │ │ ├── AmbientOcclusionEffect.h │ │ └── FBXReader.h │ ├── PairingHandler.h │ ├── InfoView.h │ ├── ui │ │ ├── ChatEntry.h │ │ ├── VoxelStatsDialog.h │ │ └── BandwidthDialog.h │ ├── Balls.h │ ├── ToolsPalette.h │ ├── VoxelPacketProcessor.h │ ├── avatar │ │ ├── HandControl.h │ │ └── BlendFace.h │ ├── devices │ │ ├── OculusManager.h │ │ ├── LeapManager.h │ │ └── Transmitter.h │ ├── GLCanvas.h │ ├── VoxelImporter.h │ ├── VoxelFade.h │ ├── Swatch.h │ ├── main.cpp │ ├── Tool.cpp │ ├── PieMenu.h │ ├── Physics.cpp │ ├── ImportDialog.h │ ├── Tool.h │ └── Stars.cpp └── InterfaceConfig.h.in ├── tools ├── samples │ ├── cube1.hio │ ├── single.hio │ ├── small.hio │ ├── simple1.hio │ └── oneRedVoxel.hio └── README.md ├── eve ├── resources │ └── audio │ │ └── eve.raw └── CMakeLists.txt ├── domain-server ├── resources │ └── web │ │ ├── index.html │ │ └── assignment │ │ ├── placeholder.js │ │ ├── index.shtml │ │ └── js │ │ └── assignment.js └── CMakeLists.txt ├── space-server ├── example.data.txt ├── CMakeLists.txt └── src │ ├── TreeNode.cpp │ └── TreeNode.h ├── cmake ├── macros │ ├── IncludeGLM.cmake │ ├── SetupHifiLibrary.cmake │ ├── LinkHifiLibrary.cmake │ └── SetupHifiProject.cmake └── modules │ ├── FindSTK.cmake │ ├── FindQuazip.cmake │ ├── FindOpenNI.cmake │ ├── FindLibOVR.cmake │ ├── FindPortAudio.cmake │ ├── FindLibVPX.cmake │ └── FindFaceshift.cmake ├── libraries ├── shared │ ├── src │ │ ├── Systime.cpp │ │ ├── NodeData.cpp │ │ ├── Syssocket.h │ │ ├── StdDev.h │ │ ├── NodeData.h │ │ ├── Systime.h │ │ ├── SimpleMovingAverage.h │ │ ├── NodeTypes.h │ │ ├── StdDev.cpp │ │ ├── ReceivedPacketProcessor.cpp │ │ └── SimpleMovingAverage.cpp │ └── CMakeLists.txt ├── voxels │ ├── src │ │ ├── SceneUtils.h │ │ ├── Plane.h │ │ ├── JurisdictionSender.h │ │ └── VoxelNodeBag.h │ └── CMakeLists.txt ├── audio │ ├── CMakeLists.txt │ └── src │ │ ├── InjectedAudioRingBuffer.h │ │ ├── AudioInjectionManager.h │ │ └── InjectedAudioRingBuffer.cpp ├── voxel-server-library │ ├── src │ │ ├── NodeWatcher.h │ │ ├── NodeWatcher.cpp │ │ ├── VoxelPersistThread.h │ │ ├── VoxelServerConsts.h │ │ ├── VoxelPersistThread.cpp │ │ ├── VoxelServerPacketProcessor.h │ │ └── VoxelSendThread.h │ └── CMakeLists.txt └── avatars │ ├── CMakeLists.txt │ └── src │ └── HeadData.cpp ├── pairing-server └── CMakeLists.txt ├── assignment-client ├── src │ ├── AssignmentFactory.h │ ├── voxels │ │ ├── VoxelScriptingInterface.cpp │ │ └── VoxelScriptingInterface.h │ ├── Agent.h │ ├── avatars │ │ └── AvatarMixer.h │ ├── audio │ │ ├── AudioMixer.h │ │ ├── AvatarAudioRingBuffer.cpp │ │ └── AvatarAudioRingBuffer.h │ └── AssignmentFactory.cpp └── CMakeLists.txt ├── .gitignore ├── injector └── CMakeLists.txt ├── voxel-edit └── CMakeLists.txt ├── animation-server └── CMakeLists.txt └── CMakeLists.txt /externals/glm/gtx/vec1.inl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /externals/glm/gtx/ocl_type.inl: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | All rights reserved. © High Fidelity, Inc. 2013 -------------------------------------------------------------------------------- /interface/interface.icns: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/interface.icns -------------------------------------------------------------------------------- /tools/samples/cube1.hio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/tools/samples/cube1.hio -------------------------------------------------------------------------------- /tools/samples/single.hio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/tools/samples/single.hio -------------------------------------------------------------------------------- /tools/samples/small.hio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/tools/samples/small.hio -------------------------------------------------------------------------------- /tools/samples/simple1.hio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/tools/samples/simple1.hio -------------------------------------------------------------------------------- /eve/resources/audio/eve.raw: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/eve/resources/audio/eve.raw -------------------------------------------------------------------------------- /tools/samples/oneRedVoxel.hio: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/tools/samples/oneRedVoxel.hio -------------------------------------------------------------------------------- /domain-server/resources/web/index.html: -------------------------------------------------------------------------------- 1 | If you can see this, your domain-server is alive and kicking. Go explore! -------------------------------------------------------------------------------- /externals/glm/gtx/simd_vec4.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/externals/glm/gtx/simd_vec4.hpp -------------------------------------------------------------------------------- /externals/stk/lib/UNIX/libstk.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/externals/stk/lib/UNIX/libstk.a -------------------------------------------------------------------------------- /externals/glm/core/func_common.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/externals/glm/core/func_common.hpp -------------------------------------------------------------------------------- /externals/glm/core/func_common.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/externals/glm/core/func_common.inl -------------------------------------------------------------------------------- /externals/glm/core/type_half.inl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/externals/glm/core/type_half.inl -------------------------------------------------------------------------------- /externals/stk/lib/MacOS/libstk.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/externals/stk/lib/MacOS/libstk.a -------------------------------------------------------------------------------- /externals/glm/core/func_integer.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/externals/glm/core/func_integer.hpp -------------------------------------------------------------------------------- /interface/resources/images/iris.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/resources/images/iris.png -------------------------------------------------------------------------------- /interface/external/LibOVR/Lib/MacOS/libovr.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/LibOVR/Lib/MacOS/libovr.a -------------------------------------------------------------------------------- /interface/external/LibVPX/lib/MacOS/libvpx.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/LibVPX/lib/MacOS/libvpx.a -------------------------------------------------------------------------------- /interface/external/LibVPX/lib/UNIX/libvpx.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/LibVPX/lib/UNIX/libvpx.a -------------------------------------------------------------------------------- /interface/external/glut/Release/freeglut.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/glut/Release/freeglut.lib -------------------------------------------------------------------------------- /interface/external/glut/Release/glew32.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/glut/Release/glew32.lib -------------------------------------------------------------------------------- /interface/external/glut/Release/lodepng.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/glut/Release/lodepng.lib -------------------------------------------------------------------------------- /interface/external/glut/Release/lodepngd.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/glut/Release/lodepngd.lib -------------------------------------------------------------------------------- /interface/external/LibOVR/Lib/Win32/libovr.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/LibOVR/Lib/Win32/libovr.lib -------------------------------------------------------------------------------- /interface/external/LibOVR/Lib/x64/libovr64.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/LibOVR/Lib/x64/libovr64.lib -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_ml.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_ml.a -------------------------------------------------------------------------------- /interface/external/glut/Release/pthread_lib.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/glut/Release/pthread_lib.lib -------------------------------------------------------------------------------- /interface/external/quazip/lib/MacOS/libquazip.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/quazip/lib/MacOS/libquazip.a -------------------------------------------------------------------------------- /space-server/example.data.txt: -------------------------------------------------------------------------------- 1 | 0 00000100001011101110 domain4.highfidelity.co domain4 2 | 0 00000100110100010001 domain3.highfidelity.co domain3 3 | -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_ml.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_ml.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_core.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_core.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_core.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_core.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_flann.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_flann.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_photo.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_photo.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_video.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_video.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_calib3d.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_calib3d.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_contrib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_contrib.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_flann.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_flann.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_highgui.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_highgui.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_imgproc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_imgproc.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_photo.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_photo.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_video.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_video.a -------------------------------------------------------------------------------- /interface/external/PortAudio/lib/MacOS/libportaudio.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/PortAudio/lib/MacOS/libportaudio.a -------------------------------------------------------------------------------- /interface/external/PortAudio/lib/UNIX/libportaudio.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/PortAudio/lib/UNIX/libportaudio.a -------------------------------------------------------------------------------- /interface/external/faceshift/lib/MacOS/libfaceshift.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/faceshift/lib/MacOS/libfaceshift.a -------------------------------------------------------------------------------- /interface/external/faceshift/lib/UNIX/libfaceshift.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/faceshift/lib/UNIX/libfaceshift.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_calib3d.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_calib3d.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_contrib.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_contrib.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_highgui.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_highgui.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_imgproc.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_imgproc.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_objdetect.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_objdetect.a -------------------------------------------------------------------------------- /interface/resources/info/ApplicationInfo.ini: -------------------------------------------------------------------------------- 1 | [INFO] 2 | name=Interface 3 | version=0.0.1 4 | organizationName=High Fidelity 5 | organizationDomain=highfidelity.io -------------------------------------------------------------------------------- /interface/external/MotionDriver/lib/MacOS/libMotionDriver.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/MotionDriver/lib/MacOS/libMotionDriver.a -------------------------------------------------------------------------------- /interface/external/MotionDriver/lib/UNIX/libMotionDriver.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/MotionDriver/lib/UNIX/libMotionDriver.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_features2d.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_features2d.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/MacOS/libopencv_objdetect.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/MacOS/libopencv_objdetect.a -------------------------------------------------------------------------------- /interface/external/OpenCV/lib/UNIX/libopencv_features2d.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/OpenCV/lib/UNIX/libopencv_features2d.a -------------------------------------------------------------------------------- /interface/external/UVCCameraControl/lib/libUVCCameraControl.a: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/problem/hifi/master/interface/external/UVCCameraControl/lib/libUVCCameraControl.a -------------------------------------------------------------------------------- /interface/src/starfield/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | 2 | project(starfield) 3 | 4 | # Only headers (that are facaded by the Stars.cpp file) here - 5 | # hence declared as custom target. 6 | 7 | file(GLOB_RECURSE STARFIELD_SRCS *.h) 8 | add_custom_target("starfield" SOURCES ${STARFIELD_SRCS}) 9 | 10 | -------------------------------------------------------------------------------- /cmake/macros/IncludeGLM.cmake: -------------------------------------------------------------------------------- 1 | MACRO(INCLUDE_GLM TARGET ROOT_DIR) 2 | set(GLM_ROOT_DIR ${ROOT_DIR}/externals) 3 | find_package(GLM REQUIRED) 4 | include_directories(${GLM_INCLUDE_DIRS}) 5 | SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -isystem ${GLM_INCLUDE_DIRS}") 6 | ENDMACRO(INCLUDE_GLM _target _root_dir) -------------------------------------------------------------------------------- /interface/external/faceshift/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(TARGET_NAME faceshift) 4 | project(${TARGET_NAME}) 5 | 6 | # grab the implemenation and header files 7 | file(GLOB FACESHIFT_SRCS include/*.h src/*.cpp) 8 | 9 | include_directories(include) 10 | 11 | add_library(${TARGET_NAME} ${FACESHIFT_SRCS}) 12 | -------------------------------------------------------------------------------- /libraries/shared/src/Systime.cpp: -------------------------------------------------------------------------------- 1 | #ifdef _WIN32 2 | #include 3 | #define _timeval_ 4 | #include "Systime.h" 5 | 6 | int gettimeofday( timeval* p_tv, timezone* p_tz ) 7 | { 8 | int tt = timeGetTime(); 9 | 10 | p_tv->tv_sec = tt / 1000; 11 | p_tv->tv_usec = tt % 1000 * 1000; 12 | return 0; 13 | } 14 | #endif 15 | -------------------------------------------------------------------------------- /libraries/shared/src/NodeData.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // NodeData.cpp 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 2/19/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #include "NodeData.h" 10 | 11 | NodeData::NodeData(Node* owningNode) : 12 | _owningNode(owningNode) 13 | { 14 | 15 | } 16 | 17 | NodeData::~NodeData() {} -------------------------------------------------------------------------------- /interface/external/OpenCV/include/opencv2/flann/dummy.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef OPENCV_FLANN_DUMMY_H_ 3 | #define OPENCV_FLANN_DUMMY_H_ 4 | 5 | namespace cvflann 6 | { 7 | 8 | #if (defined WIN32 || defined _WIN32 || defined WINCE) && defined CVAPI_EXPORTS 9 | __declspec(dllexport) 10 | #endif 11 | void dummyfunc(); 12 | 13 | } 14 | 15 | 16 | #endif /* OPENCV_FLANN_DUMMY_H_ */ 17 | -------------------------------------------------------------------------------- /interface/resources/shaders/ambient_occlusion.vert: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // ambient_occlusion.vert 5 | // vertex shader 6 | // 7 | // Created by Andrzej Kapolka on 8/16/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | void main(void) { 12 | gl_TexCoord[0] = gl_MultiTexCoord0; 13 | gl_Position = gl_Vertex; 14 | } 15 | -------------------------------------------------------------------------------- /interface/InterfaceConfig.h.in: -------------------------------------------------------------------------------- 1 | // 2 | // InterfaceConfig.h 3 | // interface 4 | // 5 | // Created by Stephen Birarda on 2/8/13. 6 | // Copyright (c) 2013 High Fidelity, Inc.. All rights reserved. 7 | // 8 | 9 | #ifndef interface__InterfaceConfig__ 10 | #define interface__InterfaceConfig__ 11 | 12 | #define GL_GLEXT_PROTOTYPES 1 13 | @GL_HEADERS@ 14 | 15 | 16 | #endif 17 | -------------------------------------------------------------------------------- /interface/external/fervor/fvplatform.h: -------------------------------------------------------------------------------- 1 | #ifndef FVPLATFORM_H 2 | #define FVPLATFORM_H 3 | 4 | #include 5 | 6 | class FvPlatform : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | static bool CurrentlyRunningOnPlatform(QString platform); 12 | 13 | private: 14 | explicit FvPlatform(QObject *parent = 0); 15 | 16 | }; 17 | 18 | #endif // FVPLATFORM_H 19 | -------------------------------------------------------------------------------- /space-server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(ROOT_DIR ..) 4 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 5 | 6 | set(TARGET_NAME space-server) 7 | 8 | include(${MACRO_DIR}/SetupHifiProject.cmake) 9 | 10 | setup_hifi_project(${TARGET_NAME} TRUE) 11 | 12 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 13 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) -------------------------------------------------------------------------------- /space-server/src/TreeNode.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // TreeNode.cpp 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 2/13/13. 6 | // 7 | // 8 | 9 | #include "TreeNode.h" 10 | 11 | std::string EMPTY_STRING = ""; 12 | 13 | TreeNode::TreeNode() { 14 | for (int i = 0; i < CHILDREN_PER_NODE; ++i) { 15 | child[i] = NULL; 16 | } 17 | 18 | hostname = NULL; 19 | nickname = NULL; 20 | } -------------------------------------------------------------------------------- /interface/external/Leap/stubs/include/Leap.h: -------------------------------------------------------------------------------- 1 | 2 | // This is an empty stub, used as a placeholder for the real Leap.h 3 | // The entire containing Leap folder should be replaced by the one 4 | // from the Leap SDK. 5 | 6 | #define LEAP_STUBS // We're using the stubbed-out Leap header 7 | 8 | namespace Leap { 9 | class Frame {}; 10 | class Controller {}; 11 | class Listener {}; 12 | } 13 | 14 | -------------------------------------------------------------------------------- /interface/src/Physics.h: -------------------------------------------------------------------------------- 1 | // 2 | // Balls.h 3 | // hifi 4 | // 5 | // Created by Philip on 4/25/13. 6 | // 7 | // 8 | 9 | #ifndef hifi_Physics_h 10 | #define hifi_Physics_h 11 | 12 | void applyStaticFriction(float deltaTime, glm::vec3& velocity, float maxVelocity, float strength); 13 | void applyDamping(float deltaTime, glm::vec3& velocity, float linearStrength, float squaredStrength); 14 | 15 | #endif 16 | -------------------------------------------------------------------------------- /pairing-server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(ROOT_DIR ..) 4 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 5 | 6 | set(TARGET_NAME pairing-server) 7 | 8 | include(${MACRO_DIR}/SetupHifiProject.cmake) 9 | setup_hifi_project(${TARGET_NAME} TRUE) 10 | 11 | # link the shared hifi library 12 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 13 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) -------------------------------------------------------------------------------- /libraries/shared/src/Syssocket.h: -------------------------------------------------------------------------------- 1 | #ifndef __Syssocket__ 2 | #define __Syssocket__ 3 | 4 | #ifdef _WIN32 5 | #define WINSOCK_API_LINKAGE 6 | #include 7 | #ifndef _timeval_ 8 | #define _timeval_ 9 | #endif 10 | typedef SSIZE_T ssize_t; 11 | typedef ULONG32 in_addr_t; 12 | typedef USHORT in_port_t; 13 | typedef USHORT uint16_t; 14 | typedef ULONG32 socklen_t; 15 | 16 | #endif _Win32 17 | 18 | #endif __Syssocket__ -------------------------------------------------------------------------------- /interface/external/MotionDriver/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(TARGET_NAME MotionDriver) 4 | project(${TARGET_NAME}) 5 | 6 | # let the library know which device we're using 7 | add_definitions(-DMPU9150) 8 | 9 | # grab the implemenation and header files 10 | file(GLOB MOTION_DRIVER_SRCS include/*.h src/*.c) 11 | 12 | include_directories(include) 13 | 14 | add_library(${TARGET_NAME} ${MOTION_DRIVER_SRCS}) 15 | -------------------------------------------------------------------------------- /interface/external/fervor/fvignoredversions.h: -------------------------------------------------------------------------------- 1 | #ifndef FVIGNOREDVERSIONS_H 2 | #define FVIGNOREDVERSIONS_H 3 | 4 | #include 5 | 6 | class FVIgnoredVersions : public QObject 7 | { 8 | Q_OBJECT 9 | 10 | public: 11 | static bool VersionIsIgnored(QString version); 12 | static void IgnoreVersion(QString version); 13 | 14 | private: 15 | explicit FVIgnoredVersions(QObject *parent = 0); 16 | 17 | }; 18 | 19 | #endif // FVIGNOREDVERSIONS_H 20 | -------------------------------------------------------------------------------- /interface/resources/shaders/face.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // face.frag 5 | // fragment shader 6 | // 7 | // Created by Andrzej Kapolka on 7/12/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the color texture 12 | uniform sampler2D colorTexture; 13 | 14 | void main(void) { 15 | // for now, just modulate color 16 | gl_FragColor = gl_Color * texture2D(colorTexture, gl_TexCoord[0].st); 17 | } 18 | -------------------------------------------------------------------------------- /libraries/voxels/src/SceneUtils.h: -------------------------------------------------------------------------------- 1 | // 2 | // SceneUtils.h 3 | // hifi 4 | // 5 | // Created by Brad Hefta-Gaub on 5/7/2013. 6 | // 7 | // 8 | 9 | #ifndef __hifi__SceneUtil__ 10 | #define __hifi__SceneUtil__ 11 | 12 | #include "VoxelTree.h" 13 | #include 14 | 15 | void addCornersAndAxisLines(VoxelTree* tree); 16 | void addSphereScene(VoxelTree * tree); 17 | void addSurfaceScene(VoxelTree * tree); 18 | 19 | 20 | #endif /* defined(__hifi__SceneUtil__) */ 21 | -------------------------------------------------------------------------------- /interface/resources/shaders/glow_add.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // glow_add.frag 5 | // fragment shader 6 | // 7 | // Created by Andrzej Kapolka on 8/14/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the texture containing the original color 12 | uniform sampler2D originalTexture; 13 | 14 | void main(void) { 15 | vec4 color = texture2D(originalTexture, gl_TexCoord[0].st); 16 | gl_FragColor = color * (1.0 + color.a); 17 | } 18 | -------------------------------------------------------------------------------- /interface/src/world.h: -------------------------------------------------------------------------------- 1 | // 2 | // world.h 3 | // interface 4 | // 5 | // Created by Philip Rosedale on 8/23/12. 6 | // Copyright (c) 2012 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | // Simulation happens in positive cube with edge of size WORLD_SIZE 10 | 11 | #ifndef __interface__world__ 12 | #define __interface__world__ 13 | 14 | 15 | #define PIf 3.14159265f 16 | 17 | const float GRAVITY_EARTH = 9.80665f; 18 | const float EDGE_SIZE_GROUND_PLANE = 20.f; 19 | 20 | #endif 21 | -------------------------------------------------------------------------------- /space-server/src/TreeNode.h: -------------------------------------------------------------------------------- 1 | // 2 | // TreeNode.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 2/13/13. 6 | // 7 | // 8 | 9 | #ifndef __hifi__TreeNode__ 10 | #define __hifi__TreeNode__ 11 | 12 | #include 13 | 14 | const int CHILDREN_PER_NODE = 8; 15 | 16 | class TreeNode { 17 | public: 18 | TreeNode(); 19 | 20 | TreeNode *child[CHILDREN_PER_NODE]; 21 | char *hostname; 22 | char *nickname; 23 | int domain_id; 24 | }; 25 | 26 | #endif /* defined(__hifi__TreeNode__) */ 27 | -------------------------------------------------------------------------------- /interface/src/renderer/RenderUtil.h: -------------------------------------------------------------------------------- 1 | // 2 | // RenderUtil.h 3 | // interface 4 | // 5 | // Created by Andrzej Kapolka on 8/15/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__RenderUtil__ 10 | #define __interface__RenderUtil__ 11 | 12 | /// Renders a quad from (-1, -1, 0) to (1, 1, 0) with texture coordinates from (sMin, 0) to (sMax, 1). 13 | void renderFullscreenQuad(float sMin = 0.0f, float sMax = 1.0f); 14 | 15 | #endif /* defined(__interface__RenderUtil__) */ 16 | -------------------------------------------------------------------------------- /assignment-client/src/AssignmentFactory.h: -------------------------------------------------------------------------------- 1 | // 2 | // AssignmentFactory.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 9/17/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__AssignmentFactory__ 10 | #define __hifi__AssignmentFactory__ 11 | 12 | #include "Assignment.h" 13 | 14 | class AssignmentFactory { 15 | public: 16 | static Assignment* unpackAssignment(const unsigned char* dataBuffer, int numBytes); 17 | }; 18 | 19 | #endif /* defined(__hifi__AssignmentFactory__) */ 20 | -------------------------------------------------------------------------------- /cmake/macros/SetupHifiLibrary.cmake: -------------------------------------------------------------------------------- 1 | MACRO(SETUP_HIFI_LIBRARY TARGET) 2 | project(${TARGET}) 3 | 4 | # grab the implemenation and header files 5 | file(GLOB LIB_SRCS src/*.h src/*.cpp) 6 | set(LIB_SRCS ${LIB_SRCS} ${WRAPPED_SRCS}) 7 | 8 | # create a library and set the property so it can be referenced later 9 | add_library(${TARGET} ${LIB_SRCS}) 10 | 11 | find_package(Qt5Core REQUIRED) 12 | qt5_use_modules(${TARGET} Core) 13 | 14 | target_link_libraries(${TARGET} ${QT_LIBRARIES}) 15 | ENDMACRO(SETUP_HIFI_LIBRARY _target) -------------------------------------------------------------------------------- /interface/src/PairingHandler.h: -------------------------------------------------------------------------------- 1 | // 2 | // PairingHandler.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 5/13/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__PairingHandler__ 10 | #define __hifi__PairingHandler__ 11 | 12 | #include 13 | 14 | class PairingHandler : public QObject { 15 | Q_OBJECT 16 | public: 17 | static PairingHandler* getInstance(); 18 | public slots: 19 | void sendPairRequest(); 20 | }; 21 | 22 | #endif /* defined(__hifi__PairingHandler__) */ 23 | -------------------------------------------------------------------------------- /libraries/shared/src/StdDev.h: -------------------------------------------------------------------------------- 1 | // 2 | // StdDev.h 3 | // hifi 4 | // 5 | // Created by Philip Rosedale on 3/12/13. 6 | // 7 | // 8 | 9 | #ifndef __hifi__StdDev__ 10 | #define __hifi__StdDev__ 11 | 12 | class StDev { 13 | public: 14 | StDev(); 15 | void reset(); 16 | void addValue(float v); 17 | float getAverage(); 18 | float getStDev(); 19 | int getSamples() const { return sampleCount; } 20 | private: 21 | float * data; 22 | int sampleCount; 23 | }; 24 | 25 | #endif /* defined(__hifi__StdDev__) */ 26 | -------------------------------------------------------------------------------- /interface/external/Leap/readme.txt: -------------------------------------------------------------------------------- 1 | 2 | Instructions for adding the Leap driver to Interface 3 | Eric Johnston, July 10, 2013 4 | 5 | NOTE: Without doing step 2, you will crash at program start time. 6 | 7 | 1. Copy the Leap sdk folders (lib, include, etc.) into the interface/external/Leap folder. There should be a folder already there called "stub", and this read me.txt should be there as well. 8 | 9 | 2. IMPORTANT: Copy the file interface/external/Leap/lib/libc++/libLeap.dylib to /usr/lib 10 | 11 | 3. Delete your build directory, run cmake and build, and you should be all set. 12 | -------------------------------------------------------------------------------- /interface/external/fervor/fvupdatedownloadprogress.h: -------------------------------------------------------------------------------- 1 | #ifndef FVUPDATEDOWNLOADPROGRESS_H 2 | #define FVUPDATEDOWNLOADPROGRESS_H 3 | 4 | #include 5 | #include "ui_fvupdatedownloadprogress.h" 6 | 7 | class FvUpdateDownloadProgress : public QWidget 8 | { 9 | Q_OBJECT 10 | 11 | public: 12 | FvUpdateDownloadProgress(QWidget *parent = 0); 13 | ~FvUpdateDownloadProgress(); 14 | 15 | public slots: 16 | void downloadProgress ( qint64 bytesReceived, qint64 bytesTotal ); 17 | void close(); 18 | 19 | private: 20 | Ui::FvUpdateDownloadProgress ui; 21 | }; 22 | 23 | #endif // FVUPDATEDOWNLOADPROGRESS_H 24 | -------------------------------------------------------------------------------- /externals/glm/gtx/std_based_type.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-06-08 5 | // Updated : 2008-06-08 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/std_based_type.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /externals/glm/gtx/number_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-05-10 5 | // Updated : 2007-05-10 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/number_precision.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | } 14 | -------------------------------------------------------------------------------- /externals/glm/gtx/unsigned_int.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-24 5 | // Updated : 2008-10-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/unsigned_int.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | 13 | }//namespace glm 14 | -------------------------------------------------------------------------------- /assignment-client/src/voxels/VoxelScriptingInterface.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelScriptingInterface.cpp 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 9/17/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #include "VoxelScriptingInterface.h" 10 | 11 | void VoxelScriptingInterface::queueVoxelAdd(float x, float y, float z, float scale, uchar red, uchar green, uchar blue) { 12 | // setup a VoxelDetail struct with the data 13 | VoxelDetail addVoxelDetail = {x, y, z, scale, red, green, blue}; 14 | _voxelPacketSender.sendVoxelEditMessage(PACKET_TYPE_SET_VOXEL, addVoxelDetail); 15 | } 16 | -------------------------------------------------------------------------------- /libraries/audio/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(ROOT_DIR ../..) 4 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 5 | 6 | # setup for find modules 7 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules/") 8 | 9 | set(TARGET_NAME audio) 10 | 11 | # set up the external glm library 12 | include(${MACRO_DIR}/SetupHifiLibrary.cmake) 13 | setup_hifi_library(${TARGET_NAME}) 14 | 15 | include(${MACRO_DIR}/IncludeGLM.cmake) 16 | include_glm(${TARGET_NAME} ${ROOT_DIR}) 17 | 18 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 19 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) -------------------------------------------------------------------------------- /interface/src/renderer/ProgramObject.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ProgramObject.cpp 3 | // interface 4 | // 5 | // Created by Andrzej Kapolka on 5/7/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | 8 | #include "ProgramObject.h" 9 | 10 | ProgramObject::ProgramObject(QObject* parent) : QGLShaderProgram(parent) { 11 | } 12 | 13 | void ProgramObject::setUniform(int location, const glm::vec3& value) { 14 | setUniformValue(location, value.x, value.y, value.z); 15 | } 16 | 17 | void ProgramObject::setUniform(const char* name, const glm::vec3& value) { 18 | setUniformValue(name, value.x, value.y, value.z); 19 | } 20 | 21 | -------------------------------------------------------------------------------- /interface/external/quazip/include/quacrc32.h: -------------------------------------------------------------------------------- 1 | #ifndef QUACRC32_H 2 | #define QUACRC32_H 3 | 4 | #include "quachecksum32.h" 5 | 6 | ///CRC32 checksum 7 | /** \class QuaCrc32 quacrc32.h 8 | * This class wrappers the crc32 function with the QuaChecksum32 interface. 9 | * See QuaChecksum32 for more info. 10 | */ 11 | class QUAZIP_EXPORT QuaCrc32 : public QuaChecksum32 { 12 | 13 | public: 14 | QuaCrc32(); 15 | 16 | quint32 calculate(const QByteArray &data); 17 | 18 | void reset(); 19 | void update(const QByteArray &buf); 20 | quint32 value(); 21 | 22 | private: 23 | quint32 checksum; 24 | }; 25 | 26 | #endif //QUACRC32_H 27 | -------------------------------------------------------------------------------- /assignment-client/src/Agent.h: -------------------------------------------------------------------------------- 1 | // 2 | // Agent.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 7/1/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__Agent__ 10 | #define __hifi__Agent__ 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | class Agent : public Assignment { 18 | Q_OBJECT 19 | public: 20 | Agent(const unsigned char* dataBuffer, int numBytes); 21 | 22 | bool volatile _shouldStop; 23 | 24 | void run(); 25 | signals: 26 | void preSendCallback(); 27 | }; 28 | 29 | #endif /* defined(__hifi__Operative__) */ 30 | -------------------------------------------------------------------------------- /interface/resources/shaders/glow_add_separate.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // glow_add_separate.frag 5 | // fragment shader 6 | // 7 | // Created by Andrzej Kapolka on 8/14/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the texture containing the original color 12 | uniform sampler2D originalTexture; 13 | 14 | // the texture containing the blurred color 15 | uniform sampler2D blurredTexture; 16 | 17 | void main(void) { 18 | vec4 blurred = texture2D(blurredTexture, gl_TexCoord[0].st); 19 | gl_FragColor = blurred * blurred.a + texture2D(originalTexture, gl_TexCoord[0].st) * (1.0 + blurred.a * 0.5); 20 | } 21 | -------------------------------------------------------------------------------- /assignment-client/src/avatars/AvatarMixer.h: -------------------------------------------------------------------------------- 1 | // 2 | // AvatarMixer.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 9/5/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__AvatarMixer__ 10 | #define __hifi__AvatarMixer__ 11 | 12 | #include 13 | 14 | /// Handles assignments of type AvatarMixer - distribution of avatar data to various clients 15 | class AvatarMixer : public Assignment { 16 | public: 17 | AvatarMixer(const unsigned char* dataBuffer, int numBytes); 18 | 19 | /// runs the avatar mixer 20 | void run(); 21 | }; 22 | 23 | #endif /* defined(__hifi__AvatarMixer__) */ 24 | -------------------------------------------------------------------------------- /interface/external/fervor/fvupdatedownloadprogress.cpp: -------------------------------------------------------------------------------- 1 | #include "fvupdatedownloadprogress.h" 2 | 3 | FvUpdateDownloadProgress::FvUpdateDownloadProgress(QWidget *parent) 4 | : QWidget(parent, Qt::SplashScreen) 5 | { 6 | ui.setupUi(this); 7 | 8 | ui.progress->setValue(0); 9 | 10 | } 11 | 12 | FvUpdateDownloadProgress::~FvUpdateDownloadProgress() 13 | { 14 | 15 | } 16 | 17 | void FvUpdateDownloadProgress::downloadProgress ( qint64 bytesReceived, qint64 bytesTotal ) 18 | { 19 | ui.progress->setValue( ((float)bytesReceived / (float)bytesTotal) * 100 ); 20 | } 21 | 22 | void FvUpdateDownloadProgress::close() 23 | { 24 | this->deleteLater(); 25 | QWidget::close(); 26 | } -------------------------------------------------------------------------------- /assignment-client/src/audio/AudioMixer.h: -------------------------------------------------------------------------------- 1 | // 2 | // AudioMixer.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 8/22/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__AudioMixer__ 10 | #define __hifi__AudioMixer__ 11 | 12 | #include 13 | 14 | /// Handles assignments of type AudioMixer - mixing streams of audio and re-distributing to various clients. 15 | class AudioMixer : public Assignment { 16 | public: 17 | AudioMixer(const unsigned char* dataBuffer, int numBytes); 18 | 19 | /// runs the audio mixer 20 | void run(); 21 | }; 22 | 23 | #endif /* defined(__hifi__AudioMixer__) */ 24 | -------------------------------------------------------------------------------- /interface/src/InfoView.h: -------------------------------------------------------------------------------- 1 | // 2 | // InfoView.h 3 | // hifi 4 | // 5 | // Created by Stojce Slavkovski on 9/7/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__InfoView__ 10 | #define __hifi__InfoView__ 11 | 12 | #include 13 | 14 | class InfoView : public QWebView { 15 | Q_OBJECT 16 | public: 17 | static void showFirstTime(); 18 | static void forcedShow(); 19 | 20 | private: 21 | InfoView(bool forced); 22 | bool _forced; 23 | bool shouldShow(); 24 | 25 | private slots: 26 | void loaded(bool ok); 27 | }; 28 | 29 | #endif /* defined(__hifi__InfoView__) */ 30 | -------------------------------------------------------------------------------- /interface/external/UVCCameraControl/include/UVCCameraControl.hpp: -------------------------------------------------------------------------------- 1 | // 2 | // UVCCameraControl.hpp 3 | // UVCCameraControl 4 | // 5 | // Created by Andrzej Kapolka on 6/18/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef UVCCameraControl_UVCCameraControl_hpp 10 | #define UVCCameraControl_UVCCameraControl_hpp 11 | 12 | #ifdef __cplusplus 13 | extern "C" { 14 | #endif 15 | 16 | void configureCamera(int vendorID, int productID, int autoExposure, float exposure, float contrast, float saturation, 17 | float sharpness, int autoWhiteBalance, float whiteBalance); 18 | 19 | #ifdef __cplusplus 20 | } 21 | #endif 22 | 23 | #endif 24 | -------------------------------------------------------------------------------- /libraries/shared/src/NodeData.h: -------------------------------------------------------------------------------- 1 | // 2 | // NodeData.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 2/19/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef hifi_NodeData_h 10 | #define hifi_NodeData_h 11 | 12 | #include 13 | 14 | class Node; 15 | 16 | class NodeData : public QObject { 17 | Q_OBJECT 18 | public: 19 | NodeData(Node* owningNode); 20 | 21 | virtual ~NodeData() = 0; 22 | virtual int parseData(unsigned char* sourceBuffer, int numBytes) = 0; 23 | 24 | Node* getOwningNode() { return _owningNode; } 25 | protected: 26 | Node* _owningNode; 27 | }; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /interface/resources/shaders/perlin_modulate.vert: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // perlin_modulate.vert 5 | // vertex shader 6 | // 7 | // Created by Andrzej Kapolka on 5/15/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the position in model space 12 | varying vec3 position; 13 | 14 | void main(void) { 15 | position = gl_Vertex.xyz; 16 | vec4 normal = normalize(gl_ModelViewMatrix * vec4(gl_Normal, 0.0)); 17 | gl_FrontColor = gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient + 18 | gl_LightSource[0].diffuse * max(0.0, dot(normal, gl_LightSource[0].position))); 19 | gl_Position = ftransform(); 20 | } 21 | -------------------------------------------------------------------------------- /interface/src/renderer/RenderUtil.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // RenderUtil.cpp 3 | // interface 4 | // 5 | // Created by Andrzej Kapolka on 8/15/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | 8 | #include "InterfaceConfig.h" 9 | #include "RenderUtil.h" 10 | 11 | void renderFullscreenQuad(float sMin, float sMax) { 12 | glBegin(GL_QUADS); 13 | glTexCoord2f(sMin, 0.0f); 14 | glVertex2f(-1.0f, -1.0f); 15 | glTexCoord2f(sMax, 0.0f); 16 | glVertex2f(1.0f, -1.0f); 17 | glTexCoord2f(sMax, 1.0f); 18 | glVertex2f(1.0f, 1.0f); 19 | glTexCoord2f(sMin, 1.0f); 20 | glVertex2f(-1.0f, 1.0f); 21 | glEnd(); 22 | } 23 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # CMake 2 | CMakeCache.txt 3 | CMakeFiles/ 4 | CMakeScripts/ 5 | cmake_install.cmake 6 | build/ 7 | Makefile 8 | *.user 9 | 10 | # Xcode 11 | *.xcodeproj 12 | *.xcworkspace 13 | .DS_Store 14 | xcuserdata 15 | *.pbxuser 16 | !default.pbxuser 17 | *.mode1v3 18 | !default.mode1v3 19 | *.mode2v3 20 | !default.mode2v3 21 | *.perspectivev3 22 | !default.perspectivev3 23 | xcuserdata 24 | profile 25 | *.moved-aside 26 | DerivedData 27 | .idea/ 28 | 29 | *.hmap 30 | 31 | #Ignore Leap, but not the stubs 32 | interface/external/Leap/docs/ 33 | interface/external/Leap/include/ 34 | interface/external/Leap/lib/ 35 | interface/external/Leap/samples/ 36 | interface/external/Leap/util/ 37 | 38 | 39 | 40 | -------------------------------------------------------------------------------- /externals/glm/gtx/raw_data.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-11-19 5 | // Updated : 2008-11-19 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/raw_data.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | // Dependency: 10 | // - GLM core 11 | /////////////////////////////////////////////////////////////////////////////////////////////////// 12 | -------------------------------------------------------------------------------- /interface/src/renderer/ProgramObject.h: -------------------------------------------------------------------------------- 1 | // 2 | // ProgramObject.h 3 | // interface 4 | // 5 | // Created by Andrzej Kapolka on 5/7/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__ProgramObject__ 10 | #define __interface__ProgramObject__ 11 | 12 | #include 13 | 14 | #include 15 | 16 | class ProgramObject : public QGLShaderProgram { 17 | public: 18 | 19 | ProgramObject(QObject* parent = 0); 20 | 21 | void setUniform(int location, const glm::vec3& value); 22 | void setUniform(const char* name, const glm::vec3& value); 23 | }; 24 | 25 | #endif /* defined(__interface__ProgramObject__) */ 26 | -------------------------------------------------------------------------------- /interface/external/quazip/include/quaadler32.h: -------------------------------------------------------------------------------- 1 | #ifndef QUAADLER32_H 2 | #define QUAADLER32_H 3 | 4 | #include 5 | 6 | #include "quachecksum32.h" 7 | 8 | /// Adler32 checksum 9 | /** \class QuaAdler32 quaadler32.h 10 | * This class wrappers the adler32 function with the QuaChecksum32 interface. 11 | * See QuaChecksum32 for more info. 12 | */ 13 | class QUAZIP_EXPORT QuaAdler32 : public QuaChecksum32 14 | { 15 | 16 | public: 17 | QuaAdler32(); 18 | 19 | quint32 calculate(const QByteArray &data); 20 | 21 | void reset(); 22 | void update(const QByteArray &buf); 23 | quint32 value(); 24 | 25 | private: 26 | quint32 checksum; 27 | }; 28 | 29 | #endif //QUAADLER32_H 30 | -------------------------------------------------------------------------------- /libraries/shared/src/Systime.h: -------------------------------------------------------------------------------- 1 | #ifndef __Systime__ 2 | #define __Systime__ 3 | 4 | #ifdef _WIN32 5 | #ifdef _WINSOCK2API_ 6 | #define _timeval_ 7 | #endif 8 | #ifndef _timeval_ 9 | #define _timeval_ 10 | /* 11 | * Structure returned by gettimeofday(2) system call, 12 | * and used in other calls. 13 | */ 14 | struct timeval { 15 | long tv_sec; /* seconds */ 16 | long tv_usec; /* and microseconds */ 17 | }; 18 | 19 | #endif _timeval_ 20 | 21 | struct timezone { 22 | int tz_minuteswest; /* minutes west of Greenwich */ 23 | int tz_dsttime; /* type of dst correction */ 24 | }; 25 | 26 | int gettimeofday( struct timeval* p_tv, struct timezone* p_tz ); 27 | 28 | #endif _Win32 29 | 30 | #endif __Systime__ 31 | -------------------------------------------------------------------------------- /domain-server/resources/web/assignment/placeholder.js: -------------------------------------------------------------------------------- 1 | /* Add your JavaScript for assignment below this line */ 2 | 3 | // here are some examples of things you can call 4 | Avatar.position = {x: 0, y: 0.565925, z: 10}; 5 | Avatar.chatMessage = "I am not a robot!"; 6 | Avatar.handPosition = {x: 0, y: 4.5, z: 0}; 7 | 8 | // here I'm creating a function to fire before each data send 9 | function dance() { 10 | // switch the body yaw from 1 to 90 11 | var randomAngle = Math.floor(Math.random() * 90); 12 | if (Math.random() < 0.5) { 13 | randomAngle * -1; 14 | } 15 | 16 | Avatar.bodyYaw = randomAngle; 17 | } 18 | 19 | // register the call back so it fires before each data send 20 | Agent.preSendCallback.connect(dance); -------------------------------------------------------------------------------- /cmake/macros/LinkHifiLibrary.cmake: -------------------------------------------------------------------------------- 1 | MACRO(LINK_HIFI_LIBRARY LIBRARY TARGET ROOT_DIR) 2 | if (NOT TARGET ${LIBRARY}) 3 | add_subdirectory(${ROOT_DIR}/libraries/${LIBRARY} ${ROOT_DIR}/libraries/${LIBRARY}) 4 | endif (NOT TARGET ${LIBRARY}) 5 | 6 | include_directories(${ROOT_DIR}/libraries/${LIBRARY}/src) 7 | 8 | add_dependencies(${TARGET} ${LIBRARY}) 9 | target_link_libraries(${TARGET} ${LIBRARY}) 10 | 11 | if (APPLE) 12 | # currently the "shared" library requires CoreServices 13 | # link in required OS X framework 14 | set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework CoreServices") 15 | endif (APPLE) 16 | ENDMACRO(LINK_HIFI_LIBRARY _library _target _root_dir) -------------------------------------------------------------------------------- /eve/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(ROOT_DIR ..) 4 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 5 | 6 | # setup for find modules 7 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/") 8 | 9 | set(TARGET_NAME eve) 10 | 11 | include(${MACRO_DIR}/SetupHifiProject.cmake) 12 | setup_hifi_project(${TARGET_NAME} TRUE) 13 | 14 | include(${MACRO_DIR}/IncludeGLM.cmake) 15 | include_glm(${TARGET_NAME} ${ROOT_DIR}) 16 | 17 | # link the required hifi libraries 18 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 19 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) 20 | link_hifi_library(avatars ${TARGET_NAME} ${ROOT_DIR}) 21 | link_hifi_library(audio ${TARGET_NAME} ${ROOT_DIR}) 22 | -------------------------------------------------------------------------------- /interface/external/MotionDriver/include/inv_tty.h: -------------------------------------------------------------------------------- 1 | // 2 | // inv_tty.h 3 | // interface 4 | // 5 | // Created by Andrzej Kapolka on 7/9/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__inv_tty__ 10 | #define __interface__inv_tty__ 11 | 12 | void tty_set_file_descriptor(int file_descriptor); 13 | 14 | int tty_i2c_write(unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char const *data); 15 | 16 | int tty_i2c_read(unsigned char slave_addr, unsigned char reg_addr, unsigned char length, unsigned char *data); 17 | 18 | void tty_delay_ms(unsigned long num_ms); 19 | 20 | void tty_get_ms(unsigned long *count); 21 | 22 | #endif /* defined(__interface__inv_tty__) */ 23 | -------------------------------------------------------------------------------- /interface/external/LibVPX/include/vpx_codec_impl_bottom.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | 12 | /* 13 | * This file is to be included at the bottom of the header files defining the 14 | * interface to individual codecs and contains matching blocks to those defined 15 | * in vpx_codec_impl_top.h 16 | */ 17 | #ifdef __cplusplus 18 | } 19 | #endif 20 | -------------------------------------------------------------------------------- /interface/external/glut/include/GL/glut.h: -------------------------------------------------------------------------------- 1 | #ifndef __GLUT_H__ 2 | #define __GLUT_H__ 3 | 4 | /* 5 | * glut.h 6 | * 7 | * The freeglut library include file 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 12 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | */ 16 | 17 | #include "freeglut_std.h" 18 | 19 | /*** END OF FILE ***/ 20 | 21 | #endif /* __GLUT_H__ */ 22 | -------------------------------------------------------------------------------- /interface/external/LibVPX/include/vpx_codec_impl_top.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | 12 | /* 13 | * This file is to be included at the top of the header files defining the 14 | * interface to individual codecs and contains various workarounds common 15 | * to all codec implementations. 16 | */ 17 | #ifdef __cplusplus 18 | extern "C" { 19 | #endif 20 | -------------------------------------------------------------------------------- /injector/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(ROOT_DIR ..) 4 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 5 | 6 | # setup for find modules 7 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/") 8 | 9 | set(TARGET_NAME injector) 10 | 11 | include(${MACRO_DIR}/SetupHifiProject.cmake) 12 | setup_hifi_project(${TARGET_NAME} TRUE) 13 | 14 | # set up the external glm library 15 | include(${MACRO_DIR}/IncludeGLM.cmake) 16 | include_glm(${TARGET_NAME} ${ROOT_DIR}) 17 | 18 | # link the shared hifi library 19 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 20 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) 21 | link_hifi_library(audio ${TARGET_NAME} ${ROOT_DIR}) 22 | link_hifi_library(avatars ${TARGET_NAME} ${ROOT_DIR}) -------------------------------------------------------------------------------- /interface/src/ui/ChatEntry.h: -------------------------------------------------------------------------------- 1 | // 2 | // ChatEntry.h 3 | // interface 4 | // 5 | // Created by Andrzej Kapolka on 4/24/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__ChatEntry__ 10 | #define __interface__ChatEntry__ 11 | 12 | #include 13 | 14 | class QKeyEvent; 15 | 16 | class ChatEntry { 17 | public: 18 | 19 | ChatEntry(); 20 | 21 | const std::string& getContents() const { return _contents; } 22 | 23 | void clear(); 24 | 25 | bool keyPressEvent(QKeyEvent* event); 26 | 27 | void render(int screenWidth, int screenHeight); 28 | 29 | private: 30 | 31 | std::string _contents; 32 | int _cursorPos; 33 | }; 34 | 35 | #endif /* defined(__interface__ChatEntry__) */ 36 | -------------------------------------------------------------------------------- /libraries/voxel-server-library/src/NodeWatcher.h: -------------------------------------------------------------------------------- 1 | // 2 | // NodeWatcher.h 3 | // voxel-server 4 | // 5 | // Created by Brad Hefta-Gaub on 8/21/13 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | // Node List Hook that watches for Node's being killed in order to clean up node specific memory and threads 9 | // 10 | 11 | #ifndef __voxel_server__NodeWatcher__ 12 | #define __voxel_server__NodeWatcher__ 13 | 14 | #include 15 | 16 | /// Voxel server's node watcher, which watches for nodes being killed and cleans up their data and threads 17 | class NodeWatcher : public virtual NodeListHook { 18 | public: 19 | virtual void nodeAdded(Node* node); 20 | virtual void nodeKilled(Node* node); 21 | }; 22 | 23 | #endif // __voxel_server__NodeWatcher__ 24 | -------------------------------------------------------------------------------- /voxel-edit/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(TARGET_NAME voxel-edit) 4 | 5 | set(ROOT_DIR ..) 6 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 7 | 8 | # setup for find modules 9 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/") 10 | 11 | # set up the external glm library 12 | include(${MACRO_DIR}/IncludeGLM.cmake) 13 | include_glm(${TARGET_NAME} ${ROOT_DIR}) 14 | 15 | include(${MACRO_DIR}/SetupHifiProject.cmake) 16 | 17 | setup_hifi_project(${TARGET_NAME} TRUE) 18 | 19 | # link in the shared library 20 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 21 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) 22 | 23 | # link in the hifi voxels library 24 | link_hifi_library(voxels ${TARGET_NAME} ${ROOT_DIR}) 25 | 26 | 27 | -------------------------------------------------------------------------------- /libraries/avatars/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(ROOT_DIR ../..) 4 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 5 | 6 | # setup for find modules 7 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules/") 8 | 9 | set(TARGET_NAME avatars) 10 | 11 | find_package(Qt5Script REQUIRED) 12 | 13 | include(${MACRO_DIR}/SetupHifiLibrary.cmake) 14 | setup_hifi_library(${TARGET_NAME}) 15 | 16 | qt5_use_modules(${TARGET_NAME} Script) 17 | 18 | include(${MACRO_DIR}/IncludeGLM.cmake) 19 | include_glm(${TARGET_NAME} ${ROOT_DIR}) 20 | 21 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 22 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) 23 | 24 | # link in the hifi voxels library 25 | link_hifi_library(voxels ${TARGET_NAME} ${ROOT_DIR}) 26 | -------------------------------------------------------------------------------- /animation-server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(TARGET_NAME animation-server) 4 | 5 | set(ROOT_DIR ..) 6 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 7 | 8 | # setup for find modules 9 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/") 10 | 11 | # set up the external glm library 12 | include(${MACRO_DIR}/IncludeGLM.cmake) 13 | include_glm(${TARGET_NAME} ${ROOT_DIR}) 14 | 15 | include(${MACRO_DIR}/SetupHifiProject.cmake) 16 | 17 | setup_hifi_project(${TARGET_NAME} TRUE) 18 | 19 | # link in the shared library 20 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 21 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) 22 | 23 | # link in the hifi voxels library 24 | link_hifi_library(voxels ${TARGET_NAME} ${ROOT_DIR}) 25 | 26 | 27 | -------------------------------------------------------------------------------- /interface/external/LibOVR/Include/OVRVersion.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | 3 | Filename : OVRVersion.h 4 | Content : 5 | 6 | Copyright : Copyright 2012 Oculus VR, Inc. All Rights reserved. 7 | 8 | Use of this software is subject to the terms of the Oculus license 9 | agreement provided at the time of installation or download, or which 10 | otherwise accompanies this software in either electronic or hard copy form. 11 | 12 | *************************************************************************************/ 13 | 14 | #ifndef _OVR_VERSION_H 15 | #define _OVR_VERSION_H 16 | 17 | #define OVR_MAJOR_VERSION 0 18 | #define OVR_MINOR_VERSION 2 19 | #define OVR_BUILD_VERSION 1 20 | #define OVR_VERSION_STRING "0.2.1" 21 | 22 | #endif 23 | -------------------------------------------------------------------------------- /interface/external/glut/include/GL/freeglut.h: -------------------------------------------------------------------------------- 1 | #ifndef __FREEGLUT_H__ 2 | #define __FREEGLUT_H__ 3 | 4 | /* 5 | * freeglut.h 6 | * 7 | * The freeglut library include file 8 | * 9 | * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS 10 | * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 11 | * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 12 | * PAWEL W. OLSZTA BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER 13 | * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN 14 | * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 15 | */ 16 | 17 | #include "freeglut_std.h" 18 | #include "freeglut_ext.h" 19 | 20 | /*** END OF FILE ***/ 21 | 22 | #endif /* __FREEGLUT_H__ */ 23 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | project(hifi) 4 | 5 | set(CMAKE_PREFIX_PATH ${CMAKE_PREFIX_PATH} $ENV{QT_CMAKE_PREFIX_PATH}) 6 | 7 | # set our Base SDK to 10.7 8 | set(CMAKE_OSX_SYSROOT /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.7.sdk) 9 | 10 | # Find includes in corresponding build directories 11 | set(CMAKE_INCLUDE_CURRENT_DIR ON) 12 | # Instruct CMake to run moc automatically when needed. 13 | set(CMAKE_AUTOMOC ON) 14 | 15 | add_subdirectory(animation-server) 16 | add_subdirectory(assignment-client) 17 | add_subdirectory(domain-server) 18 | add_subdirectory(eve) 19 | add_subdirectory(interface) 20 | add_subdirectory(injector) 21 | add_subdirectory(pairing-server) 22 | add_subdirectory(space-server) 23 | add_subdirectory(voxel-edit) 24 | -------------------------------------------------------------------------------- /externals/glm/gtx/perpendicular.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-03-06 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/perpendicular.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER vecType perp 14 | ( 15 | vecType const & x, 16 | vecType const & Normal 17 | ) 18 | { 19 | return x - proj(x, Normal); 20 | } 21 | }//namespace glm 22 | -------------------------------------------------------------------------------- /interface/external/fervor/fvversioncomparator.h: -------------------------------------------------------------------------------- 1 | #ifndef FVVERSIONCOMPARATOR_H 2 | #define FVVERSIONCOMPARATOR_H 3 | 4 | #include 5 | #include 6 | 7 | 8 | class FvVersionComparator 9 | { 10 | public: 11 | 12 | typedef enum { 13 | kSame = 0, 14 | kDescending = 1, 15 | kAscending = -1 16 | } ComparatorResult; 17 | 18 | static ComparatorResult CompareVersions(std::string versionA, 19 | std::string versionB); 20 | 21 | private: 22 | 23 | FvVersionComparator(); 24 | 25 | typedef enum { 26 | kNumberType, 27 | kStringType, 28 | kSeparatorType 29 | } CharacterType; 30 | 31 | static CharacterType TypeOfCharacter(std::string character); 32 | static std::vector SplitVersionString(std::string version); 33 | 34 | }; 35 | 36 | #endif // FVVERSIONCOMPARATOR_H 37 | -------------------------------------------------------------------------------- /libraries/voxel-server-library/src/NodeWatcher.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // NodeWatcher.h 3 | // voxel-server 4 | // 5 | // Created by Brad Hefta-Gaub on 8/21/13 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | // Node List Hook that watches for Node's being killed in order to clean up node specific memory and threads 9 | // 10 | 11 | #include 12 | #include "NodeWatcher.h" 13 | #include "VoxelNodeData.h" 14 | 15 | void NodeWatcher::nodeAdded(Node* node) { 16 | // do nothing 17 | } 18 | 19 | void NodeWatcher::nodeKilled(Node* node) { 20 | // Use this to cleanup our node 21 | if (node->getType() == NODE_TYPE_AGENT) { 22 | VoxelNodeData* nodeData = (VoxelNodeData*)node->getLinkedData(); 23 | node->setLinkedData(NULL); 24 | delete nodeData; 25 | } 26 | }; 27 | -------------------------------------------------------------------------------- /interface/external/fervor/fvupdatewindow.h: -------------------------------------------------------------------------------- 1 | #ifndef FVUPDATEWINDOW_H 2 | #define FVUPDATEWINDOW_H 3 | 4 | #if QT_VERSION >= 0x050000 5 | #include 6 | #else 7 | #include 8 | #endif 9 | 10 | class QGraphicsScene; 11 | 12 | namespace Ui { 13 | class FvUpdateWindow; 14 | } 15 | 16 | class FvUpdateWindow : public QWidget 17 | { 18 | Q_OBJECT 19 | 20 | public: 21 | explicit FvUpdateWindow(QWidget *parent, bool skipVersionAllowed, bool remindLaterAllowed); 22 | ~FvUpdateWindow(); 23 | 24 | // Update the current update proposal from FvUpdater 25 | bool UpdateWindowWithCurrentProposedUpdate(); 26 | 27 | void closeEvent(QCloseEvent* event); 28 | 29 | private: 30 | Ui::FvUpdateWindow* m_ui; 31 | QGraphicsScene* m_appIconScene; 32 | 33 | }; 34 | 35 | #endif // FVUPDATEWINDOW_H 36 | 37 | 38 | -------------------------------------------------------------------------------- /externals/glm/gtx/projection.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-03-06 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/projection.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER vecType proj 14 | ( 15 | vecType const & x, 16 | vecType const & Normal 17 | ) 18 | { 19 | return glm::dot(x, Normal) / glm::dot(Normal, Normal) * Normal; 20 | } 21 | }//namespace glm 22 | -------------------------------------------------------------------------------- /libraries/voxels/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(ROOT_DIR ../..) 4 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 5 | 6 | # setup for find modules 7 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules/") 8 | 9 | set(TARGET_NAME voxels) 10 | 11 | find_package(Qt5Widgets REQUIRED) 12 | 13 | include(${MACRO_DIR}/SetupHifiLibrary.cmake) 14 | setup_hifi_library(${TARGET_NAME}) 15 | 16 | qt5_use_modules(${TARGET_NAME} Widgets) 17 | 18 | include(${MACRO_DIR}/IncludeGLM.cmake) 19 | include_glm(${TARGET_NAME} ${ROOT_DIR}) 20 | 21 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 22 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) 23 | 24 | # link ZLIB 25 | find_package(ZLIB) 26 | include_directories(${ZLIB_INCLUDE_DIRS}) 27 | target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES}) 28 | -------------------------------------------------------------------------------- /externals/glm/gtx/int_10_10_10_2.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2010-07-07 5 | // Updated : 2010-07-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/int_10_10_10_2.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | GLM_FUNC_QUALIFIER dword uint10_10_10_2_cast 13 | ( 14 | glm::vec4 const & v 15 | ) 16 | { 17 | return dword(uint(v.x * 2047.f) << 0 | uint(v.y * 2047.f) << 10 | uint(v.z * 2047.f) << 20 | uint(v.w * 3.f) << 30); 18 | } 19 | }//namespace glm 20 | -------------------------------------------------------------------------------- /interface/resources/shaders/occlusion_blur.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // occlusion_blur.frag 5 | // fragment shader 6 | // 7 | // Created by Andrzej Kapolka on 8/16/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the original texture 12 | uniform sampler2D originalTexture; 13 | 14 | // the scale for the blur kernel 15 | uniform vec2 blurScale; 16 | 17 | void main(void) { 18 | vec2 minExtents = gl_TexCoord[0].st + blurScale * vec2(-0.5, -0.5); 19 | vec2 maxExtents = gl_TexCoord[0].st + blurScale * vec2(1.5, 1.5); 20 | gl_FragColor = (texture2D(originalTexture, minExtents) + 21 | texture2D(originalTexture, vec2(maxExtents.s, minExtents.t)) + 22 | texture2D(originalTexture, vec2(minExtents.s, maxExtents.t)) + 23 | texture2D(originalTexture, maxExtents)) * 0.25; 24 | } 25 | -------------------------------------------------------------------------------- /interface/src/Balls.h: -------------------------------------------------------------------------------- 1 | // 2 | // Balls.h 3 | // hifi 4 | // 5 | // Created by Philip on 4/25/13. 6 | // 7 | // 8 | 9 | #ifndef hifi_Balls_h 10 | #define hifi_Balls_h 11 | 12 | const int NUMBER_SPRINGS = 4; 13 | 14 | class Balls { 15 | public: 16 | Balls(int numberOfBalls); 17 | ~Balls(); 18 | 19 | void simulate(float deltaTime); 20 | void render(); 21 | 22 | void setColor(const glm::vec3& c) { _color = c; }; 23 | void moveOrigin(const glm::vec3& newOrigin); 24 | 25 | private: 26 | struct Ball { 27 | glm::vec3 position, targetPosition, velocity; 28 | int links[NUMBER_SPRINGS]; 29 | float springLength[NUMBER_SPRINGS]; 30 | float radius; 31 | } *_balls; 32 | int _numberOfBalls; 33 | glm::vec3 _origin; 34 | glm::vec3 _color; 35 | }; 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /interface/resources/shaders/iris.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // iris.frag 5 | // fragment shader 6 | // 7 | // Created by Andrzej Kapolka on 6/13/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the iris texture 12 | uniform sampler2D texture; 13 | 14 | // the interpolated normal 15 | varying vec4 normal; 16 | 17 | void main(void) { 18 | // compute the specular component (sans exponent) based on the normal OpenGL lighting model 19 | float specular = max(0.0, dot(normalize(gl_LightSource[0].position + vec4(0.0, 0.0, 1.0, 0.0)), normalize(normal))); 20 | 21 | // modulate texture by diffuse color and add specular contribution 22 | gl_FragColor = gl_Color * texture2D(texture, gl_TexCoord[0].st) + 23 | pow(specular, gl_FrontMaterial.shininess) * gl_FrontLightProduct[0].specular; 24 | } 25 | -------------------------------------------------------------------------------- /interface/src/ToolsPalette.h: -------------------------------------------------------------------------------- 1 | // 2 | // ToolsPalette.h 3 | // interface 4 | // 5 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 6 | // 7 | 8 | #ifndef __interface__ToolsPalette__ 9 | #define __interface__ToolsPalette__ 10 | 11 | #include "Tool.h" 12 | #include "Swatch.h" 13 | 14 | #include 15 | 16 | class ToolsPalette { 17 | public: 18 | void init(int screenWidth, int screenHeight); 19 | void addAction(QAction* action, int x, int y); 20 | void addTool(Tool* tool); 21 | void render(int screenWidth, int screenHeight); 22 | 23 | bool isActive(); 24 | 25 | private: 26 | QImage _textureImage; 27 | GLuint _textureID; 28 | std::vector _tools; 29 | 30 | int _top; 31 | int _left; 32 | 33 | int _width; 34 | int _height; 35 | }; 36 | 37 | #endif /* defined(__interface__ToolsPalette__) */ 38 | -------------------------------------------------------------------------------- /externals/glm/gtx/normal.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2011-06-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/normal.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tvec3 triangleNormal 14 | ( 15 | detail::tvec3 const & p1, 16 | detail::tvec3 const & p2, 17 | detail::tvec3 const & p3 18 | ) 19 | { 20 | return normalize(cross(p1 - p2, p1 - p3)); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /externals/glm/gtx/mixed_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-04-03 5 | // Updated : 2008-09-17 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/mixed_product.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER valType mixedProduct 14 | ( 15 | detail::tvec3 const & v1, 16 | detail::tvec3 const & v2, 17 | detail::tvec3 const & v3 18 | ) 19 | { 20 | return dot(cross(v1, v2), v3); 21 | } 22 | }//namespace glm 23 | -------------------------------------------------------------------------------- /cmake/macros/SetupHifiProject.cmake: -------------------------------------------------------------------------------- 1 | MACRO(SETUP_HIFI_PROJECT TARGET INCLUDE_QT) 2 | project(${TARGET}) 3 | 4 | # grab the implemenation and header files 5 | file(GLOB TARGET_SRCS src/*) 6 | 7 | file(GLOB SRC_SUBDIRS RELATIVE ${CMAKE_CURRENT_SOURCE_DIR}/src ${CMAKE_CURRENT_SOURCE_DIR}/src/*) 8 | foreach(DIR ${SRC_SUBDIRS}) 9 | if(IS_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/src/${DIR}) 10 | FILE(GLOB DIR_CONTENTS src/${DIR}/*) 11 | SET(TARGET_SRCS ${TARGET_SRCS} ${DIR_CONTENTS}) 12 | endif() 13 | endforeach() 14 | 15 | # add the executable 16 | add_executable(${TARGET} ${TARGET_SRCS}) 17 | 18 | IF (${INCLUDE_QT}) 19 | find_package(Qt5Core REQUIRED) 20 | qt5_use_modules(${TARGET} Core) 21 | ENDIF() 22 | 23 | target_link_libraries(${TARGET} ${QT_LIBRARIES}) 24 | ENDMACRO(SETUP_HIFI_PROJECT _target _include_qt) -------------------------------------------------------------------------------- /interface/src/VoxelPacketProcessor.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelPacketProcessor.h 3 | // interface 4 | // 5 | // Created by Brad Hefta-Gaub on 8/12/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | // Voxel Packet Receiver 9 | // 10 | 11 | #ifndef __shared__VoxelPacketProcessor__ 12 | #define __shared__VoxelPacketProcessor__ 13 | 14 | #include 15 | 16 | /// Handles processing of incoming voxel packets for the interface application. As with other ReceivedPacketProcessor classes 17 | /// the user is responsible for reading inbound packets and adding them to the processing queue by calling queueReceivedPacket() 18 | class VoxelPacketProcessor : public ReceivedPacketProcessor { 19 | protected: 20 | virtual void processPacket(sockaddr& senderAddress, unsigned char* packetData, ssize_t packetLength); 21 | }; 22 | #endif // __shared__VoxelPacketProcessor__ 23 | -------------------------------------------------------------------------------- /interface/external/LibOVR/Src/OVR_Win32_SensorDevice.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | 3 | Filename : OVR_Win32_SensorDevice.h 4 | Content : Win32 SensorDevice implementation 5 | Created : March 12, 2013 6 | Authors : Lee Cooper 7 | 8 | Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved. 9 | 10 | Use of this software is subject to the terms of the Oculus license 11 | agreement provided at the time of installation or download, or which 12 | otherwise accompanies this software in either electronic or hard copy form. 13 | 14 | *************************************************************************************/ 15 | 16 | #ifndef OVR_Win32_SensorDevice_h 17 | #define OVR_Win32_SensorDevice_h 18 | 19 | namespace OVR { namespace Win32 { 20 | 21 | }} // namespace OVR::Win32 22 | 23 | #endif // OVR_Win32_SensorDevice_h 24 | 25 | -------------------------------------------------------------------------------- /externals/glm/gtx/log_base.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2008-10-24 5 | // Updated : 2008-10-24 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/log_base.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #include "../core/_vectorize.hpp" 11 | 12 | namespace glm 13 | { 14 | template 15 | GLM_FUNC_QUALIFIER genType log( 16 | genType const & x, 17 | genType const & base) 18 | { 19 | assert(x != genType(0)); 20 | 21 | return glm::log(x) / glm::log(base); 22 | } 23 | 24 | VECTORIZE_VEC_SCA(log) 25 | VECTORIZE_VEC_VEC(log) 26 | }//namespace glm 27 | -------------------------------------------------------------------------------- /interface/src/avatar/HandControl.h: -------------------------------------------------------------------------------- 1 | // 2 | // HandControl.h 3 | // interface 4 | // 5 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 6 | // 7 | 8 | #ifndef __interface__HandControl__ 9 | #define __interface__HandControl__ 10 | 11 | #include 12 | 13 | class HandControl { 14 | public: 15 | HandControl(); 16 | void setScreenDimensions(int width, int height); 17 | void update( int x, int y ); 18 | glm::vec3 getValues(); 19 | void stop(); 20 | 21 | private: 22 | bool _enabled; 23 | int _width; 24 | int _height; 25 | int _startX; 26 | int _startY; 27 | int _x; 28 | int _y; 29 | int _lastX; 30 | int _lastY; 31 | int _velocityX; 32 | int _velocityY; 33 | float _rampUpRate; 34 | float _rampDownRate; 35 | float _envelope; 36 | float _leftRight; 37 | float _downUp; 38 | float _backFront; 39 | }; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /interface/src/devices/OculusManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // OculusManager.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 5/9/13. 6 | // Copyright (c) 2012 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__OculusManager__ 10 | #define __hifi__OculusManager__ 11 | 12 | #include 13 | #include 14 | 15 | using namespace OVR; 16 | 17 | class OculusManager { 18 | public: 19 | static void connect(); 20 | 21 | static bool isConnected() { return _isConnected; } 22 | 23 | static void getEulerAngles(float& yaw, float& pitch, float& roll); 24 | 25 | static void updateYawOffset(); 26 | private: 27 | static bool _isConnected; 28 | static Ptr _deviceManager; 29 | static Ptr _hmdDevice; 30 | static Ptr _sensorDevice; 31 | static SensorFusion _sensorFusion; 32 | static float _yawOffset; 33 | }; 34 | 35 | #endif /* defined(__hifi__OculusManager__) */ 36 | -------------------------------------------------------------------------------- /interface/src/starfield/data/Tile.h: -------------------------------------------------------------------------------- 1 | // 2 | // starfield/data/Tile.h 3 | // interface 4 | // 5 | // Created by Tobias Schwinger on 3/22/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__starfield__data__Tile__ 10 | #define __interface__starfield__data__Tile__ 11 | 12 | #ifndef __interface__Starfield_impl__ 13 | #error "This is an implementation file - not intended for direct inclusion." 14 | #endif 15 | 16 | #include "starfield/Config.h" 17 | #include "starfield/data/BrightnessLevel.h" 18 | 19 | namespace starfield { 20 | 21 | struct Tile { 22 | 23 | nuint offset; 24 | nuint count; 25 | BrightnessLevel lod; 26 | nuint flags; 27 | 28 | // flags 29 | static uint16_t const checked = 1; 30 | static uint16_t const visited = 2; 31 | static uint16_t const render = 4; 32 | }; 33 | 34 | 35 | } // anonymous namespace 36 | 37 | #endif 38 | 39 | -------------------------------------------------------------------------------- /interface/src/renderer/GeometryCache.h: -------------------------------------------------------------------------------- 1 | // 2 | // GeometryCache.h 3 | // interface 4 | // 5 | // Created by Andrzej Kapolka on 6/21/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__GeometryCache__ 10 | #define __interface__GeometryCache__ 11 | 12 | #include 13 | 14 | #include "InterfaceConfig.h" 15 | 16 | class GeometryCache { 17 | public: 18 | 19 | ~GeometryCache(); 20 | 21 | void renderHemisphere(int slices, int stacks); 22 | void renderSquare(int xDivisions, int yDivisions); 23 | void renderHalfCylinder(int slices, int stacks); 24 | 25 | private: 26 | 27 | typedef QPair IntPair; 28 | typedef QPair VerticesIndices; 29 | 30 | QHash _hemisphereVBOs; 31 | QHash _squareVBOs; 32 | QHash _halfCylinderVBOs; 33 | }; 34 | 35 | #endif /* defined(__interface__GeometryCache__) */ 36 | -------------------------------------------------------------------------------- /assignment-client/src/audio/AvatarAudioRingBuffer.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AvatarAudioRingBuffer.cpp 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 6/5/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | #include "AvatarAudioRingBuffer.h" 12 | 13 | AvatarAudioRingBuffer::AvatarAudioRingBuffer() : 14 | _twoPoles(), 15 | _shouldLoopbackForNode(false) { 16 | 17 | } 18 | 19 | AvatarAudioRingBuffer::~AvatarAudioRingBuffer() { 20 | // enumerate the freeVerbs map and delete the FreeVerb objects 21 | for (TwoPoleNodeMap::iterator poleIterator = _twoPoles.begin(); poleIterator != _twoPoles.end(); poleIterator++) { 22 | delete poleIterator->second; 23 | } 24 | } 25 | 26 | int AvatarAudioRingBuffer::parseData(unsigned char* sourceBuffer, int numBytes) { 27 | _shouldLoopbackForNode = (sourceBuffer[0] == PACKET_TYPE_MICROPHONE_AUDIO_WITH_ECHO); 28 | return PositionalAudioRingBuffer::parseData(sourceBuffer, numBytes); 29 | } -------------------------------------------------------------------------------- /interface/resources/shaders/diffuse.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // diffuse.frag 5 | // fragment shader 6 | // 7 | // Created by Andrzej Kapolka on 8/14/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the texture containing the original color 12 | uniform sampler2D originalTexture; 13 | 14 | // the texture containing the diffused color 15 | uniform sampler2D diffusedTexture; 16 | 17 | // the scale of diffusion 18 | uniform vec2 diffusionScale; 19 | 20 | void main(void) { 21 | vec2 minExtents = gl_TexCoord[0].st + diffusionScale * vec2(-1.5, -1.5); 22 | vec2 maxExtents = gl_TexCoord[0].st + diffusionScale * vec2(1.5, 1.5); 23 | gl_FragColor = (texture2D(diffusedTexture, minExtents) + 24 | texture2D(diffusedTexture, vec2(maxExtents.s, minExtents.t)) + 25 | texture2D(diffusedTexture, vec2(minExtents.s, maxExtents.t)) + 26 | texture2D(diffusedTexture, maxExtents)) * 0.235 + texture2D(originalTexture, gl_TexCoord[0].st) * 0.1; 27 | } 28 | -------------------------------------------------------------------------------- /libraries/shared/src/SimpleMovingAverage.h: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleMovingAverage.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 4/18/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | // Replaces Brad Hefta-Gaub's CounterStats class (RIP) 9 | // 10 | 11 | #ifndef __hifi__Stats__ 12 | #define __hifi__Stats__ 13 | 14 | #include 15 | 16 | class SimpleMovingAverage { 17 | public: 18 | SimpleMovingAverage(int numSamplesToAverage); 19 | 20 | int updateAverage(float sample); 21 | void reset(); 22 | 23 | int getSampleCount() { return _numSamples; }; 24 | float getAverage() { return _average; }; 25 | float getEventDeltaAverage(); 26 | float getAverageSampleValuePerSecond(); 27 | private: 28 | int _numSamples; 29 | uint64_t _lastEventTimestamp; 30 | float _average; 31 | float _eventDeltaAverage; 32 | 33 | const float WEIGHTING; 34 | const float ONE_MINUS_WEIGHTING; 35 | }; 36 | 37 | #endif /* defined(__hifi__Stats__) */ 38 | -------------------------------------------------------------------------------- /domain-server/resources/web/assignment/index.shtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | Create JS Assignment 5 | 6 | 7 | 8 |
9 | 10 | 11 | 12 |
13 | 14 | Run 15 | 16 |
17 |
18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /externals/stk/include/Function.h: -------------------------------------------------------------------------------- 1 | #ifndef STK_FUNCTION_H 2 | #define STK_FUNCTION_H 3 | 4 | #include "Stk.h" 5 | 6 | namespace stk { 7 | 8 | /***************************************************/ 9 | /*! \class Function 10 | \brief STK abstract function parent class. 11 | 12 | This class provides common functionality for STK classes that 13 | implement tables or other types of input to output function 14 | mappings. 15 | 16 | by Perry R. Cook and Gary P. Scavone, 1995-2012. 17 | */ 18 | /***************************************************/ 19 | 20 | class Function : public Stk 21 | { 22 | public: 23 | //! Class constructor. 24 | Function( void ) { lastFrame_.resize( 1, 1, 0.0 ); }; 25 | 26 | //! Return the last computed output sample. 27 | StkFloat lastOut( void ) const { return lastFrame_[0]; }; 28 | 29 | //! Take one sample input and compute one sample of output. 30 | virtual StkFloat tick( StkFloat input ) = 0; 31 | 32 | protected: 33 | 34 | StkFrames lastFrame_; 35 | 36 | }; 37 | 38 | } // stk namespace 39 | 40 | #endif 41 | 42 | -------------------------------------------------------------------------------- /interface/src/GLCanvas.h: -------------------------------------------------------------------------------- 1 | // 2 | // GLCanvas.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 8/14/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__GLCanvas__ 10 | #define __hifi__GLCanvas__ 11 | 12 | #include 13 | 14 | /// customized canvas that simply forwards requests/events to the singleton application 15 | class GLCanvas : public QGLWidget { 16 | public: 17 | GLCanvas(); 18 | protected: 19 | 20 | virtual void initializeGL(); 21 | virtual void paintGL(); 22 | virtual void resizeGL(int width, int height); 23 | 24 | virtual void keyPressEvent(QKeyEvent* event); 25 | virtual void keyReleaseEvent(QKeyEvent* event); 26 | 27 | virtual void mouseMoveEvent(QMouseEvent* event); 28 | virtual void mousePressEvent(QMouseEvent* event); 29 | virtual void mouseReleaseEvent(QMouseEvent* event); 30 | 31 | virtual bool event(QEvent* event); 32 | 33 | virtual void wheelEvent(QWheelEvent* event); 34 | }; 35 | 36 | #endif /* defined(__hifi__GLCanvas__) */ 37 | -------------------------------------------------------------------------------- /interface/src/VoxelImporter.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelImporter.h 3 | // hifi 4 | // 5 | // Created by Clement Brisset on 8/9/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__VoxelImporter__ 10 | #define __hifi__VoxelImporter__ 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | #include 17 | 18 | class ImportTask; 19 | 20 | class VoxelImporter : public QObject { 21 | Q_OBJECT 22 | public: 23 | VoxelImporter(QWidget* parent = NULL); 24 | ~VoxelImporter(); 25 | 26 | void init(); 27 | void reset(); 28 | 29 | VoxelTree* getVoxelTree() { return &_voxelTree; } 30 | 31 | public slots: 32 | int exec(); 33 | int preImport(); 34 | int import(); 35 | 36 | private slots: 37 | void launchTask(); 38 | 39 | private: 40 | VoxelTree _voxelTree; 41 | ImportDialog _importDialog; 42 | 43 | QString _filename; 44 | 45 | ImportTask* _currentTask; 46 | ImportTask* _nextTask; 47 | }; 48 | 49 | #endif /* defined(__hifi__VoxelImporter__) */ 50 | -------------------------------------------------------------------------------- /interface/resources/shaders/horizontal_blur.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // horizontal_blur.frag 5 | // fragment shader 6 | // 7 | // Created by Andrzej Kapolka on 8/8/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the texture containing the original color 12 | uniform sampler2D originalTexture; 13 | 14 | void main(void) { 15 | float ds = dFdx(gl_TexCoord[0].s); 16 | gl_FragColor = (texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -7.5, 0.0)) + 17 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -5.5, 0.0)) + 18 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -3.5, 0.0)) + 19 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * -1.5, 0.0)) + 20 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 1.5, 0.0)) + 21 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 3.5, 0.0)) + 22 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 5.5, 0.0)) + 23 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(ds * 7.5, 0.0))) / 8.0; 24 | } 25 | -------------------------------------------------------------------------------- /interface/src/ui/VoxelStatsDialog.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelStatsDialog.h 3 | // interface 4 | // 5 | // Created by Brad Hefta-Gaub on 7/19/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__VoxelStatsDialog__ 10 | #define __hifi__VoxelStatsDialog__ 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | class VoxelStatsDialog : public QDialog { 18 | Q_OBJECT 19 | public: 20 | // Sets up the UI 21 | VoxelStatsDialog(QWidget* parent, VoxelSceneStats* model); 22 | ~VoxelStatsDialog(); 23 | 24 | signals: 25 | void closed(); 26 | 27 | public slots: 28 | void reject(); 29 | 30 | protected: 31 | // State <- data model held by BandwidthMeter 32 | void paintEvent(QPaintEvent*); 33 | 34 | // Emits a 'closed' signal when this dialog is closed. 35 | void closeEvent(QCloseEvent*); 36 | 37 | private: 38 | QLabel* _labels[VoxelSceneStats::ITEM_COUNT]; 39 | VoxelSceneStats* _model; 40 | }; 41 | 42 | #endif /* defined(__interface__VoxelStatsDialog__) */ 43 | 44 | -------------------------------------------------------------------------------- /interface/resources/shaders/vertical_blur.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // vertical_blur.frag 5 | // fragment shader 6 | // 7 | // Created by Andrzej Kapolka on 8/14/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the texture containing the horizontally blurred color 12 | uniform sampler2D originalTexture; 13 | 14 | void main(void) { 15 | float dt = dFdy(gl_TexCoord[0].t); 16 | gl_FragColor = (texture2D(originalTexture, gl_TexCoord[0].st + vec2(0.0, dt * -7.5)) + 17 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(0.0, dt * -5.5)) + 18 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(0.0, dt * -3.5)) + 19 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(0.0, dt * -1.5)) + 20 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(0.0, dt * 1.5)) + 21 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(0.0, dt * 3.5)) + 22 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(0.0, dt * 5.5)) + 23 | texture2D(originalTexture, gl_TexCoord[0].st + vec2(0.0, dt * 7.5))) / 8.0; 24 | } 25 | -------------------------------------------------------------------------------- /libraries/shared/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(ROOT_DIR ../..) 4 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 5 | 6 | set(TARGET_NAME shared) 7 | project(${TARGET_NAME}) 8 | 9 | find_package(Qt5Network REQUIRED) 10 | 11 | include(${MACRO_DIR}/SetupHifiLibrary.cmake) 12 | setup_hifi_library(${TARGET_NAME}) 13 | 14 | qt5_use_modules(${TARGET_NAME} Network) 15 | 16 | set(EXTERNAL_ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/external) 17 | 18 | if (WIN32) 19 | # include headers for external libraries and InterfaceConfig. 20 | include_directories(${EXTERNAL_ROOT_DIR}) 21 | else (WIN32) 22 | find_package(CURL REQUIRED) 23 | include_directories(${CURL_INCLUDE_DIRS}) 24 | target_link_libraries(${TARGET_NAME} ${CURL_LIBRARY}) 25 | endif (WIN32) 26 | 27 | # link required libraries on UNIX 28 | if (UNIX AND NOT APPLE) 29 | find_package(Threads REQUIRED) 30 | target_link_libraries(${TARGET_NAME} ${CMAKE_THREAD_LIBS_INIT}) 31 | endif (UNIX AND NOT APPLE) 32 | 33 | # include GLM 34 | include(${MACRO_DIR}/IncludeGLM.cmake) 35 | include_glm(${TARGET_NAME} ${ROOT_DIR}) 36 | -------------------------------------------------------------------------------- /externals/glm/gtx/noise.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Based on the work of Stefan Gustavson and Ashima Arts on "webgl-noise": 5 | // https://github.com/ashima/webgl-noise 6 | // Following Stefan Gustavson's paper "Simplex noise demystified": 7 | // http://www.itn.liu.se/~stegu/simplexnoise/simplexnoise.pdf 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | // Created : 2011-04-21 10 | // Updated : 2011-04-21 11 | // Licence : This source is under MIT License 12 | // File : glm/gtx/noise.inl 13 | /////////////////////////////////////////////////////////////////////////////////////////////////// 14 | // Dependency: 15 | // - GLM core 16 | /////////////////////////////////////////////////////////////////////////////////////////////////// 17 | 18 | namespace glm{ 19 | 20 | }//namespace glm 21 | -------------------------------------------------------------------------------- /interface/src/renderer/AmbientOcclusionEffect.h: -------------------------------------------------------------------------------- 1 | // 2 | // AmbientOcclusionEffect.h 3 | // interface 4 | // 5 | // Created by Andrzej Kapolka on 7/14/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__AmbientOcclusionEffect__ 10 | #define __interface__AmbientOcclusionEffect__ 11 | 12 | #include "InterfaceConfig.h" 13 | 14 | class ProgramObject; 15 | 16 | /// A screen space ambient occlusion effect. See John Chapman's tutorial at 17 | /// http://john-chapman-graphics.blogspot.co.uk/2013/01/ssao-tutorial.html for reference. 18 | class AmbientOcclusionEffect { 19 | public: 20 | 21 | void init(); 22 | 23 | void render(); 24 | 25 | private: 26 | 27 | ProgramObject* _occlusionProgram; 28 | int _nearLocation; 29 | int _farLocation; 30 | int _leftBottomLocation; 31 | int _rightTopLocation; 32 | int _noiseScaleLocation; 33 | 34 | ProgramObject* _blurProgram; 35 | int _blurScaleLocation; 36 | 37 | GLuint _rotationTextureID; 38 | }; 39 | 40 | #endif /* defined(__interface__AmbientOcclusionEffect__) */ 41 | -------------------------------------------------------------------------------- /libraries/voxel-server-library/src/VoxelPersistThread.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelPersistThread.h 3 | // voxel-server 4 | // 5 | // Created by Brad Hefta-Gaub on 8/21/13 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | // Threaded or non-threaded voxel persistence 9 | // 10 | 11 | #ifndef __voxel_server__VoxelPersistThread__ 12 | #define __voxel_server__VoxelPersistThread__ 13 | 14 | #include 15 | #include 16 | #include 17 | 18 | /// Generalized threaded processor for handling received inbound packets. 19 | class VoxelPersistThread : public virtual GenericThread { 20 | public: 21 | static const int DEFAULT_PERSIST_INTERVAL = 1000 * 30; // every 30 seconds 22 | 23 | VoxelPersistThread(VoxelTree* tree, const char* filename, int persistInterval = DEFAULT_PERSIST_INTERVAL); 24 | protected: 25 | /// Implements generic processing behavior for this thread. 26 | virtual bool process(); 27 | private: 28 | VoxelTree* _tree; 29 | const char* _filename; 30 | int _persistInterval; 31 | }; 32 | 33 | #endif // __voxel_server__VoxelPersistThread__ 34 | -------------------------------------------------------------------------------- /interface/external/fervor/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | project(Fervor) 3 | 4 | find_package(Qt5Core REQUIRED) 5 | find_package(Qt5Network REQUIRED) 6 | find_package(Qt5Widgets REQUIRED) 7 | find_package(Qt5WebKitWidgets REQUIRED) 8 | 9 | add_definitions(-DFV_GUI) 10 | 11 | file(GLOB FERVOR_SOURCES *.cpp) 12 | file(GLOB FERVOR_HEADERS *.h) 13 | 14 | file(GLOB FERVOR_UI *.ui) 15 | 16 | qt5_wrap_ui(FERVOR_WRAPPED_UI ${FERVOR_UI}) 17 | 18 | LIST(GET FERVOR_HEADERS 1 FIRST_HEADER) 19 | GET_FILENAME_COMPONENT(HEADER_PATH ${FIRST_HEADER} PATH) 20 | list(REMOVE_ITEM FERVOR_HEADERS ${HEADER_PATH}/fvversioncomparator.h) 21 | 22 | file(GLOB FERVOR_UI *.ui) 23 | 24 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/") 25 | find_package(Quazip REQUIRED) 26 | 27 | include_directories( 28 | ${CMAKE_CURRENT_BINARY_DIR} 29 | ${QUAZIP_INCLUDE_DIRS} 30 | ) 31 | 32 | add_library(fervor ${FERVOR_SOURCES} ${FERVOR_HEADERS} ${FERVOR_MOC_SOURCES} ${FERVOR_WRAPPED_UI}) 33 | target_link_libraries(fervor ${QUAZIP_LIBRARIES}) 34 | 35 | qt5_use_modules(fervor Core Network Widgets WebKitWidgets) -------------------------------------------------------------------------------- /libraries/avatars/src/HeadData.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // HeadData.cpp 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 5/20/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #include "HeadData.h" 10 | 11 | HeadData::HeadData(AvatarData* owningAvatar) : 12 | _yaw(0.0f), 13 | _pitch(0.0f), 14 | _roll(0.0f), 15 | _lookAtPosition(0.0f, 0.0f, 0.0f), 16 | _leanSideways(0.0f), 17 | _leanForward(0.0f), 18 | _audioLoudness(0.0f), 19 | _isFaceshiftConnected(false), 20 | _leftEyeBlink(0.0f), 21 | _rightEyeBlink(0.0f), 22 | _averageLoudness(0.0f), 23 | _browAudioLift(0.0f), 24 | _owningAvatar(owningAvatar) 25 | { 26 | 27 | } 28 | 29 | void HeadData::addYaw(float yaw) { 30 | setYaw(_yaw + yaw); 31 | } 32 | 33 | void HeadData::addPitch(float pitch) { 34 | setPitch(_pitch + pitch); 35 | } 36 | 37 | void HeadData::addRoll(float roll) { 38 | setRoll(_roll + roll); 39 | } 40 | 41 | 42 | void HeadData::addLean(float sideways, float forwards) { 43 | // Add lean as impulse 44 | _leanSideways += sideways; 45 | _leanForward += forwards; 46 | } 47 | -------------------------------------------------------------------------------- /interface/src/ui/BandwidthDialog.h: -------------------------------------------------------------------------------- 1 | // 2 | // BandwidthDialog.h 3 | // interface 4 | // 5 | // Created by Tobias Schwinger on 6/21/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__BandwidthDialog__ 10 | #define __hifi__BandwidthDialog__ 11 | 12 | #include 13 | #include 14 | 15 | #include "BandwidthMeter.h" 16 | 17 | 18 | class BandwidthDialog : public QDialog { 19 | Q_OBJECT 20 | public: 21 | // Sets up the UI based on the configuration of the BandwidthMeter 22 | BandwidthDialog(QWidget* parent, BandwidthMeter* model); 23 | ~BandwidthDialog(); 24 | 25 | signals: 26 | 27 | void closed(); 28 | 29 | public slots: 30 | 31 | void reject(); 32 | 33 | protected: 34 | 35 | // State <- data model held by BandwidthMeter 36 | void paintEvent(QPaintEvent*); 37 | 38 | // Emits a 'closed' signal when this dialog is closed. 39 | void closeEvent(QCloseEvent*); 40 | 41 | private: 42 | BandwidthMeter* _model; 43 | QLabel* _labels[BandwidthMeter::N_STREAMS]; 44 | }; 45 | 46 | #endif /* defined(__interface__BandwidthDialog__) */ 47 | 48 | -------------------------------------------------------------------------------- /interface/resources/shaders/face.vert: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // face.vert 5 | // vertex shader 6 | // 7 | // Created by Andrzej Kapolka on 7/12/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the lower left texture coordinate 12 | uniform vec2 texCoordCorner; 13 | 14 | // the texture coordinate vector from left to right 15 | uniform vec2 texCoordRight; 16 | 17 | // the texture coordinate vector from bottom to the top 18 | uniform vec2 texCoordUp; 19 | 20 | // the depth texture 21 | uniform sampler2D depthTexture; 22 | 23 | void main(void) { 24 | gl_TexCoord[0] = vec4(texCoordCorner + gl_Vertex.x * texCoordRight + gl_Vertex.y * texCoordUp, 0.0, 1.0); 25 | float depth = texture2D(depthTexture, gl_TexCoord[0].st).r; 26 | 27 | // set alpha to zero for invalid depth values 28 | const float MIN_VISIBLE_DEPTH = 1.0 / 255.0; 29 | const float MAX_VISIBLE_DEPTH = 254.0 / 255.0; 30 | gl_FrontColor = vec4(1.0, 1.0, 1.0, step(MIN_VISIBLE_DEPTH, depth) * (1.0 - step(MAX_VISIBLE_DEPTH, depth))); 31 | gl_Position = gl_ModelViewProjectionMatrix * vec4(0.5 - gl_Vertex.x, gl_Vertex.y - 0.5, depth - 0.5, 1.0); 32 | } 33 | -------------------------------------------------------------------------------- /libraries/voxel-server-library/src/VoxelServerConsts.h: -------------------------------------------------------------------------------- 1 | // VoxelServerConsts.h 2 | // voxel-server 3 | // 4 | // Created by Brad Hefta-Gaub on 8/21/13 5 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 6 | // 7 | // 8 | 9 | #ifndef __voxel_server__VoxelServerConsts__ 10 | #define __voxel_server__VoxelServerConsts__ 11 | 12 | #include 13 | #include // for MAX_PACKET_SIZE 14 | #include 15 | #include 16 | 17 | #include "VoxelServerPacketProcessor.h" 18 | 19 | 20 | const int MAX_FILENAME_LENGTH = 1024; 21 | const int VOXEL_SIZE_BYTES = 3 + (3 * sizeof(float)); 22 | const int VOXELS_PER_PACKET = (MAX_PACKET_SIZE - 1) / VOXEL_SIZE_BYTES; 23 | const int VOXEL_SEND_INTERVAL_USECS = 17 * 1000; // approximately 60fps 24 | const int SENDING_TIME_TO_SPARE = 5 * 1000; // usec of sending interval to spare for calculating voxels 25 | const int INTERVALS_PER_SECOND = 1000 * 1000 / VOXEL_SEND_INTERVAL_USECS; 26 | const int ENVIRONMENT_SEND_INTERVAL_USECS = 1000000; 27 | 28 | extern const char* LOCAL_VOXELS_PERSIST_FILE; 29 | extern const char* VOXELS_PERSIST_FILE; 30 | 31 | #endif // __voxel_server__VoxelServerConsts__ 32 | -------------------------------------------------------------------------------- /libraries/voxel-server-library/src/VoxelPersistThread.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelPersistThread.cpp 3 | // voxel-server 4 | // 5 | // Created by Brad Hefta-Gaub on 8/21/13 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | // Threaded or non-threaded voxel persistence 9 | // 10 | 11 | #include 12 | #include 13 | 14 | #include "VoxelPersistThread.h" 15 | #include "VoxelServer.h" 16 | 17 | VoxelPersistThread::VoxelPersistThread(VoxelTree* tree, const char* filename, int persistInterval) : 18 | _tree(tree), 19 | _filename(filename), 20 | _persistInterval(persistInterval) { 21 | } 22 | 23 | bool VoxelPersistThread::process() { 24 | uint64_t MSECS_TO_USECS = 1000; 25 | usleep(_persistInterval * MSECS_TO_USECS); 26 | 27 | 28 | // check the dirty bit and persist here... 29 | if (_tree->isDirty()) { 30 | printf("saving voxels to file %s...\n",_filename); 31 | _tree->writeToSVOFile(_filename); 32 | _tree->clearDirtyBit(); // tree is clean after saving 33 | printf("DONE saving voxels to file...\n"); 34 | } 35 | 36 | return isStillRunning(); // keep running till they terminate us 37 | } 38 | -------------------------------------------------------------------------------- /externals/glm/gtx/handed_coordinate_space.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2009-02-19 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/handed_coordinate_space.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER bool rightHanded 14 | ( 15 | detail::tvec3 const & tangent, 16 | detail::tvec3 const & binormal, 17 | detail::tvec3 const & normal 18 | ) 19 | { 20 | return dot(cross(normal, tangent), binormal) > T(0); 21 | } 22 | 23 | template 24 | GLM_FUNC_QUALIFIER bool leftHanded 25 | ( 26 | detail::tvec3 const & tangent, 27 | detail::tvec3 const & binormal, 28 | detail::tvec3 const & normal 29 | ) 30 | { 31 | return dot(cross(normal, tangent), binormal) < T(0); 32 | } 33 | }//namespace glm 34 | -------------------------------------------------------------------------------- /interface/resources/shaders/skin_voxels.vert: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // skin_voxels.vert 5 | // vertex shader 6 | // 7 | // Created by Andrzej Kapolka on 5/31/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | const int MAX_BONES = 32; 12 | const int INDICES_PER_VERTEX = 4; 13 | 14 | uniform mat4 boneMatrices[MAX_BONES]; 15 | 16 | attribute vec4 boneIndices; 17 | attribute vec4 boneWeights; 18 | 19 | void main(void) { 20 | vec4 position = vec4(0.0, 0.0, 0.0, 0.0); 21 | vec4 normal = vec4(0.0, 0.0, 0.0, 0.0); 22 | for (int i = 0; i < INDICES_PER_VERTEX; i++) { 23 | mat4 boneMatrix = boneMatrices[int(boneIndices[i])]; 24 | float boneWeight = boneWeights[i]; 25 | position += boneMatrix * gl_Vertex * boneWeight; 26 | normal += boneMatrix * vec4(gl_Normal, 0.0) * boneWeight; 27 | } 28 | position = gl_ModelViewProjectionMatrix * position; 29 | normal = normalize(gl_ModelViewMatrix * normal); 30 | 31 | gl_FrontColor = gl_Color * (gl_LightModel.ambient + gl_LightSource[0].ambient + 32 | gl_LightSource[0].diffuse * max(0.0, dot(normal, gl_LightSource[0].position))); 33 | gl_Position = position; 34 | } 35 | -------------------------------------------------------------------------------- /libraries/voxel-server-library/src/VoxelServerPacketProcessor.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelServerPacketProcessor.h 3 | // voxel-server 4 | // 5 | // Created by Brad Hefta-Gaub on 8/21/13 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | // Threaded or non-threaded network packet processor for the voxel-server 9 | // 10 | 11 | #ifndef __voxel_server__VoxelServerPacketProcessor__ 12 | #define __voxel_server__VoxelServerPacketProcessor__ 13 | 14 | #include 15 | class VoxelServer; 16 | 17 | /// Handles processing of incoming network packets for the voxel-server. As with other ReceivedPacketProcessor classes 18 | /// the user is responsible for reading inbound packets and adding them to the processing queue by calling queueReceivedPacket() 19 | class VoxelServerPacketProcessor : public ReceivedPacketProcessor { 20 | 21 | public: 22 | VoxelServerPacketProcessor(VoxelServer* myServer); 23 | 24 | protected: 25 | virtual void processPacket(sockaddr& senderAddress, unsigned char* packetData, ssize_t packetLength); 26 | 27 | private: 28 | VoxelServer* _myServer; 29 | int _receivedPacketCount; 30 | }; 31 | #endif // __voxel_server__VoxelServerPacketProcessor__ 32 | -------------------------------------------------------------------------------- /assignment-client/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(TARGET_NAME assignment-client) 4 | 5 | set(ROOT_DIR ..) 6 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 7 | 8 | # setup for find modules 9 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../cmake/modules/") 10 | 11 | find_package(Qt5Network REQUIRED) 12 | 13 | include(${MACRO_DIR}/SetupHifiProject.cmake) 14 | setup_hifi_project(${TARGET_NAME} TRUE) 15 | 16 | qt5_use_modules(${TARGET_NAME} Network) 17 | 18 | # include glm 19 | include(${MACRO_DIR}/IncludeGLM.cmake) 20 | include_glm(${TARGET_NAME} ${ROOT_DIR}) 21 | 22 | # link in the shared library 23 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 24 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) 25 | link_hifi_library(audio ${TARGET_NAME} ${ROOT_DIR}) 26 | link_hifi_library(avatars ${TARGET_NAME} ${ROOT_DIR}) 27 | link_hifi_library(voxels ${TARGET_NAME} ${ROOT_DIR}) 28 | link_hifi_library(voxel-server-library ${TARGET_NAME} ${ROOT_DIR}) 29 | 30 | # link the stk library 31 | set(STK_ROOT_DIR ${ROOT_DIR}/externals/stk) 32 | find_package(STK REQUIRED) 33 | target_link_libraries(${TARGET_NAME} ${STK_LIBRARIES}) 34 | include_directories(${STK_INCLUDE_DIRS}) 35 | 36 | -------------------------------------------------------------------------------- /libraries/voxel-server-library/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(ROOT_DIR ../..) 4 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 5 | 6 | # setup for find modules 7 | set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/modules/") 8 | 9 | set(TARGET_NAME voxel-server-library) 10 | 11 | find_package(Qt5Widgets REQUIRED) 12 | 13 | include(${MACRO_DIR}/SetupHifiLibrary.cmake) 14 | setup_hifi_library(${TARGET_NAME}) 15 | 16 | qt5_use_modules(${TARGET_NAME} Widgets) 17 | 18 | include(${MACRO_DIR}/IncludeGLM.cmake) 19 | include_glm(${TARGET_NAME} ${ROOT_DIR}) 20 | 21 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 22 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) 23 | 24 | # link ZLIB 25 | find_package(ZLIB) 26 | include_directories(${ZLIB_INCLUDE_DIRS}) 27 | target_link_libraries(${TARGET_NAME} ${ZLIB_LIBRARIES}) 28 | 29 | # link in the shared library 30 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 31 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) 32 | 33 | # link in the hifi voxels library 34 | link_hifi_library(voxels ${TARGET_NAME} ${ROOT_DIR}) 35 | 36 | # link in the hifi avatars library 37 | link_hifi_library(avatars ${TARGET_NAME} ${ROOT_DIR}) 38 | -------------------------------------------------------------------------------- /libraries/shared/src/NodeTypes.h: -------------------------------------------------------------------------------- 1 | // 2 | // NodeTypes.h 3 | // hifi 4 | // 5 | // Created by Brad Hefta-Gaub on 2013/04/09 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | // Single byte/character Node Types used to identify various nodes in the system. 9 | // For example, an node whose is 'V' is always a voxel server. 10 | 11 | #ifndef hifi_NodeTypes_h 12 | #define hifi_NodeTypes_h 13 | 14 | // NOTE: If you add a new NODE_TYPE_XXX then you also should add a new NODE_TYPE_NAME_XXX and a new "case" to the 15 | // switch statement in Node.cpp specifically Node::getTypeName(). 16 | // If you don't then it will make things harder on your co-developers in debugging because the Node 17 | // class won't know the name and will report it as "Unknown". 18 | 19 | typedef char NODE_TYPE; 20 | const NODE_TYPE NODE_TYPE_DOMAIN = 'D'; 21 | const NODE_TYPE NODE_TYPE_VOXEL_SERVER = 'V'; 22 | const NODE_TYPE NODE_TYPE_AGENT = 'I'; 23 | const NODE_TYPE NODE_TYPE_AUDIO_MIXER = 'M'; 24 | const NODE_TYPE NODE_TYPE_AVATAR_MIXER = 'W'; 25 | const NODE_TYPE NODE_TYPE_AUDIO_INJECTOR = 'A'; 26 | const NODE_TYPE NODE_TYPE_ANIMATION_SERVER = 'a'; 27 | const NODE_TYPE NODE_TYPE_UNASSIGNED = 1; 28 | 29 | #endif 30 | -------------------------------------------------------------------------------- /assignment-client/src/audio/AvatarAudioRingBuffer.h: -------------------------------------------------------------------------------- 1 | // 2 | // AvatarAudioRingBuffer.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 6/5/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__AvatarAudioRingBuffer__ 10 | #define __hifi__AvatarAudioRingBuffer__ 11 | 12 | #include 13 | #include 14 | 15 | #include "PositionalAudioRingBuffer.h" 16 | 17 | typedef std::map TwoPoleNodeMap; 18 | 19 | class AvatarAudioRingBuffer : public PositionalAudioRingBuffer { 20 | public: 21 | AvatarAudioRingBuffer(); 22 | ~AvatarAudioRingBuffer(); 23 | 24 | int parseData(unsigned char* sourceBuffer, int numBytes); 25 | 26 | TwoPoleNodeMap& getTwoPoles() { return _twoPoles; } 27 | 28 | bool shouldLoopbackForNode() const { return _shouldLoopbackForNode; } 29 | private: 30 | // disallow copying of AvatarAudioRingBuffer objects 31 | AvatarAudioRingBuffer(const AvatarAudioRingBuffer&); 32 | AvatarAudioRingBuffer& operator= (const AvatarAudioRingBuffer&); 33 | 34 | TwoPoleNodeMap _twoPoles; 35 | bool _shouldLoopbackForNode; 36 | }; 37 | 38 | #endif /* defined(__hifi__AvatarAudioRingBuffer__) */ 39 | -------------------------------------------------------------------------------- /libraries/audio/src/InjectedAudioRingBuffer.h: -------------------------------------------------------------------------------- 1 | // 2 | // InjectedAudioRingBuffer.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 6/5/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__InjectedAudioRingBuffer__ 10 | #define __hifi__InjectedAudioRingBuffer__ 11 | 12 | #include "AudioInjector.h" 13 | 14 | #include "PositionalAudioRingBuffer.h" 15 | 16 | class InjectedAudioRingBuffer : public PositionalAudioRingBuffer { 17 | public: 18 | InjectedAudioRingBuffer(); 19 | 20 | int parseData(unsigned char* sourceBuffer, int numBytes); 21 | 22 | float getRadius() const { return _radius; } 23 | float getAttenuationRatio() const { return _attenuationRatio; } 24 | const unsigned char* getStreamIdentifier() const { return _streamIdentifier; } 25 | private: 26 | // disallow copying of InjectedAudioRingBuffer objects 27 | InjectedAudioRingBuffer(const InjectedAudioRingBuffer&); 28 | InjectedAudioRingBuffer& operator= (const InjectedAudioRingBuffer&); 29 | 30 | float _radius; 31 | float _attenuationRatio; 32 | unsigned char _streamIdentifier[STREAM_IDENTIFIER_NUM_BYTES]; 33 | }; 34 | 35 | #endif /* defined(__hifi__InjectedAudioRingBuffer__) */ 36 | -------------------------------------------------------------------------------- /libraries/audio/src/AudioInjectionManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // AudioInjectionManager.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 5/16/13. 6 | // Copyright (c) 2012 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__AudioInjectionManager__ 10 | #define __hifi__AudioInjectionManager__ 11 | 12 | #include 13 | 14 | #include "UDPSocket.h" 15 | #include "AudioInjector.h" 16 | 17 | const int MAX_CONCURRENT_INJECTORS = 50; 18 | 19 | class AudioInjectionManager { 20 | public: 21 | static AudioInjector* injectorWithCapacity(int capacity); 22 | static AudioInjector* injectorWithSamplesFromFile(const char* filename); 23 | 24 | static void threadInjector(AudioInjector* injector); 25 | 26 | static void setInjectorSocket(UDPSocket* injectorSocket) { _injectorSocket = injectorSocket;} 27 | static void setDestinationSocket(sockaddr& destinationSocket); 28 | private: 29 | static void* injectAudioViaThread(void* args); 30 | 31 | static UDPSocket* _injectorSocket; 32 | static sockaddr _destinationSocket; 33 | static bool _isDestinationSocketExplicit; 34 | static AudioInjector* _injectors[MAX_CONCURRENT_INJECTORS]; 35 | }; 36 | 37 | #endif /* defined(__hifi__AudioInjectionManager__) */ 38 | -------------------------------------------------------------------------------- /interface/external/LibOVR/Include/OVR.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | 3 | Filename : OVR.h 4 | Content : This contains references to all OVR-specific headers in Src folder. 5 | Should be generated automatically based on PublicHeader tags. 6 | 7 | Copyright : Copyright 2012 Oculus VR, Inc. All Rights reserved. 8 | 9 | Use of this software is subject to the terms of the Oculus license 10 | agreement provided at the time of installation or download, or which 11 | otherwise accompanies this software in either electronic or hard copy form. 12 | 13 | *************************************************************************************/ 14 | 15 | #ifndef OVR_h 16 | #define OVR_h 17 | 18 | #include "../Src/Kernel/OVR_Allocator.h" 19 | #include "../Src/Kernel/OVR_Log.h" 20 | #include "../Src/Kernel/OVR_Math.h" 21 | #include "../Src/Kernel/OVR_System.h" 22 | #include "../Src/Kernel/OVR_Types.h" 23 | #include "../Src/OVR_Device.h" 24 | #include "../Src/OVR_DeviceConstants.h" 25 | #include "../Src/OVR_DeviceHandle.h" 26 | #include "../Src/OVR_DeviceMessages.h" 27 | #include "../Src/OVR_SensorFusion.h" 28 | #include "../Src/Util/Util_LatencyTest.h" 29 | #include "../Src/Util/Util_Render_Stereo.h" 30 | 31 | #endif 32 | 33 | -------------------------------------------------------------------------------- /assignment-client/src/AssignmentFactory.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // AssignmentFactory.cpp 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 9/17/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | #include "Agent.h" 12 | #include "audio/AudioMixer.h" 13 | #include "avatars/AvatarMixer.h" 14 | #include 15 | 16 | #include "AssignmentFactory.h" 17 | 18 | Assignment* AssignmentFactory::unpackAssignment(const unsigned char* dataBuffer, int numBytes) { 19 | int headerBytes = numBytesForPacketHeader(dataBuffer); 20 | 21 | Assignment::Type assignmentType = Assignment::AllTypes; 22 | memcpy(&assignmentType, dataBuffer + headerBytes, sizeof(Assignment::Type)); 23 | 24 | switch (assignmentType) { 25 | case Assignment::AudioMixerType: 26 | return new AudioMixer(dataBuffer, numBytes); 27 | case Assignment::AvatarMixerType: 28 | return new AvatarMixer(dataBuffer, numBytes); 29 | case Assignment::AgentType: 30 | return new Agent(dataBuffer, numBytes); 31 | case Assignment::VoxelServerType: 32 | return new VoxelServer(dataBuffer, numBytes); 33 | default: 34 | return new Assignment(dataBuffer, numBytes); 35 | } 36 | } -------------------------------------------------------------------------------- /interface/src/VoxelFade.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelFade.h 3 | // interface 4 | // 5 | // Created by Brad Hefta-Gaub on 8/6/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__VoxelFade__ 10 | #define __interface__VoxelFade__ 11 | 12 | #include // for VoxelPositionSize 13 | 14 | class VoxelFade { 15 | public: 16 | 17 | enum FadeDirection { FADE_OUT, FADE_IN}; 18 | static const float FADE_OUT_START; 19 | static const float FADE_OUT_END; 20 | static const float FADE_OUT_STEP; 21 | static const float FADE_IN_START; 22 | static const float FADE_IN_END; 23 | static const float FADE_IN_STEP; 24 | static const float DEFAULT_RED; 25 | static const float DEFAULT_GREEN; 26 | static const float DEFAULT_BLUE; 27 | 28 | VoxelPositionSize voxelDetails; 29 | FadeDirection direction; 30 | float opacity; 31 | 32 | float red; 33 | float green; 34 | float blue; 35 | 36 | VoxelFade(FadeDirection direction = FADE_OUT, float red = DEFAULT_RED, 37 | float green = DEFAULT_GREEN, float blue = DEFAULT_BLUE); 38 | 39 | void render(); 40 | bool isDone() const; 41 | }; 42 | 43 | #endif // __interface__VoxelFade__ 44 | -------------------------------------------------------------------------------- /libraries/voxels/src/Plane.h: -------------------------------------------------------------------------------- 1 | // 2 | // Plane.h 3 | // hifi 4 | // 5 | // Created by Brad Hefta-Gaub on 04/11/13. 6 | // Originally from lighthouse3d. Modified to utilize glm::vec3 and clean up to our coding standards 7 | // 8 | // Simple plane class. 9 | // 10 | 11 | #ifndef _PLANE_ 12 | #define _PLANE_ 13 | 14 | #include 15 | 16 | class Plane 17 | { 18 | public: 19 | Plane(const glm::vec3 &v1, const glm::vec3 &v2, const glm::vec3 &v3) { set3Points(v1,v2,v3); } 20 | Plane() : _normal(0,0,0), _point(0,0,0), _dCoefficient(0) {}; 21 | ~Plane() {} ; 22 | 23 | // methods for defining the plane 24 | void set3Points(const glm::vec3 &v1, const glm::vec3 &v2, const glm::vec3 &v3); 25 | void setNormalAndPoint(const glm::vec3 &normal, const glm::vec3 &point); 26 | void setCoefficients(float a, float b, float c, float d); 27 | 28 | // getters 29 | const glm::vec3& getNormal() const { return _normal; }; 30 | const glm::vec3& getPoint() const { return _point; }; 31 | float getDCoefficient() const { return _dCoefficient; }; 32 | 33 | // utilities 34 | float distance(const glm::vec3 &point) const; 35 | void print() const; 36 | 37 | private: 38 | glm::vec3 _normal; 39 | glm::vec3 _point; 40 | float _dCoefficient; 41 | }; 42 | 43 | 44 | #endif -------------------------------------------------------------------------------- /interface/external/LibOVR/Src/OVR_HIDDeviceBase.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | 3 | PublicHeader: OVR.h 4 | Filename : OVR_HIDDeviceBase.h 5 | Content : Definition of HID device interface. 6 | Created : March 11, 2013 7 | Authors : Lee Cooper 8 | 9 | Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved. 10 | 11 | Use of this software is subject to the terms of the Oculus license 12 | agreement provided at the time of installation or download, or which 13 | otherwise accompanies this software in either electronic or hard copy form. 14 | 15 | *************************************************************************************/ 16 | 17 | #ifndef OVR_HIDDeviceBase_h 18 | #define OVR_HIDDeviceBase_h 19 | 20 | #include "Kernel/OVR_Types.h" 21 | 22 | namespace OVR { 23 | 24 | //------------------------------------------------------------------------------------- 25 | // ***** HIDDeviceBase 26 | 27 | // Base interface for HID devices. 28 | class HIDDeviceBase 29 | { 30 | public: 31 | 32 | virtual ~HIDDeviceBase() { } 33 | 34 | virtual bool SetFeatureReport(UByte* data, UInt32 length) = 0; 35 | virtual bool GetFeatureReport(UByte* data, UInt32 length) = 0; 36 | }; 37 | 38 | } // namespace OVR 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /externals/glm/gtx/orthonormalize.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-21 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/orthonormalize.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tmat3x3 orthonormalize 14 | ( 15 | const detail::tmat3x3& m 16 | ) 17 | { 18 | detail::tmat3x3 r = m; 19 | 20 | r[0] = normalize(r[0]); 21 | 22 | float d0 = dot(r[0], r[1]); 23 | r[1] -= r[0] * d0; 24 | r[1] = normalize(r[1]); 25 | 26 | float d1 = dot(r[1], r[2]); 27 | d0 = dot(r[0], r[2]); 28 | r[2] -= r[0] * d0 + r[1] * d1; 29 | r[2] = normalize(r[2]); 30 | 31 | return r; 32 | } 33 | 34 | template 35 | GLM_FUNC_QUALIFIER detail::tvec3 orthonormalize 36 | ( 37 | const detail::tvec3& x, 38 | const detail::tvec3& y 39 | ) 40 | { 41 | return normalize(x - y * dot(y, x)); 42 | } 43 | }//namespace glm 44 | -------------------------------------------------------------------------------- /tools/README.md: -------------------------------------------------------------------------------- 1 | tools 2 | ========= 3 | 4 | Various command line tools for interacting with the Voxel Server and Interface. 5 | 6 | objtohio.php : 7 | 8 | USAGE: 9 | php objtohio.php -i 'inputFileName' -o 'outputFileName' -m [blocks|wireframe|surface] -s [voxel size] 10 | 11 | DESCRIPTION: 12 | Converts a Wavefront OBJ file into a voxel binary file suitable for loading locally into the client or 13 | loading on the voxel server or sending to the voxel server using sendvoxels.php 14 | 15 | NOTE: 16 | Depending on the size of the model, it might take a lot of memory, so you will likely need to include 17 | the -d memory_limit=4096M option 18 | 19 | EXAMPLE: 20 | 21 | php -d memory_limit=4096M objtohio.php -i "Samples/little girl head-obj.obj" -o girl-test.hio -s 0.006 22 | 23 | 24 | sendvoxels.php : 25 | 26 | USAGE: 27 | sendvoxels.php -i 'inputFileName' -s [serverip] -p [port] -c [I|R] 28 | 29 | DESCRIPTION: 30 | Sends the contents of a voxel binary file to a voxel server. Can either Insert or Remove voxels. Command defaults 31 | to "I" insert. 32 | 33 | EXAMPLES: 34 | 35 | php sendvoxels.php -s 192.168.1.116 -i 'girl-test.hio' -c I 36 | php sendvoxels.php -s 192.168.1.116 -i 'girl-test.hio' -c R 37 | php sendvoxels.php -s 192.168.1.116 -i 'girl-test.hio' 38 | 39 | 40 | -------------------------------------------------------------------------------- /interface/resources/shaders/face_textured.vert: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // face_textured.vert 5 | // vertex shader 6 | // 7 | // Created by Andrzej Kapolka on 8/6/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the lower left texture coordinate 12 | uniform vec2 texCoordCorner; 13 | 14 | // the texture coordinate vector from left to right 15 | uniform vec2 texCoordRight; 16 | 17 | // the texture coordinate vector from bottom to the top 18 | uniform vec2 texCoordUp; 19 | 20 | // the depth texture 21 | uniform sampler2D depthTexture; 22 | 23 | // the position in model space 24 | varying vec3 position; 25 | 26 | void main(void) { 27 | gl_TexCoord[0] = vec4(texCoordCorner + gl_Vertex.x * texCoordRight + gl_Vertex.y * texCoordUp, 0.0, 1.0); 28 | float depth = texture2D(depthTexture, gl_TexCoord[0].st).r; 29 | 30 | // store the model space vertex 31 | position = gl_Vertex.xyz; 32 | 33 | // set alpha to zero for invalid depth values 34 | const float MIN_VISIBLE_DEPTH = 1.0 / 255.0; 35 | const float MAX_VISIBLE_DEPTH = 254.0 / 255.0; 36 | gl_FrontColor = vec4(1.0, 1.0, 1.0, step(MIN_VISIBLE_DEPTH, depth) * (1.0 - step(MAX_VISIBLE_DEPTH, depth))); 37 | gl_Position = gl_ModelViewProjectionMatrix * vec4(0.5 - gl_Vertex.x, gl_Vertex.y - 0.5, depth - 0.5, 1.0); 38 | } 39 | -------------------------------------------------------------------------------- /libraries/voxel-server-library/src/VoxelSendThread.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelSendThread.h 3 | // voxel-server 4 | // 5 | // Created by Brad Hefta-Gaub on 8/21/13 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | // Threaded or non-threaded object for sending voxels to a client 9 | // 10 | 11 | #ifndef __voxel_server__VoxelSendThread__ 12 | #define __voxel_server__VoxelSendThread__ 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include "VoxelNodeData.h" 19 | #include "VoxelServer.h" 20 | 21 | /// Threaded processor for sending voxel packets to a single client 22 | class VoxelSendThread : public virtual GenericThread { 23 | public: 24 | VoxelSendThread(uint16_t nodeID, VoxelServer* myServer); 25 | protected: 26 | /// Implements generic processing behavior for this thread. 27 | virtual bool process(); 28 | 29 | private: 30 | uint16_t _nodeID; 31 | VoxelServer* _myServer; 32 | 33 | void handlePacketSend(Node* node, VoxelNodeData* nodeData, int& trueBytesSent, int& truePacketsSent); 34 | void deepestLevelVoxelDistributor(Node* node, VoxelNodeData* nodeData, bool viewFrustumChanged); 35 | 36 | unsigned char _tempOutputBuffer[MAX_VOXEL_PACKET_SIZE]; 37 | }; 38 | 39 | #endif // __voxel_server__VoxelSendThread__ 40 | -------------------------------------------------------------------------------- /domain-server/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 2.8) 2 | 3 | set(ROOT_DIR ..) 4 | set(MACRO_DIR ${ROOT_DIR}/cmake/macros) 5 | 6 | set(TARGET_NAME domain-server) 7 | 8 | include(${MACRO_DIR}/SetupHifiProject.cmake) 9 | setup_hifi_project(${TARGET_NAME} TRUE) 10 | 11 | # setup a library for civetweb and link it to the domain-server 12 | FILE(GLOB CIVETWEB_SRCS external/civetweb/src/*.c) 13 | add_library(civetweb ${CIVETWEB_SRCS}) 14 | include_directories(external/civetweb/include) 15 | target_link_libraries(${TARGET_NAME} civetweb) 16 | 17 | # remove and then copy the files for the webserver 18 | add_custom_command(TARGET ${TARGET_NAME} POST_BUILD 19 | COMMAND ${CMAKE_COMMAND} -E remove_directory 20 | $/resources/web) 21 | add_custom_command(TARGET ${TARGET_NAME} POST_BUILD 22 | COMMAND ${CMAKE_COMMAND} -E copy_directory 23 | "${PROJECT_SOURCE_DIR}/resources/web" 24 | $/resources/web) 25 | 26 | # link the shared hifi library 27 | include(${MACRO_DIR}/LinkHifiLibrary.cmake) 28 | link_hifi_library(shared ${TARGET_NAME} ${ROOT_DIR}) 29 | 30 | # link dl library on UNIX for civetweb 31 | if (UNIX AND NOT APPLE) 32 | target_link_libraries(${TARGET_NAME} ${CMAKE_DL_LIBS}) 33 | endif (UNIX AND NOT APPLE) -------------------------------------------------------------------------------- /externals/stk/include/WvIn.h: -------------------------------------------------------------------------------- 1 | #ifndef STK_WVIN_H 2 | #define STK_WVIN_H 3 | 4 | #include "Stk.h" 5 | 6 | namespace stk { 7 | 8 | /***************************************************/ 9 | /*! \class WvIn 10 | \brief STK audio input abstract base class. 11 | 12 | This class provides common functionality for a variety of audio 13 | data input subclasses. 14 | 15 | by Perry R. Cook and Gary P. Scavone, 1995-2012. 16 | */ 17 | /***************************************************/ 18 | 19 | class WvIn : public Stk 20 | { 21 | public: 22 | //! Return the number of audio channels in the data or stream. 23 | unsigned int channelsOut( void ) const { return data_.channels(); }; 24 | 25 | //! Return an StkFrames reference to the last computed sample frame. 26 | /*! 27 | If no file data is loaded, an empty container is returned. 28 | */ 29 | const StkFrames& lastFrame( void ) const { return lastFrame_; }; 30 | 31 | //! Compute one sample frame and return the specified \c channel value. 32 | virtual StkFloat tick( unsigned int channel = 0 ) = 0; 33 | 34 | //! Fill the StkFrames argument with computed frames and return the same reference. 35 | virtual StkFrames& tick( StkFrames& frames ) = 0; 36 | 37 | protected: 38 | 39 | StkFrames data_; 40 | StkFrames lastFrame_; 41 | 42 | }; 43 | 44 | } // stk namespace 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /interface/src/Swatch.h: -------------------------------------------------------------------------------- 1 | // 2 | // Swatch.h 3 | // interface 4 | // 5 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 6 | // 7 | 8 | #ifndef __interface__Swatch__ 9 | #define __interface__Swatch__ 10 | 11 | #include "Tool.h" 12 | #include "ui/TextRenderer.h" 13 | 14 | static const int SWATCH_SIZE = 8; 15 | static const int colorBase[8][3] = {{237, 175, 0}, 16 | {61, 211, 72}, 17 | {51, 204, 204}, 18 | {63, 169, 245}, 19 | {193, 99, 122}, 20 | {255, 54, 69}, 21 | {124, 36, 36}, 22 | {63, 35, 19}}; 23 | 24 | class Swatch : public Tool { 25 | public: 26 | static QIcon createIcon(const QColor& color); 27 | 28 | Swatch(QAction* action); 29 | 30 | QColor getColor(); 31 | void checkColor(); 32 | void saveData(QSettings* settings); 33 | void loadData(QSettings* settings); 34 | void reset(); 35 | 36 | void render(int width, int height); 37 | void handleEvent(int key, bool getColor); 38 | 39 | private: 40 | TextRenderer _textRenderer; 41 | QColor _colors[SWATCH_SIZE]; 42 | int _selected; 43 | }; 44 | 45 | #endif /* defined(__interface__Swatch__) */ 46 | -------------------------------------------------------------------------------- /interface/resources/shaders/iris.vert: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // iris.vert 5 | // vertex shader 6 | // 7 | // Created by Andrzej Kapolka on 6/13/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the location of the eye in model space 12 | uniform vec3 eyePosition; 13 | 14 | // the interpolated normal 15 | varying vec4 normal; 16 | 17 | // the ratio of the indices of refraction 18 | const float refractionEta = 0.75; 19 | 20 | void main(void) { 21 | 22 | // transform and store the normal for interpolation 23 | normal = normalize(gl_ModelViewMatrix * vec4(gl_Normal, 0.0)); 24 | 25 | // compute standard diffuse lighting per-vertex 26 | gl_FrontColor = vec4(gl_Color.rgb * (gl_LightModel.ambient.rgb + gl_LightSource[0].ambient.rgb + 27 | gl_LightSource[0].diffuse.rgb * max(0.0, dot(normal, gl_LightSource[0].position))), gl_Color.a); 28 | 29 | // compute the texture coordinate based on where refracted vector hits z=0 in model space 30 | vec4 incidence = normalize(gl_Vertex - vec4(eyePosition, 1.0)); 31 | vec4 refracted = refract(incidence, normalize(vec4(gl_Normal, 0.0)), refractionEta); 32 | gl_TexCoord[0] = (gl_Vertex - (gl_Vertex.z / refracted.z) * refracted) + vec4(0.5, 0.5, 0.0, 0.0); 33 | 34 | // use standard pipeline transform 35 | gl_Position = ftransform(); 36 | } 37 | -------------------------------------------------------------------------------- /interface/external/LibOVR/Src/OVR_DeviceConstants.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | 3 | PublicHeader: OVR.h 4 | Filename : OVR_DeviceConstants.h 5 | Content : Device constants 6 | Created : February 5, 2013 7 | Authors : Lee Cooper 8 | 9 | Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved. 10 | 11 | Use of this software is subject to the terms of the Oculus license 12 | agreement provided at the time of installation or download, or which 13 | otherwise accompanies this software in either electronic or hard copy form. 14 | 15 | *************************************************************************************/ 16 | 17 | #ifndef OVR_DeviceConstants_h 18 | #define OVR_DeviceConstants_h 19 | 20 | namespace OVR { 21 | 22 | 23 | //------------------------------------------------------------------------------------- 24 | // Different device types supported by OVR; this type is reported by DeviceBase::GetType. 25 | // 26 | enum DeviceType 27 | { 28 | Device_None = 0, 29 | Device_Manager = 1, 30 | Device_HMD = 2, 31 | Device_Sensor = 3, 32 | Device_LatencyTester = 4, 33 | Device_All = 0xFF // Set for enumeration only, to enumerate all device types. 34 | }; 35 | 36 | } // namespace OVR 37 | 38 | #endif 39 | -------------------------------------------------------------------------------- /externals/glm/gtx/matrix_cross_product.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-21 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/matrix_cross_product.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tmat3x3 matrixCross3 14 | ( 15 | detail::tvec3 const & x 16 | ) 17 | { 18 | detail::tmat3x3 Result(T(0)); 19 | Result[0][1] = x.z; 20 | Result[1][0] = -x.z; 21 | Result[0][2] = -x.y; 22 | Result[2][0] = x.y; 23 | Result[1][2] = x.x; 24 | Result[2][1] = -x.x; 25 | return Result; 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER detail::tmat4x4 matrixCross4 30 | ( 31 | detail::tvec3 const & x 32 | ) 33 | { 34 | detail::tmat4x4 Result(T(0)); 35 | Result[0][1] = x.z; 36 | Result[1][0] = -x.z; 37 | Result[0][2] = -x.y; 38 | Result[2][0] = x.y; 39 | Result[1][2] = x.x; 40 | Result[2][1] = -x.x; 41 | return Result; 42 | } 43 | 44 | }//namespace glm 45 | -------------------------------------------------------------------------------- /interface/src/main.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Interface 3 | // 4 | // Allows you to connect to and see/hear the shared 3D space. 5 | // Optionally uses serialUSB connection to get gyro data for head movement. 6 | // Optionally gets UDP stream from transmitter to animate controller/hand. 7 | // 8 | // Usage: The interface client first attempts to contact a domain server to 9 | // discover the appropriate audio, voxel, and avatar servers to contact. 10 | // Right now, the default domain server is "highfidelity.below92.com" 11 | // You can change the domain server to use your own by editing the 12 | // DOMAIN_HOSTNAME or DOMAIN_IP strings in the file NodeList.cpp 13 | // 14 | // 15 | // Welcome Aboard! 16 | // 17 | 18 | #include "Application.h" 19 | 20 | #include 21 | #include 22 | 23 | int main(int argc, const char * argv[]) { 24 | timeval startup_time; 25 | gettimeofday(&startup_time, NULL); 26 | 27 | #if defined(Q_OS_MAC) 28 | const QString QT_RELEASE_PLUGIN_PATH = "/usr/local/lib/qt5/plugins"; 29 | QCoreApplication::addLibraryPath(QT_RELEASE_PLUGIN_PATH); 30 | #endif 31 | 32 | Application app(argc, const_cast(argv), startup_time); 33 | 34 | qDebug( "Created QT Application.\n" ); 35 | int exitCode = app.exec(); 36 | qDebug("Normal exit.\n"); 37 | return exitCode; 38 | } 39 | -------------------------------------------------------------------------------- /interface/external/LibVPX/PATENTS: -------------------------------------------------------------------------------- 1 | Additional IP Rights Grant (Patents) 2 | 3 | "This implementation" means the copyrightable works distributed by 4 | Google as part of the WebM Project. 5 | 6 | Google hereby grants to you a perpetual, worldwide, non-exclusive, 7 | no-charge, royalty-free, irrevocable (except as stated in this section) 8 | patent license to make, have made, use, offer to sell, sell, import, 9 | transfer, and otherwise run, modify and propagate the contents of this 10 | implementation of VP8, where such license applies only to those patent 11 | claims, both currently owned by Google and acquired in the future, 12 | licensable by Google that are necessarily infringed by this 13 | implementation of VP8. This grant does not include claims that would be 14 | infringed only as a consequence of further modification of this 15 | implementation. If you or your agent or exclusive licensee institute or 16 | order or agree to the institution of patent litigation against any 17 | entity (including a cross-claim or counterclaim in a lawsuit) alleging 18 | that this implementation of VP8 or any code incorporated within this 19 | implementation of VP8 constitutes direct or contributory patent 20 | infringement, or inducement of patent infringement, then any patent 21 | rights granted to you under this License for this implementation of VP8 22 | shall terminate as of the date such litigation is filed. 23 | -------------------------------------------------------------------------------- /externals/glm/gtx/vector_access.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2006-01-16 5 | // Updated : 2008-10-07 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/vector_access.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER void set 14 | ( 15 | detail::tvec2& v, 16 | valType const & x, 17 | valType const & y 18 | ) 19 | { 20 | v.x = x; 21 | v.y = y; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER void set 26 | ( 27 | detail::tvec3& v, 28 | valType const & x, 29 | valType const & y, 30 | valType const & z 31 | ) 32 | { 33 | v.x = x; 34 | v.y = y; 35 | v.z = z; 36 | } 37 | 38 | template 39 | GLM_FUNC_QUALIFIER void set 40 | ( 41 | detail::tvec4& v, 42 | valType const & x, 43 | valType const & y, 44 | valType const & z, 45 | valType const & w 46 | ) 47 | { 48 | v.x = x; 49 | v.y = y; 50 | v.z = z; 51 | v.w = w; 52 | } 53 | }//namespace glm 54 | -------------------------------------------------------------------------------- /interface/src/Tool.cpp: -------------------------------------------------------------------------------- 1 | #include "Tool.h" 2 | 3 | #include 4 | #include 5 | #include 6 | 7 | Tool::Tool(QAction *action, GLuint texture, int x, int y) : 8 | _action(action), 9 | _texture(texture), 10 | _x(x), 11 | _y(y) { 12 | } 13 | 14 | void Tool::setAction(QAction* action) { 15 | _action = action; 16 | } 17 | 18 | bool Tool::isActive() { 19 | return _action->isChecked(); 20 | } 21 | 22 | void Tool::render(int width, int height) { 23 | glEnable(GL_TEXTURE_2D); 24 | 25 | glBindTexture(GL_TEXTURE_2D, _texture); 26 | 27 | 28 | if (_action == 0 || _action->isChecked()) { 29 | glColor3f(1.0f, 1.0f, 1.0f); // reset gl color 30 | } else { 31 | glColor3f(0.3f, 0.3f, 0.3f); 32 | } 33 | 34 | glBegin(GL_QUADS); 35 | glTexCoord2f( _x / NUM_TOOLS_COLS, 1.0f - (_y + 1) / NUM_TOOLS_ROWS); 36 | glVertex2f(0 , height); 37 | 38 | glTexCoord2f((_x + 1) / NUM_TOOLS_COLS, 1.0f - (_y + 1) / NUM_TOOLS_ROWS); 39 | glVertex2f(width, height); 40 | 41 | glTexCoord2f((_x + 1) / NUM_TOOLS_COLS, 1.0f - _y / NUM_TOOLS_ROWS); 42 | glVertex2f(width, 0); 43 | 44 | glTexCoord2f( _x / NUM_TOOLS_COLS, 1.0f - _y / NUM_TOOLS_ROWS); 45 | glVertex2f(0 , 0); 46 | glEnd(); 47 | 48 | glDisable(GL_TEXTURE_2D); 49 | 50 | glTranslated(0, 1.10f * height, 0); 51 | } 52 | -------------------------------------------------------------------------------- /interface/src/PieMenu.h: -------------------------------------------------------------------------------- 1 | // 2 | // PieMenu.h 3 | // hifi 4 | // 5 | // Created by Clement Brisset on 7/18/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__PieMenu__ 10 | #define __hifi__PieMenu__ 11 | 12 | #include 13 | 14 | #include "InterfaceConfig.h" 15 | #include "Util.h" 16 | 17 | #include 18 | 19 | class QAction; 20 | 21 | class PieMenu { 22 | public: 23 | PieMenu(); 24 | 25 | void init(const char* fileName, int screenWidth, int screenHeight); 26 | void addAction(QAction* action); 27 | void render(); 28 | void resize(int screenWidth, int screenHeight); 29 | 30 | bool isDisplayed() const {return _isDisplayed;} 31 | int getX () const {return _x;} 32 | int getY () const {return _y;} 33 | 34 | void mouseMoveEvent (int x, int y); 35 | void mousePressEvent (int x, int y); 36 | void mouseReleaseEvent(int x, int y); 37 | 38 | private: 39 | QImage _textureImage; 40 | GLuint _textureID; 41 | 42 | // position of the menu 43 | int _x; 44 | int _y; 45 | int _radiusIntern; 46 | int _radiusExtern; 47 | float _magnification; 48 | 49 | int _mouseX; 50 | int _mouseY; 51 | 52 | int _selectedAction; 53 | 54 | bool _isDisplayed; 55 | 56 | std::vector _actions; 57 | }; 58 | 59 | #endif /* defined(__hifi__PieMenu__) */ 60 | -------------------------------------------------------------------------------- /externals/glm/gtx/closest_point.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-30 5 | // Updated : 2008-10-05 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/closest_point.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | #ifndef glm_gtx_closest_point 11 | #define glm_gtx_closest_point 12 | 13 | namespace glm 14 | { 15 | template 16 | GLM_FUNC_QUALIFIER detail::tvec3 closestPointOnLine 17 | ( 18 | detail::tvec3 const & point, 19 | detail::tvec3 const & a, 20 | detail::tvec3 const & b 21 | ) 22 | { 23 | valType LineLength = distance(a, b); 24 | detail::tvec3 Vector = point - a; 25 | detail::tvec3 LineDirection = (b - a) / LineLength; 26 | 27 | // Project Vector to LineDirection to get the distance of point from a 28 | valType Distance = dot(Vector, LineDirection); 29 | 30 | if(Distance <= valType(0)) return a; 31 | if(Distance >= LineLength) return b; 32 | return a + LineDirection * Distance; 33 | } 34 | }//namespace glm 35 | 36 | #endif//glm_gtx_closest_point 37 | -------------------------------------------------------------------------------- /interface/external/fervor/fvavailableupdate.h: -------------------------------------------------------------------------------- 1 | #ifndef FVAVAILABLEUPDATE_H 2 | #define FVAVAILABLEUPDATE_H 3 | 4 | #include 5 | #include 6 | 7 | class FvAvailableUpdate : public QObject 8 | { 9 | Q_OBJECT 10 | public: 11 | explicit FvAvailableUpdate(QObject *parent = 0); 12 | 13 | QString GetTitle(); 14 | void SetTitle(QString title); 15 | 16 | QUrl GetReleaseNotesLink(); 17 | void SetReleaseNotesLink(QUrl releaseNotesLink); 18 | void SetReleaseNotesLink(QString releaseNotesLink); 19 | 20 | QString GetPubDate(); 21 | void SetPubDate(QString pubDate); 22 | 23 | QUrl GetEnclosureUrl(); 24 | void SetEnclosureUrl(QUrl enclosureUrl); 25 | void SetEnclosureUrl(QString enclosureUrl); 26 | 27 | QString GetEnclosureVersion(); 28 | void SetEnclosureVersion(QString enclosureVersion); 29 | 30 | QString GetEnclosurePlatform(); 31 | void SetEnclosurePlatform(QString enclosurePlatform); 32 | 33 | unsigned long GetEnclosureLength(); 34 | void SetEnclosureLength(unsigned long enclosureLength); 35 | 36 | QString GetEnclosureType(); 37 | void SetEnclosureType(QString enclosureType); 38 | 39 | private: 40 | QString m_title; 41 | QUrl m_releaseNotesLink; 42 | QString m_pubDate; 43 | QUrl m_enclosureUrl; 44 | QString m_enclosureVersion; 45 | QString m_enclosurePlatform; 46 | unsigned long m_enclosureLength; 47 | QString m_enclosureType; 48 | 49 | }; 50 | 51 | #endif // FVAVAILABLEUPDATE_H 52 | -------------------------------------------------------------------------------- /interface/resources/shaders/vertical_blur_add.frag: -------------------------------------------------------------------------------- 1 | #version 120 2 | 3 | // 4 | // vertical_blur_add.frag 5 | // fragment shader 6 | // 7 | // Created by Andrzej Kapolka on 8/8/13. 8 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 9 | // 10 | 11 | // the texture containing the original color 12 | uniform sampler2D originalTexture; 13 | 14 | // the texture containing the horizontally blurred color 15 | uniform sampler2D horizontallyBlurredTexture; 16 | 17 | void main(void) { 18 | float dt = dFdy(gl_TexCoord[0].t); 19 | vec4 blurred = (texture2D(horizontallyBlurredTexture, gl_TexCoord[0].st + vec2(0.0, dt * -7.5)) + 20 | texture2D(horizontallyBlurredTexture, gl_TexCoord[0].st + vec2(0.0, dt * -5.5)) + 21 | texture2D(horizontallyBlurredTexture, gl_TexCoord[0].st + vec2(0.0, dt * -3.5)) + 22 | texture2D(horizontallyBlurredTexture, gl_TexCoord[0].st + vec2(0.0, dt * -1.5)) + 23 | texture2D(horizontallyBlurredTexture, gl_TexCoord[0].st + vec2(0.0, dt * 1.5)) + 24 | texture2D(horizontallyBlurredTexture, gl_TexCoord[0].st + vec2(0.0, dt * 3.5)) + 25 | texture2D(horizontallyBlurredTexture, gl_TexCoord[0].st + vec2(0.0, dt * 5.5)) + 26 | texture2D(horizontallyBlurredTexture, gl_TexCoord[0].st + vec2(0.0, dt * 7.5))) / 8.0; 27 | gl_FragColor = blurred * blurred.a + texture2D(originalTexture, gl_TexCoord[0].st) * (1.0 + blurred.a * 0.5); 28 | } 29 | -------------------------------------------------------------------------------- /interface/src/starfield/data/GpuVertex.h: -------------------------------------------------------------------------------- 1 | // 2 | // starfield/data/GpuVertex.h 3 | // interface 4 | // 5 | // Created by Tobias Schwinger on 3/29/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__starfield__data__GpuVertex__ 10 | #define __interface__starfield__data__GpuVertex__ 11 | 12 | #ifndef __interface__Starfield_impl__ 13 | #error "This is an implementation file - not intended for direct inclusion." 14 | #endif 15 | 16 | #include "starfield/data/InputVertex.h" 17 | 18 | namespace starfield { 19 | 20 | class GpuVertex { 21 | public: 22 | GpuVertex() { } 23 | 24 | GpuVertex(InputVertex const& in) { 25 | 26 | _color = in.getColor(); 27 | float azi = in.getAzimuth(); 28 | float alt = in.getAltitude(); 29 | 30 | // ground vector in x/z plane... 31 | float gx = sin(azi); 32 | float gz = -cos(azi); 33 | 34 | // ...elevated in y direction by altitude 35 | float exz = cos(alt); 36 | _valX = gx * exz; 37 | _valY = sin(alt); 38 | _valZ = gz * exz; 39 | } 40 | 41 | unsigned getColor() const { return _color; } 42 | 43 | private: 44 | unsigned _color; 45 | float _valX; 46 | float _valY; 47 | float _valZ; 48 | }; 49 | 50 | } // anonymous namespace 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /externals/glm/gtx/polar_coordinates.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2007-03-06 5 | // Updated : 2009-05-01 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/polar_coordinates.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER detail::tvec3 polar 14 | ( 15 | detail::tvec3 const & euclidean 16 | ) 17 | { 18 | T length = length(euclidean); 19 | detail::tvec3 tmp = euclidean / length; 20 | T xz_dist = sqrt(tmp.x * tmp.x + tmp.z * tmp.z); 21 | 22 | return detail::tvec3( 23 | degrees(atan(xz_dist, tmp.y)), // latitude 24 | degrees(atan(tmp.x, tmp.z)), // longitude 25 | xz_dist); // xz distance 26 | } 27 | 28 | template 29 | GLM_FUNC_QUALIFIER detail::tvec3 euclidean 30 | ( 31 | detail::tvec3 const & polar 32 | ) 33 | { 34 | T latitude = radians(polar.x); 35 | T longitude = radians(polar.y); 36 | return detail::tvec3( 37 | cos(latitude) * sin(longitude), 38 | sin(latitude), 39 | cos(latitude) * cos(longitude)); 40 | } 41 | 42 | }//namespace glm 43 | -------------------------------------------------------------------------------- /libraries/voxels/src/JurisdictionSender.h: -------------------------------------------------------------------------------- 1 | // 2 | // JurisdictionSender.h 3 | // shared 4 | // 5 | // Created by Brad Hefta-Gaub on 8/12/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | // Voxel Packet Sender 9 | // 10 | 11 | #ifndef __shared__JurisdictionSender__ 12 | #define __shared__JurisdictionSender__ 13 | 14 | #include 15 | 16 | #include 17 | #include 18 | #include "JurisdictionMap.h" 19 | 20 | /// Will process PACKET_TYPE_VOXEL_JURISDICTION_REQUEST packets and send out PACKET_TYPE_VOXEL_JURISDICTION packets 21 | /// to requesting parties. As with other ReceivedPacketProcessor classes the user is responsible for reading inbound packets 22 | /// and adding them to the processing queue by calling queueReceivedPacket() 23 | class JurisdictionSender : public PacketSender, public ReceivedPacketProcessor { 24 | public: 25 | static const int DEFAULT_PACKETS_PER_SECOND = 1; 26 | 27 | JurisdictionSender(JurisdictionMap* map, PacketSenderNotify* notify = NULL); 28 | 29 | void setJurisdiction(JurisdictionMap* map) { _jurisdictionMap = map; } 30 | 31 | virtual bool process(); 32 | 33 | protected: 34 | virtual void processPacket(sockaddr& senderAddress, unsigned char* packetData, ssize_t packetLength); 35 | 36 | private: 37 | JurisdictionMap* _jurisdictionMap; 38 | std::set _nodesRequestingJurisdictions; 39 | }; 40 | #endif // __shared__JurisdictionSender__ 41 | -------------------------------------------------------------------------------- /interface/src/devices/LeapManager.h: -------------------------------------------------------------------------------- 1 | // 2 | // LeapManager.h 3 | // hifi 4 | // 5 | // Created by Eric Johnston on 6/26/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__LeapManager__ 10 | #define __hifi__LeapManager__ 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | class Avatar; 17 | class HifiLeapListener; 18 | namespace Leap { 19 | class Controller; 20 | } 21 | 22 | class LeapManager { 23 | public: 24 | static void nextFrame(Avatar& avatar); // called once per frame to get new Leap data 25 | static bool controllersExist(); // Returns true if there's at least one active Leap plugged in 26 | static void enableFakeFingers(bool enable); // put fake data in if there's no Leap plugged in 27 | static const std::vector& getFingerTips(); 28 | static const std::vector& getFingerRoots(); 29 | static const std::vector& getHandPositions(); 30 | static const std::vector& getHandNormals(); 31 | static std::string statusString(); 32 | static void initialize(); 33 | static void terminate(); 34 | 35 | private: 36 | static bool _libraryExists; // The library is present, so we won't crash if we call it. 37 | static bool _doFakeFingers; 38 | static Leap::Controller* _controller; 39 | static HifiLeapListener* _listener; 40 | }; 41 | 42 | #endif /* defined(__hifi__LeapManager__) */ 43 | -------------------------------------------------------------------------------- /cmake/modules/FindSTK.cmake: -------------------------------------------------------------------------------- 1 | # Find the static STK library 2 | # 3 | # You must provide an STK_ROOT_DIR which contains lib and include directories 4 | # 5 | # Once done this will define 6 | # 7 | # STK_FOUND - system found PortAudio 8 | # STK_INCLUDE_DIRS - the PortAudio include directory 9 | # STK_LIBRARIES - Link this to use PortAudio 10 | # 11 | # Created on 5/30/2013 by Stephen Birarda 12 | # Copyright (c) 2013 High Fidelity 13 | # 14 | 15 | if (STK_LIBRARIES AND STK_INCLUDE_DIRS) 16 | # in cache already 17 | set(STK_FOUND TRUE) 18 | else (STK_LIBRARIES AND STK_INCLUDE_DIRS) 19 | find_path(STK_INCLUDE_DIRS Stk.h ${STK_ROOT_DIR}/include) 20 | 21 | if (APPLE) 22 | find_library(STK_LIBRARIES libstk.a ${STK_ROOT_DIR}/lib/MacOS/) 23 | elseif (UNIX) 24 | find_library(STK_LIBRARIES libstk.a ${STK_ROOT_DIR}/lib/UNIX/) 25 | endif () 26 | 27 | if (STK_INCLUDE_DIRS AND STK_LIBRARIES) 28 | set(STK_FOUND TRUE) 29 | endif (STK_INCLUDE_DIRS AND STK_LIBRARIES) 30 | 31 | if (STK_FOUND) 32 | if (NOT STK_FIND_QUIETLY) 33 | message(STATUS "Found STK: ${STK_LIBRARIES}") 34 | endif (NOT STK_FIND_QUIETLY) 35 | else (STK_FOUND) 36 | if (STK_FIND_REQUIRED) 37 | message(FATAL_ERROR "Could not find STK") 38 | endif (STK_FIND_REQUIRED) 39 | endif (STK_FOUND) 40 | 41 | # show the STK_INCLUDE_DIRS and STK_LIBRARIES variables only in the advanced view 42 | mark_as_advanced(STK_INCLUDE_DIRS STK_LIBRARIES) 43 | 44 | endif (STK_LIBRARIES AND STK_INCLUDE_DIRS) -------------------------------------------------------------------------------- /libraries/shared/src/StdDev.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // StdDev.cpp 3 | // hifi 4 | // 5 | // Created by Philip Rosedale on 3/12/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #include 10 | #include 11 | #include "StdDev.h" 12 | 13 | const int MAX_STDEV_SAMPLES = 1000; 14 | 15 | StDev::StDev() { 16 | data = new float[MAX_STDEV_SAMPLES]; 17 | sampleCount = 0; 18 | } 19 | 20 | void StDev::reset() { 21 | sampleCount = 0; 22 | } 23 | 24 | void StDev::addValue(float v) { 25 | data[sampleCount++] = v; 26 | if (sampleCount == MAX_STDEV_SAMPLES) sampleCount = 0; 27 | } 28 | 29 | float StDev::getAverage() { 30 | float average = 0; 31 | for (int i = 0; i < sampleCount; i++) { 32 | average += data[i]; 33 | } 34 | if (sampleCount > 0) 35 | return average/(float)sampleCount; 36 | else return 0; 37 | } 38 | /* 39 | float StDev::getMax() { 40 | float average = -FLT_MAX; 41 | for (int i = 0; i < sampleCount; i++) { 42 | average += data[i]; 43 | } 44 | if (sampleCount > 0) 45 | return average/(float)sampleCount; 46 | else return 0; 47 | }*/ 48 | 49 | float StDev::getStDev() { 50 | float average = getAverage(); 51 | float stdev = 0; 52 | for (int i = 0; i < sampleCount; i++) { 53 | stdev += powf(data[i] - average, 2); 54 | } 55 | if (sampleCount > 1) 56 | return sqrt(stdev/(float)(sampleCount - 1.0)); 57 | else 58 | return 0; 59 | } -------------------------------------------------------------------------------- /interface/src/Physics.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Physics.cpp 3 | // hifi 4 | // 5 | // Created by Philip on July 11, 2013 6 | // 7 | // Routines to help with doing virtual world physics 8 | // 9 | 10 | #include 11 | #include 12 | 13 | #include "Util.h" 14 | #include "world.h" 15 | #include "Physics.h" 16 | 17 | // 18 | // Applies static friction: maxVelocity is the largest velocity for which there 19 | // there is friction, and strength is the amount of friction force applied to reduce 20 | // velocity. 21 | // 22 | void applyStaticFriction(float deltaTime, glm::vec3& velocity, float maxVelocity, float strength) { 23 | float v = glm::length(velocity); 24 | if (v < maxVelocity) { 25 | velocity *= glm::clamp((1.0f - deltaTime * strength * (1.f - v / maxVelocity)), 0.0f, 1.0f); 26 | } 27 | } 28 | 29 | // 30 | // Applies velocity damping, with a strength value for linear and squared velocity damping 31 | // 32 | 33 | void applyDamping(float deltaTime, glm::vec3& velocity, float linearStrength, float squaredStrength) { 34 | if (squaredStrength == 0.f) { 35 | velocity *= glm::clamp(1.f - deltaTime * linearStrength, 0.f, 1.f); 36 | } else { 37 | velocity *= glm::clamp(1.f - deltaTime * (linearStrength + glm::length(velocity) * squaredStrength), 0.f, 1.f); 38 | } 39 | } 40 | 41 | void applyDampedSpring(float deltaTime, glm::vec3& velocity, glm::vec3& position, glm::vec3& targetPosition, float k, float damping) { 42 | 43 | } 44 | 45 | -------------------------------------------------------------------------------- /interface/src/devices/Transmitter.h: -------------------------------------------------------------------------------- 1 | // 2 | // Transmitter.h 3 | // hifi 4 | // 5 | // Created by Philip Rosedale on 5/20/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__Transmitter__ 10 | #define __hifi__Transmitter__ 11 | 12 | #include 13 | #include 14 | #include 15 | #include 16 | #include "world.h" 17 | #include 18 | 19 | struct TouchState { 20 | uint16_t x, y; 21 | char state; 22 | }; 23 | 24 | class Transmitter 25 | { 26 | public: 27 | Transmitter(); 28 | ~Transmitter(); 29 | void render(); 30 | void checkForLostTransmitter(); 31 | void resetLevels(); 32 | void renderLevels(int width, int height); 33 | bool isConnected() { return _isConnected; }; 34 | const glm::vec3 getLastRotationRate() const { return _lastRotationRate; }; 35 | const glm::vec3 getLastAcceleration() const { return _lastRotationRate; }; 36 | const glm::vec3 getEstimatedRotation() const { return _estimatedRotation; }; 37 | const TouchState* getTouchState() const { return &_touchState; }; 38 | void processIncomingData(unsigned char* packetData, int numBytes); 39 | 40 | private: 41 | bool _isConnected; 42 | glm::vec3 _lastRotationRate; 43 | glm::vec3 _lastAcceleration; 44 | glm::vec3 _estimatedRotation; 45 | TouchState _touchState; 46 | timeval* _lastReceivedPacket; 47 | 48 | #endif /* defined(__hifi__Transmitter__) */ 49 | }; 50 | -------------------------------------------------------------------------------- /cmake/modules/FindQuazip.cmake: -------------------------------------------------------------------------------- 1 | # Find the static Quazip library 2 | # 3 | # You must provide a QUAZIP_ROOT_DIR which contains lib and include directories 4 | # 5 | # Once done this will define 6 | # 7 | # QUAZIP_FOUND - system found quazip 8 | # QUAZIP_INCLUDE_DIRS - the quazip include directory 9 | # QUAZIP_LIBRARIES - Link this to use quazip 10 | # 11 | # Created on 6/25/2013 by Stephen Birarda 12 | # Copyright (c) 2013 High Fidelity 13 | # 14 | 15 | if (QUAZIP_LIBRARIES AND QUAZIP_INCLUDE_DIRS) 16 | # in cache already 17 | set(QUAZIP_FOUND TRUE) 18 | else (QUAZIP_LIBRARIES AND QUAZIP_INCLUDE_DIRS) 19 | find_path(QUAZIP_INCLUDE_DIRS quazip.h ${QUAZIP_ROOT_DIR}/include) 20 | 21 | if (APPLE) 22 | find_library(QUAZIP_LIBRARIES libquazip.a ${QUAZIP_ROOT_DIR}/lib/MacOS/) 23 | endif () 24 | 25 | if (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) 26 | set(QUAZIP_FOUND TRUE) 27 | endif (QUAZIP_INCLUDE_DIRS AND QUAZIP_LIBRARIES) 28 | 29 | if (QUAZIP_FOUND) 30 | if (NOT QUAZIP_FIND_QUIETLY) 31 | message(STATUS "Found quazip: ${QUAZIP_LIBRARIES}") 32 | endif (NOT QUAZIP_FIND_QUIETLY) 33 | else (QUAZIP_FOUND) 34 | if (QUAZIP_FIND_REQUIRED) 35 | message(FATAL_ERROR "Could not find quazip") 36 | endif (QUAZIP_FIND_REQUIRED) 37 | endif (QUAZIP_FOUND) 38 | 39 | # show the QUAZIP_INCLUDE_DIRS and QUAZIP_LIBRARIES variables only in the advanced view 40 | mark_as_advanced(QUAZIP_INCLUDE_DIRS QUAZIP_LIBRARIES) 41 | 42 | endif (QUAZIP_LIBRARIES AND QUAZIP_INCLUDE_DIRS) -------------------------------------------------------------------------------- /libraries/shared/src/ReceivedPacketProcessor.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // ReceivedPacketProcessor.cpp 3 | // shared 4 | // 5 | // Created by Brad Hefta-Gaub on 8/12/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | // Threaded or non-threaded packet receiver. 9 | // 10 | 11 | #include "NodeList.h" 12 | #include "ReceivedPacketProcessor.h" 13 | #include "SharedUtil.h" 14 | 15 | void ReceivedPacketProcessor::queueReceivedPacket(sockaddr& address, unsigned char* packetData, ssize_t packetLength) { 16 | // Make sure our Node and NodeList knows we've heard from this node. 17 | Node* node = NodeList::getInstance()->nodeWithAddress(&address); 18 | if (node) { 19 | node->setLastHeardMicrostamp(usecTimestampNow()); 20 | } 21 | 22 | NetworkPacket packet(address, packetData, packetLength); 23 | lock(); 24 | _packets.push_back(packet); 25 | unlock(); 26 | } 27 | 28 | bool ReceivedPacketProcessor::process() { 29 | if (_packets.size() == 0) { 30 | const uint64_t RECEIVED_THREAD_SLEEP_INTERVAL = (1000 * 1000)/60; // check at 60fps 31 | usleep(RECEIVED_THREAD_SLEEP_INTERVAL); 32 | } 33 | while (_packets.size() > 0) { 34 | NetworkPacket& packet = _packets.front(); 35 | processPacket(packet.getAddress(), packet.getData(), packet.getLength()); 36 | 37 | lock(); 38 | _packets.erase(_packets.begin()); 39 | unlock(); 40 | } 41 | return isStillRunning(); // keep running till they terminate us 42 | } 43 | -------------------------------------------------------------------------------- /domain-server/resources/web/assignment/js/assignment.js: -------------------------------------------------------------------------------- 1 | $(document).ready(function(){ 2 | 3 | // setup the editor 4 | var editor = ace.edit("editor"); 5 | editor.setTheme("ace/theme/twilight") 6 | editor.getSession().setMode("ace/mode/javascript"); 7 | editor.getSession().setTabSize(2); 8 | 9 | $('#deploy-button').click(function(){ 10 | script = editor.getValue(); 11 | 12 | // setup our boundary - this is "highfidelity" in hex 13 | var boundary = "----68696768666964656c697479"; 14 | var body = '--' + boundary + '\r\n' 15 | // parameter name is "file" and local filename is "temp.txt" 16 | + 'Content-Disposition:form-data; name="file"; ' 17 | + 'filename="script.js"\r\n' 18 | // add the javascript mime-type 19 | + 'Content-type: application/javascript\r\n\r\n' 20 | // add the script 21 | + script + '\r\n' 22 | + '--' + boundary + '--'; 23 | 24 | var headers = {}; 25 | if ($('#instance-field input').val()) { 26 | headers['ASSIGNMENT-INSTANCES'] = $('#instance-field input').val(); 27 | } 28 | 29 | // post form to assignment in order to create an assignment 30 | $.ajax({ 31 | contentType: "multipart/form-data; boundary=" + boundary, 32 | data: body, 33 | type: "POST", 34 | url: "/assignment", 35 | headers: headers, 36 | success: function (data, status) { 37 | console.log(data); 38 | console.log(status); 39 | } 40 | }); 41 | }); 42 | }); 43 | -------------------------------------------------------------------------------- /assignment-client/src/voxels/VoxelScriptingInterface.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelScriptingInterface.h 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 9/17/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__VoxelScriptingInterface__ 10 | #define __hifi__VoxelScriptingInterface__ 11 | 12 | #include 13 | 14 | #include 15 | 16 | /// handles scripting of voxel commands from JS passed to assigned clients 17 | class VoxelScriptingInterface : public QObject { 18 | Q_OBJECT 19 | public: 20 | VoxelEditPacketSender* getVoxelPacketSender() { return &_voxelPacketSender; } 21 | public slots: 22 | /// queues the creation of a voxel which will be sent by calling process on the PacketSender 23 | /// \param x the x-coordinate of the voxel (in VS space) 24 | /// \param y the y-coordinate of the voxel (in VS space) 25 | /// \param z the z-coordinate of the voxel (in VS space) 26 | /// \param scale the scale of the voxel (in VS space) 27 | /// \param red the R value for RGB color of voxel 28 | /// \param green the G value for RGB color of voxel 29 | /// \param blue the B value for RGB color of voxel 30 | void queueVoxelAdd(float x, float y, float z, float scale, uchar red, uchar green, uchar blue); 31 | private: 32 | /// attached VoxelEditPacketSender that handles queuing and sending of packets to VS 33 | VoxelEditPacketSender _voxelPacketSender; 34 | }; 35 | 36 | #endif /* defined(__hifi__VoxelScriptingInterface__) */ 37 | -------------------------------------------------------------------------------- /interface/src/avatar/BlendFace.h: -------------------------------------------------------------------------------- 1 | // 2 | // BlendFace.h 3 | // interface 4 | // 5 | // Created by Andrzej Kapolka on 9/16/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__BlendFace__ 10 | #define __interface__BlendFace__ 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | #include "InterfaceConfig.h" 18 | #include "renderer/FBXReader.h" 19 | 20 | class QNetworkReply; 21 | 22 | class Head; 23 | 24 | /// A face formed from a linear mix of blendshapes according to a set of coefficients. 25 | class BlendFace : public QObject { 26 | Q_OBJECT 27 | 28 | public: 29 | 30 | BlendFace(Head* owningHead); 31 | ~BlendFace(); 32 | 33 | bool render(float alpha); 34 | 35 | Q_INVOKABLE void setModelURL(const QUrl& url); 36 | const QUrl& getModelURL() const { return _modelURL; } 37 | 38 | public slots: 39 | 40 | void setRig(const fs::fsMsgRig& rig); 41 | 42 | private slots: 43 | 44 | void handleModelDownloadProgress(qint64 bytesReceived, qint64 bytesTotal); 45 | void handleModelReplyError(); 46 | 47 | private: 48 | 49 | void setGeometry(const FBXGeometry& geometry); 50 | 51 | Head* _owningHead; 52 | 53 | QUrl _modelURL; 54 | 55 | QNetworkReply* _modelReply; 56 | 57 | GLuint _iboID; 58 | GLuint _vboID; 59 | 60 | FBXGeometry _geometry; 61 | QVector _blendedVertices; 62 | }; 63 | 64 | #endif /* defined(__interface__BlendFace__) */ 65 | -------------------------------------------------------------------------------- /cmake/modules/FindOpenNI.cmake: -------------------------------------------------------------------------------- 1 | # Find the OpenNI library 2 | # 3 | # You must provide an OPENNI_ROOT_DIR which contains lib and include directories 4 | # 5 | # Once done this will define 6 | # 7 | # OPENNI_FOUND - system found OpenNI 8 | # OPENNI_INCLUDE_DIRS - the OpenNI include directory 9 | # OPENNI_LIBRARIES - Link this to use OpenNI 10 | # 11 | # Created on 6/28/2013 by Andrzej Kapolka 12 | # Copyright (c) 2013 High Fidelity 13 | # 14 | 15 | if (OPENNI_LIBRARIES AND OPENNI_INCLUDE_DIRS) 16 | # in cache already 17 | set(OPENNI_FOUND TRUE) 18 | else (OPENNI_LIBRARIES AND OPENNI_INCLUDE_DIRS) 19 | find_path(OPENNI_INCLUDE_DIRS XnOpenNI.h /usr/include/ni) 20 | 21 | if (APPLE) 22 | find_library(OPENNI_LIBRARIES libOpenNI.dylib /usr/lib) 23 | elseif (UNIX) 24 | find_library(OPENNI_LIBRARIES libOpenNI.so /usr/lib) 25 | endif () 26 | 27 | if (OPENNI_INCLUDE_DIRS AND OPENNI_LIBRARIES) 28 | set(OPENNI_FOUND TRUE) 29 | endif (OPENNI_INCLUDE_DIRS AND OPENNI_LIBRARIES) 30 | 31 | if (OPENNI_FOUND) 32 | if (NOT OPENNI_FIND_QUIETLY) 33 | message(STATUS "Found OpenNI: ${OPENNI_LIBRARIES}") 34 | endif (NOT OPENNI_FIND_QUIETLY) 35 | else (OPENNI_FOUND) 36 | if (OPENNI_FIND_REQUIRED) 37 | message(FATAL_ERROR "Could not find OpenNI") 38 | endif (OPENNI_FIND_REQUIRED) 39 | endif (OPENNI_FOUND) 40 | 41 | # show the OPENNI_INCLUDE_DIRS and OPENNI_LIBRARIES variables only in the advanced view 42 | mark_as_advanced(OPENNI_INCLUDE_DIRS OPENNI_LIBRARIES) 43 | 44 | endif (OPENNI_LIBRARIES AND OPENNI_INCLUDE_DIRS) 45 | -------------------------------------------------------------------------------- /interface/src/starfield/data/InputVertex.h: -------------------------------------------------------------------------------- 1 | // 2 | // starfield/data/InputVertex.h 3 | // interface 4 | // 5 | // Created by Tobias Schwinger on 3/29/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__starfield__data__InputVertex__ 10 | #define __interface__starfield__data__InputVertex__ 11 | 12 | #ifndef __interface__Starfield_impl__ 13 | #error "This is an implementation file - not intended for direct inclusion." 14 | #endif 15 | 16 | #include "starfield/Config.h" 17 | 18 | namespace starfield { 19 | 20 | class InputVertex { 21 | public: 22 | 23 | InputVertex(float azimuth, float altitude, unsigned color) { 24 | 25 | _color = ((color >> 16) & 0xffu) | (color & 0xff00u) | 26 | ((color << 16) & 0xff0000u) | 0xff000000u; 27 | 28 | azimuth = angleConvert(azimuth); 29 | altitude = angleConvert(altitude); 30 | 31 | angleHorizontalPolar(azimuth, altitude); 32 | 33 | _azimuth = azimuth; 34 | _altitude = altitude; 35 | } 36 | 37 | float getAzimuth() const { return _azimuth; } 38 | float getAltitude() const { return _altitude; } 39 | unsigned getColor() const { return _color; } 40 | 41 | private: 42 | unsigned _color; 43 | float _azimuth; 44 | float _altitude; 45 | }; 46 | 47 | typedef std::vector InputVertices; 48 | 49 | } // anonymous namespace 50 | 51 | #endif 52 | 53 | -------------------------------------------------------------------------------- /externals/glm/core/type_mat.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_mat.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /externals/glm/core/type_vec.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/type_vec.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /libraries/audio/src/InjectedAudioRingBuffer.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // InjectedAudioRingBuffer.cpp 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 6/5/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #include 10 | 11 | #include 12 | 13 | #include "InjectedAudioRingBuffer.h" 14 | 15 | InjectedAudioRingBuffer::InjectedAudioRingBuffer() : 16 | _radius(0.0f), 17 | _attenuationRatio(0), 18 | _streamIdentifier() 19 | { 20 | 21 | } 22 | 23 | int InjectedAudioRingBuffer::parseData(unsigned char* sourceBuffer, int numBytes) { 24 | unsigned char* currentBuffer = sourceBuffer + numBytesForPacketHeader(sourceBuffer); 25 | 26 | // pull stream identifier from the packet 27 | memcpy(&_streamIdentifier, currentBuffer, sizeof(_streamIdentifier)); 28 | currentBuffer += sizeof(_streamIdentifier); 29 | 30 | // use parsePositionalData in parent PostionalAudioRingBuffer class to pull common positional data 31 | currentBuffer += parsePositionalData(currentBuffer, numBytes - (currentBuffer - sourceBuffer)); 32 | 33 | // pull out the radius for this injected source - if it's zero this is a point source 34 | memcpy(&_radius, currentBuffer, sizeof(_radius)); 35 | currentBuffer += sizeof(_radius); 36 | 37 | unsigned int attenuationByte = *(currentBuffer++); 38 | _attenuationRatio = attenuationByte / (float) MAX_INJECTOR_VOLUME; 39 | 40 | currentBuffer += parseAudioSamples(currentBuffer, numBytes - (currentBuffer - sourceBuffer)); 41 | 42 | return currentBuffer - sourceBuffer; 43 | } 44 | -------------------------------------------------------------------------------- /cmake/modules/FindLibOVR.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the LibOVR library to use the Oculus 2 | # 3 | # You must provide a LIBOVR_ROOT_DIR which contains Lib and Include directories 4 | # 5 | # Once done this will define 6 | # 7 | # LIBOVR_FOUND - system found LibOVR 8 | # LIBOVR_INCLUDE_DIRS - the LibOVR include directory 9 | # LIBOVR_LIBRARIES - Link this to use LibOVR 10 | # 11 | # Created on 5/9/2013 by Stephen Birarda 12 | # Copyright (c) 2013 High Fidelity 13 | # 14 | 15 | if (LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIRS) 16 | # in cache already 17 | set(LIBOVR_FOUND TRUE) 18 | else (LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIRS) 19 | find_path(LIBOVR_INCLUDE_DIRS OVR.h ${LIBOVR_ROOT_DIR}/Include) 20 | 21 | if (APPLE) 22 | find_library(LIBOVR_LIBRARIES libovr.a ${LIBOVR_ROOT_DIR}/Lib/MacOS/) 23 | elseif (WIN32) 24 | find_library(LIBOVR_LIBRARIES libovr.lib ${LIBOVR_ROOT_DIR}/Lib/Win32/) 25 | endif () 26 | 27 | if (LIBOVR_INCLUDE_DIRS AND LIBOVR_LIBRARIES) 28 | set(LIBOVR_FOUND TRUE) 29 | endif (LIBOVR_INCLUDE_DIRS AND LIBOVR_LIBRARIES) 30 | 31 | if (LIBOVR_FOUND) 32 | if (NOT LibOVR_FIND_QUIETLY) 33 | message(STATUS "Found LibOVR: ${LIBOVR_LIBRARIES}") 34 | endif (NOT LibOVR_FIND_QUIETLY) 35 | else (LIBOVR_FOUND) 36 | if (LibOVR_FIND_REQUIRED) 37 | message(FATAL_ERROR "Could not find LibOVR") 38 | endif (LibOVR_FIND_REQUIRED) 39 | endif (LIBOVR_FOUND) 40 | 41 | # show the LIBOVR_INCLUDE_DIRS and LIBOVR_LIBRARIES variables only in the advanced view 42 | mark_as_advanced(LIBOVR_INCLUDE_DIRS LIBOVR_LIBRARIES) 43 | 44 | endif (LIBOVR_LIBRARIES AND LIBOVR_INCLUDE_DIRS) -------------------------------------------------------------------------------- /externals/glm/core/intrinsic_exponential.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_exponential.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /externals/glm/gtx/unsigned_int.hpp: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /////////////////////////////////////////////////////////////////////////////////// 23 | 24 | #if(defined(GLM_MESSAGES)) 25 | # pragma message("GLM: GLM_GTX_unsigned_int extension is deprecated, include GLM_GTX_integer instead") 26 | #endif 27 | -------------------------------------------------------------------------------- /interface/src/ImportDialog.h: -------------------------------------------------------------------------------- 1 | // 2 | // ImportDialog.h 3 | // hifi 4 | // 5 | // Created by Clement Brisset on 8/12/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __hifi__ImportDialog__ 10 | #define __hifi__ImportDialog__ 11 | 12 | #include 13 | 14 | #include 15 | #include 16 | #include 17 | #include 18 | #include 19 | #include 20 | 21 | class GLWidget; 22 | 23 | class ImportDialog : public QFileDialog { 24 | Q_OBJECT 25 | public: 26 | ImportDialog(QWidget* parent = NULL); 27 | ~ImportDialog(); 28 | 29 | void init(); 30 | void reset(); 31 | 32 | bool getWantPreview() const { return _previewBox.isChecked(); } 33 | QString getCurrentFile() const { return _currentFile; } 34 | bool getImportIntoClipboard() const { return _clipboardImportBox.isChecked(); } 35 | 36 | signals: 37 | void previewToggled(bool); 38 | void accepted(); 39 | 40 | public slots: 41 | int exec(); 42 | void setGLCamera(float x, float y, float z); 43 | void import(); 44 | void accept(); 45 | void reject(); 46 | 47 | private slots: 48 | void preview(bool preview); 49 | void saveCurrentFile(QString); 50 | void timer(); 51 | 52 | private: 53 | QString _currentFile; 54 | QPushButton _importButton; 55 | QCheckBox _clipboardImportBox; 56 | QCheckBox _previewBox; 57 | QProgressBar _previewBar; 58 | GLWidget* _glPreview; 59 | QTimer _glTimer; 60 | }; 61 | 62 | #endif /* defined(__hifi__ImportDialog__) */ 63 | -------------------------------------------------------------------------------- /externals/glm/core/intrinsic_trigonometric.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref core 24 | /// @file glm/core/intrinsic_trigonometric.inl 25 | /// @date 2011-06-15 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | -------------------------------------------------------------------------------- /externals/glm/gtc/type_precision.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////// 2 | /// OpenGL Mathematics (glm.g-truc.net) 3 | /// 4 | /// Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 5 | /// Permission is hereby granted, free of charge, to any person obtaining a copy 6 | /// of this software and associated documentation files (the "Software"), to deal 7 | /// in the Software without restriction, including without limitation the rights 8 | /// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | /// copies of the Software, and to permit persons to whom the Software is 10 | /// furnished to do so, subject to the following conditions: 11 | /// 12 | /// The above copyright notice and this permission notice shall be included in 13 | /// all copies or substantial portions of the Software. 14 | /// 15 | /// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | /// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | /// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | /// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | /// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | /// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 21 | /// THE SOFTWARE. 22 | /// 23 | /// @ref gtc_swizzle 24 | /// @file glm/gtc/swizzle.inl 25 | /// @date 2009-06-14 / 2011-06-15 26 | /// @author Christophe Riccio 27 | /////////////////////////////////////////////////////////////////////////////////// 28 | 29 | namespace glm 30 | { 31 | 32 | } 33 | -------------------------------------------------------------------------------- /interface/src/starfield/renderer/VertexOrder.h: -------------------------------------------------------------------------------- 1 | // 2 | // starfield/renderer/VertexOrder.h 3 | // interface 4 | // 5 | // Created by Tobias Schwinger on 3/22/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__starfield__renderer__VertexOrder__ 10 | #define __interface__starfield__renderer__VertexOrder__ 11 | 12 | #ifndef __interface__Starfield_impl__ 13 | #error "This is an implementation file - not intended for direct inclusion." 14 | #endif 15 | 16 | #include "starfield/Config.h" 17 | #include "starfield/data/InputVertex.h" 18 | #include "starfield/renderer/Tiling.h" 19 | 20 | namespace starfield { 21 | 22 | /** 23 | * Defines the vertex order for the renderer as a bit extractor for 24 | * binary in-place Radix Sort. 25 | */ 26 | class VertexOrder : public Radix2IntegerScanner 27 | { 28 | public: 29 | explicit VertexOrder(Tiling const& tiling) : 30 | 31 | base(tiling.getTileIndexBits() + BrightnessBits), 32 | _tiling(tiling) { 33 | } 34 | 35 | bool bit(InputVertex const& v, state_type const& s) const { 36 | 37 | // inspect (tile_index, brightness) tuples 38 | unsigned key = getBrightness(v.getColor()) ^ BrightnessMask; 39 | key |= _tiling.getTileIndex( 40 | v.getAzimuth(), v.getAltitude()) << BrightnessBits; 41 | return base::bit(key, s); 42 | } 43 | 44 | private: 45 | Tiling _tiling; 46 | 47 | typedef Radix2IntegerScanner base; 48 | }; 49 | 50 | } // anonymous namespace 51 | 52 | #endif 53 | 54 | -------------------------------------------------------------------------------- /interface/external/LibVPX/include/vpx_integer.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (c) 2010 The WebM project authors. All Rights Reserved. 3 | * 4 | * Use of this source code is governed by a BSD-style license 5 | * that can be found in the LICENSE file in the root of the source 6 | * tree. An additional intellectual property rights grant can be found 7 | * in the file PATENTS. All contributing project authors may 8 | * be found in the AUTHORS file in the root of the source tree. 9 | */ 10 | 11 | 12 | #ifndef VPX_INTEGER_H 13 | #define VPX_INTEGER_H 14 | 15 | /* get ptrdiff_t, size_t, wchar_t, NULL */ 16 | #include 17 | 18 | #if (defined(_MSC_VER) && (_MSC_VER < 1600)) || defined(VPX_EMULATE_INTTYPES) 19 | typedef signed char int8_t; 20 | typedef signed short int16_t; 21 | typedef signed int int32_t; 22 | 23 | typedef unsigned char uint8_t; 24 | typedef unsigned short uint16_t; 25 | typedef unsigned int uint32_t; 26 | 27 | #if (defined(_MSC_VER) && (_MSC_VER < 1600)) 28 | typedef signed __int64 int64_t; 29 | typedef unsigned __int64 uint64_t; 30 | #define INT64_MAX _I64_MAX 31 | #define INT16_MAX _I16_MAX 32 | #define INT16_MIN _I16_MIN 33 | #endif 34 | 35 | #ifndef _UINTPTR_T_DEFINED 36 | typedef size_t uintptr_t; 37 | #endif 38 | 39 | #else 40 | 41 | /* Most platforms have the C99 standard integer types. */ 42 | 43 | #if defined(__cplusplus) && !defined(__STDC_FORMAT_MACROS) 44 | #define __STDC_FORMAT_MACROS 45 | #endif 46 | #include 47 | 48 | #endif 49 | 50 | /* VS2010 defines stdint.h, but not inttypes.h */ 51 | #if defined(_MSC_VER) 52 | #define PRId64 "I64d" 53 | #else 54 | #include 55 | #endif 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /interface/external/quazip/include/quachecksum32.h: -------------------------------------------------------------------------------- 1 | #ifndef QUACHECKSUM32_H 2 | #define QUACHECKSUM32_H 3 | 4 | #include 5 | #include "quazip_global.h" 6 | 7 | /// Checksum interface. 8 | /** \class QuaChecksum32 quachecksum32.h 9 | * This is an interface for 32 bit checksums. 10 | * Classes implementing this interface can calcunate a certin 11 | * checksum in a single step: 12 | * \code 13 | * QChecksum32 *crc32 = new QuaCrc32(); 14 | * rasoult = crc32->calculate(data); 15 | * \endcode 16 | * or by streaming the data: 17 | * \code 18 | * QChecksum32 *crc32 = new QuaCrc32(); 19 | * while(!fileA.atEnd()) 20 | * crc32->update(fileA.read(bufSize)); 21 | * resoultA = crc32->value(); 22 | * crc32->reset(); 23 | * while(!fileB.atEnd()) 24 | * crc32->update(fileB.read(bufSize)); 25 | * resoultB = crc32->value(); 26 | * \endcode 27 | */ 28 | class QUAZIP_EXPORT QuaChecksum32 29 | { 30 | 31 | public: 32 | ///Calculates the checksum for data. 33 | /** \a data source data 34 | * \return data checksum 35 | * 36 | * This function has no efect on the value returned by value(). 37 | */ 38 | virtual quint32 calculate(const QByteArray &data) = 0; 39 | 40 | ///Resets the calculation on a checksun for a stream. 41 | virtual void reset() = 0; 42 | 43 | ///Updates the calculated checksum for the stream 44 | /** \a buf next portion of data from the stream 45 | */ 46 | virtual void update(const QByteArray &buf) = 0; 47 | 48 | ///Value of the checksum calculated for the stream passed throw update(). 49 | /** \return checksum 50 | */ 51 | virtual quint32 value() = 0; 52 | }; 53 | 54 | #endif //QUACHECKSUM32_H 55 | -------------------------------------------------------------------------------- /externals/glm/gtx/extend.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2006-01-07 5 | // Updated : 2008-10-05 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/extend.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | genType extend 14 | ( 15 | genType const & Origin, 16 | genType const & Source, 17 | genType const & Distance 18 | ) 19 | { 20 | return Origin + (Source - Origin) * Distance; 21 | } 22 | 23 | template 24 | detail::tvec2 extend 25 | ( 26 | detail::tvec2 const & Origin, 27 | detail::tvec2 const & Source, 28 | valType const & Distance 29 | ) 30 | { 31 | return Origin + (Source - Origin) * Distance; 32 | } 33 | 34 | template 35 | detail::tvec3 extend 36 | ( 37 | detail::tvec3 const & Origin, 38 | detail::tvec3 const & Source, 39 | valType const & Distance 40 | ) 41 | { 42 | return Origin + (Source - Origin) * Distance; 43 | } 44 | 45 | template 46 | detail::tvec4 extend 47 | ( 48 | detail::tvec4 const & Origin, 49 | detail::tvec4 const & Source, 50 | valType const & Distance 51 | ) 52 | { 53 | return Origin + (Source - Origin) * Distance; 54 | } 55 | }//namespace glm 56 | -------------------------------------------------------------------------------- /interface/external/LibVPX/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) 2010, The WebM Project authors. All rights reserved. 2 | 3 | Redistribution and use in source and binary forms, with or without 4 | modification, are permitted provided that the following conditions are 5 | met: 6 | 7 | * Redistributions of source code must retain the above copyright 8 | notice, this list of conditions and the following disclaimer. 9 | 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in 12 | the documentation and/or other materials provided with the 13 | distribution. 14 | 15 | * Neither the name of Google, nor the WebM Project, nor the names 16 | of its contributors may be used to endorse or promote products 17 | derived from this software without specific prior written 18 | permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 21 | "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 22 | LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 23 | A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 24 | HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 25 | SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 26 | LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 27 | DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 28 | THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 30 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | 32 | -------------------------------------------------------------------------------- /externals/glm/gtx/gradient_paint.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2009-03-06 5 | // Updated : 2009-03-09 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/gradient_paint.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | valType radialGradient 14 | ( 15 | detail::tvec2 const & Center, 16 | valType const & Radius, 17 | detail::tvec2 const & Focal, 18 | detail::tvec2 const & Position 19 | ) 20 | { 21 | detail::tvec2 F = Focal - Center; 22 | detail::tvec2 D = Position - Focal; 23 | valType Radius2 = pow2(Radius); 24 | valType Fx2 = pow2(F.x); 25 | valType Fy2 = pow2(F.y); 26 | 27 | valType Numerator = (D.x * F.x + D.y * F.y) + sqrt(Radius2 * (pow2(D.x) + pow2(D.y)) - pow2(D.x * F.y - D.y * F.x)); 28 | valType Denominator = Radius2 - (Fx2 + Fy2); 29 | return Numerator / Denominator; 30 | } 31 | 32 | template 33 | valType linearGradient 34 | ( 35 | detail::tvec2 const & Point0, 36 | detail::tvec2 const & Point1, 37 | detail::tvec2 const & Position 38 | ) 39 | { 40 | detail::tvec2 Dist = Point1 - Point0; 41 | return (Dist.x * (Position.x - Point0.x) + Dist.y * (Position.y - Point0.y)) / glm::dot(Dist, Dist); 42 | } 43 | }//namespace glm 44 | -------------------------------------------------------------------------------- /interface/src/Tool.h: -------------------------------------------------------------------------------- 1 | // 2 | // Tool.h 3 | // interface 4 | // 5 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 6 | // 7 | 8 | #ifndef __interface__Tool__ 9 | #define __interface__Tool__ 10 | 11 | #include 12 | 13 | #include "InterfaceConfig.h" 14 | #include "Util.h" 15 | 16 | class QAction; 17 | 18 | 19 | // Number of rows and columns in the SVG file for the tool palette 20 | static const int NUM_TOOLS_ROWS = 10; 21 | static const int NUM_TOOLS_COLS = 2; 22 | static const int SWATCHS_TOOLS_COUNT = 13; // 8 swatch + 5 tools 23 | 24 | static const int WIDTH_MIN = 47; // Minimal tools width 25 | static const float TOOLS_RATIO = 40.0f / 60.0f; // ratio height/width of tools icons 26 | static const float PAL_SCREEN_RATIO = 3.0f / 100.0f; // Percentage of the screeen width the palette is going to occupy 27 | 28 | // Swatch popup consts 29 | static const float POPUP_STEP = 0.05f; 30 | static const float POPUP_MARGIN = 10.0f; 31 | static const int POPUP_WIDTH = 280; 32 | static const int POPUP_HEIGHT = 30; 33 | static const int SWATCH_WIDTH = 64; 34 | static const int SWATCH_HEIGHT = 30; 35 | static const int FIRST_LINE_OFFSET = 12; 36 | static const int SECOND_LINE_OFFSET = 28; 37 | 38 | class Tool { 39 | public: 40 | Tool(QAction* action, GLuint texture, int x, int y); 41 | 42 | void setAction(QAction* action); 43 | bool isActive(); 44 | virtual void render(int width, int height); 45 | 46 | protected: 47 | QAction* _action; 48 | GLuint _texture; 49 | 50 | // position in the SVG grid 51 | double _x; 52 | double _y; 53 | }; 54 | 55 | #endif /* defined(__interface__Tool__) */ 56 | -------------------------------------------------------------------------------- /libraries/shared/src/SimpleMovingAverage.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // SimpleMovingAverage.cpp 3 | // hifi 4 | // 5 | // Created by Stephen Birarda on 4/18/13. 6 | // Copyright (c) 2013 HighFidelity, Inc. All rights reserved. 7 | // 8 | 9 | #include "SharedUtil.h" 10 | #include "SimpleMovingAverage.h" 11 | 12 | SimpleMovingAverage::SimpleMovingAverage(int numSamplesToAverage) : 13 | _numSamples(0), 14 | _average(0), 15 | _eventDeltaAverage(0), 16 | WEIGHTING(1.0f / numSamplesToAverage), 17 | ONE_MINUS_WEIGHTING(1 - WEIGHTING) { 18 | 19 | } 20 | 21 | int SimpleMovingAverage::updateAverage(float sample) { 22 | if (_numSamples > 0) { 23 | _average = (ONE_MINUS_WEIGHTING * _average) + (WEIGHTING * sample); 24 | 25 | float eventDelta = (usecTimestampNow() - _lastEventTimestamp) / 1000000.0f; 26 | 27 | if (_numSamples > 1) { 28 | _eventDeltaAverage = (ONE_MINUS_WEIGHTING * _eventDeltaAverage) + 29 | (WEIGHTING * eventDelta); 30 | } else { 31 | _eventDeltaAverage = eventDelta; 32 | } 33 | } else { 34 | _average = sample; 35 | _eventDeltaAverage = 0; 36 | } 37 | 38 | _lastEventTimestamp = usecTimestampNow(); 39 | 40 | return ++_numSamples; 41 | } 42 | 43 | void SimpleMovingAverage::reset() { 44 | _numSamples = 0; 45 | } 46 | 47 | float SimpleMovingAverage::getEventDeltaAverage() { 48 | return (ONE_MINUS_WEIGHTING * _eventDeltaAverage) + 49 | (WEIGHTING * ((usecTimestampNow() - _lastEventTimestamp) / 1000000.0f)); 50 | } 51 | 52 | float SimpleMovingAverage::getAverageSampleValuePerSecond() { 53 | return _average * (1 / getEventDeltaAverage()); 54 | } -------------------------------------------------------------------------------- /interface/external/LibOVR/Src/Kernel/OVR_Color.h: -------------------------------------------------------------------------------- 1 | /************************************************************************************ 2 | 3 | PublicHeader: OVR.h 4 | Filename : OVR_Color.h 5 | Content : Contains color struct. 6 | Created : February 7, 2013 7 | Notes : 8 | 9 | Copyright : Copyright 2013 Oculus VR, Inc. All Rights reserved. 10 | 11 | Use of this software is subject to the terms of the Oculus license 12 | agreement provided at the time of installation or download, or which 13 | otherwise accompanies this software in either electronic or hard copy form. 14 | 15 | ************************************************************************************/ 16 | #ifndef OVR_Color_h 17 | #define OVR_Color_h 18 | 19 | #include "OVR_Types.h" 20 | 21 | namespace OVR { 22 | 23 | struct Color 24 | { 25 | UByte R,G,B,A; 26 | 27 | Color() {} 28 | 29 | // Constructs color by channel. Alpha is set to 0xFF (fully visible) 30 | // if not specified. 31 | Color(unsigned char r,unsigned char g,unsigned char b, unsigned char a = 0xFF) 32 | : R(r), G(g), B(b), A(a) { } 33 | 34 | // 0xAARRGGBB - Common HTML color Hex layout 35 | Color(unsigned c) 36 | : R((unsigned char)(c>>16)), G((unsigned char)(c>>8)), 37 | B((unsigned char)c), A((unsigned char)(c>>24)) { } 38 | 39 | bool operator==(const Color& b) const 40 | { 41 | return R == b.R && G == b.G && B == b.B && A == b.A; 42 | } 43 | 44 | void GetRGBA(float *r, float *g, float *b, float* a) const 45 | { 46 | *r = R / 255.0f; 47 | *g = G / 255.0f; 48 | *b = B / 255.0f; 49 | *a = A / 255.0f; 50 | } 51 | }; 52 | 53 | } 54 | 55 | #endif 56 | -------------------------------------------------------------------------------- /externals/glm/gtx/optimum_pow.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-21 5 | // Updated : 2005-12-27 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/optimum_pow.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER genType pow2(const genType& x) 14 | { 15 | return x * x; 16 | } 17 | 18 | template 19 | GLM_FUNC_QUALIFIER genType pow3(const genType& x) 20 | { 21 | return x * x * x; 22 | } 23 | 24 | template 25 | GLM_FUNC_QUALIFIER genType pow4(const genType& x) 26 | { 27 | return x * x * x * x; 28 | } 29 | 30 | GLM_FUNC_QUALIFIER bool powOfTwo(int x) 31 | { 32 | return !(x & (x - 1)); 33 | } 34 | 35 | GLM_FUNC_QUALIFIER detail::tvec2 powOfTwo(const detail::tvec2& x) 36 | { 37 | return detail::tvec2( 38 | powOfTwo(x.x), 39 | powOfTwo(x.y)); 40 | } 41 | 42 | GLM_FUNC_QUALIFIER detail::tvec3 powOfTwo(const detail::tvec3& x) 43 | { 44 | return detail::tvec3( 45 | powOfTwo(x.x), 46 | powOfTwo(x.y), 47 | powOfTwo(x.z)); 48 | } 49 | 50 | GLM_FUNC_QUALIFIER detail::tvec4 powOfTwo(const detail::tvec4& x) 51 | { 52 | return detail::tvec4( 53 | powOfTwo(x.x), 54 | powOfTwo(x.y), 55 | powOfTwo(x.z), 56 | powOfTwo(x.w)); 57 | } 58 | }//namespace glm 59 | -------------------------------------------------------------------------------- /externals/stk/include/Vector3D.h: -------------------------------------------------------------------------------- 1 | #ifndef STK_VECTOR3D_H 2 | #define STK_VECTOR3D_H 3 | 4 | #include "Stk.h" 5 | #include 6 | 7 | namespace stk { 8 | 9 | /***************************************************/ 10 | /*! \class Vector3D 11 | \brief STK 3D vector class. 12 | 13 | This class implements a three-dimensional vector. 14 | 15 | by Perry R. Cook, 1995-2012. 16 | */ 17 | /***************************************************/ 18 | 19 | class Vector3D : public Stk 20 | { 21 | 22 | public: 23 | //! Default constructor taking optional initial X, Y, and Z values. 24 | Vector3D( StkFloat x = 0.0, StkFloat y = 0.0, StkFloat z = 0.0 ) { setXYZ( x, y, z ); }; 25 | 26 | //! Get the current X value. 27 | StkFloat getX( void ) { return X_; }; 28 | 29 | //! Get the current Y value. 30 | StkFloat getY( void ) { return Y_; }; 31 | 32 | //! Get the current Z value. 33 | StkFloat getZ( void ) { return Z_; }; 34 | 35 | //! Calculate the vector length. 36 | StkFloat getLength( void ); 37 | 38 | //! Set the X, Y, and Z values simultaniously. 39 | void setXYZ( StkFloat x, StkFloat y, StkFloat z ) { X_ = x; Y_ = y; Z_ = z; }; 40 | 41 | //! Set the X value. 42 | void setX( StkFloat x ) { X_ = x; }; 43 | 44 | //! Set the Y value. 45 | void setY( StkFloat y ) { Y_ = y; }; 46 | 47 | //! Set the Z value. 48 | void setZ( StkFloat z ) { Z_ = z; }; 49 | 50 | protected: 51 | StkFloat X_; 52 | StkFloat Y_; 53 | StkFloat Z_; 54 | }; 55 | 56 | inline StkFloat Vector3D :: getLength( void ) 57 | { 58 | StkFloat temp; 59 | temp = X_ * X_; 60 | temp += Y_ * Y_; 61 | temp += Z_ * Z_; 62 | temp = sqrt( temp ); 63 | return temp; 64 | } 65 | 66 | } // stk namespace 67 | 68 | #endif 69 | -------------------------------------------------------------------------------- /cmake/modules/FindPortAudio.cmake: -------------------------------------------------------------------------------- 1 | # Find the static PortAudio library 2 | # 3 | # You must provide a PORTAUDIO_ROOT_DIR which contains lib and include directories 4 | # 5 | # Once done this will define 6 | # 7 | # PORTAUDIO_FOUND - system found PortAudio 8 | # PORTAUDIO_INCLUDE_DIRS - the PortAudio include directory 9 | # PORTAUDIO_LIBRARIES - Link this to use PortAudio 10 | # 11 | # Created on 5/14/2013 by Stephen Birarda 12 | # Copyright (c) 2013 High Fidelity 13 | # 14 | 15 | if (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS) 16 | # in cache already 17 | set(PORTAUDIO_FOUND TRUE) 18 | else (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS) 19 | find_path(PORTAUDIO_INCLUDE_DIRS portaudio.h ${PORTAUDIO_ROOT_DIR}/include) 20 | 21 | if (APPLE) 22 | find_library(PORTAUDIO_LIBRARIES libportaudio.a ${PORTAUDIO_ROOT_DIR}/lib/MacOS/) 23 | elseif (UNIX) 24 | find_library(PORTAUDIO_LIBRARIES libportaudio.a ${PORTAUDIO_ROOT_DIR}/lib/UNIX/) 25 | endif () 26 | 27 | if (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES) 28 | set(PORTAUDIO_FOUND TRUE) 29 | endif (PORTAUDIO_INCLUDE_DIRS AND PORTAUDIO_LIBRARIES) 30 | 31 | if (PORTAUDIO_FOUND) 32 | if (NOT PortAudio_FIND_QUIETLY) 33 | message(STATUS "Found PortAudio: ${PORTAUDIO_LIBRARIES}") 34 | endif (NOT PortAudio_FIND_QUIETLY) 35 | else (PORTAUDIO_FOUND) 36 | if (PortAudio_FIND_REQUIRED) 37 | message(FATAL_ERROR "Could not find PortAudio") 38 | endif (PortAudio_FIND_REQUIRED) 39 | endif (PORTAUDIO_FOUND) 40 | 41 | # show the PORTAUDIO_INCLUDE_DIRS and PORTAUDIO_LIBRARIES variables only in the advanced view 42 | mark_as_advanced(PORTAUDIO_INCLUDE_DIRS PORTAUDIO_LIBRARIES) 43 | 44 | endif (PORTAUDIO_LIBRARIES AND PORTAUDIO_INCLUDE_DIRS) -------------------------------------------------------------------------------- /externals/glm/gtx/vector_angle.inl: -------------------------------------------------------------------------------- 1 | /////////////////////////////////////////////////////////////////////////////////////////////////// 2 | // OpenGL Mathematics Copyright (c) 2005 - 2012 G-Truc Creation (www.g-truc.net) 3 | /////////////////////////////////////////////////////////////////////////////////////////////////// 4 | // Created : 2005-12-30 5 | // Updated : 2008-09-29 6 | // Licence : This source is under MIT License 7 | // File : glm/gtx/vector_angle.inl 8 | /////////////////////////////////////////////////////////////////////////////////////////////////// 9 | 10 | namespace glm 11 | { 12 | template 13 | GLM_FUNC_QUALIFIER typename genType::value_type angle 14 | ( 15 | genType const & x, 16 | genType const & y 17 | ) 18 | { 19 | return degrees(acos(dot(x, y))); 20 | } 21 | 22 | //! \todo epsilon is hard coded to 0.01 23 | template 24 | GLM_FUNC_QUALIFIER valType orientedAngle 25 | ( 26 | detail::tvec2 const & x, 27 | detail::tvec2 const & y 28 | ) 29 | { 30 | valType Angle = glm::degrees(acos(dot(x, y))); 31 | detail::tvec2 TransformedVector = glm::rotate(x, Angle); 32 | if(all(equalEpsilon(y, TransformedVector, valType(0.01)))) 33 | return Angle; 34 | else 35 | return -Angle; 36 | } 37 | 38 | template 39 | GLM_FUNC_QUALIFIER valType orientedAngle 40 | ( 41 | detail::tvec3 const & x, 42 | detail::tvec3 const & y, 43 | detail::tvec3 const & ref 44 | ) 45 | { 46 | valType Angle = glm::degrees(glm::acos(glm::dot(x, y))); 47 | 48 | if(glm::dot(ref, glm::cross(x, y)) < valType(0)) 49 | return -Angle; 50 | else 51 | return Angle; 52 | } 53 | }//namespace glm 54 | -------------------------------------------------------------------------------- /externals/stk/include/Generator.h: -------------------------------------------------------------------------------- 1 | #ifndef STK_GENERATOR_H 2 | #define STK_GENERATOR_H 3 | 4 | #include "Stk.h" 5 | 6 | namespace stk { 7 | 8 | /***************************************************/ 9 | /*! \class Generator 10 | \brief STK abstract unit generator parent class. 11 | 12 | This class provides limited common functionality for STK unit 13 | generator sample-source subclasses. It is general enough to 14 | support both monophonic and polyphonic output classes. 15 | 16 | by Perry R. Cook and Gary P. Scavone, 1995-2012. 17 | */ 18 | /***************************************************/ 19 | 20 | class Generator : public Stk 21 | { 22 | public: 23 | 24 | //! Class constructor. 25 | Generator( void ) { lastFrame_.resize( 1, 1, 0.0 ); }; 26 | 27 | //! Return the number of output channels for the class. 28 | unsigned int channelsOut( void ) const { return lastFrame_.channels(); }; 29 | 30 | //! Return an StkFrames reference to the last output sample frame. 31 | const StkFrames& lastFrame( void ) const { return lastFrame_; }; 32 | 33 | //! Fill the StkFrames object with computed sample frames, starting at the specified channel. 34 | /*! 35 | The \c channel argument plus the number of output channels must 36 | be less than the number of channels in the StkFrames argument (the 37 | first channel is specified by 0). However, range checking is only 38 | performed if _STK_DEBUG_ is defined during compilation, in which 39 | case an out-of-range value will trigger an StkError exception. 40 | */ 41 | virtual StkFrames& tick( StkFrames& frames, unsigned int channel = 0 ) = 0; 42 | 43 | protected: 44 | 45 | StkFrames lastFrame_; 46 | }; 47 | 48 | } // stk namespace 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /libraries/voxels/src/VoxelNodeBag.h: -------------------------------------------------------------------------------- 1 | // 2 | // VoxelNodeBag.h 3 | // hifi 4 | // 5 | // Created by Brad Hefta-Gaub on 4/25/2013 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | // This class is used by the VoxelTree:encodeTreeBitstream() functions to store extra nodes that need to be sent 9 | // it's a generic bag style storage mechanism. But It has the property that you can't put the same node into the bag 10 | // more than once (in other words, it de-dupes automatically), also, it supports collapsing it's several peer nodes 11 | // into a parent node in cases where you add enough peers that it makes more sense to just add the parent. 12 | // 13 | 14 | #ifndef __hifi__VoxelNodeBag__ 15 | #define __hifi__VoxelNodeBag__ 16 | 17 | #include "VoxelNode.h" 18 | 19 | class VoxelNodeBag : public VoxelNodeDeleteHook { 20 | 21 | public: 22 | VoxelNodeBag(); 23 | ~VoxelNodeBag(); 24 | 25 | void insert(VoxelNode* node); // put a node into the bag 26 | VoxelNode* extract(); // pull a node out of the bag (could come in any order) 27 | bool contains(VoxelNode* node); // is this node in the bag? 28 | void remove(VoxelNode* node); // remove a specific item from the bag 29 | 30 | bool isEmpty() const { return (_elementsInUse == 0); } 31 | int count() const { return _elementsInUse; } 32 | 33 | void deleteAll(); 34 | 35 | static void voxelNodeDeleteHook(VoxelNode* node, void* extraData); 36 | 37 | virtual void nodeDeleted(VoxelNode* node); 38 | 39 | private: 40 | 41 | VoxelNode** _bagElements; 42 | int _elementsInUse; 43 | int _sizeOfElementsArray; 44 | int _hookID; 45 | }; 46 | 47 | #endif /* defined(__hifi__VoxelNodeBag__) */ 48 | -------------------------------------------------------------------------------- /cmake/modules/FindLibVPX.cmake: -------------------------------------------------------------------------------- 1 | # - Try to find the LibVPX library to perform VP8 video encoding/decoding 2 | # 3 | # You must provide a LIBVPX_ROOT_DIR which contains lib and include directories 4 | # 5 | # Once done this will define 6 | # 7 | # LIBVPX_FOUND - system found LibVPX 8 | # LIBVPX_INCLUDE_DIRS - the LibVPX include directory 9 | # LIBVPX_LIBRARIES - Link this to use LibVPX 10 | # 11 | # Created on 7/17/2013 by Andrzej Kapolka 12 | # Copyright (c) 2013 High Fidelity 13 | # 14 | 15 | if (LIBVPX_LIBRARIES AND LIBVPX_INCLUDE_DIRS) 16 | # in cache already 17 | set(LIBVPX_FOUND TRUE) 18 | else (LIBVPX_LIBRARIES AND LIBVPX_INCLUDE_DIRS) 19 | find_path(LIBVPX_INCLUDE_DIRS vpx_codec.h ${LIBVPX_ROOT_DIR}/include) 20 | 21 | if (APPLE) 22 | find_library(LIBVPX_LIBRARIES libvpx.a ${LIBVPX_ROOT_DIR}/lib/MacOS/) 23 | elseif (UNIX) 24 | find_library(LIBVPX_LIBRARIES libvpx.a ${LIBVPX_ROOT_DIR}/lib/UNIX/) 25 | elseif (WIN32) 26 | find_library(LIBVPX_LIBRARIES libvpx.lib ${LIBVPX_ROOT_DIR}/lib/Win32/) 27 | endif () 28 | 29 | if (LIBVPX_INCLUDE_DIRS AND LIBVPX_LIBRARIES) 30 | set(LIBVPX_FOUND TRUE) 31 | endif (LIBVPX_INCLUDE_DIRS AND LIBVPX_LIBRARIES) 32 | 33 | if (LIBVPX_FOUND) 34 | if (NOT LibVPX_FIND_QUIETLY) 35 | message(STATUS "Found LibVPX: ${LIBVPX_LIBRARIES}") 36 | endif (NOT LibVPX_FIND_QUIETLY) 37 | else (LIBVPX_FOUND) 38 | if (LibVPX_FIND_REQUIRED) 39 | message(FATAL_ERROR "Could not find LibVPX") 40 | endif (LibVPX_FIND_REQUIRED) 41 | endif (LIBVPX_FOUND) 42 | 43 | # show the LIBVPX_INCLUDE_DIRS and LIBVPX_LIBRARIES variables only in the advanced view 44 | mark_as_advanced(LIBVPX_INCLUDE_DIRS LIBVPX_LIBRARIES) 45 | 46 | endif (LIBVPX_LIBRARIES AND LIBVPX_INCLUDE_DIRS) 47 | -------------------------------------------------------------------------------- /cmake/modules/FindFaceshift.cmake: -------------------------------------------------------------------------------- 1 | # Try to find the Faceshift networking library 2 | # 3 | # You must provide a FACESHIFT_ROOT_DIR which contains lib and include directories 4 | # 5 | # Once done this will define 6 | # 7 | # FACESHIFT_FOUND - system found Faceshift 8 | # FACESHIFT_INCLUDE_DIRS - the Faceshift include directory 9 | # FACESHIFT_LIBRARIES - Link this to use Faceshift 10 | # 11 | # Created on 8/30/2013 by Andrzej Kapolka 12 | # Copyright (c) 2013 High Fidelity 13 | # 14 | 15 | if (FACESHIFT_LIBRARIES AND FACESHIFT_INCLUDE_DIRS) 16 | # in cache already 17 | set(FACESHIFT_FOUND TRUE) 18 | else (FACESHIFT_LIBRARIES AND FACESHIFT_INCLUDE_DIRS) 19 | find_path(FACESHIFT_INCLUDE_DIRS fsbinarystream.h ${FACESHIFT_ROOT_DIR}/include) 20 | 21 | if (APPLE) 22 | find_library(FACESHIFT_LIBRARIES libfaceshift.a ${FACESHIFT_ROOT_DIR}/lib/MacOS/) 23 | elseif (UNIX) 24 | find_library(FACESHIFT_LIBRARIES libfaceshift.a ${FACESHIFT_ROOT_DIR}/lib/UNIX/) 25 | endif () 26 | 27 | if (FACESHIFT_INCLUDE_DIRS AND FACESHIFT_LIBRARIES) 28 | set(FACESHIFT_FOUND TRUE) 29 | endif (FACESHIFT_INCLUDE_DIRS AND FACESHIFT_LIBRARIES) 30 | 31 | if (FACESHIFT_FOUND) 32 | if (NOT FACESHIFT_FIND_QUIETLY) 33 | message(STATUS "Found Faceshift: ${FACESHIFT_LIBRARIES}") 34 | endif (NOT FACESHIFT_FIND_QUIETLY) 35 | else (FACESHIFT_FOUND) 36 | if (FACESHIFT_FIND_REQUIRED) 37 | message(FATAL_ERROR "Could not find Faceshift") 38 | endif (FACESHIFT_FIND_REQUIRED) 39 | endif (FACESHIFT_FOUND) 40 | 41 | # show the FACESHIFT_INCLUDE_DIRS and FACESHIFT_LIBRARIES variables only in the advanced view 42 | mark_as_advanced(FACESHIFT_INCLUDE_DIRS FACESHIFT_LIBRARIES) 43 | 44 | endif (FACESHIFT_LIBRARIES AND FACESHIFT_INCLUDE_DIRS) 45 | -------------------------------------------------------------------------------- /interface/src/Stars.cpp: -------------------------------------------------------------------------------- 1 | // 2 | // Stars.cpp 3 | // interface 4 | // 5 | // Created by Tobias Schwinger on 3/22/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #include "InterfaceConfig.h" 10 | #include "Stars.h" 11 | 12 | #define __interface__Starfield_impl__ 13 | #include "starfield/Controller.h" 14 | #undef __interface__Starfield_impl__ 15 | 16 | Stars::Stars() : 17 | _controller(0l), _fileLoaded(false) { 18 | _controller = new starfield::Controller; 19 | } 20 | 21 | Stars::~Stars() { 22 | delete _controller; 23 | } 24 | 25 | bool Stars::readInput(const char* url, const char* cacheFile, unsigned limit) { 26 | _fileLoaded = _controller->readInput(url, cacheFile, limit); 27 | return _fileLoaded; 28 | } 29 | 30 | bool Stars::setResolution(unsigned k) { 31 | return _controller->setResolution(k); 32 | } 33 | 34 | float Stars::changeLOD(float fraction, float overalloc, float realloc) { 35 | return float(_controller->changeLOD(fraction, overalloc, realloc)); 36 | } 37 | 38 | void Stars::render(float fovY, float aspect, float nearZ, float alpha) { 39 | 40 | // determine length of screen diagonal from quadrant height and aspect ratio 41 | float quadrantHeight = nearZ * tan(angleConvert(fovY) * 0.5f); 42 | float halfDiagonal = sqrt(quadrantHeight * quadrantHeight * (1.0f + aspect * aspect)); 43 | 44 | // determine fov angle in respect to the diagonal 45 | float fovDiagonal = atan(halfDiagonal / nearZ) * 2.0f; 46 | 47 | // pull the modelview matrix off the GL stack 48 | glm::mat4 view; glGetFloatv(GL_MODELVIEW_MATRIX, glm::value_ptr(view)); 49 | 50 | _controller->render(fovDiagonal, aspect, glm::affineInverse(view), alpha); 51 | } 52 | 53 | 54 | -------------------------------------------------------------------------------- /interface/src/renderer/FBXReader.h: -------------------------------------------------------------------------------- 1 | // 2 | // FBXReader.h 3 | // interface 4 | // 5 | // Created by Andrzej Kapolka on 9/18/13. 6 | // Copyright (c) 2013 High Fidelity, Inc. All rights reserved. 7 | // 8 | 9 | #ifndef __interface__FBXReader__ 10 | #define __interface__FBXReader__ 11 | 12 | #include 13 | #include 14 | 15 | #include 16 | 17 | class QIODevice; 18 | 19 | class FBXNode; 20 | 21 | typedef QList FBXNodeList; 22 | 23 | /// A node within an FBX document. 24 | class FBXNode { 25 | public: 26 | 27 | QByteArray name; 28 | QVariantList properties; 29 | FBXNodeList children; 30 | }; 31 | 32 | /// A single blendshape extracted from an FBX document. 33 | class FBXBlendshape { 34 | public: 35 | 36 | QVector indices; 37 | QVector vertices; 38 | QVector normals; 39 | }; 40 | 41 | /// Base geometry with blendshapes mapped by name. 42 | class FBXGeometry { 43 | public: 44 | 45 | QVector quadIndices; 46 | QVector triangleIndices; 47 | QVector vertices; 48 | QVector normals; 49 | 50 | QVector blendshapes; 51 | }; 52 | 53 | /// Parses the input from the supplied data as an FBX file. 54 | /// \exception QString if an error occurs in parsing 55 | FBXNode parseFBX(const QByteArray& data); 56 | 57 | /// Parses the input from the supplied device as an FBX file. 58 | /// \exception QString if an error occurs in parsing 59 | FBXNode parseFBX(QIODevice* device); 60 | 61 | /// Extracts the geometry from a parsed FBX node. 62 | FBXGeometry extractFBXGeometry(const FBXNode& node); 63 | 64 | void printNode(const FBXNode& node, int indent = 0); 65 | 66 | #endif /* defined(__interface__FBXReader__) */ 67 | --------------------------------------------------------------------------------