├── .gitmodules ├── LICENSE ├── README.md ├── auralizer ├── .gitignore ├── CMakeLists.txt ├── LICENSE ├── README.md ├── pyproject.toml ├── setup.py ├── spherical_harmonics.egg-info │ ├── PKG-INFO │ ├── SOURCES.txt │ ├── dependency_links.txt │ ├── not-zip-safe │ └── top_level.txt ├── src │ ├── cpp │ │ └── binding.cpp │ ├── python │ │ └── spherical_harmonics │ │ │ └── __init__.py │ └── spherical_harmonics.egg-info │ │ ├── PKG-INFO │ │ ├── SOURCES.txt │ │ ├── dependency_links.txt │ │ ├── not-zip-safe │ │ ├── requires.txt │ │ └── top_level.txt └── test.py └── ray_generator ├── .gitignore ├── CMakeLists.txt ├── LICENSE.txt ├── README.md ├── examples ├── compare_image.py ├── cube.mtl ├── cube.obj ├── custom_array.py ├── mesh_sim.py ├── path_data_obj.json └── path_data_shoebox.json ├── pipeline.py ├── pyproject.toml ├── setup.cfg ├── setup.py ├── src ├── GSound │ ├── CMakeLists.txt │ └── gsound │ │ ├── gsConfig.h │ │ ├── gsDebugCache.cpp │ │ ├── gsDebugCache.h │ │ ├── gsDebugFlags.h │ │ ├── gsFrequencyBandResponse.cpp │ │ ├── gsFrequencyBandResponse.h │ │ ├── gsFrequencyBands.cpp │ │ ├── gsFrequencyBands.h │ │ ├── gsFrequencyResponse.cpp │ │ ├── gsFrequencyResponse.h │ │ ├── gsIRMetrics.h │ │ ├── gsIRRequest.h │ │ ├── gsImpulseResponse.cpp │ │ ├── gsImpulseResponse.h │ │ ├── gsMeshFlags.h │ │ ├── gsMeshRequest.cpp │ │ ├── gsMeshRequest.h │ │ ├── gsPropagationFlags.h │ │ ├── gsPropagationRequest.cpp │ │ ├── gsPropagationRequest.h │ │ ├── gsRenderFlags.h │ │ ├── gsRenderRequest.cpp │ │ ├── gsRenderRequest.h │ │ ├── gsSampledIR.cpp │ │ ├── gsSampledIR.h │ │ ├── gsSoundDetector.cpp │ │ ├── gsSoundDetector.h │ │ ├── gsSoundDirectivity.cpp │ │ ├── gsSoundDirectivity.h │ │ ├── gsSoundListener.cpp │ │ ├── gsSoundListener.h │ │ ├── gsSoundListenerFlags.h │ │ ├── gsSoundListenerIR.cpp │ │ ├── gsSoundListenerIR.h │ │ ├── gsSoundListenerRenderer.cpp │ │ ├── gsSoundListenerRenderer.h │ │ ├── gsSoundMaterial.cpp │ │ ├── gsSoundMaterial.h │ │ ├── gsSoundMedium.cpp │ │ ├── gsSoundMedium.h │ │ ├── gsSoundMesh.cpp │ │ ├── gsSoundMesh.h │ │ ├── gsSoundMeshPreprocessor.cpp │ │ ├── gsSoundMeshPreprocessor.h │ │ ├── gsSoundObject.cpp │ │ ├── gsSoundObject.h │ │ ├── gsSoundObjectFlags.h │ │ ├── gsSoundPath.h │ │ ├── gsSoundPathFlags.h │ │ ├── gsSoundPropagationSystem.cpp │ │ ├── gsSoundPropagationSystem.h │ │ ├── gsSoundPropagator.cpp │ │ ├── gsSoundPropagator.h │ │ ├── gsSoundRay.h │ │ ├── gsSoundScene.cpp │ │ ├── gsSoundScene.h │ │ ├── gsSoundSceneIR.cpp │ │ ├── gsSoundSceneIR.h │ │ ├── gsSoundSource.cpp │ │ ├── gsSoundSource.h │ │ ├── gsSoundSourceFlags.h │ │ ├── gsSoundSourceIR.cpp │ │ ├── gsSoundSourceIR.h │ │ ├── gsSoundStatistics.cpp │ │ ├── gsSoundStatistics.h │ │ ├── gsSoundTriangle.h │ │ ├── gsSourceSoundBuffer.cpp │ │ ├── gsSourceSoundBuffer.h │ │ ├── gsound.h │ │ ├── gsoundC.cpp │ │ ├── gsoundC.h │ │ └── internal │ │ ├── gsDiffractionEdge.h │ │ ├── gsDiffractionGraph.h │ │ ├── gsDiffusePathCache.cpp │ │ ├── gsDiffusePathCache.h │ │ ├── gsDiffusePathInfo.h │ │ ├── gsHRTFFilter.cpp │ │ ├── gsHRTFFilter.h │ │ ├── gsIRCache.cpp │ │ ├── gsIRCache.h │ │ ├── gsInternalConfig.h │ │ ├── gsInternalSoundTriangle.h │ │ ├── gsObjectSpaceTriangle.h │ │ ├── gsPanLookupTable.h │ │ ├── gsPropagationData.cpp │ │ ├── gsPropagationData.h │ │ ├── gsSIMDCrossover.h │ │ ├── gsSampleBuffer.h │ │ ├── gsSoundBandDirectivity.cpp │ │ ├── gsSoundBandDirectivity.h │ │ ├── gsSoundPathCache.cpp │ │ ├── gsSoundPathCache.h │ │ ├── gsSoundPathID.h │ │ ├── gsSoundPathPoint.h │ │ ├── gsSoundSourceCluster.h │ │ ├── gsSoundSourceClusterer.cpp │ │ ├── gsSoundSourceClusterer.h │ │ ├── gsUTDFrequencyResponse.cpp │ │ ├── gsUTDFrequencyResponse.h │ │ ├── gsVisibilityCache.cpp │ │ ├── gsVisibilityCache.h │ │ └── gsWorldSpaceTriangle.h ├── Om │ ├── CMakeLists.txt │ ├── Om BVH │ │ ├── CMakeLists.txt │ │ └── om │ │ │ ├── bvh │ │ │ ├── omAABBTree4.cpp │ │ │ ├── omAABBTree4.h │ │ │ ├── omBVHBVH.cpp │ │ │ ├── omBVHBVH.h │ │ │ ├── omBVHConfig.h │ │ │ ├── omBVHGeometry.cpp │ │ │ ├── omBVHGeometry.h │ │ │ ├── omBVHInstance.cpp │ │ │ ├── omBVHInstance.h │ │ │ ├── omBVHRay.h │ │ │ ├── omBVHScene.cpp │ │ │ ├── omBVHScene.h │ │ │ └── omBVHTransform.h │ │ │ └── omBVH.h │ ├── Om Framework │ │ ├── CMakeLists.txt │ │ └── om │ │ │ ├── data │ │ │ ├── omData.cpp │ │ │ ├── omData.h │ │ │ ├── omDataBuffer.cpp │ │ │ ├── omDataBuffer.h │ │ │ ├── omDataConfig.h │ │ │ ├── omDataStore.cpp │ │ │ ├── omDataStore.h │ │ │ ├── omEndian.h │ │ │ ├── omHashCode.cpp │ │ │ ├── omHashCode.h │ │ │ ├── omString.cpp │ │ │ ├── omString.h │ │ │ ├── omStringBuffer.cpp │ │ │ ├── omStringBuffer.h │ │ │ ├── omStringIterator.cpp │ │ │ └── omStringIterator.h │ │ │ ├── fs │ │ │ ├── omDirectory.cpp │ │ │ ├── omDirectory.h │ │ │ ├── omFile.cpp │ │ │ ├── omFile.h │ │ │ ├── omFileSystemConfig.h │ │ │ ├── omFileSystemNode.h │ │ │ ├── omPath.cpp │ │ │ └── omPath.h │ │ │ ├── io │ │ │ ├── omBinaryDecoder.cpp │ │ │ ├── omBinaryDecoder.h │ │ │ ├── omBinaryEncoder.cpp │ │ │ ├── omBinaryEncoder.h │ │ │ ├── omBinaryFormat.h │ │ │ ├── omDataInputStream.cpp │ │ │ ├── omDataInputStream.h │ │ │ ├── omDataOutputStream.h │ │ │ ├── omFileReader.cpp │ │ │ ├── omFileReader.h │ │ │ ├── omFileWriter.cpp │ │ │ ├── omFileWriter.h │ │ │ ├── omIOConfig.h │ │ │ ├── omLog.cpp │ │ │ ├── omLog.h │ │ │ ├── omPrintStream.cpp │ │ │ ├── omPrintStream.h │ │ │ ├── omStringInputStream.cpp │ │ │ ├── omStringInputStream.h │ │ │ └── omStringOutputStream.h │ │ │ ├── lang │ │ │ ├── internal │ │ │ │ ├── omFunctionCallBase.h │ │ │ │ ├── omFunctionDefinition.h │ │ │ │ └── omMemberFunction.h │ │ │ ├── omFunction.h │ │ │ ├── omFunctionCall.h │ │ │ ├── omHalfFloat.h │ │ │ ├── omLanguageConfig.h │ │ │ ├── omOptional.h │ │ │ ├── omShared.h │ │ │ ├── omUnique.h │ │ │ └── omUserData.h │ │ │ ├── math │ │ │ ├── omAABB1D.h │ │ │ ├── omAABB2D.h │ │ │ ├── omAABB3D.h │ │ │ ├── omArrayMath.cpp │ │ │ ├── omArrayMath.h │ │ │ ├── omComplex.h │ │ │ ├── omFFT.cpp │ │ │ ├── omFFT.h │ │ │ ├── omFFTBase.h │ │ │ ├── omFFTComplex.h │ │ │ ├── omFFTReal.h │ │ │ ├── omInterpolation.cpp │ │ │ ├── omInterpolation.h │ │ │ ├── omMathConfig.h │ │ │ ├── omMathPrimitives.h │ │ │ ├── omMatrix.h │ │ │ ├── omMatrix2D.h │ │ │ ├── omMatrix3D.h │ │ │ ├── omMatrix4D.h │ │ │ ├── omMatrixND.h │ │ │ ├── omPlane3D.h │ │ │ ├── omPrimes.cpp │ │ │ ├── omPrimes.h │ │ │ ├── omQuaternion.h │ │ │ ├── omRandom.h │ │ │ ├── omRay3D.h │ │ │ ├── omResample.h │ │ │ ├── omSIMD.h │ │ │ ├── omSIMDAABB3D.h │ │ │ ├── omSIMDArray.h │ │ │ ├── omSIMDArrayFloat32.h │ │ │ ├── omSIMDArrayInt32.h │ │ │ ├── omSIMDConfig.h │ │ │ ├── omSIMDFlags.cpp │ │ │ ├── omSIMDFlags.h │ │ │ ├── omSIMDPlane3D.h │ │ │ ├── omSIMDRay3D.h │ │ │ ├── omSIMDScalar.h │ │ │ ├── omSIMDScalarFloat32_4.h │ │ │ ├── omSIMDScalarFloat64_2.h │ │ │ ├── omSIMDScalarInt16_8.h │ │ │ ├── omSIMDScalarInt32_4.h │ │ │ ├── omSIMDScalarInt64_2.h │ │ │ ├── omSIMDTriangle3D.h │ │ │ ├── omSIMDTypes.h │ │ │ ├── omSIMDVector3D.h │ │ │ ├── omScalarMath.h │ │ │ ├── omScalarType.cpp │ │ │ ├── omScalarType.h │ │ │ ├── omSphere3D.h │ │ │ ├── omSphericalHarmonics.h │ │ │ ├── omTransform3D.h │ │ │ ├── omVector2D.h │ │ │ ├── omVector3D.h │ │ │ ├── omVector4D.h │ │ │ └── omVectorND.h │ │ │ ├── omAssets.h │ │ │ ├── omConfig.h │ │ │ ├── omData.h │ │ │ ├── omFileSystem.h │ │ │ ├── omFramework.h │ │ │ ├── omIO.h │ │ │ ├── omLanguage.h │ │ │ ├── omMath.h │ │ │ ├── omSystem.h │ │ │ ├── omThreads.h │ │ │ ├── omTime.h │ │ │ ├── omUtilities.h │ │ │ ├── system │ │ │ ├── omCPU.cpp │ │ │ ├── omCPU.h │ │ │ └── omSystemConfig.h │ │ │ ├── threads │ │ │ ├── omAtomics.cpp │ │ │ ├── omAtomics.h │ │ │ ├── omMutex.cpp │ │ │ ├── omMutex.h │ │ │ ├── omScopedMutex.h │ │ │ ├── omSemaphore.cpp │ │ │ ├── omSemaphore.h │ │ │ ├── omSignal.cpp │ │ │ ├── omSignal.h │ │ │ ├── omThread.h │ │ │ ├── omThreadBase.h │ │ │ ├── omThreadBase_Cocoa.mm │ │ │ ├── omThreadBase_POSIX.cpp │ │ │ ├── omThreadBase_Win32.cpp │ │ │ ├── omThreadPool.cpp │ │ │ ├── omThreadPool.h │ │ │ ├── omThreadPriority.cpp │ │ │ ├── omThreadPriority.h │ │ │ └── omThreadsConfig.h │ │ │ ├── time │ │ │ ├── omTime.cpp │ │ │ ├── omTime.h │ │ │ ├── omTimeConfig.h │ │ │ ├── omTimer.cpp │ │ │ └── omTimer.h │ │ │ └── util │ │ │ ├── omAllocator.h │ │ │ ├── omArray.h │ │ │ ├── omArrayList.h │ │ │ ├── omCopy.h │ │ │ ├── omHashMap.h │ │ │ ├── omPODArray.h │ │ │ ├── omPriorityQueue.h │ │ │ ├── omShortArray.h │ │ │ ├── omShortArrayList.h │ │ │ ├── omStaticArray.h │ │ │ └── omUtilitiesConfig.h │ ├── Om Resources │ │ ├── CMakeLists.txt │ │ └── om │ │ │ ├── omResources.h │ │ │ └── resources │ │ │ ├── omOpaqueResource.h │ │ │ ├── omResource.h │ │ │ ├── omResourceFlags.h │ │ │ ├── omResourceFormat.cpp │ │ │ ├── omResourceFormat.h │ │ │ ├── omResourceID.h │ │ │ ├── omResourceManager.cpp │ │ │ ├── omResourceManager.h │ │ │ ├── omResourceMode.cpp │ │ │ ├── omResourceMode.h │ │ │ ├── omResourceModule.cpp │ │ │ ├── omResourceModule.h │ │ │ ├── omResourceSet.cpp │ │ │ ├── omResourceSet.h │ │ │ ├── omResourceSetTypeTranscoder.h │ │ │ ├── omResourceTranscoder.h │ │ │ ├── omResourceType.cpp │ │ │ ├── omResourceType.h │ │ │ ├── omResourceTypeSet.h │ │ │ ├── omResourceTypeSetBase.h │ │ │ ├── omResourceTypeTranscoder.h │ │ │ └── omResourcesConfig.h │ └── Om Sound │ │ ├── CMakeLists.txt │ │ └── om │ │ ├── omSound.h │ │ └── sound │ │ ├── base │ │ ├── omSound.cpp │ │ ├── omSound.h │ │ ├── omSoundBaseConfig.h │ │ ├── omSoundBuffer.cpp │ │ ├── omSoundBuffer.h │ │ ├── omSoundCallbackStream.cpp │ │ ├── omSoundCallbackStream.h │ │ ├── omSoundChannelInfo.h │ │ ├── omSoundChannelLayout.cpp │ │ ├── omSoundChannelLayout.h │ │ ├── omSoundChannelLayoutType.cpp │ │ ├── omSoundChannelLayoutType.h │ │ ├── omSoundChannelMixMatrix.cpp │ │ ├── omSoundChannelMixMatrix.h │ │ ├── omSoundChannelType.cpp │ │ ├── omSoundChannelType.h │ │ ├── omSoundDataInputStream.cpp │ │ ├── omSoundDataInputStream.h │ │ ├── omSoundDirectionalIR.cpp │ │ ├── omSoundDirectionalIR.h │ │ ├── omSoundFormat.cpp │ │ ├── omSoundFormat.h │ │ ├── omSoundFormatFlags.h │ │ ├── omSoundFormatSettings.h │ │ ├── omSoundFrame.cpp │ │ ├── omSoundFrame.h │ │ ├── omSoundFrequencyBands.cpp │ │ ├── omSoundFrequencyBands.h │ │ ├── omSoundFrequencyData.cpp │ │ ├── omSoundFrequencyData.h │ │ ├── omSoundInputStream.cpp │ │ ├── omSoundInputStream.h │ │ ├── omSoundInt24.h │ │ ├── omSoundLerpState.h │ │ ├── omSoundMIDIBuffer.cpp │ │ ├── omSoundMIDIBuffer.h │ │ ├── omSoundMIDIEvent.h │ │ ├── omSoundMIDIMessage.cpp │ │ ├── omSoundMIDIMessage.h │ │ ├── omSoundMIDITime.h │ │ ├── omSoundOutputStream.cpp │ │ ├── omSoundOutputStream.h │ │ ├── omSoundPanDirection.h │ │ ├── omSoundResult.h │ │ ├── omSoundSIMDCrossover.h │ │ ├── omSoundSample.h │ │ ├── omSoundSampleType.cpp │ │ ├── omSoundSampleType.h │ │ ├── omSoundSharedBufferInfo.h │ │ ├── omSoundSharedBufferPool.cpp │ │ ├── omSoundSharedBufferPool.h │ │ ├── omSoundSharedSoundBuffer.h │ │ └── omSoundTimeSignature.h │ │ ├── filters │ │ ├── omSoundCompressor.cpp │ │ ├── omSoundCompressor.h │ │ ├── omSoundCutoffFilter.h │ │ ├── omSoundCutofffilter.cpp │ │ ├── omSoundFilter.cpp │ │ ├── omSoundFilter.h │ │ ├── omSoundFilterCategory.cpp │ │ ├── omSoundFilterCategory.h │ │ ├── omSoundFilterParameter.cpp │ │ ├── omSoundFilterParameter.h │ │ ├── omSoundFilterParameterCurve.cpp │ │ ├── omSoundFilterParameterCurve.h │ │ ├── omSoundFilterParameterFlags.h │ │ ├── omSoundFilterParameterInfo.h │ │ ├── omSoundFilterParameterType.cpp │ │ ├── omSoundFilterParameterType.h │ │ ├── omSoundFilterParameterUnits.cpp │ │ ├── omSoundFilterParameterUnits.h │ │ ├── omSoundFilterParameterValue.cpp │ │ ├── omSoundFilterParameterValue.h │ │ ├── omSoundFilterPreset.h │ │ ├── omSoundFilterState.h │ │ ├── omSoundFilterVersion.cpp │ │ ├── omSoundFilterVersion.h │ │ ├── omSoundFiltersConfig.h │ │ ├── omSoundHDRFilter.cpp │ │ ├── omSoundHDRFilter.h │ │ ├── omSoundLimiter.cpp │ │ ├── omSoundLimiter.h │ │ ├── omSoundPlayer.cpp │ │ ├── omSoundPlayer.h │ │ ├── omSoundResampler.cpp │ │ ├── omSoundResampler.h │ │ ├── omSoundReverbFilter.cpp │ │ └── omSoundReverbFilter.h │ │ ├── omSoundBase.h │ │ ├── omSoundConfig.h │ │ └── omSoundFilters.h ├── pygsound.egg-info │ ├── SOURCES.txt │ ├── dependency_links.txt │ ├── not-zip-safe │ ├── requires.txt │ └── top_level.txt └── pygsound │ ├── CMakeLists.txt │ ├── __init__.py │ ├── __pycache__ │ └── __init__.cpython-310.pyc │ ├── deps │ └── include │ │ └── tiny_obj_loader.h │ └── src │ ├── Context.cpp │ ├── Context.hpp │ ├── Listener.cpp │ ├── Listener.hpp │ ├── MicrophoneArrays.cpp │ ├── MicrophoneArrays.hpp │ ├── Python.hpp │ ├── Scene.cpp │ ├── Scene.hpp │ ├── SoundMesh.cpp │ ├── SoundMesh.hpp │ ├── SoundSource.cpp │ ├── SoundSource.hpp │ └── module.cpp └── tests ├── __init__.py ├── __pycache__ ├── __init__.cpython-310.pyc └── rir_test.cpython-310.pyc └── rir_test.py /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "ray_generator/lib/pybind11"] 2 | path = ray_generator/lib/pybind11 3 | url = https://github.com/pybind/pybind11.git 4 | -------------------------------------------------------------------------------- /auralizer/.gitignore: -------------------------------------------------------------------------------- 1 | *.png 2 | *.npy 3 | build -------------------------------------------------------------------------------- /auralizer/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.15) 2 | project(spherical_harmonics) 3 | 4 | set(CMAKE_CXX_STANDARD 14) 5 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 6 | set(CMAKE_POSITION_INDEPENDENT_CODE ON) 7 | 8 | # Find Python 9 | find_package(Python COMPONENTS Interpreter Development REQUIRED) 10 | 11 | # Add pybind11 12 | include(FetchContent) 13 | FetchContent_Declare( 14 | pybind11 15 | GIT_REPOSITORY https://github.com/pybind/pybind11.git 16 | GIT_TAG v2.11.1 17 | ) 18 | FetchContent_MakeAvailable(pybind11) 19 | 20 | # Add source files 21 | set(SOURCES 22 | src/cpp/binding.cpp 23 | ) 24 | 25 | # Create the Python module 26 | pybind11_add_module(spherical_harmonics ${SOURCES}) 27 | 28 | # Include directories 29 | target_include_directories(spherical_harmonics PRIVATE 30 | ${CMAKE_CURRENT_SOURCE_DIR}/src/cpp 31 | ) 32 | 33 | # Enable SSE2 instructions 34 | if(MSVC) 35 | target_compile_options(spherical_harmonics PRIVATE /arch:SSE2) 36 | else() 37 | target_compile_options(spherical_harmonics PRIVATE -msse2) 38 | endif() -------------------------------------------------------------------------------- /auralizer/README.md: -------------------------------------------------------------------------------- 1 | # Spherical Harmonics Auralizer 2 | An efficient way of calculting spherical harmonics, in Python. 3 | 4 | # Installing 5 | ```bash 6 | pip install . 7 | ``` 8 | 9 | # Minimal usage example 10 | ```python 11 | import numpy as np 12 | import spherical_harmonics as sh 13 | 14 | order = 3 # Ambisonic order 15 | sample_rate = 48000 # Hz 16 | 17 | # Simulated listener directions 18 | num_directions = 100 19 | listener_directions = np.random.randn(num_directions, 3).astype(np.float32) 20 | listener_directions /= np.linalg.norm(listener_directions, axis=1, keepdims=True) 21 | 22 | # Simulated intensities for a single frequency band 23 | intensities = np.random.rand(num_directions, 1).astype(np.float32) 24 | 25 | # Simulated distances and speeds 26 | distances = np.random.uniform(1.0, 10.0, size=num_directions).astype(np.float32) 27 | speeds = np.full(num_directions, 343.0, dtype=np.float32) 28 | 29 | # Simulated path types (not used right now during IR synthesis) 30 | path_types = np.ones(num_directions, dtype=np.int32) 31 | 32 | # Define frequency points (Hz) 33 | frequency_points = np.array([125, 250, 500, 1000, 2000, 4000, 8000], dtype=np.float32) 34 | 35 | # Generate ambisonic IR 36 | ir = sh.generate_ambisonic_ir( 37 | order=order, 38 | listener_directions=listener_directions, 39 | intensities=intensities, 40 | distances=distances, 41 | speeds=speeds, 42 | path_types=path_types, 43 | frequency_points=frequency_points, 44 | sample_rate=sample_rate, 45 | normalize=True 46 | ) 47 | ``` 48 | 49 | # Using with PyGSound-SIR 50 | ```python 51 | df = pd.read_parquet("/root/pygsound-sir/output/20241216_004202_1x1_4000998paths.parquet") 52 | 53 | order = 7 54 | sample_rate = 48000 55 | 56 | listener_directions = np.vstack([ 57 | df['listener_x'], 58 | df['listener_y'], 59 | df['listener_z'] 60 | ]).T.astype(np.float32) 61 | 62 | intensity_columns = [col for col in df.columns if col.startswith('intensity_band_')] 63 | intensities = df[intensity_columns].to_numpy().astype(np.float32) 64 | 65 | distances = df['distance'].to_numpy().astype(np.float32) 66 | speeds = df['speed_of_sound'].to_numpy().astype(np.float32) 67 | path_types = np.ones(len(df), dtype=np.int32) 68 | 69 | frequency_points = np.array([125, 250, 500, 1000, 2000, 4000, 8000], dtype=np.float32) 70 | 71 | ir = sh.generate_ambisonic_ir( 72 | order=order, 73 | listener_directions=listener_directions, 74 | intensities=intensities, 75 | distances=distances, 76 | speeds=speeds, 77 | path_types=path_types, 78 | frequency_points=frequency_points, 79 | sample_rate=sample_rate, 80 | normalize=True 81 | ) 82 | ``` 83 | -------------------------------------------------------------------------------- /auralizer/pyproject.toml: -------------------------------------------------------------------------------- 1 | [build-system] 2 | requires = ["setuptools>=42", "wheel", "cmake>=3.18", "ninja"] 3 | build-backend = "setuptools.build_meta" 4 | 5 | [project] 6 | name = "spherical_harmonics" 7 | version = "0.1.0" 8 | description = "Spherical Harmonics Library" 9 | requires-python = ">=3.7" 10 | dependencies = [ 11 | "numpy>=1.20", 12 | ] -------------------------------------------------------------------------------- /auralizer/setup.py: -------------------------------------------------------------------------------- 1 | from setuptools import setup, Extension 2 | from setuptools.command.build_ext import build_ext 3 | import sys 4 | import os 5 | import subprocess 6 | import platform 7 | 8 | class CMakeExtension(Extension): 9 | def __init__(self, name, sourcedir=""): 10 | Extension.__init__(self, name, sources=[]) 11 | self.sourcedir = os.path.abspath(sourcedir) 12 | 13 | class CMakeBuild(build_ext): 14 | def build_extension(self, ext): 15 | extdir = os.path.abspath(os.path.dirname(self.get_ext_fullpath(ext.name))) 16 | 17 | # Required for auto-detection & inclusion of auxiliary "native" libs 18 | if not extdir.endswith(os.path.sep): 19 | extdir += os.path.sep 20 | 21 | debug = int(os.environ.get("DEBUG", 0)) if self.debug is None else self.debug 22 | cfg = "Debug" if debug else "Release" 23 | 24 | # CMake lets you override the generator - we need to check this. 25 | # Can be set with Conda-Build, for example. 26 | cmake_generator = os.environ.get("CMAKE_GENERATOR", "") 27 | 28 | # Set Python_EXECUTABLE instead if you use PYBIND11_FINDPYTHON 29 | cmake_args = [ 30 | f"-DCMAKE_LIBRARY_OUTPUT_DIRECTORY={extdir}", 31 | f"-DPYTHON_EXECUTABLE={sys.executable}", 32 | f"-DCMAKE_BUILD_TYPE={cfg}", # not used on MSVC, but no harm 33 | ] 34 | build_args = [] 35 | 36 | if "CMAKE_ARGS" in os.environ: 37 | cmake_args += [item for item in os.environ["CMAKE_ARGS"].split(" ") if item] 38 | 39 | if not cmake_generator or cmake_generator == "Ninja": 40 | try: 41 | import ninja 42 | ninja_executable_path = os.path.join(ninja.BIN_DIR, "ninja") 43 | cmake_args += [ 44 | "-GNinja", 45 | f"-DCMAKE_MAKE_PROGRAM:FILEPATH={ninja_executable_path}", 46 | ] 47 | except ImportError: 48 | pass 49 | 50 | if "CMAKE_BUILD_PARALLEL_LEVEL" not in os.environ: 51 | if hasattr(self, "parallel") and self.parallel: 52 | build_args += [f"-j{self.parallel}"] 53 | 54 | build_temp = os.path.join(self.build_temp, ext.name) 55 | if not os.path.exists(build_temp): 56 | os.makedirs(build_temp) 57 | 58 | subprocess.check_call(["cmake", ext.sourcedir] + cmake_args, cwd=build_temp) 59 | subprocess.check_call(["cmake", "--build", "."] + build_args, cwd=build_temp) 60 | 61 | setup( 62 | name="spherical_harmonics", 63 | version="0.1.0", 64 | author="Yongyi Zang", 65 | description="Spherical Harmonics Library", 66 | long_description="", 67 | ext_modules=[CMakeExtension("spherical_harmonics")], 68 | cmdclass={"build_ext": CMakeBuild}, 69 | zip_safe=False, 70 | python_requires=">=3.7", 71 | ) -------------------------------------------------------------------------------- /auralizer/spherical_harmonics.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 2.1 2 | Name: spherical_harmonics 3 | Version: 0.1 4 | Summary: Spherical Harmonics Evaluation Library 5 | Author: Yongyi Zang 6 | Requires-Python: >=3.6 7 | License-File: LICENSE 8 | -------------------------------------------------------------------------------- /auralizer/spherical_harmonics.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | LICENSE 2 | README.md 3 | pyproject.toml 4 | setup.py 5 | spherical_harmonics.egg-info/PKG-INFO 6 | spherical_harmonics.egg-info/SOURCES.txt 7 | spherical_harmonics.egg-info/dependency_links.txt 8 | spherical_harmonics.egg-info/not-zip-safe 9 | spherical_harmonics.egg-info/top_level.txt -------------------------------------------------------------------------------- /auralizer/spherical_harmonics.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /auralizer/spherical_harmonics.egg-info/not-zip-safe: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /auralizer/spherical_harmonics.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | spherical_harmonics 2 | -------------------------------------------------------------------------------- /auralizer/src/python/spherical_harmonics/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyizang/GSound-SIR/bf5acf368a5b80069702bdc1fe2b767c33d4ac80/auralizer/src/python/spherical_harmonics/__init__.py -------------------------------------------------------------------------------- /auralizer/src/spherical_harmonics.egg-info/PKG-INFO: -------------------------------------------------------------------------------- 1 | Metadata-Version: 2.4 2 | Name: spherical_harmonics 3 | Version: 0.1.0 4 | Summary: Spherical Harmonics Library 5 | Author: Yongyi Zang 6 | Requires-Python: >=3.7 7 | License-File: LICENSE 8 | Requires-Dist: numpy>=1.20 9 | Dynamic: author 10 | Dynamic: license-file 11 | Dynamic: requires-python 12 | -------------------------------------------------------------------------------- /auralizer/src/spherical_harmonics.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | LICENSE 2 | README.md 3 | pyproject.toml 4 | setup.py 5 | src/python/spherical_harmonics/__init__.py 6 | src/spherical_harmonics.egg-info/PKG-INFO 7 | src/spherical_harmonics.egg-info/SOURCES.txt 8 | src/spherical_harmonics.egg-info/dependency_links.txt 9 | src/spherical_harmonics.egg-info/not-zip-safe 10 | src/spherical_harmonics.egg-info/requires.txt 11 | src/spherical_harmonics.egg-info/top_level.txt -------------------------------------------------------------------------------- /auralizer/src/spherical_harmonics.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /auralizer/src/spherical_harmonics.egg-info/not-zip-safe: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /auralizer/src/spherical_harmonics.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | numpy>=1.20 2 | -------------------------------------------------------------------------------- /auralizer/src/spherical_harmonics.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | cpp 2 | python 3 | spherical_harmonics 4 | -------------------------------------------------------------------------------- /ray_generator/.gitignore: -------------------------------------------------------------------------------- 1 | src/pygsound/pygsound.cpython-310-x86_64-linux-gnu.so 2 | src/pygsound.egg-info/PKG-INFO 3 | -------------------------------------------------------------------------------- /ray_generator/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.12) 2 | project(gsound) 3 | 4 | # Set a default build type if none was specified 5 | if( NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES ) 6 | message( STATUS "Setting build type to 'debug' as none was specified." ) 7 | set( CMAKE_BUILD_TYPE debug CACHE STRING "Choose the type of build." FORCE ) 8 | # Set the possible values of build type for cmake-gui 9 | set_property( CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "debug" "release" ) 10 | endif() 11 | 12 | #set build directory 13 | set(BUILD_DIRECTORY ${CMAKE_BUILD_TYPE}) 14 | set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wno-narrowing -Wno-deprecated") 15 | set( CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${BUILD_DIRECTORY}/lib) 16 | set( CMAKE_CXX_FLAGS_DEBUG "-g -O0 -fPIC --coverage" ) 17 | set( CMAKE_CXX_FLAGS_RELEASE "-O3 -DNDEBUG -fPIC" ) 18 | 19 | set( THREADS_PREFER_PTHREAD_FLAG ON ) 20 | 21 | find_package( Threads REQUIRED ) 22 | find_package( PkgConfig REQUIRED ) 23 | find_package( ZLIB REQUIRED ) 24 | pkg_check_modules( FFTW3 REQUIRED fftw3 ) 25 | 26 | # Add include directories 27 | include_directories( 28 | ${CMAKE_SOURCE_DIR}/src/Om/Om\ Framework 29 | ${CMAKE_SOURCE_DIR}/src/Om/Om\ BVH 30 | ${CMAKE_SOURCE_DIR}/src/Om/Om\ Compression 31 | ${CMAKE_SOURCE_DIR}/src/Om/Om\ Resources 32 | ${CMAKE_SOURCE_DIR}/src/Om/Om\ Sound 33 | ${CMAKE_SOURCE_DIR}/src/GSound 34 | ${FFTW3_INCLUDEDIR} 35 | ) 36 | 37 | # Add link directories 38 | link_directories( 39 | ${FFTW3_LIBRARY_DIRS} 40 | ) 41 | 42 | 43 | enable_testing() 44 | add_subdirectory(lib/pybind11) 45 | add_subdirectory(src/Om) 46 | add_subdirectory(src/GSound) 47 | add_subdirectory(src/pygsound) 48 | 49 | -------------------------------------------------------------------------------- /ray_generator/LICENSE.txt: -------------------------------------------------------------------------------- 1 | COPYRIGHT AND PERMISSION NOTICE 2 | UNC Software GSound 3 | Copyright (C) 2020 The University of North Carolina at Chapel Hill 4 | All rights reserved. 5 | 6 | The University of North Carolina at Chapel Hill (“UNC”) and the developers of GSound software (“Software”) give recipient (“Recipient”) permission to download a single copy of the Software in executable form and use for non-commercial purposes only provided that the following conditions are met: 7 | 8 | 1) Recipient may use the Software for any purpose, EXCEPT for commercial benefit. 9 | 10 | 2) Recipient will not copy the Software. 11 | 12 | 3) Recipient will not sell the Software. 13 | 14 | 4) Recipient will not give the Software to any third party. 15 | 16 | 5) Recipient may use Software in support of publications as long as UNC and its developers are recognized with appropriate attribution. 17 | 18 | 6) Any party desiring a license to use the Software for commercial purposes shall contact: 19 | 20 | The Office of Technology Commercialization at UNC at 919-966-3929. 21 | 22 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS, CONTRIBUTORS, AND THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER, CONTRIBUTORS OR THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 23 | 24 | 25 | -------------------------------------------------------------------------------- /ray_generator/examples/compare_image.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pygsound as ps 3 | import matplotlib.pyplot as plt 4 | import rir_generator as rir 5 | # using https://github.com/audiolabs/rir-generator/ 6 | 7 | 8 | def main(): 9 | l = 10 10 | w = 6 11 | h = 4 12 | absorb = 0.3 13 | reflec = np.sqrt(1.0 - absorb) 14 | 15 | ctx = ps.Context() 16 | ctx.diffuse_count = 20000 17 | ctx.specular_count = 2000 18 | ctx.channel_type = ps.ChannelLayoutType.mono 19 | scene = ps.Scene() 20 | 21 | mesh = ps.createbox(l, w, h, absorb, 0.1) 22 | scene.setMesh(mesh) 23 | 24 | src_coord = [1, 1, 0.5] 25 | lis_coord = [5, 3, 0.5] 26 | 27 | src = ps.Source(src_coord) 28 | src.radius = 0.01 29 | 30 | lis = ps.Listener(lis_coord) 31 | lis.radius = 0.01 32 | 33 | rir_gs = scene.computeIR([src], [lis], ctx) 34 | rir_img = rir.generate( 35 | c=343, # Sound velocity (m/s) 36 | fs=ctx.sample_rate, # Sample frequency (samples/s) 37 | r=[lis_coord], 38 | s=src_coord, # Source position [x y z] (m) 39 | L=[l, w, h], # Room dimensions [x y z] (m) 40 | beta=[reflec] * 6, # Reflection coefficients 41 | ) 42 | rir_img = rir_img[:, 0] / max(abs(rir_img)) 43 | rir_gs = rir_gs['samples'][0][0][0] 44 | max_cnt = min(len(rir_gs), len(rir_img)) 45 | 46 | fig, axs = plt.subplots(2, 1, figsize=(16, 10)) 47 | axs[0].set_title('Image Method (waveform)') 48 | axs[0].plot(rir_img, linewidth=0.5) 49 | axs[0].set_xlabel('Sample') 50 | axs[0].set_xlim(0, max_cnt) 51 | axs[0].set_ylim(-1, 1) 52 | axs[0].set_ylabel('Amplitude') 53 | 54 | axs[1].set_title('Geometric Sound Propagation (waveform)') 55 | axs[1].plot(rir_gs, linewidth=0.5) 56 | axs[1].set_xlabel('Sample') 57 | axs[1].set_xlim(0, max_cnt) 58 | axs[1].set_ylim(-1, 1) 59 | axs[1].set_ylabel('Amplitude') 60 | 61 | fig.tight_layout() 62 | plt.savefig('img_comparison.png') 63 | plt.show() 64 | 65 | 66 | if __name__ == '__main__': 67 | main() 68 | -------------------------------------------------------------------------------- /ray_generator/examples/cube.mtl: -------------------------------------------------------------------------------- 1 | # Blender MTL File: 'None' 2 | # Material Count: 1 3 | 4 | newmtl Material 5 | Ns 96.078431 6 | Ka 1.000000 1.000000 1.000000 7 | Kd 0.640000 0.640000 0.640000 8 | Ks 0.500000 0.500000 0.500000 9 | Ke 0.000000 0.000000 0.000000 10 | Ni 1.000000 11 | d 1.000000 12 | illum 2 13 | sound_a 0.5 0.5 0.5 0.5 0.5 0.5 0.5 0.5 14 | sound_s 0.1 0.1 0.1 0.1 0.1 0.1 0.1 0.1 15 | -------------------------------------------------------------------------------- /ray_generator/examples/cube.obj: -------------------------------------------------------------------------------- 1 | # Blender v2.79 (sub 0) OBJ File: '' 2 | # www.blender.org 3 | mtllib cube.mtl 4 | o Cube 5 | v 10.000000 6.000000 0.000000 6 | v 10.000000 0.000000 0.000000 7 | v -0.000000 0.000000 0.000000 8 | v 0.000002 6.000001 0.000000 9 | v 10.000002 5.999998 2.000000 10 | v 9.999996 -0.000002 2.000000 11 | v -0.000002 0.000001 2.000000 12 | v 0.000000 6.000000 2.000000 13 | vn 0.0000 0.0000 -1.0000 14 | vn 0.0000 0.0000 1.0000 15 | vn 1.0000 0.0000 -0.0000 16 | vn -0.0000 -1.0000 -0.0000 17 | vn -1.0000 0.0000 -0.0000 18 | vn 0.0000 1.0000 0.0000 19 | usemtl Material 20 | s off 21 | f 2//1 4//1 1//1 22 | f 8//2 6//2 5//2 23 | f 5//3 2//3 1//3 24 | f 6//4 3//4 2//4 25 | f 3//5 8//5 4//5 26 | f 1//6 8//6 5//6 27 | f 2//1 3//1 4//1 28 | f 8//2 7//2 6//2 29 | f 5//3 6//3 2//3 30 | f 6//4 7//4 3//4 31 | f 3//5 7//5 8//5 32 | f 1//6 4//6 8//6 33 | -------------------------------------------------------------------------------- /ray_generator/examples/custom_array.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pygsound as ps 3 | from wavefile import WaveWriter, Format 4 | 5 | 6 | def compute_array(meshpath, src_coord, lis_coord, r, s, micarray): 7 | mesh = ps.loadobj(meshpath, r, s) 8 | ctx = ps.Context() 9 | ctx.diffuse_count = 20000 10 | ctx.specular_count = 2000 11 | ctx.channel_type = ps.ChannelLayoutType.mono 12 | scene = ps.Scene() 13 | scene.setMesh(mesh) 14 | 15 | src = ps.Source(src_coord) 16 | src.radius = 0.01 17 | 18 | res = {} 19 | res_buffer = [] 20 | rate = 0 21 | for offset in micarray: 22 | lis = ps.Listener((offset + lis_coord).tolist()) 23 | lis.radius = 0.01 24 | 25 | res_ch = scene.computeIR([src], [lis], ctx) 26 | rate = res_ch['rate'] 27 | sa = res_ch['samples'][0][0][0] 28 | res['rate'] = rate 29 | res_buffer.append(sa) 30 | res['samples'] = np.zeros((len(res_buffer), np.max([len(ps) for ps in res_buffer]))) 31 | for i, c in enumerate(res_buffer): 32 | res['samples'][i, :len(c)] = c 33 | return res 34 | 35 | 36 | def main(): 37 | custom_array = np.array( 38 | [[0, 0.035, 0], [-0.0303, 0.0175, 0], [-0.0303, -0.0175, 0], [0, -0.035, 0], [0.0303, -0.0175, 0], 39 | [0.0303, 0.0175, 0]]) 40 | 41 | src_coord = [1, 1, 1] 42 | lis_coord = [0.1, 0.1, 0.1] 43 | 44 | res = compute_array("cube.obj", src_coord, lis_coord, 0.5, 0.1, custom_array) 45 | 46 | with WaveWriter('custom_array.wav', channels=np.shape(res['samples'])[0], samplerate=int(res['rate'])) as w: 47 | w.write(np.array(res['samples'])) 48 | 49 | 50 | if __name__ == '__main__': 51 | main() 52 | -------------------------------------------------------------------------------- /ray_generator/examples/mesh_sim.py: -------------------------------------------------------------------------------- 1 | import numpy as np 2 | import pygsound as ps 3 | import json 4 | 5 | def dict_to_json(d): # for demonstration purposes only, only displays the shape of numpy arrays 6 | # convert all numpy arrays to lists 7 | for k, v in d.items(): 8 | if isinstance(v, np.ndarray): 9 | d[k] = v.shape 10 | elif isinstance(v, dict): 11 | d[k] = dict_to_json(v) 12 | 13 | return json.dumps(d, indent=4) 14 | 15 | def main(): 16 | # Simulation using .obj file (and an optional .mtl file) 17 | ctx = ps.Context() 18 | ctx.diffuse_count = 20000 19 | ctx.specular_count = 2000 20 | ctx.channel_type = ps.ChannelLayoutType.stereo 21 | 22 | mesh1 = ps.loadobj("cube.obj") 23 | scene = ps.Scene() 24 | scene.setMesh(mesh1) 25 | 26 | src_coord = [1, 1, 0.5] 27 | lis_coord = [5, 3, 0.5] 28 | 29 | src = ps.Source(src_coord) 30 | src.radius = 0.01 31 | src.power = 1.0 32 | 33 | lis = ps.Listener(lis_coord) 34 | lis.radius = 0.01 35 | 36 | # res = scene.computeIR([src], [lis], ctx) # you may pass lists of sources and listeners to get N_src x N_lis IRs 37 | # audio_data = np.array(res['samples'][0][0]) # the IRs are indexed by [i_src, i_lis, i_channel] 38 | # with WaveWriter('test1.wav', channels=audio_data.shape[0], samplerate=int(res['rate'])) as w1: 39 | # w1.write(audio_data) 40 | # print("IR using .obj input written to test1.wav.") 41 | 42 | res = scene.getPathData([src], [lis], ctx)["path_data"] 43 | # get the first listener's path data 44 | path_data = res[0] 45 | path_data = dict_to_json(path_data) 46 | # dump as a .json file 47 | with open("path_data_obj.json", "w") as f: 48 | f.write(path_data) 49 | 50 | # Simulation using a shoebox definition 51 | mesh2 = ps.createbox(10, 6, 2, 0.5, 0.1) 52 | scene = ps.Scene() 53 | scene.setMesh(mesh2) 54 | 55 | # res = scene.computeIR([src_coord], [lis_coord], ctx) # use default source and listener settings if you only pass coordinates 56 | # audio_data = np.array(res['samples'][0][0]) 57 | # with WaveWriter('test2.wav', channels=audio_data.shape[0], samplerate=int(res['rate'])) as w2: 58 | # w2.write(audio_data) 59 | # print("IR using shoebox input written to test2.wav.") 60 | 61 | res = scene.getPathData([src_coord], [lis_coord], ctx)["path_data"] 62 | path_data = res[0] 63 | path_data = dict_to_json(path_data) 64 | with open("path_data_shoebox.json", "w") as f: 65 | f.write(path_data) 66 | 67 | if __name__ == '__main__': 68 | main() 69 | -------------------------------------------------------------------------------- /ray_generator/examples/path_data_obj.json: -------------------------------------------------------------------------------- 1 | { 2 | "source_indices": [ 3 | 3351922 4 | ], 5 | "path_types": [ 6 | 3351922 7 | ], 8 | "distances": [ 9 | 3351922 10 | ], 11 | "listener_directions": [ 12 | 3351922, 13 | 3 14 | ], 15 | "source_directions": [ 16 | 3351922, 17 | 3 18 | ], 19 | "relative_speeds": [ 20 | 3351922 21 | ], 22 | "speeds_of_sound": [ 23 | 3351922 24 | ], 25 | "intensities": [ 26 | 3351922, 27 | 8 28 | ], 29 | "num_paths": 3351922, 30 | "num_bands": 8 31 | } -------------------------------------------------------------------------------- /ray_generator/examples/path_data_shoebox.json: -------------------------------------------------------------------------------- 1 | { 2 | "source_indices": [ 3 | 4000787 4 | ], 5 | "path_types": [ 6 | 4000787 7 | ], 8 | "distances": [ 9 | 4000787 10 | ], 11 | "listener_directions": [ 12 | 4000787, 13 | 3 14 | ], 15 | "source_directions": [ 16 | 4000787, 17 | 3 18 | ], 19 | "relative_speeds": [ 20 | 4000787 21 | ], 22 | "speeds_of_sound": [ 23 | 4000787 24 | ], 25 | "intensities": [ 26 | 4000787, 27 | 8 28 | ], 29 | "num_paths": 4000787, 30 | "num_bands": 8 31 | } -------------------------------------------------------------------------------- /ray_generator/pyproject.toml: -------------------------------------------------------------------------------- 1 | [tool.cibuildwheel.linux] 2 | before-all = "yum install -y fftw-devel" 3 | 4 | [[tool.cibuildwheel.overrides]] 5 | select = "*-musllinux*" 6 | before-all = "apk add fftw-dev" 7 | 8 | [tool.cibuildwheel.macos] 9 | before-all = "brew install fftw" 10 | -------------------------------------------------------------------------------- /ray_generator/setup.cfg: -------------------------------------------------------------------------------- 1 | # Inside of setup.cfg 2 | [metadata] 3 | description-file = README.md 4 | -------------------------------------------------------------------------------- /ray_generator/setup.py: -------------------------------------------------------------------------------- 1 | import os 2 | import re 3 | import sys 4 | import sysconfig 5 | import platform 6 | import subprocess 7 | import multiprocessing 8 | 9 | from distutils.version import LooseVersion 10 | from setuptools import setup, find_packages, Extension 11 | from setuptools.command.build_ext import build_ext 12 | 13 | # read the contents of your README file 14 | from pathlib import Path 15 | long_description = Path("README.md").read_text() 16 | 17 | class CMakeExtension(Extension): 18 | def __init__(self, name, sourcedir=''): 19 | Extension.__init__(self, name, sources=[]) 20 | self.sourcedir = os.path.abspath(sourcedir) 21 | 22 | 23 | class CMakeBuild(build_ext): 24 | def run(self): 25 | try: 26 | out = subprocess.check_output(['cmake', '--version']) 27 | except OSError: 28 | raise RuntimeError( 29 | "CMake must be installed to build the following extensions: " + 30 | ", ".join(e.name for e in self.extensions)) 31 | 32 | if platform.system() == "Windows": 33 | cmake_version = LooseVersion(re.search(r'version\s*([\d.]+)', 34 | out.decode()).group(1)) 35 | if cmake_version < '3.12': 36 | raise RuntimeError("CMake >= 3.12 is required on Windows") 37 | 38 | for ext in self.extensions: 39 | self.build_extension(ext) 40 | 41 | def build_extension(self, ext): 42 | extdir = os.path.abspath( 43 | os.path.dirname(self.get_ext_fullpath(ext.name))) 44 | cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir, 45 | '-DPYTHON_EXECUTABLE=' + sys.executable] 46 | 47 | cfg = 'Debug' if self.debug else 'Release' 48 | build_args = ['--config', cfg] 49 | 50 | if platform.system() == "Windows": 51 | cmake_args += ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_{}={}'.format( 52 | cfg.upper(), 53 | extdir)] 54 | if sys.maxsize > 2**32: 55 | cmake_args += ['-A', 'x64'] 56 | build_args += ['--', '/m'] 57 | else: 58 | cmake_args += ['-DCMAKE_BUILD_TYPE=' + cfg] 59 | build_args += ['--', '-j{}'.format(multiprocessing.cpu_count()//2)] 60 | 61 | env = os.environ.copy() 62 | env['CXXFLAGS'] = '{} -DVERSION_INFO=\\"{}\\"'.format( 63 | env.get('CXXFLAGS', ''), 64 | self.distribution.get_version()) 65 | if not os.path.exists(self.build_temp): 66 | os.makedirs(self.build_temp) 67 | subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, 68 | cwd=self.build_temp, env=env) 69 | subprocess.check_call(['cmake', '--build', '.'] + build_args, 70 | cwd=self.build_temp) 71 | print() # Add an empty line for cleaner output 72 | 73 | setup( 74 | name='pygsound', 75 | version='0.3', 76 | author='Zhenyu Tang, Carl Schissler, Dinesh Manocha', 77 | author_email='zhy@umd.edu', 78 | description='A room impulse response simulator using for geometric sound propagation', 79 | long_description=long_description, 80 | long_description_content_type='text/markdown', 81 | # tell setuptools to look for any packages under 'src' 82 | packages=find_packages('src'), 83 | # tell setuptools that all packages will be under the 'src' directory 84 | # and nowhere else 85 | package_dir={'':'src'}, 86 | # add an extension module named 'pygsound' to the package 'pygsound' 87 | ext_modules=[CMakeExtension('pygsound/pygsound')], 88 | # add custom build_ext command 89 | cmdclass=dict(build_ext=CMakeBuild), 90 | zip_safe=False, 91 | test_suite='tests', 92 | install_requires=[ 93 | 'Cython', 94 | 'numpy', 95 | ], 96 | ) 97 | -------------------------------------------------------------------------------- /ray_generator/src/GSound/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project( gsound ) 2 | 3 | file(GLOB_RECURSE SOURCES gsound/*.cpp) 4 | set( SOURCEFILES ${SOURCES} ) 5 | 6 | add_library( gsound STATIC ${SOURCEFILES}) 7 | 8 | set( EXTERNAL_LIBS 9 | om-sound 10 | om-resources 11 | om-bvh 12 | om-framework 13 | fftw3_threads 14 | fftw3f 15 | fftw3 16 | ) 17 | 18 | target_link_libraries( gsound ${EXTERNAL_LIBS} ) 19 | 20 | 21 | -------------------------------------------------------------------------------- /ray_generator/src/GSound/gsound/gsFrequencyBands.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: GSound 3 | * 4 | * File: gsound/gsFrequencyBands.cpp 5 | * Contents: gsound::FrequencyBands class implementation 6 | * 7 | * Author(s): Carl Schissler 8 | * Website: http://gamma.cs.unc.edu/GSOUND/ 9 | * 10 | * License: 11 | * 12 | * Copyright (C) 2010-16 Carl Schissler, University of North Carolina at Chapel Hill. 13 | * All rights reserved. 14 | * 15 | * Permission to use, copy, modify, and distribute this software and its 16 | * documentation for educational, research, and non-profit purposes, without 17 | * fee, and without a written agreement is hereby granted, provided that the 18 | * above copyright notice, this paragraph, and the following four paragraphs 19 | * appear in all copies. 20 | * 21 | * Permission to incorporate this software into commercial products may be 22 | * obtained by contacting the University of North Carolina at Chapel Hill. 23 | * 24 | * This software program and documentation are copyrighted by Carl Schissler and 25 | * the University of North Carolina at Chapel Hill. The software program and 26 | * documentation are supplied "as is", without any accompanying services from 27 | * the University of North Carolina at Chapel Hill or the authors. The University 28 | * of North Carolina at Chapel Hill and the authors do not warrant that the 29 | * operation of the program will be uninterrupted or error-free. The end-user 30 | * understands that the program was developed for research purposes and is advised 31 | * not to rely exclusively on the program for any reason. 32 | * 33 | * IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR ITS 34 | * EMPLOYEES OR THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 35 | * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, 36 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE 37 | * UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE AUTHORS HAVE BEEN ADVISED 38 | * OF THE POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS SPECIFICALLY 41 | * DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 42 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY 43 | * STATUTORY WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS 44 | * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND 45 | * THE AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 46 | * ENHANCEMENTS, OR MODIFICATIONS. 47 | */ 48 | 49 | 50 | #include "gsFrequencyBands.h" 51 | 52 | 53 | //########################################################################################## 54 | //****************************** Start GSound Namespace ********************************** 55 | GSOUND_NAMESPACE_START 56 | //****************************************************************************************** 57 | //########################################################################################## 58 | 59 | 60 | 61 | 62 | FrequencyBands:: FrequencyBands() 63 | { 64 | // Logarithmically distribute the frequencies in the human hearing range. 65 | const Real minF = 20.0f; 66 | const Real maxF = 20000.0f; 67 | const Real lnMinF = math::ln( minF ); 68 | const Real lnMaxF = math::ln( maxF ); 69 | 70 | for ( Index i = 0; i < numFrequencyBands; i++ ) 71 | { 72 | const Real a = (Real(i) + Real(0.5)) / Real(numFrequencyBands); 73 | const Real lnF = lnMinF + a*(lnMaxF - lnMinF); 74 | frequencies[i] = math::exp( lnF ); 75 | } 76 | 77 | updateCrossovers(); 78 | } 79 | 80 | 81 | 82 | 83 | void FrequencyBands:: updateCrossovers() 84 | { 85 | // Compute the crossover points, midway between the frequencies in log space. 86 | for ( Index i = 0; i < numFrequencyBands - 1; i++ ) 87 | crossovers[i] = math::exp( Real(0.5)*(math::ln(frequencies[i]) + math::ln(frequencies[i+1])) ); 88 | } 89 | 90 | 91 | 92 | 93 | //########################################################################################## 94 | //****************************** End GSound Namespace ************************************ 95 | GSOUND_NAMESPACE_END 96 | //****************************************************************************************** 97 | //########################################################################################## 98 | -------------------------------------------------------------------------------- /ray_generator/src/GSound/gsound/gsMeshRequest.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: GSound 3 | * 4 | * File: gsound/gsMeshRequest.cpp 5 | * Contents: gsound::MeshRequest class implementation 6 | * 7 | * Author(s): Carl Schissler 8 | * Website: http://gamma.cs.unc.edu/GSOUND/ 9 | * 10 | * License: 11 | * 12 | * Copyright (C) 2010-16 Carl Schissler, University of North Carolina at Chapel Hill. 13 | * All rights reserved. 14 | * 15 | * Permission to use, copy, modify, and distribute this software and its 16 | * documentation for educational, research, and non-profit purposes, without 17 | * fee, and without a written agreement is hereby granted, provided that the 18 | * above copyright notice, this paragraph, and the following four paragraphs 19 | * appear in all copies. 20 | * 21 | * Permission to incorporate this software into commercial products may be 22 | * obtained by contacting the University of North Carolina at Chapel Hill. 23 | * 24 | * This software program and documentation are copyrighted by Carl Schissler and 25 | * the University of North Carolina at Chapel Hill. The software program and 26 | * documentation are supplied "as is", without any accompanying services from 27 | * the University of North Carolina at Chapel Hill or the authors. The University 28 | * of North Carolina at Chapel Hill and the authors do not warrant that the 29 | * operation of the program will be uninterrupted or error-free. The end-user 30 | * understands that the program was developed for research purposes and is advised 31 | * not to rely exclusively on the program for any reason. 32 | * 33 | * IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR ITS 34 | * EMPLOYEES OR THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 35 | * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, 36 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE 37 | * UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE AUTHORS HAVE BEEN ADVISED 38 | * OF THE POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS SPECIFICALLY 41 | * DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 42 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY 43 | * STATUTORY WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS 44 | * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND 45 | * THE AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 46 | * ENHANCEMENTS, OR MODIFICATIONS. 47 | */ 48 | 49 | 50 | #include "gsMeshRequest.h" 51 | 52 | 53 | //########################################################################################## 54 | //****************************** Start GSound Namespace ********************************** 55 | GSOUND_NAMESPACE_START 56 | //****************************************************************************************** 57 | //########################################################################################## 58 | 59 | 60 | //########################################################################################## 61 | //########################################################################################## 62 | //############ 63 | //############ Constructors 64 | //############ 65 | //########################################################################################## 66 | //########################################################################################## 67 | 68 | 69 | 70 | 71 | MeshRequest:: MeshRequest() 72 | : flags( MeshFlags::DEFAULT ), 73 | voxelSize( 0 ), 74 | weldTolerance( 0.00001f ), 75 | simplifyTolerance( 0.0001f ), 76 | minDiffractionEdgeAngle( 0.0f ), 77 | minDiffractionEdgeLength( 0.5f ), 78 | diffuseResolution( 0.5f ), 79 | edgeResolution( 0.5f ), 80 | minRaysPerEdge( 1 ), 81 | maxRaysPerEdge( 1 ), 82 | edgeOffset( 0.001f ), 83 | numThreads( CPU::getCount() ), 84 | statistics( NULL ) 85 | { 86 | } 87 | 88 | 89 | 90 | 91 | //########################################################################################## 92 | //****************************** End GSound Namespace ************************************ 93 | GSOUND_NAMESPACE_END 94 | //****************************************************************************************** 95 | //########################################################################################## 96 | -------------------------------------------------------------------------------- /ray_generator/src/GSound/gsound/gsSoundStatistics.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: GSound 3 | * 4 | * File: gsound/gsSoundStatistics.cpp 5 | * Contents: gsound::SoundStatistics class implementation 6 | * 7 | * Author(s): Carl Schissler 8 | * Website: http://gamma.cs.unc.edu/GSOUND/ 9 | * 10 | * License: 11 | * 12 | * Copyright (C) 2010-16 Carl Schissler, University of North Carolina at Chapel Hill. 13 | * All rights reserved. 14 | * 15 | * Permission to use, copy, modify, and distribute this software and its 16 | * documentation for educational, research, and non-profit purposes, without 17 | * fee, and without a written agreement is hereby granted, provided that the 18 | * above copyright notice, this paragraph, and the following four paragraphs 19 | * appear in all copies. 20 | * 21 | * Permission to incorporate this software into commercial products may be 22 | * obtained by contacting the University of North Carolina at Chapel Hill. 23 | * 24 | * This software program and documentation are copyrighted by Carl Schissler and 25 | * the University of North Carolina at Chapel Hill. The software program and 26 | * documentation are supplied "as is", without any accompanying services from 27 | * the University of North Carolina at Chapel Hill or the authors. The University 28 | * of North Carolina at Chapel Hill and the authors do not warrant that the 29 | * operation of the program will be uninterrupted or error-free. The end-user 30 | * understands that the program was developed for research purposes and is advised 31 | * not to rely exclusively on the program for any reason. 32 | * 33 | * IN NO EVENT SHALL THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR ITS 34 | * EMPLOYEES OR THE AUTHORS BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, 35 | * SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES, INCLUDING LOST PROFITS, 36 | * ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN IF THE 37 | * UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL OR THE AUTHORS HAVE BEEN ADVISED 38 | * OF THE POSSIBILITY OF SUCH DAMAGE. 39 | * 40 | * THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND THE AUTHORS SPECIFICALLY 41 | * DISCLAIM ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 42 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AND ANY 43 | * STATUTORY WARRANTY OF NON-INFRINGEMENT. THE SOFTWARE PROVIDED HEREUNDER IS 44 | * ON AN "AS IS" BASIS, AND THE UNIVERSITY OF NORTH CAROLINA AT CHAPEL HILL AND 45 | * THE AUTHORS HAVE NO OBLIGATIONS TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, 46 | * ENHANCEMENTS, OR MODIFICATIONS. 47 | */ 48 | 49 | 50 | #include "gsSoundStatistics.h" 51 | 52 | 53 | //########################################################################################## 54 | //****************************** Start GSound Namespace ********************************** 55 | GSOUND_NAMESPACE_START 56 | //****************************************************************************************** 57 | //########################################################################################## 58 | 59 | 60 | 61 | 62 | SoundStatistics:: SoundStatistics() 63 | : listenerCount( 0 ), 64 | sourceCount( 0 ), 65 | sourceClusterCount( 0 ), 66 | objectCount( 0 ), 67 | triangleCount( 0 ), 68 | vertexCount( 0 ), 69 | edgeCount( 0 ), 70 | pathCount( 0 ), 71 | diffuseRayCount( 0 ), 72 | diffuseRayDepth( 0 ), 73 | specularRayCount( 0 ), 74 | rayCastCount( 0 ), 75 | renderedPathCount( 0 ), 76 | maxIRLength( 0 ), 77 | 78 | clusteringTime(), 79 | propagationTime(), 80 | cacheUpdateTime(), 81 | irUpdateTime(), 82 | bufferingLoad( 0 ), 83 | renderingLoad( 0 ), 84 | renderingLatency( 0 ), 85 | 86 | preprocessTime(), 87 | remeshTime(), 88 | weldTime(), 89 | simplifyTime(), 90 | bvhTime(), 91 | edgeTime(), 92 | edgeVisibilityTime(), 93 | 94 | sceneMemory( 0 ), 95 | propagationMemory( 0 ), 96 | irMemory( 0 ), 97 | renderingMemory( 0 ), 98 | totalMemory( 0 ) 99 | { 100 | } 101 | 102 | 103 | 104 | 105 | //########################################################################################## 106 | //****************************** End GSound Namespace ************************************ 107 | GSOUND_NAMESPACE_END 108 | //****************************************************************************************** 109 | //########################################################################################## 110 | -------------------------------------------------------------------------------- /ray_generator/src/Om/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(Om) 2 | 3 | add_subdirectory(Om\ Framework) 4 | add_subdirectory(Om\ BVH) 5 | add_subdirectory(Om\ Resources) 6 | add_subdirectory(Om\ Sound) 7 | 8 | message(STATUS "CMAKE_SYSTEM_NAME = ${CMAKE_SYSTEM_NAME}" ) 9 | message(STATUS "CMAKE_CXX_COMPILER_ID = ${CMAKE_CXX_COMPILER_ID}" ) 10 | message(STATUS "CMAKE_CXX_COMPILER_VERSION = ${CMAKE_CXX_COMPILER_VERSION}") 11 | message(STATUS "CMAKE_COMPILER_IS_GNUCXX = ${CMAKE_COMPILER_IS_GNUCXX}" ) 12 | 13 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om BVH/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(om-bvh) 2 | 3 | # Add include directories 4 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Om\ Framework 5 | ) 6 | 7 | file(GLOB SOURCES om/*/*.cpp) 8 | set( SOURCEFILES ${SOURCES} ) 9 | 10 | add_library( om-bvh STATIC ${SOURCEFILES}) 11 | 12 | target_link_libraries( om-bvh om-framework ) 13 | 14 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om BVH/om/bvh/omBVHBVH.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omBVHBVH.h" 34 | 35 | 36 | //########################################################################################## 37 | //****************************** Start Om BVH Namespace ********************************** 38 | OM_BVH_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | 44 | 45 | BVHGeometry* BVH:: getGeometry() const 46 | { 47 | return NULL; 48 | } 49 | 50 | 51 | 52 | 53 | Bool BVH:: setGeometry( BVHGeometry* newGeometry ) 54 | { 55 | return false; 56 | } 57 | 58 | 59 | 60 | 61 | void BVH:: refit() 62 | { 63 | this->rebuild(); 64 | } 65 | 66 | 67 | 68 | 69 | Sphere3f BVH:: getBoundingSphere() const 70 | { 71 | AABB3f bbox = this->getAABB(); 72 | return Sphere3f( bbox.getCenter(), Float(0.5)*bbox.getDiagonal().getMagnitude() ); 73 | } 74 | 75 | 76 | 77 | 78 | //########################################################################################## 79 | //****************************** End Om BVH Namespace ************************************ 80 | OM_BVH_NAMESPACE_END 81 | //****************************************************************************************** 82 | //########################################################################################## 83 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om BVH/om/omBVH.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_BVH_H 34 | #define INCLUDE_OM_BVH_H 35 | 36 | 37 | #include "bvh/omBVHConfig.h" 38 | 39 | 40 | #include "bvh/omBVHRay.h" 41 | #include "bvh/omBVHTransform.h" 42 | #include "bvh/omBVHGeometry.h" 43 | 44 | 45 | #include "bvh/omBVHBVH.h" 46 | #include "bvh/omAABBTree4.h" 47 | 48 | 49 | #include "bvh/omBVHInstance.h" 50 | #include "bvh/omBVHScene.h" 51 | 52 | 53 | #endif // INCLUDE_OM_BVH_H 54 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(om-framework) 2 | 3 | if(APPLE) 4 | file(GLOB SOURCES om/*/*.cpp om/*/*.mm) 5 | else() 6 | file(GLOB SOURCES om/*/*.cpp) 7 | endif() 8 | set( SOURCEFILES ${SOURCES} ) 9 | 10 | add_library( om-framework STATIC ${SOURCEFILES}) 11 | 12 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/data/omDataConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_DATA_CONFIG_H 34 | #define INCLUDE_OM_DATA_CONFIG_H 35 | 36 | 37 | #include "../omConfig.h" 38 | 39 | 40 | #include "../util/omAllocator.h" 41 | #include "../util/omCopy.h" 42 | #include "../lang/omHalfFloat.h" 43 | #include "../math/omScalarMath.h" 44 | 45 | 46 | //########################################################################################## 47 | //******************************* Start Data Namespace ********************************* 48 | OM_DATA_NAMESPACE_START 49 | //****************************************************************************************** 50 | //########################################################################################## 51 | 52 | 53 | 54 | //########################################################################################## 55 | //******************************* End Data Namespace *********************************** 56 | OM_DATA_NAMESPACE_END 57 | //****************************************************************************************** 58 | //########################################################################################## 59 | 60 | 61 | 62 | #endif // INCLUDE_OM_DATA_CONFIG_H 63 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/data/omHashCode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omHashCode.h" 34 | 35 | 36 | //########################################################################################## 37 | //******************************* Start Data Namespace ********************************* 38 | OM_DATA_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | 44 | 45 | Hash HashCode:: computeHashCode( const UByte* data, Size length ) 46 | { 47 | if ( data == NULL || length == 0 ) 48 | return Hash(0); 49 | 50 | Hash hash = Hash(length); 51 | Hash temp; 52 | 53 | Hash remainder = Hash(length) & 3; 54 | length >>= 2; 55 | 56 | // Main loop 57 | for ( ; length > Size(0); length-- ) 58 | { 59 | hash += data[0] + (data[1] << 8); 60 | temp = ((data[2] + (data[3] << 8)) << 11) ^ hash; 61 | hash = (hash << 16) ^ temp; 62 | data += 2*sizeof(UInt16); 63 | hash += hash >> 11; 64 | } 65 | 66 | // Handle end cases 67 | switch ( remainder ) 68 | { 69 | case 3: hash += data[0] + (data[1] << 8); 70 | hash ^= hash << 16; 71 | hash ^= data[sizeof(UInt16)] << 18; 72 | hash += hash >> 11; 73 | break; 74 | case 2: hash += data[0] + (data[1] << 8); 75 | hash ^= hash << 11; 76 | hash += hash >> 17; 77 | break; 78 | case 1: hash += *data; 79 | hash ^= hash << 10; 80 | hash += hash >> 1; 81 | } 82 | 83 | // Force "avalanching" of final 127 bits 84 | hash ^= hash << 3; 85 | hash += hash >> 5; 86 | hash ^= hash << 4; 87 | hash += hash >> 17; 88 | hash ^= hash << 25; 89 | hash += hash >> 6; 90 | 91 | return hash; 92 | } 93 | 94 | 95 | 96 | 97 | //########################################################################################## 98 | //******************************* End Data Namespace *********************************** 99 | OM_DATA_NAMESPACE_END 100 | //****************************************************************************************** 101 | //########################################################################################## 102 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/fs/omFileSystemConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_FILE_SYSTEM_CONFIG_H 34 | #define INCLUDE_OM_FILE_SYSTEM_CONFIG_H 35 | 36 | 37 | #include "../omConfig.h" 38 | 39 | 40 | #include "../omUtilities.h" 41 | #include "../omData.h" 42 | #include "../omTime.h" 43 | 44 | 45 | //########################################################################################## 46 | //************************** Start Om File System Namespace ****************************** 47 | OM_FILE_SYSTEM_NAMESPACE_START 48 | //****************************************************************************************** 49 | //########################################################################################## 50 | 51 | 52 | 53 | 54 | using om::data::String; 55 | using om::data::UTF8String; 56 | using om::util::ArrayList; 57 | 58 | 59 | 60 | //########################################################################################## 61 | //************************** End Om File System Namespace ******************************** 62 | OM_FILE_SYSTEM_NAMESPACE_END 63 | //****************************************************************************************** 64 | //########################################################################################## 65 | 66 | 67 | #endif // INCLUDE_OM_FILE_SYSTEM_CONFIG_H 68 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/io/omBinaryFormat.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_BINARY_FORMAT_H 34 | #define INCLUDE_OM_BINARY_FORMAT_H 35 | 36 | 37 | #include "omIOConfig.h" 38 | 39 | 40 | //########################################################################################## 41 | //******************************* Start Om IO Namespace ********************************** 42 | OM_IO_NAMESPACE_START 43 | //****************************************************************************************** 44 | //########################################################################################## 45 | 46 | 47 | 48 | 49 | //******************************************************************************** 50 | /// A class that stores the global format parameters of a binary file. 51 | class BinaryFormat 52 | { 53 | public: 54 | 55 | //******************************************************************************** 56 | //****** Constructors 57 | 58 | 59 | /// Create a new binary format that uses the native endianness and default alignment. 60 | OM_INLINE BinaryFormat() 61 | : endianness(), 62 | alignment( DEFAULT_ALIGNMENT ) 63 | { 64 | } 65 | 66 | 67 | /// Create a new binary format that uses the specified endianness for primitive types and alignment. 68 | OM_INLINE BinaryFormat( const data::Endianness& newEndianness, Size newAlignment ) 69 | : endianness( newEndianness ), 70 | alignment( newAlignment ) 71 | { 72 | } 73 | 74 | 75 | //******************************************************************************** 76 | //****** Public Static Data Members 77 | 78 | 79 | /// The default alignment to use for objects. 80 | static const Size DEFAULT_ALIGNMENT = 8; 81 | 82 | 83 | //******************************************************************************** 84 | //****** Public Data Members 85 | 86 | 87 | /// The endianness that the asset file is encoded or decoded to/from. 88 | data::Endianness endianness; 89 | 90 | 91 | /// The required alignment in bytes of all objects in the file and the padding for strings. 92 | Size alignment; 93 | 94 | 95 | 96 | }; 97 | 98 | 99 | 100 | 101 | 102 | //########################################################################################## 103 | //******************************* End Om IO Namespace ************************************ 104 | OM_IO_NAMESPACE_END 105 | //****************************************************************************************** 106 | //########################################################################################## 107 | 108 | 109 | #endif // INCLUDE_OM_BINARY_FORMAT_H 110 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/io/omIOConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_IO_CONFIG_H 34 | #define INCLUDE_OM_IO_CONFIG_H 35 | 36 | 37 | #include "../omConfig.h" 38 | 39 | 40 | #include "../omFileSystem.h" 41 | #include "../omData.h" 42 | #include "../math/omScalarMath.h" 43 | 44 | 45 | //########################################################################################## 46 | //******************************* Start Om IO Namespace ********************************** 47 | OM_IO_NAMESPACE_START 48 | //****************************************************************************************** 49 | //########################################################################################## 50 | 51 | 52 | 53 | 54 | //########################################################################################## 55 | //******************************* End Om IO Namespace ************************************ 56 | OM_IO_NAMESPACE_END 57 | //****************************************************************************************** 58 | //########################################################################################## 59 | 60 | 61 | #endif // INCLUDE_OM_IO_CONFIG_H 62 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/lang/omLanguageConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_LANGUAGE_CONFIG_H 34 | #define INCLUDE_OM_LANGUAGE_CONFIG_H 35 | 36 | 37 | #include "../omConfig.h" 38 | 39 | 40 | #include "../util/omAllocator.h" 41 | 42 | 43 | //########################################################################################## 44 | //**************************** Start Om Language Namespace ******************************* 45 | OM_LANGUAGE_NAMESPACE_START 46 | //****************************************************************************************** 47 | //########################################################################################## 48 | 49 | 50 | //########################################################################################## 51 | //**************************** End Om Language Namespace ********************************* 52 | OM_LANGUAGE_NAMESPACE_END 53 | //****************************************************************************************** 54 | //########################################################################################## 55 | 56 | 57 | 58 | 59 | //########################################################################################## 60 | //************************ Start Om Language Internal Namespace ************************** 61 | OM_LANGUAGE_INTERNAL_NAMESPACE_START 62 | //****************************************************************************************** 63 | //########################################################################################## 64 | 65 | 66 | //########################################################################################## 67 | //************************ End Om Language Internal Namespace **************************** 68 | OM_LANGUAGE_INTERNAL_NAMESPACE_END 69 | //****************************************************************************************** 70 | //########################################################################################## 71 | 72 | 73 | 74 | #endif // INCLUDE_OM_LANGUAGE_CONFIG_H 75 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/lang/omUserData.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_USER_DATA_H 34 | #define INCLUDE_OM_USER_DATA_H 35 | 36 | 37 | #include "omLanguageConfig.h" 38 | 39 | 40 | //########################################################################################## 41 | //**************************** Start Om Language Namespace ******************************* 42 | OM_LANGUAGE_NAMESPACE_START 43 | //****************************************************************************************** 44 | //########################################################################################## 45 | 46 | 47 | 48 | //******************************************************************************** 49 | /// A class that wraps opaque client data that represents a pointer or an integer. 50 | /** 51 | * Client-specific data is often needed by the user of a complex system that 52 | * requires callbacks in order to identify an object or provide an opaque data source. 53 | * This class provides a uniform mechanism for storing either an opaque pointer or 54 | * integer to client data. The class stores at least 64 bits of information. 55 | */ 56 | class UserData 57 | { 58 | public: 59 | 60 | //******************************************************************************** 61 | //****** Constructors 62 | 63 | 64 | /// Create a user data object that is NULL. 65 | OM_INLINE UserData() 66 | : uint64( 0 ) 67 | { 68 | } 69 | 70 | 71 | /// Create a user data object that refers to the specified index. 72 | OM_INLINE UserData( Index newIndex ) 73 | : uint64( 0 ) 74 | { 75 | index = newIndex; 76 | } 77 | 78 | 79 | /// Create a user data object that refers to the specified pointer. 80 | OM_INLINE UserData( void* newPointer ) 81 | : uint64( 0 ) 82 | { 83 | pointer = newPointer; 84 | } 85 | 86 | 87 | /// A union that contains the various possible representations of the user data. 88 | union 89 | { 90 | Int8 int8; 91 | UInt8 uint8; 92 | Int16 int16; 93 | UInt16 uint16; 94 | Int32 int32; 95 | UInt32 uint32; 96 | Int64 int64; 97 | UInt64 uint64; 98 | Float32 float32; 99 | Float64 float64; 100 | Index index; 101 | Size size; 102 | void* pointer; 103 | }; 104 | 105 | 106 | 107 | }; 108 | 109 | 110 | 111 | 112 | //########################################################################################## 113 | //**************************** End Om Language Namespace ********************************* 114 | OM_LANGUAGE_NAMESPACE_END 115 | //****************************************************************************************** 116 | //########################################################################################## 117 | 118 | 119 | #endif // INCLUDE_OM_USER_DATA_H 120 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/math/omInterpolation.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omInterpolation.h" 34 | 35 | 36 | //########################################################################################## 37 | //****************************** Start Om Math Namespace ********************************* 38 | OM_MATH_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | //########################################################################################## 44 | //########################################################################################## 45 | //############ 46 | //############ String Conversion Method 47 | //############ 48 | //########################################################################################## 49 | //########################################################################################## 50 | 51 | 52 | 53 | 54 | data::String Interpolation:: toString() const 55 | { 56 | const Char* typeString = "Undefined"; 57 | 58 | switch ( type ) 59 | { 60 | case NONE: typeString = "None"; break; 61 | case LINEAR: typeString = "Linear"; break; 62 | case BEZIER: typeString = "Bezier"; break; 63 | case HERMITE: typeString = "Hermite"; break; 64 | case B_SPLINE: typeString = "B-Spline"; break; 65 | case SINC: typeString = "Sinc"; break; 66 | case SLERP: typeString = "Slerp"; break; 67 | } 68 | 69 | return data::String(typeString); 70 | } 71 | 72 | 73 | 74 | 75 | //########################################################################################## 76 | //****************************** End Om Math Namespace *********************************** 77 | OM_MATH_NAMESPACE_END 78 | //****************************************************************************************** 79 | //########################################################################################## 80 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/math/omMathConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_MATH_CONFIG_H 34 | #define INCLUDE_OM_MATH_CONFIG_H 35 | 36 | 37 | #include "../omConfig.h" 38 | 39 | 40 | //########################################################################################## 41 | //****************************** Start Om Math Namespace ********************************* 42 | OM_MATH_NAMESPACE_START 43 | //****************************************************************************************** 44 | //########################################################################################## 45 | 46 | 47 | //########################################################################################## 48 | //****************************** End Om Math Namespace *********************************** 49 | OM_MATH_NAMESPACE_END 50 | //****************************************************************************************** 51 | //########################################################################################## 52 | 53 | 54 | #endif // INCLUDE_OM_MATH_CONFIG_H 55 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/math/omPrimes.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_PRIMES_H 34 | #define INCLUDE_OM_PRIMES_H 35 | 36 | 37 | #include "omMathConfig.h" 38 | 39 | 40 | //########################################################################################## 41 | //****************************** Start Om Math Namespace ********************************* 42 | OM_MATH_NAMESPACE_START 43 | //****************************************************************************************** 44 | //########################################################################################## 45 | 46 | 47 | 48 | 49 | /// Return a prime number larger than the specified value, but smaller than the next power of two. 50 | template < typename T > 51 | T nextPowerOf2Prime( T value ); 52 | 53 | 54 | 55 | 56 | template <> 57 | unsigned int nextPowerOf2Prime( unsigned int value ); 58 | template <> 59 | unsigned long nextPowerOf2Prime( unsigned long value ); 60 | template <> 61 | unsigned long long nextPowerOf2Prime( unsigned long long value ); 62 | 63 | 64 | 65 | 66 | //########################################################################################## 67 | //****************************** End Om Math Namespace *********************************** 68 | OM_MATH_NAMESPACE_END 69 | //****************************************************************************************** 70 | //########################################################################################## 71 | 72 | 73 | #endif // INCLUDE_OM_PRIMES_H 74 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/math/omSIMD.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_SIMD_H 34 | #define INCLUDE_OM_SIMD_H 35 | 36 | 37 | #include "omMathConfig.h" 38 | 39 | 40 | #include "omSIMDConfig.h" 41 | #include "omSIMDTypes.h" 42 | #include "omSIMDFlags.h" 43 | 44 | // SIMD Scalar/Vector Classes. 45 | #include "omSIMDScalar.h" 46 | #include "omSIMDScalarInt16_8.h" 47 | #include "omSIMDScalarInt32_4.h" 48 | #include "omSIMDScalarInt64_2.h" 49 | #include "omSIMDScalarFloat32_4.h" 50 | #include "omSIMDScalarFloat64_2.h" 51 | 52 | // SIMD Array Classes. 53 | #include "omSIMDArray.h" 54 | #include "omSIMDArrayInt32.h" 55 | #include "omSIMDArrayFloat32.h" 56 | 57 | // SIMD Math Primitive Types 58 | #include "omSIMDVector3D.h" 59 | #include "omSIMDRay3D.h" 60 | #include "omSIMDAABB3D.h" 61 | #include "omSIMDPlane3D.h" 62 | #include "omSIMDTriangle3D.h" 63 | 64 | 65 | //########################################################################################## 66 | //****************************** Start Om Math Namespace ********************************* 67 | OM_MATH_NAMESPACE_START 68 | //****************************************************************************************** 69 | //########################################################################################## 70 | 71 | 72 | // SIMD Scalar Type Definitions for the given primitive type. 73 | typedef SIMDScalar SIMDFloat4; 74 | typedef SIMDScalar SIMDDouble2; 75 | typedef SIMDScalar SIMDInt4; 76 | 77 | 78 | //########################################################################################## 79 | //****************************** End Om Math Namespace *********************************** 80 | OM_MATH_NAMESPACE_END 81 | //****************************************************************************************** 82 | //########################################################################################## 83 | 84 | 85 | #endif // INCLUDE_OM_SIMD_H 86 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/omAssets.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_ASSETS_H 34 | #define INCLUDE_OM_ASSETS_H 35 | 36 | 37 | #include "assets/omAssetsConfig.h" 38 | 39 | 40 | #include "assets/omAssetType.h" 41 | #include "assets/omAssetTypeTranscoder.h" 42 | #include "assets/omAssetTextObject.h" 43 | #include "assets/omAssetListBase.h" 44 | #include "assets/omAssetList.h" 45 | #include "assets/omAssetSet.h" 46 | #include "assets/omAssetTranscoder.h" 47 | 48 | 49 | #endif // INCLUDE_OM_ASSETS_H 50 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/omData.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_DATA_MODULE_H 34 | #define INCLUDE_OM_DATA_MODULE_H 35 | 36 | 37 | #include "data/omDataConfig.h" 38 | 39 | 40 | #include "data/omData.h" 41 | #include "data/omDataBuffer.h" 42 | 43 | #include "data/omString.h" 44 | #include "data/omStringBuffer.h" 45 | #include "data/omStringIterator.h" 46 | 47 | #include "data/omHashCode.h" 48 | 49 | 50 | #include "data/omDataStore.h" 51 | 52 | 53 | #endif // INCLUDE_OM_DATA_MODULE_H 54 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/omFileSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_FILE_SYSTEM_H 34 | #define INCLUDE_OM_FILE_SYSTEM_H 35 | 36 | 37 | #include "fs/omFileSystemConfig.h" 38 | 39 | 40 | // Path Classes 41 | #include "fs/omPath.h" 42 | 43 | 44 | // File System Classes 45 | #include "fs/omFileSystemNode.h" 46 | #include "fs/omFile.h" 47 | #include "fs/omDirectory.h" 48 | 49 | 50 | #endif // INCLUDE_OM_FILE_SYSTEM_H 51 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/omIO.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_IO_H 34 | #define INCLUDE_OM_IO_H 35 | 36 | 37 | #include "io/omIOConfig.h" 38 | 39 | 40 | // String I/O 41 | #include "io/omStringInputStream.h" 42 | #include "io/omStringOutputStream.h" 43 | #include "io/omPrintStream.h" 44 | #include "io/omLog.h" 45 | 46 | 47 | // Binary I/O 48 | #include "io/omDataInputStream.h" 49 | #include "io/omDataOutputStream.h" 50 | #include "io/omBinaryFormat.h" 51 | #include "io/omBinaryDecoder.h" 52 | #include "io/omBinaryEncoder.h" 53 | 54 | 55 | // File I/O 56 | #include "io/omFileReader.h" 57 | #include "io/omFileWriter.h" 58 | 59 | 60 | #endif // INCLUDE_OM_IO_H 61 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/omLanguage.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_LANGUAGE_H 34 | #define INCLUDE_OM_LANGUAGE_H 35 | 36 | 37 | #include "lang/omLanguageConfig.h" 38 | 39 | 40 | #include "lang/omFunction.h" 41 | #include "lang/omFunctionCall.h" 42 | #include "lang/omUnique.h" 43 | #include "lang/omShared.h" 44 | #include "lang/omOptional.h" 45 | #include "lang/omHalfFloat.h" 46 | #include "lang/omUserData.h" 47 | 48 | 49 | #endif // INCLUDE_OM_LANGUAGE_H 50 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/omSystem.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_SYSTEM_H 34 | #define INCLUDE_OM_SYSTEM_H 35 | 36 | 37 | #include "system/omSystemConfig.h" 38 | 39 | 40 | #include "system/omCPU.h" 41 | 42 | 43 | 44 | #endif // INCLUDE_OM_SYSTEM_H 45 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/omThreads.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_THREADS_H 34 | #define INCLUDE_OM_THREADS_H 35 | 36 | 37 | #include "threads/omThreadsConfig.h" 38 | 39 | 40 | #include "threads/omThreadBase.h" 41 | #include "threads/omThreadPriority.h" 42 | #include "threads/omThread.h" 43 | #include "threads/omAtomics.h" 44 | #include "threads/omMutex.h" 45 | #include "threads/omScopedMutex.h" 46 | #include "threads/omSignal.h" 47 | #include "threads/omSemaphore.h" 48 | #include "threads/omThreadPool.h" 49 | 50 | 51 | #endif // INCLUDE_OM_THREADS_H 52 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/omTime.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_TIME_MODULE_H 34 | #define INCLUDE_OM_TIME_MODULE_H 35 | 36 | 37 | #include "time/omTimeConfig.h" 38 | 39 | #include "time/omTimer.h" 40 | 41 | 42 | #endif // INCLUDE_OM_TIME_MODULE_H 43 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/omUtilities.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_UTILITIES_H 34 | #define INCLUDE_OM_UTILITIES_H 35 | 36 | 37 | #include "util/omUtilitiesConfig.h" 38 | 39 | 40 | #include "util/omAllocator.h" 41 | #include "util/omCopy.h" 42 | 43 | // Array classes 44 | #include "util/omArray.h" 45 | #include "util/omShortArray.h" 46 | #include "util/omStaticArray.h" 47 | #include "util/omPODArray.h" 48 | 49 | // Array-based list classes 50 | #include "util/omArrayList.h" 51 | #include "util/omShortArrayList.h" 52 | 53 | // Hash map. 54 | #include "util/omHashMap.h" 55 | 56 | // Priority Queue. 57 | #include "util/omPriorityQueue.h" 58 | 59 | 60 | #endif // INCLUDE_OM_UTILITIES_H 61 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/system/omCPU.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omCPU.h" 34 | 35 | 36 | #if defined(OM_PLATFORM_APPLE) || defined(OM_PLATFORM_LINUX) 37 | #include 38 | #elif defined(OM_PLATFORM_WINDOWS) 39 | #include 40 | #else 41 | #error Unsupported platform 42 | #endif 43 | 44 | 45 | //########################################################################################## 46 | //************************** Start Rim System Namespace **************************** 47 | OM_SYSTEM_NAMESPACE_START 48 | //****************************************************************************************** 49 | //########################################################################################## 50 | 51 | 52 | //########################################################################################## 53 | //########################################################################################## 54 | //############ 55 | //############ CPU Attribute Accessor Methods 56 | //############ 57 | //########################################################################################## 58 | //########################################################################################## 59 | 60 | 61 | 62 | 63 | Size CPU:: getCount() 64 | { 65 | #if defined(OM_PLATFORM_APPLE) || defined(OM_PLATFORM_LINUX) 66 | return (Size)sysconf( _SC_NPROCESSORS_ONLN ); 67 | #elif defined(OM_PLATFORM_WINDOWS) 68 | SYSTEM_INFO systemInfo; 69 | GetSystemInfo( &systemInfo ); 70 | 71 | return (Size)systemInfo.dwNumberOfProcessors; 72 | #endif 73 | } 74 | 75 | 76 | 77 | 78 | //########################################################################################## 79 | //************************** End Rim System Namespace ****************************** 80 | OM_SYSTEM_NAMESPACE_END 81 | //****************************************************************************************** 82 | //########################################################################################## 83 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/system/omSystemConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_SYSTEM_CONFIG_H 34 | #define INCLUDE_OM_SYSTEM_CONFIG_H 35 | 36 | 37 | #include "../omConfig.h" 38 | 39 | #include "../omData.h" 40 | #include "../omUtilities.h" 41 | #include "../omMath.h" 42 | 43 | 44 | //########################################################################################## 45 | //************************** Start Rim System Namespace **************************** 46 | OM_SYSTEM_NAMESPACE_START 47 | //****************************************************************************************** 48 | //########################################################################################## 49 | 50 | 51 | using om::math::SIMDFlags; 52 | 53 | 54 | //########################################################################################## 55 | //************************** End Rim System Namespace ****************************** 56 | OM_SYSTEM_NAMESPACE_END 57 | //****************************************************************************************** 58 | //########################################################################################## 59 | 60 | 61 | #endif // INCLUDE_OM_SYSTEM_CONFIG_H 62 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/threads/omThreadBase_Cocoa.mm: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omThreadBase.h" 34 | 35 | 36 | #if defined(OM_PLATFORM_APPLE) 37 | #include 38 | #include 39 | 40 | 41 | //########################################################################################## 42 | //**************************** Start Om Threads Namespace ******************************** 43 | OM_THREADS_NAMESPACE_START 44 | //****************************************************************************************** 45 | //########################################################################################## 46 | 47 | 48 | //########################################################################################## 49 | //########################################################################################## 50 | //############ 51 | //############ Thread Run Method 52 | //############ 53 | //########################################################################################## 54 | //########################################################################################## 55 | 56 | 57 | 58 | 59 | void ThreadBase:: runThread() 60 | { 61 | pthread_setcanceltype( PTHREAD_CANCEL_ASYNCHRONOUS, NULL ); 62 | 63 | // Create an autorelease pool for this thread. 64 | NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; 65 | 66 | threadIsRunning = true; 67 | 68 | // Call the main thread function. 69 | this->run(); 70 | 71 | // Clean up the autorelease pool. 72 | [pool release]; 73 | 74 | threadIsRunning = false; 75 | } 76 | 77 | 78 | 79 | 80 | //########################################################################################## 81 | //**************************** End Om Threads Namespace ********************************** 82 | OM_THREADS_NAMESPACE_END 83 | //****************************************************************************************** 84 | //########################################################################################## 85 | 86 | 87 | #endif // OM_PLATFORM_APPLE 88 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/threads/omThreadPriority.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omThreadPriority.h" 34 | 35 | 36 | //########################################################################################## 37 | //**************************** Start Om Threads Namespace ******************************** 38 | OM_THREADS_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | //########################################################################################## 44 | //########################################################################################## 45 | //############ 46 | //############ String Conversion Method 47 | //############ 48 | //########################################################################################## 49 | //########################################################################################## 50 | 51 | 52 | 53 | 54 | data::String ThreadPriority:: toString() const 55 | { 56 | const Char* typeString = "Default"; 57 | 58 | switch ( type ) 59 | { 60 | case LOW: typeString = "Low"; break; 61 | case MEDIUM: typeString = "Medium"; break; 62 | case HIGH: typeString = "High"; break; 63 | case TIME_CRITICAL: typeString = "Time-Critical"; break; 64 | } 65 | 66 | return data::String(typeString); 67 | } 68 | 69 | 70 | 71 | 72 | //########################################################################################## 73 | //**************************** End Om Threads Namespace ********************************** 74 | OM_THREADS_NAMESPACE_END 75 | //****************************************************************************************** 76 | //########################################################################################## 77 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/threads/omThreadsConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_THREADS_CONFIG_H 34 | #define INCLUDE_OM_THREADS_CONFIG_H 35 | 36 | 37 | #include "../omConfig.h" 38 | 39 | 40 | //########################################################################################## 41 | //**************************** Start Om Threads Namespace ******************************** 42 | OM_THREADS_NAMESPACE_START 43 | //****************************************************************************************** 44 | //########################################################################################## 45 | 46 | 47 | 48 | //########################################################################################## 49 | //**************************** End Om Threads Namespace ********************************** 50 | OM_THREADS_NAMESPACE_END 51 | //****************************************************************************************** 52 | //########################################################################################## 53 | 54 | 55 | 56 | #endif // INCLUDE_OM_THREADS_CONFIG_H 57 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/time/omTimeConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_TIME_CONFIG_H 34 | #define INCLUDE_OM_TIME_CONFIG_H 35 | 36 | 37 | #include "../omConfig.h" 38 | 39 | 40 | #include "../omData.h" 41 | 42 | 43 | //########################################################################################## 44 | //******************************* Start Time Namespace ********************************* 45 | OM_TIME_NAMESPACE_START 46 | //****************************************************************************************** 47 | //########################################################################################## 48 | 49 | 50 | 51 | //########################################################################################## 52 | //******************************* End Time Namespace *********************************** 53 | OM_TIME_NAMESPACE_END 54 | //****************************************************************************************** 55 | //########################################################################################## 56 | 57 | 58 | #endif // INCLUDE_OM_TIME_CONFIG_H 59 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/time/omTimer.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omTimer.h" 34 | 35 | 36 | //########################################################################################## 37 | //******************************* Start Time Namespace ********************************* 38 | OM_TIME_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | //########################################################################################## 44 | //########################################################################################## 45 | //############ 46 | //############ Timer Update Method 47 | //############ 48 | //########################################################################################## 49 | //########################################################################################## 50 | 51 | 52 | 53 | 54 | Time Timer:: update() 55 | { 56 | if ( paused ) 57 | return Time(); 58 | 59 | oldTime = currentTime; 60 | currentTime = Time::getCurrent(); 61 | lastInterval = currentTime - oldTime; 62 | 63 | return lastInterval; 64 | } 65 | 66 | 67 | 68 | 69 | //########################################################################################## 70 | //########################################################################################## 71 | //############ 72 | //############ Timer Is Paused Accessor Method 73 | //############ 74 | //########################################################################################## 75 | //########################################################################################## 76 | 77 | 78 | 79 | 80 | void Timer:: setIsPaused( Bool newIsPaused ) 81 | { 82 | if ( newIsPaused ) 83 | { 84 | // is the timer already paused? if so, then return. 85 | if ( paused ) 86 | return; 87 | 88 | oldTime = currentTime; 89 | currentTime = Time::getCurrent(); 90 | paused = newIsPaused; 91 | } 92 | else 93 | { 94 | 95 | // is the timer already active? if so, then return. 96 | if ( !paused ) 97 | return; 98 | 99 | currentTime = Time::getCurrent() - (currentTime - oldTime); 100 | paused = newIsPaused; 101 | } 102 | } 103 | 104 | 105 | 106 | 107 | //########################################################################################## 108 | //******************************* End Time Namespace *********************************** 109 | OM_TIME_NAMESPACE_END 110 | //****************************************************************************************** 111 | //########################################################################################## 112 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Framework/om/util/omUtilitiesConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_UTILITIES_CONFIG_H 34 | #define INCLUDE_OM_UTILITIES_CONFIG_H 35 | 36 | 37 | #include "../omConfig.h" 38 | 39 | 40 | #include "../math/omScalarMath.h" 41 | 42 | 43 | //########################################################################################## 44 | //**************************** Start Om Utilities Namespace ****************************** 45 | OM_UTILITIES_NAMESPACE_START 46 | //****************************************************************************************** 47 | //########################################################################################## 48 | 49 | 50 | 51 | 52 | //########################################################################################## 53 | //**************************** End Om Utilities Namespace ******************************** 54 | OM_UTILITIES_NAMESPACE_END 55 | //****************************************************************************************** 56 | //########################################################################################## 57 | 58 | 59 | #endif // INCLUDE_OM_UTILITIES_CONFIG_H 60 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Resources/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(om-resources) 2 | 3 | # Add include directories 4 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Om\ Framework 5 | ) 6 | 7 | file(GLOB SOURCES om/*/*.cpp) 8 | set( SOURCEFILES ${SOURCES} ) 9 | 10 | add_library( om-resources STATIC ${SOURCEFILES}) 11 | 12 | target_link_libraries( om-resources om-framework ) 13 | 14 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Resources/om/omResources.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_RESOURCES_H 34 | #define INCLUDE_OM_RESOURCES_H 35 | 36 | 37 | #include "resources/omResourcesConfig.h" 38 | 39 | 40 | #include "resources/omResourceFormat.h" 41 | #include "resources/omResourceType.h" 42 | 43 | #include "resources/omResourceID.h" 44 | #include "resources/omOpaqueResource.h" 45 | #include "resources/omResource.h" 46 | 47 | #include "resources/omResourceSet.h" 48 | 49 | #include "resources/omResourceMode.h" 50 | #include "resources/omResourceTranscoder.h" 51 | #include "resources/omResourceTypeTranscoder.h" 52 | #include "resources/omResourceManager.h" 53 | 54 | #include "resources/omResourceModule.h" 55 | 56 | 57 | #endif // INCLUDE_OM_RESOURCES_H 58 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Resources/om/resources/omResourceMode.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omResourceMode.h" 34 | 35 | 36 | //########################################################################################## 37 | //*************************** Start Om Resources Namespace ******************************* 38 | OM_RESOURCES_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | //########################################################################################## 44 | //########################################################################################## 45 | //############ 46 | //############ String Conversion Method 47 | //############ 48 | //########################################################################################## 49 | //########################################################################################## 50 | 51 | 52 | 53 | 54 | data::String ResourceMode:: toString() const 55 | { 56 | const Char* modeString = "Undefined"; 57 | 58 | switch ( mode ) 59 | { 60 | case READ_ONLY: modeString = "Read Only"; break; 61 | case READ_WRITE: modeString = "Read & Write"; break; 62 | } 63 | 64 | return data::String(modeString); 65 | } 66 | 67 | 68 | 69 | 70 | //########################################################################################## 71 | //*************************** End Om Resources Namespace ********************************* 72 | OM_RESOURCES_NAMESPACE_END 73 | //****************************************************************************************** 74 | //########################################################################################## 75 | 76 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Resources/om/resources/omResourceModule.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omResourceModule.h" 34 | 35 | 36 | //########################################################################################## 37 | //*************************** Start Om Resources Namespace ******************************* 38 | OM_RESOURCES_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | 44 | 45 | ResourceModule:: ~ResourceModule() 46 | { 47 | } 48 | 49 | 50 | 51 | 52 | void ResourceModule:: getFormats( ResourceManager& manager ) 53 | { 54 | } 55 | 56 | 57 | 58 | 59 | //########################################################################################## 60 | //*************************** End Om Resources Namespace ********************************* 61 | OM_RESOURCES_NAMESPACE_END 62 | //****************************************************************************************** 63 | //########################################################################################## 64 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Resources/om/resources/omResourceModule.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_RESOURCE_MODULE_H 34 | #define INCLUDE_OM_RESOURCE_MODULE_H 35 | 36 | 37 | #include "omResourcesConfig.h" 38 | 39 | 40 | #include "omResourceManager.h" 41 | 42 | 43 | //########################################################################################## 44 | //*************************** Start Om Resources Namespace ******************************* 45 | OM_RESOURCES_NAMESPACE_START 46 | //****************************************************************************************** 47 | //########################################################################################## 48 | 49 | 50 | 51 | 52 | //******************************************************************************** 53 | /// A class that encapsulates a collection of related ResourceSetTypeTranscoder objects. 54 | /** 55 | * External resource modules (e.g. graphics, physics, or sound) can inherit from 56 | * this class and provide ResourceSetTranscoder objects with transcoders for the 57 | * various datatypes that they support. 58 | */ 59 | class ResourceModule 60 | { 61 | public: 62 | 63 | //******************************************************************************** 64 | //****** Destructor 65 | 66 | 67 | /// Destroy this resource module and release all internal resources. 68 | /** 69 | * Any ResourceSetTranscoder objects that are using the transcoders provided 70 | * by this module should cease using those trancoders before the module is detroyed. 71 | */ 72 | virtual ~ResourceModule(); 73 | 74 | 75 | //******************************************************************************** 76 | //****** Resource Type Accessor Method 77 | 78 | 79 | /// Add transcoders to the specified resource manager for the resource formats this module supports. 80 | virtual void getFormats( ResourceManager& manager ); 81 | 82 | 83 | 84 | }; 85 | 86 | 87 | 88 | 89 | //########################################################################################## 90 | //*************************** End Om Resources Namespace ********************************* 91 | OM_RESOURCES_NAMESPACE_END 92 | //****************************************************************************************** 93 | //########################################################################################## 94 | 95 | 96 | #endif // INCLUDE_OM_RESOURCE_MODULE_H 97 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Resources/om/resources/omResourceTranscoder.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_RESOURCE_TRANSCODER_H 34 | #define INCLUDE_OM_RESOURCE_TRANSCODER_H 35 | 36 | 37 | #include "omResourcesConfig.h" 38 | 39 | 40 | #include "omResourceID.h" 41 | 42 | 43 | //########################################################################################## 44 | //*************************** Start Om Resources Namespace ******************************* 45 | OM_RESOURCES_NAMESPACE_START 46 | //****************************************************************************************** 47 | //########################################################################################## 48 | 49 | 50 | class ResourceSet; 51 | 52 | 53 | 54 | //******************************************************************************** 55 | /// The base class for objects that load and save resource data. 56 | class ResourceTranscoder 57 | { 58 | public: 59 | 60 | //******************************************************************************** 61 | //****** Destructor 62 | 63 | 64 | /// Destroy a resource transcoder and release all of its resources. 65 | virtual ~ResourceTranscoder() 66 | { 67 | } 68 | 69 | 70 | //******************************************************************************** 71 | //****** Resource Type Accessor Methods 72 | 73 | 74 | /// Return an object that represents the resource type that this transcoder can read and write. 75 | virtual const ResourceType& getResourceType() const = 0; 76 | 77 | 78 | /// Return an object that represents the resource format that this transcoder can read and write. 79 | virtual const ResourceFormat& getResourceFormat() const = 0; 80 | 81 | 82 | //******************************************************************************** 83 | //****** Decoding Methods 84 | 85 | 86 | /// Return whether or not the specified identifier refers to a valid resource for this transcoder. 87 | /** 88 | * If the identifier represents a valid resource, TRUE is returned. Otherwise, 89 | * if the resource is not valid, FALSE is returned. 90 | */ 91 | virtual Bool canDecode( const ResourceID& identifier ) const = 0; 92 | 93 | 94 | 95 | }; 96 | 97 | 98 | 99 | 100 | //########################################################################################## 101 | //*************************** End Om Resources Namespace ********************************* 102 | OM_RESOURCES_NAMESPACE_END 103 | //****************************************************************************************** 104 | //########################################################################################## 105 | 106 | 107 | #endif // INCLUDE_OM_RESOURCE_TRANSCODER_H 108 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Resources/om/resources/omResourceType.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omResourceType.h" 34 | 35 | 36 | //########################################################################################## 37 | //*************************** Start Om Resources Namespace ******************************* 38 | OM_RESOURCES_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | 44 | const ResourceType ResourceType:: UNDEFINED("?"); 45 | 46 | 47 | const ResourceType ResourceType:: INT8("int8"); 48 | const ResourceType ResourceType:: UINT8("uint8"); 49 | const ResourceType ResourceType:: INT16("int16"); 50 | const ResourceType ResourceType:: UINT16("uint16"); 51 | const ResourceType ResourceType:: INT32("int32"); 52 | const ResourceType ResourceType:: UINT32("uint32"); 53 | const ResourceType ResourceType:: INT64("int64"); 54 | const ResourceType ResourceType:: UINT64("uint64"); 55 | const ResourceType ResourceType:: FLOAT16("float16"); 56 | const ResourceType ResourceType:: FLOAT32("float32"); 57 | const ResourceType ResourceType:: FLOAT64("float64"); 58 | 59 | 60 | const ResourceType ResourceType:: VECTOR2_F32("Vector2f32"); 61 | const ResourceType ResourceType:: VECTOR2_F64("Vector2f64"); 62 | const ResourceType ResourceType:: VECTOR3_F32("Vector3f32"); 63 | const ResourceType ResourceType:: VECTOR3_F64("Vector3f64"); 64 | const ResourceType ResourceType:: VECTOR4_F32("Vector4f32"); 65 | const ResourceType ResourceType:: VECTOR4_F64("Vector4f64"); 66 | 67 | 68 | const ResourceType ResourceType:: MATRIX2_F32("Matrix2f32"); 69 | const ResourceType ResourceType:: MATRIX2_F64("Matrix2f64"); 70 | const ResourceType ResourceType:: MATRIX3_F32("Matrix3f32"); 71 | const ResourceType ResourceType:: MATRIX3_F64("Matrix3f64"); 72 | const ResourceType ResourceType:: MATRIX4_F32("Matrix4f32"); 73 | const ResourceType ResourceType:: MATRIX4_F64("Matrix4f64"); 74 | 75 | 76 | const ResourceType ResourceType:: STRING_ASCII("StringASCII"); 77 | const ResourceType ResourceType:: STRING_UTF8("StringUTF8"); 78 | const ResourceType ResourceType:: STRING_UTF16("StringUTF16"); 79 | const ResourceType ResourceType:: STRING_UTF32("StringUTF32"); 80 | 81 | 82 | 83 | 84 | //########################################################################################## 85 | //*************************** End Om Resources Namespace ********************************* 86 | OM_RESOURCES_NAMESPACE_END 87 | //****************************************************************************************** 88 | //########################################################################################## 89 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Resources/om/resources/omResourcesConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_RESOURCES_CONFIG_H 34 | #define INCLUDE_OM_RESOURCES_CONFIG_H 35 | 36 | 37 | #include "om/omFramework.h" 38 | 39 | 40 | //########################################################################################## 41 | //########################################################################################## 42 | //############ 43 | //############ Library Namespace Configuration 44 | //############ 45 | //########################################################################################## 46 | //########################################################################################## 47 | 48 | 49 | 50 | 51 | /// The enclosing namespace for the entire Om library. 52 | /** 53 | * @namespace om 54 | */ 55 | namespace om 56 | { 57 | /// A namespace containing classes that handle resource serialization and management. 58 | /** 59 | * @namespace om::resources 60 | */ 61 | namespace resources 62 | { 63 | class ResourceSet; 64 | }; 65 | #define OM_RESOURCES_NAMESPACE_START namespace om { namespace resources { 66 | #define OM_RESOURCES_NAMESPACE_END }; }; 67 | }; 68 | 69 | 70 | 71 | //########################################################################################## 72 | //*************************** Start Om Resources Namespace ******************************* 73 | OM_RESOURCES_NAMESPACE_START 74 | //****************************************************************************************** 75 | //########################################################################################## 76 | 77 | 78 | //########################################################################################## 79 | //*************************** End Om Resources Namespace ********************************* 80 | OM_RESOURCES_NAMESPACE_END 81 | //****************************************************************************************** 82 | //########################################################################################## 83 | 84 | 85 | #endif // INCLUDE_OM_RESOURCES_CONFIG_H 86 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project(om-sound) 2 | 3 | # Add include directories 4 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/../Om\ Framework 5 | ${CMAKE_CURRENT_SOURCE_DIR}/../Om\ Resources 6 | ${CMAKE_CURRENT_SOURCE_DIR}/../platform 7 | ) 8 | 9 | 10 | file(GLOB SOURCES om/*/*/*.cpp) 11 | set( SOURCEFILES ${SOURCES} ) 12 | 13 | add_library( om-sound STATIC ${SOURCEFILES}) 14 | 15 | 16 | set( EXTERNAL_LIBS 17 | om-resources 18 | om-framework 19 | Threads::Threads ) 20 | 21 | target_link_libraries( om-sound ${EXTERNAL_LIBS}) 22 | 23 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/omSound.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_SOUND_H 34 | #define INCLUDE_OM_SOUND_H 35 | 36 | 37 | #include "sound/omSoundConfig.h" 38 | 39 | 40 | #include "sound/omSoundBase.h" 41 | #include "sound/omSoundFilters.h" 42 | 43 | 44 | //########################################################################################## 45 | //***************************** Start Om Sound Namespace ********************************* 46 | OM_SOUND_NAMESPACE_START 47 | //****************************************************************************************** 48 | //########################################################################################## 49 | 50 | 51 | 52 | using namespace om::sound::base; 53 | using namespace om::sound::filters; 54 | 55 | 56 | 57 | //########################################################################################## 58 | //***************************** End Om Sound Namespace *********************************** 59 | OM_SOUND_NAMESPACE_END 60 | //****************************************************************************************** 61 | //########################################################################################## 62 | 63 | 64 | #endif // INCLUDE_OM_SOUND_H 65 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/base/omSoundBaseConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_SOUND_BASE_CONFIG_H 34 | #define INCLUDE_OM_SOUND_BASE_CONFIG_H 35 | 36 | 37 | #include "../omSoundConfig.h" 38 | 39 | 40 | //########################################################################################## 41 | //*************************** Start Om Sound Base Namespace ****************************** 42 | OM_SOUND_BASE_NAMESPACE_START 43 | //****************************************************************************************** 44 | //########################################################################################## 45 | 46 | 47 | 48 | 49 | /// Define the type to represent a linear gain coefficient. 50 | typedef Float32 Gain; 51 | 52 | 53 | 54 | 55 | /// Define the type used to represent a sound sample that is a complex number. 56 | typedef math::Complex ComplexSample; 57 | 58 | 59 | 60 | 61 | //########################################################################################## 62 | //*************************** End Om Sound Base Namespace ******************************** 63 | OM_SOUND_BASE_NAMESPACE_END 64 | //****************************************************************************************** 65 | //########################################################################################## 66 | 67 | 68 | #endif // INCLUDE_OM_SOUND_BASE_CONFIG_H 69 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/base/omSoundOutputStream.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omSoundOutputStream.h" 34 | 35 | 36 | //########################################################################################## 37 | //*************************** Start Om Sound Base Namespace ****************************** 38 | OM_SOUND_BASE_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | //########################################################################################## 44 | //########################################################################################## 45 | //############ 46 | //############ Destructor 47 | //############ 48 | //########################################################################################## 49 | //########################################################################################## 50 | 51 | 52 | 53 | 54 | SoundOutputStream:: ~SoundOutputStream() 55 | { 56 | } 57 | 58 | 59 | 60 | 61 | //########################################################################################## 62 | //########################################################################################## 63 | //############ 64 | //############ Seeking Methods 65 | //############ 66 | //########################################################################################## 67 | //########################################################################################## 68 | 69 | 70 | 71 | 72 | Bool SoundOutputStream:: canSeek() const 73 | { 74 | return false; 75 | } 76 | 77 | 78 | 79 | 80 | Bool SoundOutputStream:: canSeek( Int64 relativeSampleOffset ) const 81 | { 82 | return false; 83 | } 84 | 85 | 86 | 87 | 88 | Int64 SoundOutputStream:: seek( Int64 relativeSampleOffset ) 89 | { 90 | return 0; 91 | } 92 | 93 | 94 | 95 | 96 | //########################################################################################## 97 | //*************************** End Om Sound Base Namespace ******************************** 98 | OM_SOUND_BASE_NAMESPACE_END 99 | //****************************************************************************************** 100 | //########################################################################################## 101 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/base/omSoundSampleType.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omSoundSampleType.h" 34 | 35 | 36 | //########################################################################################## 37 | //*************************** Start Om Sound Base Namespace ****************************** 38 | OM_SOUND_BASE_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | 44 | 45 | String SampleType:: toString() const 46 | { 47 | const Char* typeString; 48 | 49 | switch ( type ) 50 | { 51 | case SAMPLE_8: 52 | typeString = "8-bit Signed Integer"; 53 | break; 54 | case SAMPLE_16: 55 | typeString = "16-bit Signed Integer"; 56 | break; 57 | case SAMPLE_24: 58 | typeString = "24-bit Signed Integer"; 59 | break; 60 | case SAMPLE_32: 61 | typeString = "32-bit Signed Integer"; 62 | break; 63 | case SAMPLE_64: 64 | typeString = "64-bit Signed Integer"; 65 | break; 66 | case SAMPLE_32F: 67 | typeString = "32-bit Floating Point"; 68 | break; 69 | case SAMPLE_64F: 70 | typeString = "64-bit Floating Point"; 71 | break; 72 | default: 73 | typeString = "Undefined"; 74 | break; 75 | } 76 | 77 | return String( typeString ); 78 | } 79 | 80 | 81 | 82 | 83 | //########################################################################################## 84 | //*************************** End Om Sound Base Namespace ******************************** 85 | OM_SOUND_BASE_NAMESPACE_END 86 | //****************************************************************************************** 87 | //########################################################################################## 88 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/filters/omSoundFilterCategory.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omSoundFilterCategory.h" 34 | 35 | 36 | //########################################################################################## 37 | //************************* Start Om Sound Filters Namespace ***************************** 38 | OM_SOUND_FILTERS_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | 44 | 45 | UTF8String FilterCategory:: toString() const 46 | { 47 | const Char* typeString = "Other"; 48 | 49 | switch ( type ) 50 | { 51 | case PLAYBACK: typeString = "Playback"; break; 52 | case RECORDING: typeString = "Recording"; break; 53 | case INSTRUMENT: typeString = "Instrument"; break; 54 | case ROUTING: typeString = "Routing"; break; 55 | case IMAGING: typeString = "Imaging"; break; 56 | case EQUALIZER: typeString = "Equalizer"; break; 57 | case DYNAMICS: typeString = "Dynamics"; break; 58 | case DISTORTION: typeString = "Distortion"; break; 59 | case DELAY: typeString = "Delay"; break; 60 | case REVERB: typeString = "Reverb"; break; 61 | case MODULATION: typeString = "Modulation"; break; 62 | case PITCH: typeString = "Pitch"; break; 63 | case MIDI: typeString = "MIDI"; break; 64 | case ANALYSIS: typeString = "Analysis"; break; 65 | case UTILITY: typeString = "Utility"; break; 66 | } 67 | 68 | return UTF8String( typeString ); 69 | } 70 | 71 | 72 | 73 | 74 | //########################################################################################## 75 | //************************* End Om Sound Filters Namespace ******************************* 76 | OM_SOUND_FILTERS_NAMESPACE_END 77 | //****************************************************************************************** 78 | //########################################################################################## 79 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/filters/omSoundFilterParameter.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omSoundFilterParameter.h" 34 | 35 | 36 | //########################################################################################## 37 | //************************* Start Om Sound Filters Namespace ***************************** 38 | OM_SOUND_FILTERS_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | 44 | 45 | UTF8String FilterParameter:: toString() const 46 | { 47 | Bool booleanValue; 48 | Int64 integerValue; 49 | Float32 floatValue; 50 | Float64 doubleValue; 51 | 52 | switch ( type ) 53 | { 54 | case FilterParameterType::BOOLEAN: 55 | value.getValueAsType( type, booleanValue ); 56 | return UTF8String( booleanValue ); 57 | 58 | case FilterParameterType::INTEGER: 59 | value.getValueAsType( type, integerValue ); 60 | return UTF8String( integerValue ); 61 | 62 | case FilterParameterType::ENUMERATION: 63 | value.getValueAsType( type, integerValue ); 64 | return UTF8String( integerValue ); 65 | 66 | case FilterParameterType::FLOAT: 67 | value.getValueAsType( type, floatValue ); 68 | return UTF8String( floatValue ); 69 | 70 | case FilterParameterType::DOUBLE: 71 | value.getValueAsType( type, doubleValue ); 72 | return UTF8String( doubleValue ); 73 | } 74 | 75 | return UTF8String(); 76 | } 77 | 78 | 79 | 80 | 81 | //########################################################################################## 82 | //************************* End Om Sound Filters Namespace ******************************* 83 | OM_SOUND_FILTERS_NAMESPACE_END 84 | //****************************************************************************************** 85 | //########################################################################################## 86 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/filters/omSoundFilterParameterCurve.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omSoundFilterParameterCurve.h" 34 | 35 | 36 | //########################################################################################## 37 | //************************* Start Om Sound Filters Namespace ***************************** 38 | OM_SOUND_FILTERS_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | 44 | 45 | UTF8String FilterParameterCurve:: toString() const 46 | { 47 | const Char* curveString = "Undefined"; 48 | 49 | switch ( curve ) 50 | { 51 | case LINEAR: curveString = "Linear"; break; 52 | case LOGARITHMIC: curveString = "Logarithmic"; break; 53 | case SQUARE: curveString = "Square"; break; 54 | case SQUARE_ROOT: curveString = "Square Root"; break; 55 | case CUBE: curveString = "Cube"; break; 56 | case CUBE_ROOT: curveString = "Cube Root"; break; 57 | } 58 | 59 | return UTF8String( curveString ); 60 | } 61 | 62 | 63 | 64 | 65 | //########################################################################################## 66 | //************************* End Om Sound Filters Namespace ******************************* 67 | OM_SOUND_FILTERS_NAMESPACE_END 68 | //****************************************************************************************** 69 | //########################################################################################## 70 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/filters/omSoundFilterParameterType.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omSoundFilterParameterType.h" 34 | 35 | 36 | //########################################################################################## 37 | //************************* Start Om Sound Filters Namespace ***************************** 38 | OM_SOUND_FILTERS_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | 44 | 45 | UTF8String FilterParameterType:: toString() const 46 | { 47 | const Char* typeString; 48 | 49 | switch ( type ) 50 | { 51 | case BOOLEAN: 52 | typeString = "Boolean"; 53 | break; 54 | case INTEGER: 55 | typeString = "Integer"; 56 | break; 57 | case FLOAT: 58 | typeString = "Float"; 59 | break; 60 | case DOUBLE: 61 | typeString = "Double"; 62 | break; 63 | case ENUMERATION: 64 | typeString = "Enumeration"; 65 | break; 66 | default: 67 | typeString = "Undefined"; 68 | break; 69 | } 70 | 71 | return UTF8String( typeString ); 72 | } 73 | 74 | 75 | 76 | 77 | //########################################################################################## 78 | //************************* End Om Sound Filters Namespace ******************************* 79 | OM_SOUND_FILTERS_NAMESPACE_END 80 | //****************************************************************************************** 81 | //########################################################################################## 82 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/filters/omSoundFilterParameterValue.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #include "omSoundFilterParameterValue.h" 34 | 35 | 36 | //########################################################################################## 37 | //************************* Start Om Sound Filters Namespace ***************************** 38 | OM_SOUND_FILTERS_NAMESPACE_START 39 | //****************************************************************************************** 40 | //########################################################################################## 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | //########################################################################################## 49 | //************************* End Om Sound Filters Namespace ******************************* 50 | OM_SOUND_FILTERS_NAMESPACE_END 51 | //****************************************************************************************** 52 | //########################################################################################## 53 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/filters/omSoundFiltersConfig.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_SOUND_FILTERS_CONFIG_H 34 | #define INCLUDE_OM_SOUND_FILTERS_CONFIG_H 35 | 36 | 37 | #include "../omSoundConfig.h" 38 | 39 | 40 | #include "../omSoundBase.h" 41 | 42 | 43 | //########################################################################################## 44 | //************************* Start Om Sound Filters Namespace ***************************** 45 | OM_SOUND_FILTERS_NAMESPACE_START 46 | //****************************************************************************************** 47 | //########################################################################################## 48 | 49 | 50 | 51 | 52 | using om::sound::base::Gain; 53 | using om::sound::base::Sample32f; 54 | using om::sound::base::Sample64f; 55 | using om::sound::base::ComplexSample; 56 | using om::sound::base::SampleType; 57 | using om::sound::base::SoundBuffer; 58 | using om::sound::base::SharedBufferPool; 59 | using om::sound::base::SharedSoundBuffer; 60 | using om::sound::base::PanDirection; 61 | using om::sound::base::ChannelLayout; 62 | using om::sound::base::ChannelMixMatrix; 63 | using om::sound::base::SoundInputStream; 64 | using om::sound::base::SoundOutputStream; 65 | using om::sound::base::SoundInputStream; 66 | using om::sound::base::SoundOutputStream; 67 | using om::sound::base::MIDIMessage; 68 | using om::sound::base::MIDIEvent; 69 | using om::sound::base::MIDIBuffer; 70 | using om::sound::base::MIDITime; 71 | using om::sound::base::SoundFrame; 72 | using om::sound::base::SoundResult; 73 | 74 | 75 | 76 | 77 | //########################################################################################## 78 | //************************* End Om Sound Filters Namespace ******************************* 79 | OM_SOUND_FILTERS_NAMESPACE_END 80 | //****************************************************************************************** 81 | //########################################################################################## 82 | 83 | 84 | #endif // INCLUDE_OM_SOUND_FILTERS_CONFIG_H 85 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/omSoundBase.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_SOUND_BASE_H 34 | #define INCLUDE_OM_SOUND_BASE_H 35 | 36 | 37 | #include "base/omSoundBaseConfig.h" 38 | 39 | 40 | // Sample Information 41 | #include "base/omSoundInt24.h" 42 | #include "base/omSoundSample.h" 43 | #include "base/omSoundSampleType.h" 44 | 45 | 46 | // Speaker/Channel Management 47 | #include "base/omSoundChannelType.h" 48 | #include "base/omSoundChannelLayout.h" 49 | #include "base/omSoundChannelLayoutType.h" 50 | #include "base/omSoundPanDirection.h" 51 | 52 | // Sound Buffer Management Classes 53 | #include "base/omSoundBuffer.h" 54 | #include "base/omSoundSharedBufferPool.h" 55 | #include "base/omSoundSharedSoundBuffer.h" 56 | 57 | // Streaming Sound I/O Classes 58 | #include "base/omSoundInputStream.h" 59 | #include "base/omSoundOutputStream.h" 60 | #include "base/omSoundDataInputStream.h" 61 | 62 | // Sound Resource Management 63 | #include "base/omSoundFormat.h" 64 | #include "base/omSound.h" 65 | 66 | // Response Classes 67 | #include "base/omSoundDirectionalIR.h" 68 | #include "base/omSoundFrequencyData.h" 69 | #include "base/omSoundFrequencyBands.h" 70 | #include "base/omSoundSIMDCrossover.h" 71 | 72 | // MIDI Classes 73 | #include "base/omSoundMIDIMessage.h" 74 | #include "base/omSoundMIDIEvent.h" 75 | #include "base/omSoundMIDITime.h" 76 | #include "base/omSoundTimeSignature.h" 77 | #include "base/omSoundMIDIBuffer.h" 78 | 79 | // Sound Frame 80 | #include "base/omSoundFrame.h" 81 | #include "base/omSoundResult.h" 82 | 83 | #include "base/omSoundLerpState.h" 84 | 85 | 86 | #endif // INCLUDE_OM_SOUND_BASE_H 87 | -------------------------------------------------------------------------------- /ray_generator/src/Om/Om Sound/om/sound/omSoundFilters.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Project: Om Software 3 | * Version: 1.0.0 4 | * Website: http://www.carlschissler.com/om 5 | * Author(s): Carl Schissler 6 | * 7 | * Copyright (c) 2016, Carl Schissler 8 | * All rights reserved. 9 | * 10 | * Redistribution and use in source and binary forms, with or without 11 | * modification, are permitted provided that the following conditions are met: 12 | * 1. Redistributions of source code must retain the above copyright 13 | * notice, this list of conditions and the following disclaimer. 14 | * 2. Redistributions in binary form must reproduce the above copyright 15 | * notice, this list of conditions and the following disclaimer in the 16 | * documentation and/or other materials provided with the distribution. 17 | * 3. Neither the name of the copyright holder nor the 18 | * names of its contributors may be used to endorse or promote products 19 | * derived from this software without specific prior written permission. 20 | * 21 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 22 | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 23 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 24 | * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 25 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 26 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 27 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 28 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 29 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 30 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 31 | */ 32 | 33 | #ifndef INCLUDE_OM_SOUND_FILTERS_H 34 | #define INCLUDE_OM_SOUND_FILTERS_H 35 | 36 | 37 | #include "filters/omSoundFiltersConfig.h" 38 | 39 | 40 | // Base Framework Classes 41 | #include "filters/omSoundFilterVersion.h" 42 | #include "filters/omSoundFilterParameterInfo.h" 43 | #include "filters/omSoundFilterParameterType.h" 44 | #include "filters/omSoundFilterParameterValue.h" 45 | #include "filters/omSoundFilterParameterFlags.h" 46 | #include "filters/omSoundFilterParameter.h" 47 | #include "filters/omSoundFilterState.h" 48 | #include "filters/omSoundFilterPreset.h" 49 | #include "filters/omSoundFilter.h" 50 | 51 | 52 | // Equalization Filters 53 | #include "filters/omSoundCutoffFilter.h" 54 | 55 | 56 | // Reverb Filters 57 | #include "filters/omSoundReverbFilter.h" 58 | 59 | 60 | // Sound Sources/Destinations 61 | #include "filters/omSoundPlayer.h" 62 | 63 | 64 | // Dynamics Filters 65 | #include "filters/omSoundCompressor.h" 66 | #include "filters/omSoundLimiter.h" 67 | #include "filters/omSoundHDRFilter.h" 68 | 69 | 70 | // Sample Rate Conversion 71 | #include "filters/omSoundResampler.h" 72 | 73 | 74 | #endif // INCLUDE_OM_SOUND_FILTERS_H 75 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound.egg-info/SOURCES.txt: -------------------------------------------------------------------------------- 1 | LICENSE.txt 2 | README.md 3 | pyproject.toml 4 | setup.cfg 5 | setup.py 6 | src/pygsound/__init__.py 7 | src/pygsound.egg-info/PKG-INFO 8 | src/pygsound.egg-info/SOURCES.txt 9 | src/pygsound.egg-info/dependency_links.txt 10 | src/pygsound.egg-info/not-zip-safe 11 | src/pygsound.egg-info/requires.txt 12 | src/pygsound.egg-info/top_level.txt -------------------------------------------------------------------------------- /ray_generator/src/pygsound.egg-info/dependency_links.txt: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound.egg-info/not-zip-safe: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound.egg-info/requires.txt: -------------------------------------------------------------------------------- 1 | Cython 2 | numpy 3 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound.egg-info/top_level.txt: -------------------------------------------------------------------------------- 1 | pygsound 2 | pygsound/pygsound 3 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound/CMakeLists.txt: -------------------------------------------------------------------------------- 1 | project( pygsound ) 2 | 3 | set(CMAKE_CXX_STANDARD 14) 4 | set(CMAKE_CXX_STANDARD_REQUIRED ON) 5 | set(CMAKE_CXX_EXTENSIONS OFF) 6 | 7 | # May need this when building on RHEL 8 | #add_definitions(-D_GLIBCXX_USE_CXX11_ABI=0) 9 | 10 | # Add include directories 11 | include_directories(${CMAKE_CURRENT_SOURCE_DIR}/deps/include 12 | ${CMAKE_CURRENT_SOURCE_DIR}/src 13 | ) 14 | 15 | set( SOURCEFILES src/Context.cpp 16 | src/SoundMesh.cpp 17 | src/Scene.cpp 18 | src/SoundSource.cpp 19 | src/Listener.cpp 20 | src/MicrophoneArrays.cpp) 21 | 22 | message("Building pygsound release library") 23 | pybind11_add_module(pygsound SHARED ${SOURCEFILES} src/module.cpp) 24 | target_link_libraries( pygsound PRIVATE gsound) 25 | 26 | 27 | # Platform specific libraries 28 | if (APPLE) 29 | find_library(CARBON_LIBRARY Carbon) 30 | find_library(FOUNDATION_LIBRARY Foundation) 31 | find_library(CORE_FOUNDATION_LIBRARY CoreFoundation) 32 | find_library(CORE_SERVICES_LIBRARY CoreServices) 33 | 34 | target_link_libraries( pygsound PRIVATE ${CARBON_LIBRARY} ${FOUNDATION_LIBRARY} 35 | ${CORE_FOUNDATION_LIBRARY} ${CORE_SERVICES_LIBRARY}) 36 | endif() -------------------------------------------------------------------------------- /ray_generator/src/pygsound/__init__.py: -------------------------------------------------------------------------------- 1 | from .pygsound import * 2 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyizang/GSound-SIR/bf5acf368a5b80069702bdc1fe2b767c33d4ac80/ray_generator/src/pygsound/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /ray_generator/src/pygsound/src/Context.cpp: -------------------------------------------------------------------------------- 1 | #include "Context.hpp" 2 | 3 | //std::shared_ptr< Context > 4 | //Context::instance = std::make_shared< Context >(); 5 | 6 | Context::Context() 7 | { 8 | const gs::Float f[] = { 63.0f, 125.0f, 250.0f, 500.0f, 1000.0f, 2000.0f, 4000.0f, 8000.0f }; 9 | prop_request.frequencies = gs::FrequencyBands(f); 10 | prop_request.flags.set(gs::PropagationFlags::DIRECT, true); 11 | prop_request.flags.set(gs::PropagationFlags::SPECULAR, true); 12 | prop_request.flags.set(gs::PropagationFlags::DIFFUSE, true); 13 | prop_request.flags.set(gs::PropagationFlags::DIFFRACTION, true); 14 | prop_request.flags.set(gs::PropagationFlags::SOURCE_DIRECTIVITY, false); 15 | prop_request.flags.set(gs::PropagationFlags::DOPPLER_SORTING, false); 16 | prop_request.flags.set(gs::PropagationFlags::ADAPTIVE_QUALITY, false); 17 | prop_request.flags.set(gs::PropagationFlags::AIR_ABSORPTION, true); 18 | prop_request.flags.set(gs::PropagationFlags::ADAPTIVE_IR_LENGTH, true); 19 | prop_request.flags.set(gs::PropagationFlags::VISIBILITY_CACHE, true); 20 | prop_request.flags.set(gs::PropagationFlags::IR_THRESHOLD, true); 21 | prop_request.flags.set(gs::PropagationFlags::IR_CACHE, false); 22 | prop_request.flags.set(gs::PropagationFlags::DIFFUSE_CACHE, false); 23 | prop_request.flags.set(gs::PropagationFlags::SAMPLED_IR, false); 24 | prop_request.targetDt = 1.0f / 15.0f; 25 | prop_request.sampleRate = 16000; 26 | prop_request.numSpecularRays = 20000; 27 | prop_request.maxSpecularDepth = 200; 28 | prop_request.numSpecularSamples = 100; 29 | prop_request.numDiffuseRays = 20000; 30 | prop_request.maxDiffuseDepth = 200; 31 | prop_request.numDiffuseSamples = 3; 32 | prop_request.responseTime = 5.0; 33 | prop_request.maxIRLength = 3.0; 34 | prop_request.numThreads = 8; 35 | 36 | ir_request.ir = true; 37 | ir_request.metrics = false; 38 | ir_request.normalize = true; 39 | ir_request.channelLayout = gs::ChannelLayout::MONO; 40 | } 41 | 42 | Context::~Context() 43 | = default; 44 | 45 | gs::Size Context::getSpecularCount() 46 | { 47 | return prop_request.numSpecularRays; 48 | } 49 | 50 | void Context::setSpecularCount(gs::Size cnt) 51 | { 52 | prop_request.numSpecularRays = cnt; 53 | } 54 | 55 | gs::Size Context::getSpecularDepth() 56 | { 57 | return prop_request.maxSpecularDepth; 58 | } 59 | 60 | void Context::setSpecularDepth(gs::Size cnt) 61 | { 62 | prop_request.maxSpecularDepth = cnt; 63 | } 64 | 65 | gs::Size Context::getDiffuseCount() 66 | { 67 | return prop_request.numDiffuseRays; 68 | } 69 | 70 | void Context::setDiffuseCount(gs::Size cnt) 71 | { 72 | prop_request.numDiffuseRays = cnt; 73 | } 74 | 75 | gs::Size Context::getDiffuseDepth() 76 | { 77 | return prop_request.maxDiffuseDepth; 78 | } 79 | 80 | void Context::setDiffuseDepth(gs::Size cnt) 81 | { 82 | prop_request.maxDiffuseDepth = cnt; 83 | } 84 | 85 | gs::Size Context::getThreadsCount() 86 | { 87 | return prop_request.numThreads; 88 | } 89 | 90 | void Context::setThreadsCount(gs::Size cnt) 91 | { 92 | prop_request.numThreads = cnt; 93 | } 94 | 95 | gs::SampleRate Context::getSampleRate() 96 | { 97 | return prop_request.sampleRate; 98 | } 99 | 100 | void Context::setSampleRate(gs::SampleRate rate) 101 | { 102 | prop_request.sampleRate = rate; 103 | } 104 | 105 | oms::ChannelLayout::Type Context::getChannelLayout() 106 | { 107 | return ir_request.channelLayout.getType(); 108 | } 109 | 110 | void Context::setChannelLayout(oms::ChannelLayout::Type type) 111 | { 112 | ir_request.channelLayout.setType(type); 113 | } 114 | 115 | gs::Bool Context::getNormalize() 116 | { 117 | return ir_request.normalize; 118 | } 119 | 120 | void Context::setNormalize(gs::Bool flag) 121 | { 122 | ir_request.normalize = flag; 123 | } -------------------------------------------------------------------------------- /ray_generator/src/pygsound/src/Context.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INC_CONTEXT_HPP 2 | #define INC_CONTEXT_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | namespace gs = gsound; 9 | namespace oms = om::sound; 10 | 11 | class Context 12 | { 13 | public: 14 | 15 | //static std::shared_ptr< Context > instance; 16 | 17 | Context(); 18 | ~Context(); 19 | 20 | gs::IRRequest &internalIRReq() { return ir_request; } 21 | gs::PropagationRequest &internalPropReq() { return prop_request; } 22 | 23 | gs::Size getSpecularCount(); 24 | void setSpecularCount(gs::Size cnt); 25 | gs::Size getSpecularDepth(); 26 | void setSpecularDepth(gs::Size cnt); 27 | 28 | gs::Size getDiffuseCount(); 29 | void setDiffuseCount(gs::Size cnt); 30 | gs::Size getDiffuseDepth(); 31 | void setDiffuseDepth(gs::Size cnt); 32 | 33 | gs::Size getThreadsCount(); 34 | void setThreadsCount(gs::Size cnt); 35 | 36 | gs::SampleRate getSampleRate(); 37 | void setSampleRate(gs::SampleRate rate); 38 | 39 | oms::ChannelLayout::Type getChannelLayout(); 40 | void setChannelLayout(oms::ChannelLayout::Type type); 41 | 42 | gs::Bool getNormalize(); 43 | void setNormalize(gs::Bool flag); 44 | 45 | private: 46 | 47 | gs::IRRequest ir_request; 48 | gs::PropagationRequest prop_request; 49 | }; 50 | 51 | #endif // INC_CONTEXT_HPP 52 | 53 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound/src/Listener.cpp: -------------------------------------------------------------------------------- 1 | #include "Listener.hpp" 2 | #include 3 | 4 | namespace omm = om::math; 5 | 6 | Listener::Listener( std::vector _loc ) 7 | { 8 | setPosition( _loc ); 9 | m_listener.setSensitivity( 0 ); 10 | } 11 | 12 | void 13 | Listener::setPosition( const std::vector &_loc ) 14 | { 15 | m_listener.setTransform( omm::Transform3f( omm::Vector3f( _loc.data() ) )); 16 | } 17 | 18 | std::vector 19 | Listener::getPosition() const 20 | { 21 | auto vec = m_listener.getTransform(); 22 | 23 | std::vector ret; 24 | for ( int i = 0; i < 3; ++i ) 25 | ret.push_back( vec.position[i] ); 26 | 27 | return ret; 28 | } 29 | 30 | void 31 | Listener::setRadius( float _radius ) 32 | { 33 | m_listener.setRadius( _radius ); 34 | } 35 | 36 | float 37 | Listener::getRadius() const 38 | { 39 | return m_listener.getRadius(); 40 | } 41 | 42 | 43 | //void 44 | //Listener::setChannelLayoutType( oms::ChannelLayout::Type _layout ) 45 | //{ 46 | // m_listener.setChannelLayout( _layout ); 47 | //} 48 | // 49 | //oms::ChannelLayout::Type 50 | //Listener::getChannelLayoutType() const 51 | //{ 52 | // return m_listener.getChannelLayout().getType(); 53 | //} 54 | // 55 | // 56 | //void 57 | //Listener::setChannelLayout( oms::ChannelLayout _layout ) 58 | //{ 59 | // m_listener.setChannelLayout( _layout ); 60 | //} 61 | // 62 | //oms::ChannelLayout 63 | //Listener::getChannelLayout() const 64 | //{ 65 | // return m_listener.getChannelLayout(); 66 | //} 67 | // 68 | //void 69 | //Listener::setArrayLayout( oms::MicrophoneArrays _layout ) 70 | //{ 71 | // m_listener.setChannelLayout( _layout ); 72 | //} 73 | 74 | std::ostream & 75 | operator<<( std::ostream &_strm, const Listener &_list ) 76 | { 77 | auto vec = _list.m_listener.getTransform().position; 78 | 79 | _strm << "[ " << vec.x << ", " << vec.y << ", " << vec.z << " ]"; 80 | 81 | return _strm; 82 | } 83 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound/src/Listener.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INC_LISTENER_HPP 2 | #define INC_LISTENER_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | #include "MicrophoneArrays.hpp" 8 | 9 | namespace gs = gsound; 10 | namespace py = pybind11; 11 | namespace oms = om::sound; 12 | 13 | class Listener 14 | { 15 | public: 16 | 17 | explicit Listener( std::vector _loc ); 18 | 19 | void setPosition( const std::vector &_loc ); 20 | std::vector getPosition() const; 21 | 22 | void setRadius( float _radius ); 23 | float getRadius() const; 24 | 25 | // void setChannelLayoutType( oms::ChannelLayout::Type _layout ); 26 | // oms::ChannelLayout::Type getChannelLayoutType() const; 27 | // 28 | // void setChannelLayout( oms::ChannelLayout _layout ); 29 | // oms::ChannelLayout getChannelLayout() const; 30 | // 31 | // void setArrayLayout( oms::MicrophoneArrays _layout ); 32 | 33 | private: 34 | 35 | friend class Scene; 36 | friend std::ostream &operator<<( std::ostream &_strm, 37 | const Listener &_list ); 38 | 39 | gs::SoundListener m_listener; 40 | }; 41 | 42 | #endif // INC_LISTENER_HPP 43 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound/src/Python.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INC_PYTHON_HPP 2 | #define INC_PYTHON_HPP 3 | 4 | #include 5 | #include 6 | 7 | 8 | #endif // INC_PYTHON_HPP -------------------------------------------------------------------------------- /ray_generator/src/pygsound/src/Scene.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INC_SCENE_HPP 2 | #define INC_SCENE_HPP 3 | 4 | #include "Python.hpp" 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | 11 | namespace gs = gsound; 12 | namespace py = pybind11; 13 | 14 | class SoundMesh; 15 | class SoundSource; 16 | class Listener; 17 | class Context; 18 | 19 | class Scene 20 | { 21 | public: 22 | 23 | Scene(); 24 | 25 | void setMesh( SoundMesh &_mesh ); 26 | 27 | py::dict computeIR( std::vector &_sources, std::vector &_listeners, Context &_context ); 28 | py::dict computeIR( std::vector> &_sources, std::vector> &_listeners, Context &_context, 29 | float src_radius = 0.01, float src_power = 1.0, float lis_radius = 0.01); 30 | 31 | py::dict getPathData(std::vector &_sources, 32 | std::vector &_listeners, 33 | Context &_context, 34 | float energy_percentage = 100.0f, 35 | size_t max_rays = 0); 36 | py::dict getPathData(std::vector> &_sources, 37 | std::vector> &_listeners, 38 | Context &_context, 39 | float src_radius = 0.01f, 40 | float src_power = 1.0f, 41 | float lis_radius = 0.01f, 42 | float energy_percentage = 100.0f, 43 | size_t max_rays = 0); 44 | 45 | public: 46 | 47 | gs::SoundScene m_scene; 48 | gs::SoundObject m_soundObject; 49 | gs::SoundPropagator propagator; 50 | gs::SoundSceneIR sceneIR; 51 | 52 | }; 53 | 54 | #endif // INC_SCENE_HPP 55 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound/src/SoundMesh.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INC_SOUNDMESH_HPP 2 | #define INC_SOUNDMESH_HPP 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | class SoundMesh 11 | { 12 | public: 13 | 14 | static std::shared_ptr< SoundMesh > loadObj( const std::string &_path, float _forceabsorp = -1.0, float _forcescatter = -1.0 ); 15 | static std::shared_ptr< SoundMesh > createBox( float _width, float _length, float _height, float _absorp = 0.5, float _scatter = 0.1 ); 16 | static std::shared_ptr< SoundMesh > createBox( float _width, float _length, float _height, std::vector _absorp, float _scatter = 0.1 ); 17 | 18 | gsound::SoundMesh &mesh() { return m_mesh; } 19 | 20 | private: 21 | 22 | friend class Scene; 23 | 24 | gsound::SoundMesh m_mesh; 25 | }; 26 | 27 | #endif // INC_SOUNDMESH_HPP 28 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound/src/SoundSource.cpp: -------------------------------------------------------------------------------- 1 | #include "SoundSource.hpp" 2 | #include 3 | 4 | namespace omm = om::math; 5 | 6 | SoundSource::SoundSource( std::vector _loc ) 7 | { 8 | setPosition( _loc ); 9 | } 10 | 11 | void 12 | SoundSource::setPosition( const std::vector &_loc ) 13 | { 14 | m_source.setTransform( omm::Transform3f( omm::Vector3f( _loc.data() ) ) ); 15 | } 16 | 17 | std::vector 18 | SoundSource::getPosition() const 19 | { 20 | auto vec = m_source.getTransform(); 21 | 22 | std::vector ret; 23 | for ( int i = 0; i < 3; ++i ) 24 | ret.push_back( vec.position[i] ); 25 | 26 | return ret; 27 | } 28 | 29 | void 30 | SoundSource::setRadius( float _radius ) 31 | { 32 | m_source.setRadius( _radius ); 33 | } 34 | 35 | float 36 | SoundSource::getRadius() const 37 | { 38 | return m_source.getRadius(); 39 | } 40 | 41 | void 42 | SoundSource::setPower( float _power ) 43 | { 44 | m_source.setPower( _power ); 45 | } 46 | 47 | float 48 | SoundSource::getPower() const 49 | { 50 | return m_source.getPower(); 51 | } 52 | -------------------------------------------------------------------------------- /ray_generator/src/pygsound/src/SoundSource.hpp: -------------------------------------------------------------------------------- 1 | #ifndef INC_SOUNDSOURCE_HPP 2 | #define INC_SOUNDSOURCE_HPP 3 | 4 | #include "Python.hpp" 5 | #include 6 | 7 | namespace gs = gsound; 8 | namespace py = pybind11; 9 | 10 | class SoundSource 11 | { 12 | public: 13 | 14 | explicit SoundSource( std::vector _loc ); 15 | 16 | void setPosition( const std::vector &_loc ); 17 | std::vector getPosition() const; 18 | 19 | void setRadius( float _radius ); 20 | float getRadius() const; 21 | 22 | void setPower( float _power ); 23 | float getPower() const; 24 | 25 | private: 26 | 27 | friend class Scene; 28 | 29 | gs::SoundSource m_source; 30 | }; 31 | 32 | #endif // INC_SOUNDSOURCE_HPP 33 | -------------------------------------------------------------------------------- /ray_generator/tests/__init__.py: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyizang/GSound-SIR/bf5acf368a5b80069702bdc1fe2b767c33d4ac80/ray_generator/tests/__init__.py -------------------------------------------------------------------------------- /ray_generator/tests/__pycache__/__init__.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyizang/GSound-SIR/bf5acf368a5b80069702bdc1fe2b767c33d4ac80/ray_generator/tests/__pycache__/__init__.cpython-310.pyc -------------------------------------------------------------------------------- /ray_generator/tests/__pycache__/rir_test.cpython-310.pyc: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/yongyizang/GSound-SIR/bf5acf368a5b80069702bdc1fe2b767c33d4ac80/ray_generator/tests/__pycache__/rir_test.cpython-310.pyc --------------------------------------------------------------------------------