├── LICENSE ├── LICENSE.meta ├── Materials.meta ├── Materials ├── AugmentaObjectDebug.mat ├── AugmentaObjectDebug.mat.meta ├── AugmentaOrientationDebug.mat ├── AugmentaOrientationDebug.mat.meta ├── AugmentaSceneDebug.mat ├── AugmentaSceneDebug.mat.meta ├── AugmentaVelocityDebug.mat └── AugmentaVelocityDebug.mat.meta ├── Plugins.meta ├── Plugins ├── UnityOSC.meta └── UnityOSC │ ├── Lib.meta │ ├── Lib │ ├── OSC.meta │ ├── OSC │ │ ├── OSCBundle.cs │ │ ├── OSCBundle.cs.meta │ │ ├── OSCClient.cs │ │ ├── OSCClient.cs.meta │ │ ├── OSCMessage.cs │ │ ├── OSCMessage.cs.meta │ │ ├── OSCPacket.cs │ │ ├── OSCPacket.cs.meta │ │ ├── OSCReceiver.cs │ │ ├── OSCReceiver.cs.meta │ │ ├── OSCServer.cs │ │ └── OSCServer.cs.meta │ ├── OSCHandler.cs │ └── OSCHandler.cs.meta │ ├── OSCMaster.cs │ ├── OSCMaster.cs.meta │ ├── README.md │ └── README.md.meta ├── Prefabs.meta ├── Prefabs ├── Augmenta.prefab ├── Augmenta.prefab.meta ├── AugmentaVideoOutput.prefab ├── AugmentaVideoOutput.prefab.meta ├── AugmentaVideoOutputWithCamera.prefab ├── AugmentaVideoOutputWithCamera.prefab.meta ├── AugmentaWithCamera.prefab ├── AugmentaWithCamera.prefab.meta ├── Debug.meta └── Debug │ ├── AugmentaObject.prefab │ ├── AugmentaObject.prefab.meta │ ├── AugmentaScene.prefab │ └── AugmentaScene.prefab.meta ├── README.md ├── README.md.meta ├── Scripts.meta ├── Scripts ├── AugmentaCamera.cs ├── AugmentaCamera.cs.meta ├── AugmentaManager.cs ├── AugmentaManager.cs.meta ├── AugmentaObject.cs ├── AugmentaObject.cs.meta ├── AugmentaObjectBehaviour.cs ├── AugmentaObjectBehaviour.cs.meta ├── AugmentaScene.cs ├── AugmentaScene.cs.meta ├── AugmentaSceneCamera.cs ├── AugmentaSceneCamera.cs.meta ├── AugmentaVideoOutput.cs ├── AugmentaVideoOutput.cs.meta ├── AugmentaVideoOutputCamera.cs ├── AugmentaVideoOutputCamera.cs.meta ├── Editor.meta └── Editor │ ├── AugmentaManagerEditor.cs │ ├── AugmentaManagerEditor.cs.meta │ ├── AugmentaSceneCameraEditor.cs │ ├── AugmentaSceneCameraEditor.cs.meta │ ├── AugmentaVideoOutputCameraEditor.cs │ ├── AugmentaVideoOutputCameraEditor.cs.meta │ ├── AugmentaVideoOutputEditor.cs │ └── AugmentaVideoOutputEditor.cs.meta ├── Shaders.meta ├── Shaders ├── CameraDisplayTexture.shader ├── CameraDisplayTexture.shader.meta ├── UnlitTextureAlwaysOnTop.shader ├── UnlitTextureAlwaysOnTop.shader.meta ├── UnlitTextureColor.shader └── UnlitTextureColor.shader.meta ├── Textures.meta └── Textures ├── Black.png ├── Black.png.meta ├── Transparent.png ├── Transparent.png.meta ├── White.png ├── White.png.meta ├── checker.png ├── checker.png.meta ├── cross.png ├── cross.png.meta ├── cross_borders.png └── cross_borders.png.meta /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2018 THÉORIZ 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7aee17a356e07db4f8f2c0dd10cffcba 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: da3b317cfea82f4448539067a96d5c58 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Materials/AugmentaObjectDebug.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AugmentaObjectDebug 11 | m_Shader: {fileID: 4800000, guid: 0eea18b359b788a46bd2301d86894c00, type: 3} 12 | m_ShaderKeywords: _USEBORDER_ON _USETEXTURE_ON 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 2800000, guid: dc8326fbacbbea1429b478e3d7bb4f08, type: 3} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BorderThickness: 0.05 60 | - _BumpScale: 1 61 | - _Cutoff: 0.5 62 | - _DetailNormalMapScale: 1 63 | - _DstBlend: 0 64 | - _GlossMapScale: 1 65 | - _Glossiness: 0.5 66 | - _GlossyReflections: 1 67 | - _Metallic: 0 68 | - _Mode: 0 69 | - _OcclusionStrength: 1 70 | - _Parallax: 0.02 71 | - _SmoothnessTextureChannel: 0 72 | - _SpecularHighlights: 1 73 | - _SrcBlend: 1 74 | - _Transparency: 1 75 | - _UVSec: 0 76 | - _UseBorder: 1 77 | - _UseTexture: 1 78 | - _ZWrite: 1 79 | m_Colors: 80 | - _BorderColor: {r: 1, g: 0, b: 0, a: 1} 81 | - _CenterColor: {r: 1, g: 1, b: 1, a: 1} 82 | - _Color: {r: 1, g: 1, b: 1, a: 1} 83 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 84 | -------------------------------------------------------------------------------- /Materials/AugmentaObjectDebug.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5565f52ee1ec29741ae6add23be6671b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Materials/AugmentaOrientationDebug.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AugmentaOrientationDebug 11 | m_Shader: {fileID: 4800000, guid: 0eea18b359b788a46bd2301d86894c00, type: 3} 12 | m_ShaderKeywords: _EMISSION _NORMALMAP_TANGENT_SPACE 13 | m_LightmapFlags: 1 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: 19 | - DistortionVectors 20 | - MOTIONVECTORS 21 | - TransparentDepthPrepass 22 | - TransparentDepthPostpass 23 | - TransparentBackface 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _AnisotropyMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BaseColorMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _BentNormalMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _BentNormalMapOS: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _BumpMap: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _CoatMaskMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DetailAlbedoMap: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _DetailMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _DetailMask: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _DetailNormalMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _DistortionVectorMap: 68 | m_Texture: {fileID: 0} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _EmissionMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _EmissiveColorMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - _HeightMap: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - _IridescenceMaskMap: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - _IridescenceThicknessMap: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | - _MainTex: 92 | m_Texture: {fileID: 0} 93 | m_Scale: {x: 1, y: 1} 94 | m_Offset: {x: 0, y: 0} 95 | - _MaskMap: 96 | m_Texture: {fileID: 0} 97 | m_Scale: {x: 1, y: 1} 98 | m_Offset: {x: 0, y: 0} 99 | - _MetallicGlossMap: 100 | m_Texture: {fileID: 0} 101 | m_Scale: {x: 1, y: 1} 102 | m_Offset: {x: 0, y: 0} 103 | - _NormalMap: 104 | m_Texture: {fileID: 0} 105 | m_Scale: {x: 1, y: 1} 106 | m_Offset: {x: 0, y: 0} 107 | - _NormalMapOS: 108 | m_Texture: {fileID: 0} 109 | m_Scale: {x: 1, y: 1} 110 | m_Offset: {x: 0, y: 0} 111 | - _OcclusionMap: 112 | m_Texture: {fileID: 0} 113 | m_Scale: {x: 1, y: 1} 114 | m_Offset: {x: 0, y: 0} 115 | - _ParallaxMap: 116 | m_Texture: {fileID: 0} 117 | m_Scale: {x: 1, y: 1} 118 | m_Offset: {x: 0, y: 0} 119 | - _SpecularColorMap: 120 | m_Texture: {fileID: 0} 121 | m_Scale: {x: 1, y: 1} 122 | m_Offset: {x: 0, y: 0} 123 | - _SubsurfaceMaskMap: 124 | m_Texture: {fileID: 0} 125 | m_Scale: {x: 1, y: 1} 126 | m_Offset: {x: 0, y: 0} 127 | - _TangentMap: 128 | m_Texture: {fileID: 0} 129 | m_Scale: {x: 1, y: 1} 130 | m_Offset: {x: 0, y: 0} 131 | - _TangentMapOS: 132 | m_Texture: {fileID: 0} 133 | m_Scale: {x: 1, y: 1} 134 | m_Offset: {x: 0, y: 0} 135 | - _ThicknessMap: 136 | m_Texture: {fileID: 0} 137 | m_Scale: {x: 1, y: 1} 138 | m_Offset: {x: 0, y: 0} 139 | - _TransmittanceColorMap: 140 | m_Texture: {fileID: 0} 141 | m_Scale: {x: 1, y: 1} 142 | m_Offset: {x: 0, y: 0} 143 | m_Floats: 144 | - _AORemapMax: 1 145 | - _AORemapMin: 0 146 | - _ATDistance: 1 147 | - _AddPrecomputedVelocity: 0 148 | - _AlbedoAffectEmissive: 0 149 | - _AlphaCutoff: 0.5 150 | - _AlphaCutoffEnable: 0 151 | - _AlphaCutoffPostpass: 0.5 152 | - _AlphaCutoffPrepass: 0.5 153 | - _AlphaCutoffShadow: 0.5 154 | - _AlphaDstBlend: 0 155 | - _AlphaSrcBlend: 1 156 | - _Anisotropy: 0 157 | - _BlendMode: 0 158 | - _BumpScale: 1 159 | - _CoatMask: 0 160 | - _CullMode: 2 161 | - _CullModeForward: 2 162 | - _Cutoff: 0.5 163 | - _DepthOffsetEnable: 0 164 | - _DetailAlbedoScale: 1 165 | - _DetailNormalMapScale: 1 166 | - _DetailNormalScale: 1 167 | - _DetailSmoothnessScale: 1 168 | - _DiffusionProfile: 0 169 | - _DiffusionProfileHash: 0 170 | - _DisplacementLockObjectScale: 1 171 | - _DisplacementLockTilingScale: 1 172 | - _DisplacementMode: 0 173 | - _DistortionBlendMode: 0 174 | - _DistortionBlurBlendMode: 0 175 | - _DistortionBlurDstBlend: 1 176 | - _DistortionBlurRemapMax: 1 177 | - _DistortionBlurRemapMin: 0 178 | - _DistortionBlurScale: 1 179 | - _DistortionBlurSrcBlend: 1 180 | - _DistortionDepthTest: 1 181 | - _DistortionDstBlend: 1 182 | - _DistortionEnable: 0 183 | - _DistortionScale: 1 184 | - _DistortionSrcBlend: 1 185 | - _DistortionVectorBias: -1 186 | - _DistortionVectorScale: 2 187 | - _DoubleSidedEnable: 0 188 | - _DoubleSidedNormalMode: 1 189 | - _DstBlend: 0 190 | - _EmissiveColorMode: 1 191 | - _EmissiveExposureWeight: 1 192 | - _EmissiveIntensity: 1 193 | - _EmissiveIntensityUnit: 0 194 | - _EnableBlendModePreserveSpecularLighting: 1 195 | - _EnableFogOnTransparent: 1 196 | - _EnableGeometricSpecularAA: 0 197 | - _EnergyConservingSpecularColor: 1 198 | - _GlossMapScale: 1 199 | - _Glossiness: 0.5 200 | - _GlossyReflections: 1 201 | - _HeightAmplitude: 0.02 202 | - _HeightCenter: 0.5 203 | - _HeightMapParametrization: 0 204 | - _HeightMax: 1 205 | - _HeightMin: -1 206 | - _HeightOffset: 0 207 | - _HeightPoMAmplitude: 2 208 | - _HeightTessAmplitude: 2 209 | - _HeightTessCenter: 0.5 210 | - _InvTilingScale: 1 211 | - _Ior: 1.5 212 | - _IridescenceMask: 1 213 | - _IridescenceThickness: 1 214 | - _LinkDetailsWithBase: 0 215 | - _MaterialID: 1 216 | - _Metallic: 0 217 | - _Mode: 0 218 | - _NormalMapSpace: 0 219 | - _NormalScale: 1 220 | - _OcclusionStrength: 1 221 | - _PPDLodThreshold: 5 222 | - _PPDMaxSamples: 15 223 | - _PPDMinSamples: 5 224 | - _PPDPrimitiveLength: 1 225 | - _PPDPrimitiveWidth: 1 226 | - _Parallax: 0.02 227 | - _ReceivesSSR: 1 228 | - _RefractionModel: 0 229 | - _SSRefractionProjectionModel: 0 230 | - _Smoothness: 0.5 231 | - _SmoothnessRemapMax: 0.5 232 | - _SmoothnessRemapMin: 0 233 | - _SmoothnessTextureChannel: 0 234 | - _SpecularAAScreenSpaceVariance: 0.1 235 | - _SpecularAAThreshold: 0.2 236 | - _SpecularHighlights: 1 237 | - _SpecularOcclusionMode: 1 238 | - _SrcBlend: 1 239 | - _StencilRef: 0 240 | - _StencilRefDepth: 8 241 | - _StencilRefDistortionVec: 4 242 | - _StencilRefGBuffer: 10 243 | - _StencilRefMV: 40 244 | - _StencilWriteMask: 6 245 | - _StencilWriteMaskDepth: 8 246 | - _StencilWriteMaskDistortionVec: 4 247 | - _StencilWriteMaskGBuffer: 14 248 | - _StencilWriteMaskMV: 40 249 | - _SubsurfaceMask: 1 250 | - _SupportDecals: 1 251 | - _SurfaceType: 0 252 | - _TexWorldScale: 1 253 | - _TexWorldScaleEmissive: 1 254 | - _Thickness: 1 255 | - _TransmissionEnable: 1 256 | - _TransparentBackfaceEnable: 0 257 | - _TransparentCullMode: 2 258 | - _TransparentDepthPostpassEnable: 0 259 | - _TransparentDepthPrepassEnable: 0 260 | - _TransparentSortPriority: 0 261 | - _TransparentWritingMotionVec: 0 262 | - _TransparentZWrite: 0 263 | - _UVBase: 0 264 | - _UVDetail: 0 265 | - _UVEmissive: 0 266 | - _UVSec: 0 267 | - _UseEmissiveIntensity: 0 268 | - _UseShadowThreshold: 0 269 | - _ZTestDepthEqualForOpaque: 3 270 | - _ZTestGBuffer: 4 271 | - _ZTestModeDistortion: 4 272 | - _ZTestTransparent: 4 273 | - _ZWrite: 1 274 | m_Colors: 275 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 276 | - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} 277 | - _Color: {r: 1, g: 0.26666668, b: 0, a: 1} 278 | - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} 279 | - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} 280 | - _EmissionColor: {r: 1, g: 0.26666668, b: 0, a: 1} 281 | - _EmissiveColor: {r: 1, g: 0.27507278, b: 0, a: 1} 282 | - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} 283 | - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} 284 | - _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} 285 | - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} 286 | - _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} 287 | - _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} 288 | - _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} 289 | - _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} 290 | - _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} 291 | m_BuildTextureStacks: [] 292 | --- !u!114 &9180404367684576145 293 | MonoBehaviour: 294 | m_ObjectHideFlags: 11 295 | m_CorrespondingSourceObject: {fileID: 0} 296 | m_PrefabInstance: {fileID: 0} 297 | m_PrefabAsset: {fileID: 0} 298 | m_GameObject: {fileID: 0} 299 | m_Enabled: 1 300 | m_EditorHideFlags: 0 301 | m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} 302 | m_Name: 303 | m_EditorClassIdentifier: 304 | version: 2 305 | -------------------------------------------------------------------------------- /Materials/AugmentaOrientationDebug.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 720106550ad579446883f2c8f5a30219 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Materials/AugmentaSceneDebug.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AugmentaSceneDebug 11 | m_Shader: {fileID: 4800000, guid: 0eea18b359b788a46bd2301d86894c00, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: 19 | - DistortionVectors 20 | - MOTIONVECTORS 21 | m_SavedProperties: 22 | serializedVersion: 3 23 | m_TexEnvs: 24 | - _BumpMap: 25 | m_Texture: {fileID: 0} 26 | m_Scale: {x: 1, y: 1} 27 | m_Offset: {x: 0, y: 0} 28 | - _DetailAlbedoMap: 29 | m_Texture: {fileID: 0} 30 | m_Scale: {x: 1, y: 1} 31 | m_Offset: {x: 0, y: 0} 32 | - _DetailMask: 33 | m_Texture: {fileID: 0} 34 | m_Scale: {x: 1, y: 1} 35 | m_Offset: {x: 0, y: 0} 36 | - _DetailNormalMap: 37 | m_Texture: {fileID: 0} 38 | m_Scale: {x: 1, y: 1} 39 | m_Offset: {x: 0, y: 0} 40 | - _DistortionVectorMap: 41 | m_Texture: {fileID: 0} 42 | m_Scale: {x: 1, y: 1} 43 | m_Offset: {x: 0, y: 0} 44 | - _EmissionMap: 45 | m_Texture: {fileID: 0} 46 | m_Scale: {x: 1, y: 1} 47 | m_Offset: {x: 0, y: 0} 48 | - _EmissiveColorMap: 49 | m_Texture: {fileID: 0} 50 | m_Scale: {x: 1, y: 1} 51 | m_Offset: {x: 0, y: 0} 52 | - _MainTex: 53 | m_Texture: {fileID: 2800000, guid: b779b90a173440d4ea9971d2257d2cd8, type: 3} 54 | m_Scale: {x: 1, y: 1} 55 | m_Offset: {x: 0, y: 0} 56 | - _MetallicGlossMap: 57 | m_Texture: {fileID: 0} 58 | m_Scale: {x: 1, y: 1} 59 | m_Offset: {x: 0, y: 0} 60 | - _OcclusionMap: 61 | m_Texture: {fileID: 0} 62 | m_Scale: {x: 1, y: 1} 63 | m_Offset: {x: 0, y: 0} 64 | - _ParallaxMap: 65 | m_Texture: {fileID: 0} 66 | m_Scale: {x: 1, y: 1} 67 | m_Offset: {x: 0, y: 0} 68 | - _UnlitColorMap: 69 | m_Texture: {fileID: 10309, guid: 0000000000000000f000000000000000, type: 0} 70 | m_Scale: {x: 1, y: 1} 71 | m_Offset: {x: 0, y: 0} 72 | m_Floats: 73 | - _AddPrecomputedVelocity: 0 74 | - _AlbedoAffectEmissive: 0 75 | - _AlphaCutoff: 0.5 76 | - _AlphaCutoffEnable: 0 77 | - _AlphaDstBlend: 0 78 | - _AlphaSrcBlend: 1 79 | - _BlendMode: 0 80 | - _BumpScale: 1 81 | - _CullMode: 2 82 | - _Cutoff: 0.5 83 | - _DetailNormalMapScale: 1 84 | - _DistortionBlendMode: 0 85 | - _DistortionBlurBlendMode: 0 86 | - _DistortionBlurDstBlend: 1 87 | - _DistortionBlurRemapMax: 1 88 | - _DistortionBlurRemapMin: 0 89 | - _DistortionBlurScale: 1 90 | - _DistortionBlurSrcBlend: 1 91 | - _DistortionDepthTest: 1 92 | - _DistortionDstBlend: 1 93 | - _DistortionEnable: 0 94 | - _DistortionOnly: 0 95 | - _DistortionScale: 1 96 | - _DistortionSrcBlend: 1 97 | - _DistortionVectorBias: -1 98 | - _DistortionVectorScale: 2 99 | - _DoubleSidedEnable: 0 100 | - _DstBlend: 0 101 | - _EmissiveExposureWeight: 1 102 | - _EmissiveIntensity: 1 103 | - _EmissiveIntensityUnit: 0 104 | - _EnableFogOnTransparent: 0 105 | - _GlossMapScale: 1 106 | - _Glossiness: 0.5 107 | - _GlossyReflections: 1 108 | - _IncludeIndirectLighting: 1 109 | - _Metallic: 0 110 | - _Mode: 0 111 | - _OcclusionStrength: 1 112 | - _Parallax: 0.02 113 | - _SmoothnessTextureChannel: 0 114 | - _SpecularHighlights: 1 115 | - _SrcBlend: 1 116 | - _StencilRef: 0 117 | - _StencilRefDepth: 0 118 | - _StencilRefDistortionVec: 4 119 | - _StencilRefMV: 32 120 | - _StencilWriteMask: 6 121 | - _StencilWriteMaskDepth: 8 122 | - _StencilWriteMaskDistortionVec: 4 123 | - _StencilWriteMaskMV: 40 124 | - _SurfaceType: 0 125 | - _TransparentCullMode: 2 126 | - _TransparentSortPriority: 0 127 | - _TransparentZWrite: 0 128 | - _UVSec: 0 129 | - _UseEmissiveIntensity: 0 130 | - _ZTestDepthEqualForOpaque: 3 131 | - _ZTestModeDistortion: 4 132 | - _ZTestTransparent: 4 133 | - _ZWrite: 1 134 | m_Colors: 135 | - _Color: {r: 1, g: 1, b: 1, a: 1} 136 | - _EmissionColor: {r: 1, g: 1, b: 1, a: 1} 137 | - _EmissiveColor: {r: 0, g: 0, b: 0, a: 1} 138 | - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} 139 | - _UnlitColor: {r: 1, g: 1, b: 1, a: 1} 140 | - _UnlitColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} 141 | m_BuildTextureStacks: [] 142 | --- !u!114 &8072735581076853413 143 | MonoBehaviour: 144 | m_ObjectHideFlags: 11 145 | m_CorrespondingSourceObject: {fileID: 0} 146 | m_PrefabInstance: {fileID: 0} 147 | m_PrefabAsset: {fileID: 0} 148 | m_GameObject: {fileID: 0} 149 | m_Enabled: 1 150 | m_EditorHideFlags: 0 151 | m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} 152 | m_Name: 153 | m_EditorClassIdentifier: 154 | version: 2 155 | -------------------------------------------------------------------------------- /Materials/AugmentaSceneDebug.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d895c72d4749de34c910f12e6fc4048b 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Materials/AugmentaVelocityDebug.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: AugmentaVelocityDebug 11 | m_Shader: {fileID: 4800000, guid: 0eea18b359b788a46bd2301d86894c00, type: 3} 12 | m_ShaderKeywords: _EMISSION _NORMALMAP_TANGENT_SPACE 13 | m_LightmapFlags: 1 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: 19 | - DistortionVectors 20 | - MOTIONVECTORS 21 | - TransparentDepthPrepass 22 | - TransparentDepthPostpass 23 | - TransparentBackface 24 | m_SavedProperties: 25 | serializedVersion: 3 26 | m_TexEnvs: 27 | - _AnisotropyMap: 28 | m_Texture: {fileID: 0} 29 | m_Scale: {x: 1, y: 1} 30 | m_Offset: {x: 0, y: 0} 31 | - _BaseColorMap: 32 | m_Texture: {fileID: 0} 33 | m_Scale: {x: 1, y: 1} 34 | m_Offset: {x: 0, y: 0} 35 | - _BentNormalMap: 36 | m_Texture: {fileID: 0} 37 | m_Scale: {x: 1, y: 1} 38 | m_Offset: {x: 0, y: 0} 39 | - _BentNormalMapOS: 40 | m_Texture: {fileID: 0} 41 | m_Scale: {x: 1, y: 1} 42 | m_Offset: {x: 0, y: 0} 43 | - _BumpMap: 44 | m_Texture: {fileID: 0} 45 | m_Scale: {x: 1, y: 1} 46 | m_Offset: {x: 0, y: 0} 47 | - _CoatMaskMap: 48 | m_Texture: {fileID: 0} 49 | m_Scale: {x: 1, y: 1} 50 | m_Offset: {x: 0, y: 0} 51 | - _DetailAlbedoMap: 52 | m_Texture: {fileID: 0} 53 | m_Scale: {x: 1, y: 1} 54 | m_Offset: {x: 0, y: 0} 55 | - _DetailMap: 56 | m_Texture: {fileID: 0} 57 | m_Scale: {x: 1, y: 1} 58 | m_Offset: {x: 0, y: 0} 59 | - _DetailMask: 60 | m_Texture: {fileID: 0} 61 | m_Scale: {x: 1, y: 1} 62 | m_Offset: {x: 0, y: 0} 63 | - _DetailNormalMap: 64 | m_Texture: {fileID: 0} 65 | m_Scale: {x: 1, y: 1} 66 | m_Offset: {x: 0, y: 0} 67 | - _DistortionVectorMap: 68 | m_Texture: {fileID: 0} 69 | m_Scale: {x: 1, y: 1} 70 | m_Offset: {x: 0, y: 0} 71 | - _EmissionMap: 72 | m_Texture: {fileID: 0} 73 | m_Scale: {x: 1, y: 1} 74 | m_Offset: {x: 0, y: 0} 75 | - _EmissiveColorMap: 76 | m_Texture: {fileID: 0} 77 | m_Scale: {x: 1, y: 1} 78 | m_Offset: {x: 0, y: 0} 79 | - _HeightMap: 80 | m_Texture: {fileID: 0} 81 | m_Scale: {x: 1, y: 1} 82 | m_Offset: {x: 0, y: 0} 83 | - _IridescenceMaskMap: 84 | m_Texture: {fileID: 0} 85 | m_Scale: {x: 1, y: 1} 86 | m_Offset: {x: 0, y: 0} 87 | - _IridescenceThicknessMap: 88 | m_Texture: {fileID: 0} 89 | m_Scale: {x: 1, y: 1} 90 | m_Offset: {x: 0, y: 0} 91 | - _MainTex: 92 | m_Texture: {fileID: 0} 93 | m_Scale: {x: 1, y: 1} 94 | m_Offset: {x: 0, y: 0} 95 | - _MaskMap: 96 | m_Texture: {fileID: 0} 97 | m_Scale: {x: 1, y: 1} 98 | m_Offset: {x: 0, y: 0} 99 | - _MetallicGlossMap: 100 | m_Texture: {fileID: 0} 101 | m_Scale: {x: 1, y: 1} 102 | m_Offset: {x: 0, y: 0} 103 | - _NormalMap: 104 | m_Texture: {fileID: 0} 105 | m_Scale: {x: 1, y: 1} 106 | m_Offset: {x: 0, y: 0} 107 | - _NormalMapOS: 108 | m_Texture: {fileID: 0} 109 | m_Scale: {x: 1, y: 1} 110 | m_Offset: {x: 0, y: 0} 111 | - _OcclusionMap: 112 | m_Texture: {fileID: 0} 113 | m_Scale: {x: 1, y: 1} 114 | m_Offset: {x: 0, y: 0} 115 | - _ParallaxMap: 116 | m_Texture: {fileID: 0} 117 | m_Scale: {x: 1, y: 1} 118 | m_Offset: {x: 0, y: 0} 119 | - _SpecularColorMap: 120 | m_Texture: {fileID: 0} 121 | m_Scale: {x: 1, y: 1} 122 | m_Offset: {x: 0, y: 0} 123 | - _SubsurfaceMaskMap: 124 | m_Texture: {fileID: 0} 125 | m_Scale: {x: 1, y: 1} 126 | m_Offset: {x: 0, y: 0} 127 | - _TangentMap: 128 | m_Texture: {fileID: 0} 129 | m_Scale: {x: 1, y: 1} 130 | m_Offset: {x: 0, y: 0} 131 | - _TangentMapOS: 132 | m_Texture: {fileID: 0} 133 | m_Scale: {x: 1, y: 1} 134 | m_Offset: {x: 0, y: 0} 135 | - _ThicknessMap: 136 | m_Texture: {fileID: 0} 137 | m_Scale: {x: 1, y: 1} 138 | m_Offset: {x: 0, y: 0} 139 | - _TransmittanceColorMap: 140 | m_Texture: {fileID: 0} 141 | m_Scale: {x: 1, y: 1} 142 | m_Offset: {x: 0, y: 0} 143 | m_Floats: 144 | - _AORemapMax: 1 145 | - _AORemapMin: 0 146 | - _ATDistance: 1 147 | - _AddPrecomputedVelocity: 0 148 | - _AlbedoAffectEmissive: 0 149 | - _AlphaCutoff: 0.5 150 | - _AlphaCutoffEnable: 0 151 | - _AlphaCutoffPostpass: 0.5 152 | - _AlphaCutoffPrepass: 0.5 153 | - _AlphaCutoffShadow: 0.5 154 | - _AlphaDstBlend: 0 155 | - _AlphaSrcBlend: 1 156 | - _Anisotropy: 0 157 | - _BlendMode: 0 158 | - _BumpScale: 1 159 | - _CoatMask: 0 160 | - _CullMode: 2 161 | - _CullModeForward: 2 162 | - _Cutoff: 0.5 163 | - _DepthOffsetEnable: 0 164 | - _DetailAlbedoScale: 1 165 | - _DetailNormalMapScale: 1 166 | - _DetailNormalScale: 1 167 | - _DetailSmoothnessScale: 1 168 | - _DiffusionProfile: 0 169 | - _DiffusionProfileHash: 0 170 | - _DisplacementLockObjectScale: 1 171 | - _DisplacementLockTilingScale: 1 172 | - _DisplacementMode: 0 173 | - _DistortionBlendMode: 0 174 | - _DistortionBlurBlendMode: 0 175 | - _DistortionBlurDstBlend: 1 176 | - _DistortionBlurRemapMax: 1 177 | - _DistortionBlurRemapMin: 0 178 | - _DistortionBlurScale: 1 179 | - _DistortionBlurSrcBlend: 1 180 | - _DistortionDepthTest: 1 181 | - _DistortionDstBlend: 1 182 | - _DistortionEnable: 0 183 | - _DistortionScale: 1 184 | - _DistortionSrcBlend: 1 185 | - _DistortionVectorBias: -1 186 | - _DistortionVectorScale: 2 187 | - _DoubleSidedEnable: 0 188 | - _DoubleSidedNormalMode: 1 189 | - _DstBlend: 0 190 | - _EmissiveColorMode: 1 191 | - _EmissiveExposureWeight: 1 192 | - _EmissiveIntensity: 1 193 | - _EmissiveIntensityUnit: 0 194 | - _EnableBlendModePreserveSpecularLighting: 1 195 | - _EnableFogOnTransparent: 1 196 | - _EnableGeometricSpecularAA: 0 197 | - _EnergyConservingSpecularColor: 1 198 | - _GlossMapScale: 1 199 | - _Glossiness: 0.5 200 | - _GlossyReflections: 1 201 | - _HeightAmplitude: 0.02 202 | - _HeightCenter: 0.5 203 | - _HeightMapParametrization: 0 204 | - _HeightMax: 1 205 | - _HeightMin: -1 206 | - _HeightOffset: 0 207 | - _HeightPoMAmplitude: 2 208 | - _HeightTessAmplitude: 2 209 | - _HeightTessCenter: 0.5 210 | - _InvTilingScale: 1 211 | - _Ior: 1.5 212 | - _IridescenceMask: 1 213 | - _IridescenceThickness: 1 214 | - _LinkDetailsWithBase: 0 215 | - _MaterialID: 1 216 | - _Metallic: 0 217 | - _Mode: 0 218 | - _NormalMapSpace: 0 219 | - _NormalScale: 1 220 | - _OcclusionStrength: 1 221 | - _PPDLodThreshold: 5 222 | - _PPDMaxSamples: 15 223 | - _PPDMinSamples: 5 224 | - _PPDPrimitiveLength: 1 225 | - _PPDPrimitiveWidth: 1 226 | - _Parallax: 0.02 227 | - _ReceivesSSR: 1 228 | - _RefractionModel: 0 229 | - _SSRefractionProjectionModel: 0 230 | - _Smoothness: 0.5 231 | - _SmoothnessRemapMax: 0.5 232 | - _SmoothnessRemapMin: 0 233 | - _SmoothnessTextureChannel: 0 234 | - _SpecularAAScreenSpaceVariance: 0.1 235 | - _SpecularAAThreshold: 0.2 236 | - _SpecularHighlights: 1 237 | - _SpecularOcclusionMode: 1 238 | - _SrcBlend: 1 239 | - _StencilRef: 0 240 | - _StencilRefDepth: 8 241 | - _StencilRefDistortionVec: 4 242 | - _StencilRefGBuffer: 10 243 | - _StencilRefMV: 40 244 | - _StencilWriteMask: 6 245 | - _StencilWriteMaskDepth: 8 246 | - _StencilWriteMaskDistortionVec: 4 247 | - _StencilWriteMaskGBuffer: 14 248 | - _StencilWriteMaskMV: 40 249 | - _SubsurfaceMask: 1 250 | - _SupportDecals: 1 251 | - _SurfaceType: 0 252 | - _TexWorldScale: 1 253 | - _TexWorldScaleEmissive: 1 254 | - _Thickness: 1 255 | - _TransmissionEnable: 1 256 | - _TransparentBackfaceEnable: 0 257 | - _TransparentCullMode: 2 258 | - _TransparentDepthPostpassEnable: 0 259 | - _TransparentDepthPrepassEnable: 0 260 | - _TransparentSortPriority: 0 261 | - _TransparentWritingMotionVec: 0 262 | - _TransparentZWrite: 0 263 | - _UVBase: 0 264 | - _UVDetail: 0 265 | - _UVEmissive: 0 266 | - _UVSec: 0 267 | - _UseEmissiveIntensity: 0 268 | - _UseShadowThreshold: 0 269 | - _ZTestDepthEqualForOpaque: 3 270 | - _ZTestGBuffer: 4 271 | - _ZTestModeDistortion: 4 272 | - _ZTestTransparent: 4 273 | - _ZWrite: 1 274 | m_Colors: 275 | - _BaseColor: {r: 1, g: 1, b: 1, a: 1} 276 | - _BaseColorMap_MipInfo: {r: 0, g: 0, b: 0, a: 0} 277 | - _Color: {r: 0, g: 1, b: 0.9333334, a: 1} 278 | - _DiffusionProfileAsset: {r: 0, g: 0, b: 0, a: 0} 279 | - _DoubleSidedConstants: {r: 1, g: 1, b: -1, a: 0} 280 | - _EmissionColor: {r: 0, g: 1, b: 0.9333334, a: 1} 281 | - _EmissiveColor: {r: 0, g: 1, b: 0.9381459, a: 1} 282 | - _EmissiveColorLDR: {r: 0, g: 0, b: 0, a: 1} 283 | - _InvPrimScale: {r: 1, g: 1, b: 0, a: 0} 284 | - _IridescenceThicknessRemap: {r: 0, g: 1, b: 0, a: 0} 285 | - _SpecularColor: {r: 1, g: 1, b: 1, a: 1} 286 | - _ThicknessRemap: {r: 0, g: 1, b: 0, a: 0} 287 | - _TransmittanceColor: {r: 1, g: 1, b: 1, a: 1} 288 | - _UVDetailsMappingMask: {r: 1, g: 0, b: 0, a: 0} 289 | - _UVMappingMask: {r: 1, g: 0, b: 0, a: 0} 290 | - _UVMappingMaskEmissive: {r: 1, g: 0, b: 0, a: 0} 291 | m_BuildTextureStacks: [] 292 | --- !u!114 &2928486075919050732 293 | MonoBehaviour: 294 | m_ObjectHideFlags: 11 295 | m_CorrespondingSourceObject: {fileID: 0} 296 | m_PrefabInstance: {fileID: 0} 297 | m_PrefabAsset: {fileID: 0} 298 | m_GameObject: {fileID: 0} 299 | m_Enabled: 1 300 | m_EditorHideFlags: 0 301 | m_Script: {fileID: 11500000, guid: da692e001514ec24dbc4cca1949ff7e8, type: 3} 302 | m_Name: 303 | m_EditorClassIdentifier: 304 | version: 2 305 | -------------------------------------------------------------------------------- /Materials/AugmentaVelocityDebug.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 26e3b8924c944a04f9c8eb7610036aa9 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 83cdb01540df6c7478b61ca234acef08 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/UnityOSC.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 673a15a3736df9d4d9cd1c5c37e6c508 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: af37efb1d03d82c47bb7dd273c043fdb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bd288184d5e20a0419a679bf76fffa7f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCBundle.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UnityOSC - Open Sound Control interface for the Unity3d game engine 3 | // 4 | // Copyright (c) 2012 Jorge Garcia Martin 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation 8 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 9 | // and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions 12 | // of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 15 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | // IN THE SOFTWARE. 19 | // 20 | 21 | using System; 22 | using System.Net; 23 | using System.Text; 24 | using System.Collections.Generic; 25 | using System.Diagnostics; 26 | 27 | namespace Augmenta.UnityOSC 28 | { 29 | /// 30 | /// Models a Bundle of the OSC protocol. 31 | /// Derived from a OSC Packet over a OSC Stream. 32 | /// 33 | public sealed class OSCBundle : OSCPacket 34 | { 35 | 36 | #region Constructors 37 | public OSCBundle() 38 | { 39 | _address = BUNDLE; 40 | } 41 | 42 | public OSCBundle(long timestamp) 43 | { 44 | _address = BUNDLE; 45 | _timeStamp = timestamp; 46 | } 47 | #endregion 48 | 49 | #region Member Variables 50 | private const string BUNDLE = "#bundle"; 51 | 52 | #endregion 53 | 54 | #region Properties 55 | #endregion 56 | 57 | #region Methods 58 | 59 | /// 60 | /// Specifies if the packet is an OSC bundle. 61 | /// 62 | override public bool IsBundle() { return true; } 63 | 64 | /// 65 | /// Packs a bundle to be transported over an OSC stream. 66 | /// 67 | override public void Pack() 68 | { 69 | // TODO: Pack bundle with timestamp in NTP format 70 | 71 | throw new NotImplementedException("OSCBundle.Pack() : Not implemented method."); 72 | } 73 | 74 | /// 75 | /// Unpacks an OSC bundle from a data stream. 76 | /// 77 | /// 78 | /// A 79 | /// 80 | /// 81 | /// A 82 | /// 83 | /// 84 | /// A 85 | /// 86 | /// 87 | /// A 88 | /// 89 | public new static OSCBundle Unpack(byte[] data, ref int start, int end) 90 | { 91 | string address = OSCPacket.UnpackValue(data, ref start); 92 | Trace.Assert(address == BUNDLE); 93 | 94 | long timeStamp = OSCPacket.UnpackValue(data, ref start); 95 | OSCBundle bundle = new OSCBundle(timeStamp); 96 | 97 | while(start < end) 98 | { 99 | int length = OSCPacket.UnpackValue(data, ref start); 100 | int packetEnd = start + length; 101 | bundle.Append(OSCPacket.Unpack(data, ref start, packetEnd)); 102 | } 103 | 104 | return bundle; 105 | } 106 | 107 | /// 108 | /// Appends an OSC message to a bundle. 109 | /// 110 | /// 111 | /// A 112 | /// 113 | public override void Append (T msgvalue) 114 | { 115 | Trace.Assert(msgvalue is OSCMessage); 116 | _data.Add(msgvalue); 117 | } 118 | #endregion 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCBundle.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16e515372e242f347a5cc91bd276a024 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCClient.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UnityOSC - Open Sound Control interface for the Unity3d game engine 3 | // 4 | // Copyright (c) 2012 Jorge Garcia Martin 5 | // 6 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 7 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation 8 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 9 | // and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 10 | // 11 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions 12 | // of the Software. 13 | // 14 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 15 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 16 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 17 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 18 | // IN THE SOFTWARE. 19 | // 20 | 21 | using System; 22 | using System.Net; 23 | using System.Net.Sockets; 24 | 25 | namespace Augmenta.UnityOSC 26 | { 27 | /// 28 | /// Dispatches OSC messages to the specified destination address and port. 29 | /// 30 | 31 | public class OSCClient 32 | { 33 | #region Constructors 34 | public OSCClient (IPAddress address, int port) 35 | { 36 | _ipAddress = address; 37 | _port = port; 38 | Connect(); 39 | } 40 | #endregion 41 | 42 | #region Member Variables 43 | private IPAddress _ipAddress; 44 | private int _port; 45 | private UdpClient _udpClient; 46 | #endregion 47 | 48 | #region Properties 49 | 50 | public string Name; 51 | public bool LogOutgoing; 52 | 53 | public IPAddress ClientIPAddress 54 | { 55 | get 56 | { 57 | return _ipAddress; 58 | } 59 | } 60 | 61 | public int Port 62 | { 63 | get 64 | { 65 | return _port; 66 | } 67 | } 68 | #endregion 69 | 70 | #region Methods 71 | /// 72 | /// Connects the client to a given remote address and port. 73 | /// 74 | public void Connect() 75 | { 76 | if(_udpClient != null) Close(); 77 | _udpClient = new UdpClient(); 78 | try 79 | { 80 | _udpClient.Connect(_ipAddress, _port); 81 | } 82 | catch 83 | { 84 | throw new Exception(String.Format("Can't create client at IP address {0} and port {1}.", _ipAddress,_port)); 85 | } 86 | } 87 | 88 | /// 89 | /// Closes the client. 90 | /// 91 | public void Close() 92 | { 93 | if (_udpClient != null) { 94 | _udpClient.Close(); 95 | _udpClient = null; 96 | } 97 | } 98 | 99 | /// 100 | /// Sends an OSC packet to the defined destination and address of the client. 101 | /// 102 | /// 103 | /// A 104 | /// 105 | public void Send(OSCPacket packet) 106 | { 107 | byte[] data = packet.BinaryData; 108 | try 109 | { 110 | _udpClient.Send(data, data.Length); 111 | } 112 | catch 113 | { 114 | //throw new Exception(String.Format("Can't send OSC packet to client {0} : {1}", _ipAddress, _port)); 115 | UnityEngine.Debug.LogError("Cannot send OSC packet to client " + _ipAddress + ":" + _port); 116 | } 117 | } 118 | 119 | public void SendTo(OSCPacket packet, string host, int port) 120 | { 121 | byte[] data = packet.BinaryData; 122 | try 123 | { 124 | //Debug.Log("SendTo :"+host+"/"+port); 125 | _ipAddress = IPAddress.Parse(host); 126 | _port = port; 127 | 128 | //Connect (); 129 | var tmpUdpClient = new UdpClient(); //BOF BOF 130 | tmpUdpClient.Send(data, data.Length, host, port); 131 | //Debug.Log ("Sent"); 132 | 133 | } 134 | catch(Exception e) 135 | { 136 | throw new Exception(String.Format("Can't send OSC packet to client {0} : {1} | {2}", _ipAddress, _port, e.ToString())); 137 | } 138 | } 139 | #endregion 140 | } 141 | } 142 | 143 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCClient.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c3572eefca9bbd40a5045a780171ad5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCMessage.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UnityOSC - Open Sound Control interface for the Unity3d game engine 3 | // 4 | // Copyright (c) 2012 Jorge Garcia Martin 5 | // Last edit: Gerard Llorach 2nd August 2017 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 8 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation 9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 10 | // and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions 13 | // of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 16 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 18 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | // IN THE SOFTWARE. 20 | // 21 | 22 | using System; 23 | using System.Collections.Generic; 24 | using System.Net; 25 | using System.Text; 26 | 27 | namespace Augmenta.UnityOSC 28 | { 29 | public sealed class OSCMessage : OSCPacket 30 | { 31 | #region Constructors 32 | public OSCMessage (string address) 33 | { 34 | _typeTag = DEFAULT.ToString(); 35 | this.Address = address; 36 | } 37 | 38 | public OSCMessage (string address, object msgvalue) 39 | { 40 | _typeTag = DEFAULT.ToString(); 41 | this.Address = address; 42 | Append(msgvalue); 43 | } 44 | #endregion 45 | 46 | #region Member Variables 47 | private const char INTEGER = 'i'; 48 | private const char FLOAT = 'f'; 49 | private const char LONG = 'h'; 50 | private const char DOUBLE = 'd'; 51 | private const char STRING = 's'; 52 | private const char BYTE = 'b'; 53 | private const char DEFAULT = ','; 54 | 55 | private string _typeTag; 56 | 57 | #endregion 58 | 59 | #region Properties 60 | #endregion 61 | 62 | #region Methods 63 | 64 | /// 65 | /// Specifies if the message is an OSC bundle. 66 | /// 67 | /// 68 | /// A 69 | /// 70 | override public bool IsBundle() { return false; } 71 | 72 | /// 73 | /// Packs the OSC message to binary data. 74 | /// 75 | override public void Pack() 76 | { 77 | List data = new List(); 78 | 79 | data.AddRange(OSCPacket.PackValue(_address)); 80 | OSCPacket.PadNull(data); 81 | 82 | data.AddRange(OSCPacket.PackValue(_typeTag)); 83 | OSCPacket.PadNull(data); 84 | 85 | foreach (object value in _data) 86 | { 87 | data.AddRange(OSCPacket.PackValue(value)); 88 | if (value is string || value is byte[]) 89 | { 90 | OSCPacket.PadNull(data); 91 | } 92 | } 93 | 94 | this._binaryData = data.ToArray(); 95 | } 96 | 97 | /// 98 | /// Unpacks an OSC message. 99 | /// 100 | /// 101 | /// A 102 | /// 103 | /// 104 | /// A 105 | /// 106 | /// 107 | /// A 108 | /// 109 | public static OSCMessage Unpack(byte[] data, ref int start) 110 | { 111 | string address = OSCPacket.UnpackValue(data, ref start); 112 | OSCMessage message = new OSCMessage(address); 113 | 114 | char[] tags = OSCPacket.UnpackValue(data, ref start).ToCharArray(); 115 | foreach (char tag in tags) 116 | { 117 | object value; 118 | switch (tag) 119 | { 120 | case DEFAULT: 121 | continue; 122 | 123 | case INTEGER: 124 | value = OSCPacket.UnpackValue(data, ref start); 125 | break; 126 | 127 | case LONG: 128 | value = OSCPacket.UnpackValue(data, ref start); 129 | break; 130 | 131 | case FLOAT: 132 | value = OSCPacket.UnpackValue(data, ref start); 133 | break; 134 | 135 | case DOUBLE: 136 | value = OSCPacket.UnpackValue(data, ref start); 137 | break; 138 | 139 | case STRING: 140 | value = OSCPacket.UnpackValue(data, ref start); 141 | break; 142 | 143 | case BYTE: 144 | value = OSCPacket.UnpackValue(data, ref start); 145 | break; 146 | 147 | default: 148 | Console.WriteLine("Unknown tag: " + tag); 149 | continue; 150 | } 151 | 152 | message.Append(value); 153 | } 154 | 155 | if(message.TimeStamp == 0) 156 | { 157 | message.TimeStamp = DateTime.Now.Ticks; 158 | } 159 | 160 | return message; 161 | } 162 | 163 | /// 164 | /// Appends a value to an OSC message. 165 | /// 166 | /// 167 | /// A 168 | /// 169 | public override void Append (T value) 170 | { 171 | Type type = value.GetType(); 172 | char typeTag = DEFAULT; 173 | 174 | switch (type.Name) 175 | { 176 | case "Int32": 177 | typeTag = INTEGER; 178 | break; 179 | 180 | case "Int64": 181 | typeTag = LONG; 182 | break; 183 | 184 | case "Single": 185 | typeTag = FLOAT; 186 | break; 187 | 188 | case "Double": 189 | typeTag = DOUBLE; 190 | break; 191 | 192 | case "String": 193 | typeTag = STRING; 194 | break; 195 | 196 | case "Byte[]": 197 | typeTag = BYTE; 198 | break; 199 | 200 | default: 201 | throw new Exception("Unsupported data type."); 202 | } 203 | 204 | _typeTag += typeTag; 205 | _data.Add(value); 206 | } 207 | #endregion 208 | } 209 | } -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCMessage.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d3afda59a121123408759af0c81b8cfc 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCPacket.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UnityOSC - Open Sound Control interface for the Unity3d game engine 3 | // 4 | // Copyright (c) 2012 Jorge Garcia Martin 5 | // Last edit: Gerard Llorach 2nd August 2017 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 8 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation 9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 10 | // and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions 13 | // of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 16 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 18 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | // IN THE SOFTWARE. 20 | // 21 | 22 | using System; 23 | using System.Diagnostics; 24 | using System.Collections.Generic; 25 | using System.Text; 26 | 27 | namespace Augmenta.UnityOSC 28 | { 29 | /// 30 | /// Models a OSC Packet over an OSC stream. 31 | /// 32 | abstract public class OSCPacket 33 | { 34 | #region Member Variables 35 | protected List _data; 36 | protected byte[] _binaryData; 37 | protected string _address; 38 | protected long _timeStamp; 39 | public OSCServer server; 40 | #endregion 41 | 42 | #region Properties 43 | public string Address 44 | { 45 | get 46 | { 47 | return _address; 48 | } 49 | set 50 | { 51 | //Trace.Assert(string.IsNullOrEmpty(_address) == false); //Heavy in computation 52 | _address = value; 53 | } 54 | } 55 | 56 | public List Data 57 | { 58 | get 59 | { 60 | return _data; 61 | } 62 | } 63 | 64 | public byte[] BinaryData 65 | { 66 | get 67 | { 68 | Pack(); 69 | return _binaryData; 70 | } 71 | } 72 | 73 | public long TimeStamp 74 | { 75 | get 76 | { 77 | return _timeStamp; 78 | } 79 | set 80 | { 81 | _timeStamp = value; 82 | } 83 | } 84 | #endregion 85 | 86 | #region Methods 87 | abstract public bool IsBundle(); 88 | abstract public void Pack(); 89 | abstract public void Append(T msgvalue); 90 | 91 | /// 92 | /// OSC Packet initialization. 93 | /// 94 | public OSCPacket () 95 | { 96 | this._data = new List(); 97 | } 98 | 99 | /// 100 | /// Swap endianess given a data set. 101 | /// 102 | /// 103 | /// A 104 | /// 105 | /// 106 | /// A 107 | /// 108 | protected static byte[] SwapEndian(byte[] data) 109 | { 110 | byte[] swapped = new byte[data.Length]; 111 | for(int i = data.Length - 1, j = 0 ; i >= 0 ; i--, j++) 112 | { 113 | swapped[j] = data[i]; 114 | } 115 | return swapped; 116 | } 117 | 118 | /// 119 | /// Packs a value in a byte stream. Accepted types: Int32, Int64, Single, Double, String and Byte[]. 120 | /// 121 | /// 122 | /// A 123 | /// 124 | /// 125 | /// A 126 | /// 127 | protected static byte[] PackValue(T value) 128 | { 129 | object valueObject = value; 130 | Type type = value.GetType(); 131 | byte[] data = null; 132 | 133 | switch (type.Name) 134 | { 135 | case "Int32": 136 | data = BitConverter.GetBytes((int)valueObject); 137 | if (BitConverter.IsLittleEndian) data = SwapEndian(data); 138 | break; 139 | 140 | case "Int64": 141 | data = BitConverter.GetBytes((long)valueObject); 142 | if (BitConverter.IsLittleEndian) data = SwapEndian(data); 143 | break; 144 | 145 | case "Single": 146 | data = BitConverter.GetBytes((float)valueObject); 147 | if (BitConverter.IsLittleEndian) data = SwapEndian(data); 148 | break; 149 | 150 | case "Double": 151 | data = BitConverter.GetBytes((double)valueObject); 152 | if (BitConverter.IsLittleEndian) data = SwapEndian(data); 153 | break; 154 | 155 | case "String": 156 | data = Encoding.ASCII.GetBytes((string)valueObject); 157 | break; 158 | 159 | case "Byte[]": 160 | byte[] valueData = ((byte[])valueObject); 161 | List bytes = new List(); 162 | bytes.AddRange(PackValue(valueData.Length)); 163 | bytes.AddRange(valueData); 164 | data = bytes.ToArray(); 165 | break; 166 | 167 | default: 168 | throw new Exception("Unsupported data type."); 169 | } 170 | return data; 171 | } 172 | 173 | /// 174 | /// Unpacks a value from a byte stream. Accepted types: Int32, Int64, Single, Double, String and Byte[]. 175 | /// 176 | /// 177 | /// A 178 | /// 179 | /// 180 | /// A 181 | /// 182 | /// 183 | /// A 184 | /// 185 | protected static T UnpackValue(byte[] data, ref int start) 186 | { 187 | object msgvalue; //msgvalue is casted and returned by the function 188 | Type type = typeof(T); 189 | byte[] buffername; 190 | 191 | if (type.Name == "String") 192 | { 193 | int count = 0; 194 | for (int index = start; data[index] != 0; index++) count++; 195 | 196 | msgvalue = Encoding.ASCII.GetString(data, start, count); 197 | start += count + 1; 198 | start = ((start + 3) / 4) * 4; 199 | } 200 | else if (type.Name == "Byte[]") 201 | { 202 | int length = UnpackValue(data, ref start); 203 | byte[] buffer = new byte[length]; 204 | Array.Copy(data, start, buffer, 0, buffer.Length); 205 | start += buffer.Length; 206 | start = ((start + 3) / 4) * 4; 207 | 208 | msgvalue = buffer; 209 | } 210 | else 211 | { 212 | switch (type.Name) 213 | { 214 | case "Int32": 215 | case "Single"://this also serves for float numbers 216 | buffername = new byte[4]; 217 | break; 218 | 219 | case "Int64": 220 | case "Double": 221 | buffername = new byte[8]; 222 | break; 223 | 224 | default: 225 | throw new Exception("Unsupported data type."); 226 | } 227 | 228 | Array.Copy(data, start, buffername, 0, buffername.Length); 229 | start += buffername.Length; 230 | 231 | if (BitConverter.IsLittleEndian) 232 | { 233 | buffername = SwapEndian(buffername); 234 | } 235 | 236 | switch (type.Name) 237 | { 238 | case "Int32": 239 | msgvalue = BitConverter.ToInt32(buffername, 0); 240 | break; 241 | 242 | case "Int64": 243 | msgvalue = BitConverter.ToInt64(buffername, 0); 244 | break; 245 | 246 | case "Single": 247 | msgvalue = BitConverter.ToSingle(buffername, 0); 248 | break; 249 | 250 | case "Double": 251 | msgvalue = BitConverter.ToDouble(buffername, 0); 252 | break; 253 | 254 | default: 255 | throw new Exception("Unsupported data type."); 256 | } 257 | } 258 | 259 | return (T)msgvalue; 260 | } 261 | 262 | /// 263 | /// Unpacks an array of binary data. 264 | /// 265 | /// 266 | /// A 267 | /// 268 | /// 269 | /// A 270 | /// 271 | public static OSCPacket Unpack(byte[] data) 272 | { 273 | int start = 0; 274 | return Unpack(data, ref start, data.Length); 275 | } 276 | 277 | /// 278 | /// Unpacks an array of binary data given reference start and end pointers. 279 | /// 280 | /// 281 | /// A 282 | /// 283 | /// 284 | /// A 285 | /// 286 | /// 287 | /// A 288 | /// 289 | /// 290 | /// A 291 | /// 292 | public static OSCPacket Unpack(byte[] data, ref int start, int end) 293 | { 294 | if (data[start] == '#') 295 | { 296 | return OSCBundle.Unpack(data, ref start, end); 297 | } 298 | 299 | else return OSCMessage.Unpack(data, ref start); 300 | } 301 | 302 | /// 303 | /// Pads null a list of bytes. 304 | /// 305 | /// 306 | /// A 307 | /// 308 | protected static void PadNull(List data) 309 | { 310 | byte nullvalue = 0; 311 | int pad = 4 - (data.Count % 4); 312 | for(int i = 0; i < pad; i++) 313 | data.Add(nullvalue); 314 | } 315 | 316 | #endregion 317 | } 318 | } 319 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCPacket.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6ed02ed068384344bac643ec3b01e826 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCReceiver.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UnityOSC - Open Sound Control interface for the Unity3d game engine 3 | // 4 | // Copyright (c) 2012 Jorge Garcia Martin 5 | // Last edit: Gerard Llorach 2nd August 2017 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 8 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation 9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 10 | // and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions 13 | // of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 16 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 18 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | // IN THE SOFTWARE. 20 | // 21 | 22 | 23 | using System.Collections.Generic; 24 | using UnityEngine; 25 | using System; 26 | #if UNITY_EDITOR 27 | using UnityEditor; 28 | #endif 29 | 30 | namespace Augmenta.UnityOSC 31 | { 32 | public class OSCReceiver 33 | { 34 | public delegate void MessageReceived(OSCMessage message); 35 | public event MessageReceived messageReceived; 36 | 37 | public string Name; 38 | 39 | private Queue _queue; 40 | private OSCServer _server; 41 | 42 | public bool Open(int port) 43 | { 44 | _queue = new Queue(); 45 | #if UNITY_EDITOR 46 | if (PlayerSettings.runInBackground == false) 47 | { 48 | Debug.LogWarning("Recommend PlayerSettings > runInBackground = true"); 49 | } 50 | #endif 51 | if (_server != null) 52 | { 53 | _server.Close(); 54 | } 55 | 56 | try 57 | { 58 | _server = new OSCServer(port); 59 | _server.SleepMilliseconds = 0; 60 | _server.PacketReceivedEvent += didReceivedEvent; 61 | } 62 | catch(Exception e) 63 | { 64 | Debug.LogError("[" + Name + "] Couldn't open port " + port + " | " +e.Message); 65 | return false; 66 | } 67 | 68 | return true; 69 | } 70 | 71 | public void PropagateEvent() 72 | { 73 | var msg = GetLastMessage(); 74 | //if (msg == null) 75 | // return; 76 | 77 | if (messageReceived != null) 78 | messageReceived(msg); 79 | } 80 | 81 | public OSCMessage GetLastMessage() 82 | { 83 | var lastMessage = new OSCMessage(""); 84 | lock (_queue) 85 | { 86 | lastMessage = _queue.Dequeue(); 87 | } 88 | return lastMessage; 89 | } 90 | 91 | public int WaitingMessagesCount() 92 | { 93 | return _queue.Count; 94 | } 95 | 96 | public void Close() 97 | { 98 | if (_server != null) 99 | { 100 | _server.Close(); 101 | _server = null; 102 | } 103 | } 104 | 105 | void didReceivedEvent(OSCServer sender, OSCPacket packet) 106 | { 107 | lock (_queue) 108 | { 109 | if (packet.IsBundle()) 110 | { 111 | var bundle = packet as OSCBundle; 112 | 113 | foreach (object obj in bundle.Data) 114 | { 115 | OSCMessage msg = obj as OSCMessage; 116 | 117 | if (OSCMaster.Instance.LogIncoming) 118 | { 119 | Debug.Log("[" + Name + "] " + msg.Address); 120 | foreach (var data in msg.Data) 121 | Debug.Log(data); 122 | } 123 | 124 | _queue.Enqueue(msg); 125 | } 126 | } 127 | else 128 | { 129 | OSCMessage msg = packet as OSCMessage; 130 | 131 | if (OSCMaster.Instance.LogIncoming) 132 | { 133 | Debug.Log("[" + Name + "] " + msg.Address); 134 | foreach (var data in msg.Data) 135 | Debug.Log(data); 136 | } 137 | 138 | _queue.Enqueue(msg); 139 | } 140 | } 141 | } 142 | } 143 | } -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCReceiver.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 496d08e6f78e9ab4db31370fbd16ede0 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCServer.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UnityOSC - Open Sound Control interface for the Unity3d game engine 3 | // 4 | // Copyright (c) 2012 Jorge Garcia Martin 5 | // Last edit: Gerard Llorach 2nd August 2017 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 8 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation 9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 10 | // and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions 13 | // of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 16 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 18 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | // IN THE SOFTWARE. 20 | // 21 | 22 | using System; 23 | using System.Net; 24 | using System.Net.Sockets; 25 | using System.Threading; 26 | using System.Collections.Generic; 27 | 28 | namespace Augmenta.UnityOSC 29 | { 30 | public delegate void PacketReceivedEventHandler(OSCServer sender, OSCPacket packet); 31 | 32 | /// 33 | /// Receives incoming OSC messages 34 | /// 35 | public class OSCServer 36 | { 37 | #region Delegates 38 | public event PacketReceivedEventHandler PacketReceivedEvent; 39 | #endregion 40 | 41 | #region Constructors 42 | public OSCServer (int localPort) 43 | { 44 | PacketReceivedEvent += delegate(OSCServer s, OSCPacket p) { }; 45 | 46 | _localPort = localPort; 47 | Connect(); 48 | } 49 | #endregion 50 | 51 | #region Member Variables 52 | private UdpClient _udpClient; 53 | private int _localPort; 54 | private Thread _receiverThread; 55 | private OSCPacket _lastReceivedPacket; 56 | private int _sleepMilliseconds = 10; 57 | private int _bufferSize = 8192; //default value in .NET 58 | #endregion 59 | 60 | #region Properties 61 | public UdpClient UDPClient 62 | { 63 | get 64 | { 65 | return _udpClient; 66 | } 67 | set 68 | { 69 | _udpClient = value; 70 | } 71 | } 72 | 73 | public int LocalPort 74 | { 75 | get 76 | { 77 | return _localPort; 78 | } 79 | set 80 | { 81 | _localPort = value; 82 | } 83 | } 84 | 85 | public OSCPacket LastReceivedPacket 86 | { 87 | get 88 | { 89 | return _lastReceivedPacket; 90 | } 91 | } 92 | 93 | public int ServerPort 94 | { 95 | get 96 | { 97 | return _localPort; 98 | } 99 | } 100 | 101 | /// 102 | /// "Osc Receive Loop" sleep duration per message. 103 | /// 104 | /// The sleep milliseconds. 105 | public int SleepMilliseconds 106 | { 107 | get 108 | { 109 | return _sleepMilliseconds; 110 | } 111 | set 112 | { 113 | _sleepMilliseconds = value; 114 | } 115 | } 116 | 117 | 118 | /// 119 | /// Buffer size of the server. 120 | /// 121 | /// Number of bytes to store in the buffer. 122 | public int ReceiveBufferSize 123 | { 124 | get 125 | { 126 | return _udpClient.Client.ReceiveBufferSize; 127 | } 128 | set 129 | { 130 | _udpClient.Client.ReceiveBufferSize = _bufferSize = value; 131 | } 132 | } 133 | #endregion 134 | 135 | #region Methods 136 | 137 | /// 138 | /// Opens the server at the given port and starts the listener thread. 139 | /// 140 | public void Connect() 141 | { 142 | if(this._udpClient != null) Close(); 143 | 144 | try 145 | { 146 | _udpClient = new UdpClient(_localPort); 147 | _udpClient.Client.ReceiveBufferSize = _bufferSize; 148 | _receiverThread = new Thread(new ThreadStart(this.ReceivePool)); 149 | _receiverThread.Start(); 150 | } 151 | catch(Exception e) 152 | { 153 | throw e; 154 | } 155 | } 156 | 157 | /// 158 | /// Closes the server and terminates its listener thread. 159 | /// 160 | public void Close() 161 | { 162 | if(_receiverThread !=null) _receiverThread.Abort(); 163 | _receiverThread = null; 164 | if (_udpClient != null) _udpClient.Close(); 165 | _udpClient = null; 166 | } 167 | 168 | 169 | /// 170 | /// Receives and unpacks an OSC packet. 171 | /// A 172 | /// 173 | private void Receive() 174 | { 175 | IPEndPoint ip = null; 176 | 177 | try 178 | { 179 | byte[] bytes = _udpClient.Receive(ref ip); 180 | 181 | if(bytes != null && bytes.Length > 0) 182 | { 183 | OSCPacket packet = OSCPacket.Unpack(bytes); 184 | 185 | _lastReceivedPacket = packet; 186 | 187 | PacketReceivedEvent(this, _lastReceivedPacket); 188 | } 189 | } 190 | catch (Exception e) 191 | { 192 | if (_receiverThread != null && _receiverThread.ThreadState != ThreadState.AbortRequested && _receiverThread.ThreadState != ThreadState.Aborted) throw new Exception("OSC Receive error : " + e.Message); 193 | } 194 | } 195 | 196 | /// 197 | /// Thread pool that receives upcoming messages. 198 | /// 199 | private void ReceivePool() 200 | { 201 | while( true ) 202 | { 203 | Receive(); 204 | 205 | if (_udpClient.Available == 0) 206 | Thread.Sleep(_sleepMilliseconds); 207 | } 208 | } 209 | #endregion 210 | } 211 | } 212 | 213 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSC/OSCServer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 92abd4063ab3ea34a8f79639115a6208 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSCHandler.cs: -------------------------------------------------------------------------------- 1 | // 2 | // UnityOSC - Open Sound Control interface for the Unity3d game engine 3 | // 4 | // Copyright (c) 2012 Jorge Garcia Martin 5 | // Last edit: Gerard Llorach 2nd August 2017 6 | // 7 | // Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 8 | // documentation files (the "Software"), to deal in the Software without restriction, including without limitation 9 | // the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, 10 | // and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 11 | // 12 | // The above copyright notice and this permission notice shall be included in all copies or substantial portions 13 | // of the Software. 14 | // 15 | // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED 16 | // TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 17 | // THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF 18 | // CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS 19 | // IN THE SOFTWARE. 20 | // 21 | // Inspired by http://www.unifycommunity.com/wiki/index.php?title=AManagerClass 22 | 23 | using System; 24 | using System.Net; 25 | using System.Collections.Generic; 26 | 27 | using UnityEngine; 28 | 29 | namespace Augmenta.UnityOSC 30 | { 31 | /// 32 | /// Models a log of a server composed by an OSCServer, a List of OSCPacket and a List of 33 | /// strings that represent the current messages in the log. 34 | /// 35 | public struct ServerLog 36 | { 37 | public OSCServer server; 38 | public List packets; 39 | public List log; 40 | } 41 | 42 | /// 43 | /// Models a log of a client composed by an OSCClient, a List of OSCMessage and a List of 44 | /// strings that represent the current messages in the log. 45 | /// 46 | public struct ClientLog 47 | { 48 | public OSCClient client; 49 | public List messages; 50 | public List log; 51 | } 52 | 53 | /// 54 | /// Handles all the OSC servers and clients of the current Unity game/application. 55 | /// Tracks incoming and outgoing messages. 56 | /// 57 | public class OSCHandler : MonoBehaviour 58 | { 59 | #region Singleton Constructors 60 | static OSCHandler() { 61 | } 62 | 63 | OSCHandler() { 64 | } 65 | 66 | public static OSCHandler Instance { 67 | get { 68 | if (_instance == null) { 69 | _instance = new GameObject("OSCHandler").AddComponent(); 70 | } 71 | 72 | return _instance; 73 | } 74 | } 75 | #endregion 76 | 77 | #region Member Variables 78 | private static OSCHandler _instance = null; 79 | private Dictionary _clients = new Dictionary(); 80 | private Dictionary _servers = new Dictionary(); 81 | public List packets = new List(); 82 | 83 | 84 | private const int _loglength = 100; 85 | #endregion 86 | 87 | /// 88 | /// Initializes the OSC Handler. 89 | /// Here you can create the OSC servers and clientes. 90 | /// 91 | public void Init() { 92 | //Initialize OSC clients (transmitters) 93 | //Example: 94 | //CreateClient("SuperCollider", IPAddress.Parse("127.0.0.1"), 5555); 95 | 96 | //Initialize OSC servers (listeners) 97 | //Example: 98 | 99 | //CreateServer("AndroidPhone", 6666); 100 | } 101 | 102 | #region Properties 103 | public Dictionary Clients { 104 | get { 105 | return _clients; 106 | } 107 | } 108 | 109 | public Dictionary Servers { 110 | get { 111 | return _servers; 112 | } 113 | } 114 | #endregion 115 | 116 | #region Methods 117 | 118 | /// 119 | /// Ensure that the instance is destroyed when the game is stopped in the Unity editor 120 | /// Close all the OSC clients and servers 121 | /// 122 | void OnApplicationQuit() { 123 | foreach (KeyValuePair pair in _clients) { 124 | pair.Value.client.Close(); 125 | } 126 | 127 | foreach (KeyValuePair pair in _servers) { 128 | pair.Value.server.Close(); 129 | } 130 | 131 | _instance = null; 132 | } 133 | 134 | /// 135 | /// Creates an OSC Client (sends OSC messages) given an outgoing port and address. 136 | /// 137 | /// 138 | /// A 139 | /// 140 | /// 141 | /// A 142 | /// 143 | /// 144 | /// A 145 | /// 146 | public void CreateClient(string clientId, IPAddress destination, int port) { 147 | ClientLog clientitem = new ClientLog(); 148 | clientitem.client = new OSCClient(destination, port); 149 | clientitem.log = new List(); 150 | clientitem.messages = new List(); 151 | 152 | _clients.Add(clientId, clientitem); 153 | 154 | // Send test message 155 | string testaddress = "/test/alive/"; 156 | OSCMessage message = new OSCMessage(testaddress, destination.ToString()); 157 | message.Append(port); message.Append("OK"); 158 | 159 | _clients[clientId].log.Add(String.Concat(DateTime.UtcNow.ToString(), ".", 160 | FormatMilliseconds(DateTime.Now.Millisecond), " : ", 161 | testaddress, " ", DataToString(message.Data))); 162 | _clients[clientId].messages.Add(message); 163 | 164 | _clients[clientId].client.Send(message); 165 | } 166 | 167 | /// 168 | /// Creates an OSC Server (listens to upcoming OSC messages) given an incoming port. 169 | /// 170 | /// 171 | /// A 172 | /// 173 | /// 174 | /// A 175 | /// 176 | public OSCServer CreateServer(string serverId, int port) { 177 | OSCServer server = new OSCServer(port); 178 | server.PacketReceivedEvent += OnPacketReceived; 179 | 180 | ServerLog serveritem = new ServerLog(); 181 | serveritem.server = server; 182 | serveritem.log = new List(); 183 | serveritem.packets = new List(); 184 | 185 | _servers.Add(serverId, serveritem); 186 | 187 | return server; 188 | } 189 | 190 | /// 191 | /// Callback when a message is received. It stores the messages in a list of the oscControl 192 | void OnPacketReceived(OSCServer server, OSCPacket packet) { 193 | // Remember origin 194 | packet.server = server; 195 | 196 | // Limit buffer 197 | if (packets.Count > _loglength) { 198 | packets.RemoveRange(0, packets.Count - _loglength); 199 | } 200 | // Add to OSCPackets list 201 | packets.Add(packet); 202 | } 203 | 204 | /// 205 | /// Sends an OSC message to a specified client, given its clientId (defined at the OSC client construction), 206 | /// OSC address and a single value. Also updates the client log. 207 | /// 208 | /// 209 | /// A 210 | /// 211 | /// 212 | /// A 213 | /// 214 | /// 215 | /// A 216 | /// 217 | public void SendMessageToClient(string clientId, string address, T value) { 218 | List temp = new List(); 219 | temp.Add(value); 220 | 221 | SendMessageToClient(clientId, address, temp); 222 | } 223 | 224 | /// 225 | /// Sends an OSC message to a specified client, given its clientId (defined at the OSC client construction), 226 | /// OSC address and a list of values. Also updates the client log. 227 | /// 228 | /// 229 | /// A 230 | /// 231 | /// 232 | /// A 233 | /// 234 | /// 235 | /// A 236 | /// 237 | public void SendMessageToClient(string clientId, string address, List values) { 238 | if (_clients.ContainsKey(clientId)) { 239 | OSCMessage message = new OSCMessage(address); 240 | 241 | foreach (T msgvalue in values) { 242 | message.Append(msgvalue); 243 | } 244 | 245 | if (_clients[clientId].log.Count < _loglength) { 246 | _clients[clientId].log.Add(String.Concat(DateTime.UtcNow.ToString(), ".", 247 | FormatMilliseconds(DateTime.Now.Millisecond), 248 | " : ", address, " ", DataToString(message.Data))); 249 | _clients[clientId].messages.Add(message); 250 | } else { 251 | _clients[clientId].log.RemoveAt(0); 252 | _clients[clientId].messages.RemoveAt(0); 253 | 254 | _clients[clientId].log.Add(String.Concat(DateTime.UtcNow.ToString(), ".", 255 | FormatMilliseconds(DateTime.Now.Millisecond), 256 | " : ", address, " ", DataToString(message.Data))); 257 | _clients[clientId].messages.Add(message); 258 | } 259 | 260 | _clients[clientId].client.Send(message); 261 | } else { 262 | Debug.LogError(string.Format("Can't send OSC messages to {0}. Client doesn't exist.", clientId)); 263 | } 264 | } 265 | 266 | /// 267 | /// Updates clients and servers logs. 268 | /// NOTE: Only used by the editor helper script (OSCHelper.cs), could be removed 269 | /// 270 | public void UpdateLogs() { 271 | foreach (KeyValuePair pair in _servers) { 272 | if (_servers[pair.Key].server.LastReceivedPacket != null) { 273 | //Initialization for the first packet received 274 | if (_servers[pair.Key].log.Count == 0) { 275 | _servers[pair.Key].packets.Add(_servers[pair.Key].server.LastReceivedPacket); 276 | 277 | _servers[pair.Key].log.Add(String.Concat(DateTime.UtcNow.ToString(), ".", 278 | FormatMilliseconds(DateTime.Now.Millisecond), " : ", 279 | _servers[pair.Key].server.LastReceivedPacket.Address, " ", 280 | DataToString(_servers[pair.Key].server.LastReceivedPacket.Data))); 281 | break; 282 | } 283 | 284 | if (_servers[pair.Key].server.LastReceivedPacket.TimeStamp 285 | != _servers[pair.Key].packets[_servers[pair.Key].packets.Count - 1].TimeStamp) { 286 | if (_servers[pair.Key].log.Count > _loglength - 1) { 287 | _servers[pair.Key].log.RemoveAt(0); 288 | _servers[pair.Key].packets.RemoveAt(0); 289 | } 290 | 291 | _servers[pair.Key].packets.Add(_servers[pair.Key].server.LastReceivedPacket); 292 | 293 | _servers[pair.Key].log.Add(String.Concat(DateTime.UtcNow.ToString(), ".", 294 | FormatMilliseconds(DateTime.Now.Millisecond), " : ", 295 | _servers[pair.Key].server.LastReceivedPacket.Address, " ", 296 | DataToString(_servers[pair.Key].server.LastReceivedPacket.Data))); 297 | } 298 | } 299 | } 300 | } 301 | 302 | /// 303 | /// Converts a collection of object values to a concatenated string. 304 | /// 305 | /// 306 | /// A 307 | /// 308 | /// 309 | /// A 310 | /// 311 | private string DataToString(List data) { 312 | string buffer = ""; 313 | 314 | for (int i = 0; i < data.Count; i++) { 315 | buffer += data[i].ToString() + " "; 316 | } 317 | 318 | buffer += "\n"; 319 | 320 | return buffer; 321 | } 322 | 323 | /// 324 | /// Formats a milliseconds number to a 000 format. E.g. given 50, it outputs 050. Given 5, it outputs 005 325 | /// 326 | /// 327 | /// A 328 | /// 329 | /// 330 | /// A 331 | /// 332 | private string FormatMilliseconds(int milliseconds) { 333 | if (milliseconds < 100) { 334 | if (milliseconds < 10) 335 | return String.Concat("00", milliseconds.ToString()); 336 | 337 | return String.Concat("0", milliseconds.ToString()); 338 | } 339 | 340 | return milliseconds.ToString(); 341 | } 342 | 343 | #endregion 344 | } 345 | } 346 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/Lib/OSCHandler.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e5e09a11ecfbb04da1eeb796b7138c9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/OSCMaster.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Net; 3 | using UnityEngine; 4 | using System.Collections.Generic; 5 | 6 | namespace Augmenta.UnityOSC 7 | { 8 | public class OSCMaster : MonoBehaviour 9 | { 10 | private static OSCMaster _instance; 11 | public static OSCMaster Instance { 12 | get { 13 | 14 | //if (_instance == null) { 15 | // Debug.Log("Creating OSCMaster gameobject"); 16 | // _instance = new GameObject("OSCMaster").AddComponent(); 17 | //} 18 | 19 | return _instance; 20 | } 21 | set { 22 | _instance = value; 23 | } 24 | } 25 | 26 | public static Dictionary Receivers; 27 | public static Dictionary Clients; 28 | 29 | public bool ShowDebug; 30 | 31 | public bool LogIncoming; 32 | public bool LogOutgoing; 33 | 34 | void Awake() { 35 | Instance = this; 36 | Receivers = new Dictionary(); 37 | Clients = new Dictionary(); 38 | } 39 | 40 | private void Update() { 41 | foreach (var receiver in Receivers) { 42 | while (receiver.Value.WaitingMessagesCount() > 0) //Allow to switch from receiver/server thread to main thread 43 | receiver.Value.PropagateEvent(); 44 | } 45 | } 46 | 47 | public static bool HasClient(string clientId) { 48 | return Clients.ContainsKey(clientId); 49 | } 50 | 51 | public static bool HasReceiver(string receiverId) { 52 | return Receivers.ContainsKey(receiverId); 53 | } 54 | 55 | public static void CreateClient(string clientId, string destination, int port) { 56 | CreateClient(clientId, IPAddress.Parse(destination), port); 57 | } 58 | 59 | public static void CreateClient(string clientId, IPAddress destination, int port) { 60 | var client = new OSCClient(destination, port) { 61 | Name = clientId 62 | }; 63 | 64 | Clients.Add(clientId, client); 65 | 66 | if (Instance.ShowDebug) 67 | Debug.Log("Client " + clientId + " on " + destination + ":" + port + "created."); 68 | } 69 | 70 | public static void RemoveClient(string clientId) { 71 | Clients[clientId].Close(); 72 | Clients.Remove(clientId); 73 | 74 | if (Instance.ShowDebug) 75 | Debug.Log("Client " + clientId + " removed."); 76 | } 77 | 78 | public static OSCReceiver CreateReceiver(string receiverId, int port) { 79 | var receiver = new OSCReceiver { 80 | Name = receiverId 81 | }; 82 | 83 | if (!receiver.Open(port)) { 84 | return null; 85 | } 86 | 87 | Receivers.Add(receiverId, receiver); 88 | 89 | if (Instance.ShowDebug) 90 | Debug.Log("Receiver " + receiverId + " on " + port + " created."); 91 | 92 | return receiver; 93 | } 94 | 95 | public static void RemoveReceiver(string receiverId) { 96 | Receivers[receiverId].Close(); 97 | Receivers.Remove(receiverId); 98 | 99 | if (Instance.ShowDebug) 100 | Debug.Log("Receiver " + receiverId + " removed."); 101 | } 102 | 103 | public static void SendMessageUsingClient(string clientId, OSCMessage msg) { 104 | Clients[clientId].Send(msg); 105 | 106 | if (Instance.LogOutgoing) { 107 | Debug.Log("[" + clientId + " to " + Clients[clientId].ClientIPAddress.ToString() + ":" + Clients[clientId].Port + "|" + DateTime.Now.ToLocalTime() + "] " + msg.Address); 108 | foreach (var data in msg.Data) 109 | Debug.Log(data); 110 | } 111 | } 112 | 113 | public static void SendMessage(OSCMessage m, string host, int port) { 114 | if (Instance.LogOutgoing) { 115 | string args = ""; 116 | for (int i = 0; i < m.Data.Count; i++) 117 | args += (i > 0 ? ", " : "") + m.Data[i].ToString(); 118 | 119 | Debug.Log("[OSCMaster to" + host + ":" + port + " | " + DateTime.Now.ToLocalTime() + "] " + m.Address + " : " + args); 120 | } 121 | 122 | var tempClient = new OSCClient(System.Net.IPAddress.Loopback, port); 123 | tempClient.SendTo(m, host, port); 124 | tempClient.Close(); 125 | } 126 | 127 | 128 | void OnDestroy() { 129 | foreach (var pair in Clients) { 130 | pair.Value.Close(); 131 | } 132 | 133 | foreach (var pair in Receivers) { 134 | pair.Value.Close(); 135 | } 136 | 137 | //_instance = null; 138 | } 139 | } 140 | } 141 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/OSCMaster.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 85039493e6f0daf4ca49ea2144197ed4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: -50 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/README.md: -------------------------------------------------------------------------------- 1 | ## UnityOSC v1.2. 2 | 3 | Open Sound Control classes and API for the Unity 3d game engine 4 | 5 | Based on Bespoke Open Sound Control Library by Paul Varcholik (pvarchol@bespokesoftware.org). 6 | Licensed under MIT license. 7 | 8 | ## How to use 9 | 10 | ### Install 11 | 12 | Copy the src/Editor folder contents to the corresponding Editor/ folder of your Unity project. The rest can go to your e.g. Assets/ folder of the same project. 13 | 14 | ### Usage 15 | 16 | There are two different approaches to use the plugin: 17 | 18 | #### OSCHandler 19 | 20 | The first and original approach works by modifying and initializing the `OSCHandler`. It is a Singleton handling your client & server connections and sending & receiving OSC data. Additionally, all incoming and outgoing messages are logged and can be viewed in an Editor Window. 21 | 22 | Check the documentation below for more detailed instructions. 23 | 24 | #### OSCReceiver 25 | 26 | The second approach is a simple `OSCReceiver` which only supports receiving OSC data but with the benefits of reduced complexity and a thread-safe `OSCMessage` queue. 27 | 28 | After opening a server connection by `OSCReceiver.Open(int port)` you can easily receive new OSCMessages via `OSCReceiver.getNextMessage()`. Always make sure there are OSCMessages available by using `OSCReceiver.hasWaitingMessages()` before trying to receive new ones. 29 | 30 | ## Documentation and examples of usage 31 | 32 | docs/doxygen/html/index.html 33 | 34 | docs/UnityOSC_manual.pdf 35 | 36 | docs/UnityOSC & TouchOSC Integration.pdf 37 | 38 | Please head to the tests/ folder for examples of usage and a TouchOSC test Unity project. 39 | 40 | ## TODO 41 | 42 | 07.11 Change string concatenations to C# string builders. 43 | -------------------------------------------------------------------------------- /Plugins/UnityOSC/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e381b354a44d4b448ac1b1707bfd1b60 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 919093fc9d3e26a479e0023d359035c1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Prefabs/Augmenta.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1772874338564897812 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 1772874338564897813} 12 | - component: {fileID: 1772874338564897810} 13 | m_Layer: 0 14 | m_Name: Augmenta 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &1772874338564897813 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 1772874338564897812} 27 | serializedVersion: 2 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_ConstrainProportionsScale: 0 32 | m_Children: [] 33 | m_Father: {fileID: 0} 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!114 &1772874338564897810 36 | MonoBehaviour: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 1772874338564897812} 42 | m_Enabled: 1 43 | m_EditorHideFlags: 0 44 | m_Script: {fileID: 11500000, guid: 2a6216aad597d8a4e94fe7c0ef766a37, type: 3} 45 | m_Name: 46 | m_EditorClassIdentifier: 47 | augmentaId: Main 48 | _inputPort: 12000 49 | portBinded: 0 50 | receivingData: 0 51 | protocolVersion: 1 52 | pixelSize: 0.005 53 | scaling: {x: 1, y: 1} 54 | flipX: 0 55 | flipY: 0 56 | augmentaObjectTimeOut: 1 57 | desiredAugmentaObjectType: 0 58 | desiredAugmentaObjectCount: 1 59 | velocitySmoothing: 0.5 60 | positionOffsetFromVelocity: 0 61 | positionFromBoundingBox: 0 62 | augmentaScenePrefab: {fileID: 7870137636367897960, guid: 1f88dc5aedbc8814b9b3f0bf73b3c6b6, 63 | type: 3} 64 | augmentaObjectPrefab: {fileID: 9127892026477570146, guid: d1029461073db394a800b516377c2ab4, 65 | type: 3} 66 | customObjectPrefab: {fileID: 0} 67 | customObjectPositionType: 0 68 | customObjectRotationType: 0 69 | customObjectScalingType: 0 70 | videoOutputSizeInPixels: {x: 0, y: 0} 71 | videoOutputSizeInMeters: {x: 0, y: 0} 72 | videoOutputOffset: {x: 0, y: 0} 73 | mute: 0 74 | augmentaScene: {fileID: 0} 75 | _showSceneDebug: 1 76 | _showObjectDebug: 1 77 | -------------------------------------------------------------------------------- /Prefabs/Augmenta.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3893de5ef0f42a048bd9142972e01291 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Prefabs/AugmentaVideoOutput.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &8323288267989200192 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 8323288267989200254} 12 | - component: {fileID: 8323288267989200193} 13 | m_Layer: 0 14 | m_Name: AugmentaVideoOutput 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &8323288267989200254 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 8323288267989200192} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 0, y: 0, z: 0} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_Children: [] 31 | m_Father: {fileID: 0} 32 | m_RootOrder: 0 33 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 34 | --- !u!114 &8323288267989200193 35 | MonoBehaviour: 36 | m_ObjectHideFlags: 0 37 | m_CorrespondingSourceObject: {fileID: 0} 38 | m_PrefabInstance: {fileID: 0} 39 | m_PrefabAsset: {fileID: 0} 40 | m_GameObject: {fileID: 8323288267989200192} 41 | m_Enabled: 1 42 | m_EditorHideFlags: 0 43 | m_Script: {fileID: 11500000, guid: 2bc981ad089ad4e468a94af62c1203b8, type: 3} 44 | m_Name: 45 | m_EditorClassIdentifier: 46 | augmentaManager: {fileID: 0} 47 | camera: {fileID: 0} 48 | paddingColor: {r: 0, g: 0, b: 0, a: 1} 49 | autoOutputSizeInPixels: 1 50 | autoOutputSizeInMeters: 1 51 | autoOutputOffset: 1 52 | botLeftCorner: {x: 0, y: 0, z: 0} 53 | botRightCorner: {x: 0, y: 0, z: 0} 54 | topLeftCorner: {x: 0, y: 0, z: 0} 55 | topRightCorner: {x: 0, y: 0, z: 0} 56 | _videoOutputSizeInPixels: {x: 1200, y: 1200} 57 | _videoOutputSizeInMeters: {x: 0, y: 0} 58 | _videoOutputOffset: {x: 0, y: 0} 59 | _cameraMode: 2 60 | -------------------------------------------------------------------------------- /Prefabs/AugmentaVideoOutput.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3b1a973b921bcfc44b78a997e6497dd7 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Prefabs/AugmentaVideoOutputWithCamera.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &5911934448075057492 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 4287684411615678005} 12 | - component: {fileID: 6782243780472929878} 13 | - component: {fileID: 8025085316270742507} 14 | m_Layer: 0 15 | m_Name: Camera 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &4287684411615678005 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 5911934448075057492} 28 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_Children: [] 32 | m_Father: {fileID: 1478169657122737632} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!20 &6782243780472929878 36 | Camera: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 5911934448075057492} 42 | m_Enabled: 1 43 | serializedVersion: 2 44 | m_ClearFlags: 2 45 | m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} 46 | m_projectionMatrixMode: 1 47 | m_GateFitMode: 2 48 | m_FOVAxisMode: 0 49 | m_SensorSize: {x: 36, y: 24} 50 | m_LensShift: {x: 0, y: 0} 51 | m_FocalLength: 50 52 | m_NormalizedViewPortRect: 53 | serializedVersion: 2 54 | x: 0 55 | y: 0 56 | width: 1 57 | height: 1 58 | near clip plane: 0.3 59 | far clip plane: 1000 60 | field of view: 60 61 | orthographic: 0 62 | orthographic size: 5 63 | m_Depth: 0 64 | m_CullingMask: 65 | serializedVersion: 2 66 | m_Bits: 4294967295 67 | m_RenderingPath: -1 68 | m_TargetTexture: {fileID: 0} 69 | m_TargetDisplay: 0 70 | m_TargetEye: 3 71 | m_HDR: 0 72 | m_AllowMSAA: 0 73 | m_AllowDynamicResolution: 0 74 | m_ForceIntoRT: 0 75 | m_OcclusionCulling: 1 76 | m_StereoConvergence: 10 77 | m_StereoSeparation: 0.022 78 | --- !u!114 &8025085316270742507 79 | MonoBehaviour: 80 | m_ObjectHideFlags: 0 81 | m_CorrespondingSourceObject: {fileID: 0} 82 | m_PrefabInstance: {fileID: 0} 83 | m_PrefabAsset: {fileID: 0} 84 | m_GameObject: {fileID: 5911934448075057492} 85 | m_Enabled: 1 86 | m_EditorHideFlags: 0 87 | m_Script: {fileID: 11500000, guid: 48c22896cd63ce544b3c2b1635387b3a, type: 3} 88 | m_Name: 89 | m_EditorClassIdentifier: 90 | cameraType: 1 91 | augmentaVideoOutput: {fileID: 1478169657122737631} 92 | distanceToVideoOutput: 10 93 | --- !u!1001 &7422426882154684574 94 | PrefabInstance: 95 | m_ObjectHideFlags: 0 96 | serializedVersion: 2 97 | m_Modification: 98 | m_TransformParent: {fileID: 0} 99 | m_Modifications: 100 | - target: {fileID: 8323288267989200192, guid: 3b1a973b921bcfc44b78a997e6497dd7, 101 | type: 3} 102 | propertyPath: m_Name 103 | value: AugmentaVideoOutputWithCamera 104 | objectReference: {fileID: 0} 105 | - target: {fileID: 8323288267989200193, guid: 3b1a973b921bcfc44b78a997e6497dd7, 106 | type: 3} 107 | propertyPath: _cameraMode 108 | value: 1 109 | objectReference: {fileID: 0} 110 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 111 | type: 3} 112 | propertyPath: m_RootOrder 113 | value: 0 114 | objectReference: {fileID: 0} 115 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 116 | type: 3} 117 | propertyPath: m_LocalPosition.x 118 | value: 0 119 | objectReference: {fileID: 0} 120 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 121 | type: 3} 122 | propertyPath: m_LocalPosition.y 123 | value: 0 124 | objectReference: {fileID: 0} 125 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 126 | type: 3} 127 | propertyPath: m_LocalPosition.z 128 | value: 0 129 | objectReference: {fileID: 0} 130 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 131 | type: 3} 132 | propertyPath: m_LocalRotation.w 133 | value: 1 134 | objectReference: {fileID: 0} 135 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 136 | type: 3} 137 | propertyPath: m_LocalRotation.x 138 | value: 0 139 | objectReference: {fileID: 0} 140 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 141 | type: 3} 142 | propertyPath: m_LocalRotation.y 143 | value: 0 144 | objectReference: {fileID: 0} 145 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 146 | type: 3} 147 | propertyPath: m_LocalRotation.z 148 | value: 0 149 | objectReference: {fileID: 0} 150 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 151 | type: 3} 152 | propertyPath: m_LocalEulerAnglesHint.x 153 | value: 0 154 | objectReference: {fileID: 0} 155 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 156 | type: 3} 157 | propertyPath: m_LocalEulerAnglesHint.y 158 | value: 0 159 | objectReference: {fileID: 0} 160 | - target: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 161 | type: 3} 162 | propertyPath: m_LocalEulerAnglesHint.z 163 | value: 0 164 | objectReference: {fileID: 0} 165 | m_RemovedComponents: [] 166 | m_SourcePrefab: {fileID: 100100000, guid: 3b1a973b921bcfc44b78a997e6497dd7, type: 3} 167 | --- !u!4 &1478169657122737632 stripped 168 | Transform: 169 | m_CorrespondingSourceObject: {fileID: 8323288267989200254, guid: 3b1a973b921bcfc44b78a997e6497dd7, 170 | type: 3} 171 | m_PrefabInstance: {fileID: 7422426882154684574} 172 | m_PrefabAsset: {fileID: 0} 173 | --- !u!114 &1478169657122737631 stripped 174 | MonoBehaviour: 175 | m_CorrespondingSourceObject: {fileID: 8323288267989200193, guid: 3b1a973b921bcfc44b78a997e6497dd7, 176 | type: 3} 177 | m_PrefabInstance: {fileID: 7422426882154684574} 178 | m_PrefabAsset: {fileID: 0} 179 | m_GameObject: {fileID: 0} 180 | m_Enabled: 1 181 | m_EditorHideFlags: 0 182 | m_Script: {fileID: 11500000, guid: 2bc981ad089ad4e468a94af62c1203b8, type: 3} 183 | m_Name: 184 | m_EditorClassIdentifier: 185 | -------------------------------------------------------------------------------- /Prefabs/AugmentaVideoOutputWithCamera.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d7a911dfaff1dc54b8dc9f835fa19814 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Prefabs/AugmentaWithCamera.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &1383861036 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 1383861037} 12 | - component: {fileID: 1383861039} 13 | - component: {fileID: 1383861040} 14 | m_Layer: 0 15 | m_Name: Camera 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &1383861037 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 1383861036} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0, z: 0} 30 | m_LocalScale: {x: 1, y: 1, z: 1} 31 | m_Children: [] 32 | m_Father: {fileID: 8715168552399655841} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!20 &1383861039 36 | Camera: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 1383861036} 42 | m_Enabled: 1 43 | serializedVersion: 2 44 | m_ClearFlags: 2 45 | m_BackGroundColor: {r: 0, g: 0, b: 0, a: 0} 46 | m_projectionMatrixMode: 1 47 | m_GateFitMode: 2 48 | m_FOVAxisMode: 0 49 | m_SensorSize: {x: 36, y: 24} 50 | m_LensShift: {x: 0, y: 0} 51 | m_FocalLength: 50 52 | m_NormalizedViewPortRect: 53 | serializedVersion: 2 54 | x: 0 55 | y: 0 56 | width: 1 57 | height: 1 58 | near clip plane: 0.3 59 | far clip plane: 1000 60 | field of view: 60 61 | orthographic: 0 62 | orthographic size: 5 63 | m_Depth: 0 64 | m_CullingMask: 65 | serializedVersion: 2 66 | m_Bits: 4294967295 67 | m_RenderingPath: -1 68 | m_TargetTexture: {fileID: 0} 69 | m_TargetDisplay: 0 70 | m_TargetEye: 3 71 | m_HDR: 0 72 | m_AllowMSAA: 0 73 | m_AllowDynamicResolution: 0 74 | m_ForceIntoRT: 0 75 | m_OcclusionCulling: 1 76 | m_StereoConvergence: 10 77 | m_StereoSeparation: 0.022 78 | --- !u!114 &1383861040 79 | MonoBehaviour: 80 | m_ObjectHideFlags: 0 81 | m_CorrespondingSourceObject: {fileID: 0} 82 | m_PrefabInstance: {fileID: 0} 83 | m_PrefabAsset: {fileID: 0} 84 | m_GameObject: {fileID: 1383861036} 85 | m_Enabled: 1 86 | m_EditorHideFlags: 0 87 | m_Script: {fileID: 11500000, guid: 65d27036d52cbbd4db8cc98ef8b3edf9, type: 3} 88 | m_Name: 89 | m_EditorClassIdentifier: 90 | cameraType: 1 91 | augmentaManager: {fileID: 8715168552399655846} 92 | distanceToScene: 10 93 | --- !u!1001 &6947079840495251380 94 | PrefabInstance: 95 | m_ObjectHideFlags: 0 96 | serializedVersion: 2 97 | m_Modification: 98 | m_TransformParent: {fileID: 0} 99 | m_Modifications: 100 | - target: {fileID: 1772874338564897812, guid: 3893de5ef0f42a048bd9142972e01291, 101 | type: 3} 102 | propertyPath: m_Name 103 | value: AugmentaWithCamera 104 | objectReference: {fileID: 0} 105 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 106 | type: 3} 107 | propertyPath: m_RootOrder 108 | value: 0 109 | objectReference: {fileID: 0} 110 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 111 | type: 3} 112 | propertyPath: m_LocalPosition.x 113 | value: 0 114 | objectReference: {fileID: 0} 115 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 116 | type: 3} 117 | propertyPath: m_LocalPosition.y 118 | value: 0 119 | objectReference: {fileID: 0} 120 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 121 | type: 3} 122 | propertyPath: m_LocalPosition.z 123 | value: 0 124 | objectReference: {fileID: 0} 125 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 126 | type: 3} 127 | propertyPath: m_LocalRotation.w 128 | value: 1 129 | objectReference: {fileID: 0} 130 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 131 | type: 3} 132 | propertyPath: m_LocalRotation.x 133 | value: 0 134 | objectReference: {fileID: 0} 135 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 136 | type: 3} 137 | propertyPath: m_LocalRotation.y 138 | value: 0 139 | objectReference: {fileID: 0} 140 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 141 | type: 3} 142 | propertyPath: m_LocalRotation.z 143 | value: 0 144 | objectReference: {fileID: 0} 145 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 146 | type: 3} 147 | propertyPath: m_LocalEulerAnglesHint.x 148 | value: 0 149 | objectReference: {fileID: 0} 150 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 151 | type: 3} 152 | propertyPath: m_LocalEulerAnglesHint.y 153 | value: 0 154 | objectReference: {fileID: 0} 155 | - target: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 156 | type: 3} 157 | propertyPath: m_LocalEulerAnglesHint.z 158 | value: 0 159 | objectReference: {fileID: 0} 160 | m_RemovedComponents: [] 161 | m_SourcePrefab: {fileID: 100100000, guid: 3893de5ef0f42a048bd9142972e01291, type: 3} 162 | --- !u!4 &8715168552399655841 stripped 163 | Transform: 164 | m_CorrespondingSourceObject: {fileID: 1772874338564897813, guid: 3893de5ef0f42a048bd9142972e01291, 165 | type: 3} 166 | m_PrefabInstance: {fileID: 6947079840495251380} 167 | m_PrefabAsset: {fileID: 0} 168 | --- !u!114 &8715168552399655846 stripped 169 | MonoBehaviour: 170 | m_CorrespondingSourceObject: {fileID: 1772874338564897810, guid: 3893de5ef0f42a048bd9142972e01291, 171 | type: 3} 172 | m_PrefabInstance: {fileID: 6947079840495251380} 173 | m_PrefabAsset: {fileID: 0} 174 | m_GameObject: {fileID: 0} 175 | m_Enabled: 1 176 | m_EditorHideFlags: 0 177 | m_Script: {fileID: 11500000, guid: 2a6216aad597d8a4e94fe7c0ef766a37, type: 3} 178 | m_Name: 179 | m_EditorClassIdentifier: 180 | -------------------------------------------------------------------------------- /Prefabs/AugmentaWithCamera.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f6a9ca1c5f519c4a915444dc1505402 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Prefabs/Debug.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f3af2aa44ec8f2545aced9b7e9708710 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Prefabs/Debug/AugmentaObject.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &3129054637571367275 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 6820061578582001486} 12 | - component: {fileID: 6277374306744804509} 13 | - component: {fileID: 4046492468546139849} 14 | m_Layer: 0 15 | m_Name: Velocity 16 | m_TagString: Untagged 17 | m_Icon: {fileID: 0} 18 | m_NavMeshLayer: 0 19 | m_StaticEditorFlags: 0 20 | m_IsActive: 1 21 | --- !u!4 &6820061578582001486 22 | Transform: 23 | m_ObjectHideFlags: 0 24 | m_CorrespondingSourceObject: {fileID: 0} 25 | m_PrefabInstance: {fileID: 0} 26 | m_PrefabAsset: {fileID: 0} 27 | m_GameObject: {fileID: 3129054637571367275} 28 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 29 | m_LocalPosition: {x: 0, y: 0.5, z: 0.5} 30 | m_LocalScale: {x: 0.05, y: 0.05, z: 1} 31 | m_Children: [] 32 | m_Father: {fileID: 5581722689723464186} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!33 &6277374306744804509 36 | MeshFilter: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 3129054637571367275} 42 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 43 | --- !u!23 &4046492468546139849 44 | MeshRenderer: 45 | m_ObjectHideFlags: 0 46 | m_CorrespondingSourceObject: {fileID: 0} 47 | m_PrefabInstance: {fileID: 0} 48 | m_PrefabAsset: {fileID: 0} 49 | m_GameObject: {fileID: 3129054637571367275} 50 | m_Enabled: 1 51 | m_CastShadows: 1 52 | m_ReceiveShadows: 1 53 | m_DynamicOccludee: 1 54 | m_MotionVectors: 1 55 | m_LightProbeUsage: 1 56 | m_ReflectionProbeUsage: 1 57 | m_RayTracingMode: 2 58 | m_RayTraceProcedural: 0 59 | m_RenderingLayerMask: 1 60 | m_RendererPriority: 0 61 | m_Materials: 62 | - {fileID: 2100000, guid: 26e3b8924c944a04f9c8eb7610036aa9, type: 2} 63 | m_StaticBatchInfo: 64 | firstSubMesh: 0 65 | subMeshCount: 0 66 | m_StaticBatchRoot: {fileID: 0} 67 | m_ProbeAnchor: {fileID: 0} 68 | m_LightProbeVolumeOverride: {fileID: 0} 69 | m_ScaleInLightmap: 1 70 | m_ReceiveGI: 1 71 | m_PreserveUVs: 0 72 | m_IgnoreNormalsForChartDetection: 0 73 | m_ImportantGI: 0 74 | m_StitchLightmapSeams: 1 75 | m_SelectedEditorRenderState: 3 76 | m_MinimumChartSize: 4 77 | m_AutoUVMaxDistance: 0.5 78 | m_AutoUVMaxAngle: 89 79 | m_LightmapParameters: {fileID: 0} 80 | m_SortingLayerID: 0 81 | m_SortingLayer: 0 82 | m_SortingOrder: 0 83 | m_AdditionalVertexStreams: {fileID: 0} 84 | --- !u!1 &7644094214414990225 85 | GameObject: 86 | m_ObjectHideFlags: 0 87 | m_CorrespondingSourceObject: {fileID: 0} 88 | m_PrefabInstance: {fileID: 0} 89 | m_PrefabAsset: {fileID: 0} 90 | serializedVersion: 6 91 | m_Component: 92 | - component: {fileID: 3552796606555849774} 93 | m_Layer: 0 94 | m_Name: OrientationPivot 95 | m_TagString: Untagged 96 | m_Icon: {fileID: 0} 97 | m_NavMeshLayer: 0 98 | m_StaticEditorFlags: 0 99 | m_IsActive: 1 100 | --- !u!4 &3552796606555849774 101 | Transform: 102 | m_ObjectHideFlags: 0 103 | m_CorrespondingSourceObject: {fileID: 0} 104 | m_PrefabInstance: {fileID: 0} 105 | m_PrefabAsset: {fileID: 0} 106 | m_GameObject: {fileID: 7644094214414990225} 107 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 108 | m_LocalPosition: {x: 0, y: 0, z: 0} 109 | m_LocalScale: {x: 1, y: 1, z: 1} 110 | m_Children: 111 | - {fileID: 3249705111531912429} 112 | m_Father: {fileID: 9127892026477570148} 113 | m_RootOrder: 2 114 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 115 | --- !u!1 &7788265575643023910 116 | GameObject: 117 | m_ObjectHideFlags: 0 118 | m_CorrespondingSourceObject: {fileID: 0} 119 | m_PrefabInstance: {fileID: 0} 120 | m_PrefabAsset: {fileID: 0} 121 | serializedVersion: 6 122 | m_Component: 123 | - component: {fileID: 3249705111531912429} 124 | - component: {fileID: 766148864445978909} 125 | - component: {fileID: 6417012263404541823} 126 | m_Layer: 0 127 | m_Name: Orientation 128 | m_TagString: Untagged 129 | m_Icon: {fileID: 0} 130 | m_NavMeshLayer: 0 131 | m_StaticEditorFlags: 0 132 | m_IsActive: 1 133 | --- !u!4 &3249705111531912429 134 | Transform: 135 | m_ObjectHideFlags: 0 136 | m_CorrespondingSourceObject: {fileID: 0} 137 | m_PrefabInstance: {fileID: 0} 138 | m_PrefabAsset: {fileID: 0} 139 | m_GameObject: {fileID: 7788265575643023910} 140 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 141 | m_LocalPosition: {x: 0, y: 0.5, z: 0.25} 142 | m_LocalScale: {x: 0.05, y: 0.05, z: 0.5} 143 | m_Children: [] 144 | m_Father: {fileID: 3552796606555849774} 145 | m_RootOrder: 0 146 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 147 | --- !u!33 &766148864445978909 148 | MeshFilter: 149 | m_ObjectHideFlags: 0 150 | m_CorrespondingSourceObject: {fileID: 0} 151 | m_PrefabInstance: {fileID: 0} 152 | m_PrefabAsset: {fileID: 0} 153 | m_GameObject: {fileID: 7788265575643023910} 154 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 155 | --- !u!23 &6417012263404541823 156 | MeshRenderer: 157 | m_ObjectHideFlags: 0 158 | m_CorrespondingSourceObject: {fileID: 0} 159 | m_PrefabInstance: {fileID: 0} 160 | m_PrefabAsset: {fileID: 0} 161 | m_GameObject: {fileID: 7788265575643023910} 162 | m_Enabled: 1 163 | m_CastShadows: 1 164 | m_ReceiveShadows: 1 165 | m_DynamicOccludee: 1 166 | m_MotionVectors: 1 167 | m_LightProbeUsage: 1 168 | m_ReflectionProbeUsage: 1 169 | m_RayTracingMode: 2 170 | m_RayTraceProcedural: 0 171 | m_RenderingLayerMask: 1 172 | m_RendererPriority: 0 173 | m_Materials: 174 | - {fileID: 2100000, guid: 720106550ad579446883f2c8f5a30219, type: 2} 175 | m_StaticBatchInfo: 176 | firstSubMesh: 0 177 | subMeshCount: 0 178 | m_StaticBatchRoot: {fileID: 0} 179 | m_ProbeAnchor: {fileID: 0} 180 | m_LightProbeVolumeOverride: {fileID: 0} 181 | m_ScaleInLightmap: 1 182 | m_ReceiveGI: 1 183 | m_PreserveUVs: 0 184 | m_IgnoreNormalsForChartDetection: 0 185 | m_ImportantGI: 0 186 | m_StitchLightmapSeams: 1 187 | m_SelectedEditorRenderState: 3 188 | m_MinimumChartSize: 4 189 | m_AutoUVMaxDistance: 0.5 190 | m_AutoUVMaxAngle: 89 191 | m_LightmapParameters: {fileID: 0} 192 | m_SortingLayerID: 0 193 | m_SortingLayer: 0 194 | m_SortingOrder: 0 195 | m_AdditionalVertexStreams: {fileID: 0} 196 | --- !u!1 &9127892026477570146 197 | GameObject: 198 | m_ObjectHideFlags: 0 199 | m_CorrespondingSourceObject: {fileID: 0} 200 | m_PrefabInstance: {fileID: 0} 201 | m_PrefabAsset: {fileID: 0} 202 | serializedVersion: 6 203 | m_Component: 204 | - component: {fileID: 9127892026477570148} 205 | - component: {fileID: 9127892026477570149} 206 | m_Layer: 0 207 | m_Name: AugmentaObject 208 | m_TagString: Untagged 209 | m_Icon: {fileID: 0} 210 | m_NavMeshLayer: 0 211 | m_StaticEditorFlags: 0 212 | m_IsActive: 1 213 | --- !u!4 &9127892026477570148 214 | Transform: 215 | m_ObjectHideFlags: 0 216 | m_CorrespondingSourceObject: {fileID: 0} 217 | m_PrefabInstance: {fileID: 0} 218 | m_PrefabAsset: {fileID: 0} 219 | m_GameObject: {fileID: 9127892026477570146} 220 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 221 | m_LocalPosition: {x: 0, y: 0, z: 0} 222 | m_LocalScale: {x: 1, y: 1, z: 1} 223 | m_Children: 224 | - {fileID: 9127892027014267412} 225 | - {fileID: 5581722689723464186} 226 | - {fileID: 3552796606555849774} 227 | m_Father: {fileID: 0} 228 | m_RootOrder: 0 229 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 230 | --- !u!114 &9127892026477570149 231 | MonoBehaviour: 232 | m_ObjectHideFlags: 0 233 | m_CorrespondingSourceObject: {fileID: 0} 234 | m_PrefabInstance: {fileID: 0} 235 | m_PrefabAsset: {fileID: 0} 236 | m_GameObject: {fileID: 9127892026477570146} 237 | m_Enabled: 1 238 | m_EditorHideFlags: 0 239 | m_Script: {fileID: 11500000, guid: 630ed87da88e5bb419c5e1e3a58ae74d, type: 3} 240 | m_Name: 241 | m_EditorClassIdentifier: 242 | augmentaManager: {fileID: 0} 243 | showDebug: 0 244 | debugObject: {fileID: 9127892027014267413} 245 | debugVelocityPivot: {fileID: 9215737759918594999} 246 | debugVelocity: {fileID: 3129054637571367275} 247 | debugOrientationPivot: {fileID: 7644094214414990225} 248 | debugOrientation: {fileID: 7788265575643023910} 249 | id: 0 250 | oid: 0 251 | ageInFrames: 0 252 | ageInSeconds: 0 253 | centroid: {x: 0, y: 0} 254 | velocity: {x: 0, y: 0} 255 | orientation: 0 256 | depth: 0 257 | boundingRect: 258 | serializedVersion: 2 259 | x: 0 260 | y: 0 261 | width: 0 262 | height: 0 263 | boundingRectRotation: 0 264 | highest: {x: 0, y: 0, z: 0} 265 | distanceToSensor: 0 266 | reflectivity: 0 267 | inactiveTime: 0 268 | worldPosition2D: {x: 0, y: 0, z: 0} 269 | worldPosition3D: {x: 0, y: 0, z: 0} 270 | worldScale: {x: 0, y: 0, z: 0} 271 | worldVelocity2D: {x: 0, y: 0, z: 0} 272 | worldVelocity3D: {x: 0, y: 0, z: 0} 273 | useCustomObject: 0 274 | --- !u!1 &9127892027014267413 275 | GameObject: 276 | m_ObjectHideFlags: 0 277 | m_CorrespondingSourceObject: {fileID: 0} 278 | m_PrefabInstance: {fileID: 0} 279 | m_PrefabAsset: {fileID: 0} 280 | serializedVersion: 6 281 | m_Component: 282 | - component: {fileID: 9127892027014267412} 283 | - component: {fileID: 9127892027014267625} 284 | - component: {fileID: 9127892027014267414} 285 | m_Layer: 0 286 | m_Name: Debug 287 | m_TagString: Untagged 288 | m_Icon: {fileID: 0} 289 | m_NavMeshLayer: 0 290 | m_StaticEditorFlags: 0 291 | m_IsActive: 1 292 | --- !u!4 &9127892027014267412 293 | Transform: 294 | m_ObjectHideFlags: 0 295 | m_CorrespondingSourceObject: {fileID: 0} 296 | m_PrefabInstance: {fileID: 0} 297 | m_PrefabAsset: {fileID: 0} 298 | m_GameObject: {fileID: 9127892027014267413} 299 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 300 | m_LocalPosition: {x: 0, y: 0, z: 0} 301 | m_LocalScale: {x: 1, y: 1, z: 1} 302 | m_Children: [] 303 | m_Father: {fileID: 9127892026477570148} 304 | m_RootOrder: 0 305 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 306 | --- !u!33 &9127892027014267625 307 | MeshFilter: 308 | m_ObjectHideFlags: 0 309 | m_CorrespondingSourceObject: {fileID: 0} 310 | m_PrefabInstance: {fileID: 0} 311 | m_PrefabAsset: {fileID: 0} 312 | m_GameObject: {fileID: 9127892027014267413} 313 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 314 | --- !u!23 &9127892027014267414 315 | MeshRenderer: 316 | m_ObjectHideFlags: 0 317 | m_CorrespondingSourceObject: {fileID: 0} 318 | m_PrefabInstance: {fileID: 0} 319 | m_PrefabAsset: {fileID: 0} 320 | m_GameObject: {fileID: 9127892027014267413} 321 | m_Enabled: 1 322 | m_CastShadows: 1 323 | m_ReceiveShadows: 1 324 | m_DynamicOccludee: 1 325 | m_MotionVectors: 1 326 | m_LightProbeUsage: 1 327 | m_ReflectionProbeUsage: 1 328 | m_RayTracingMode: 2 329 | m_RayTraceProcedural: 0 330 | m_RenderingLayerMask: 1 331 | m_RendererPriority: 0 332 | m_Materials: 333 | - {fileID: 2100000, guid: 5565f52ee1ec29741ae6add23be6671b, type: 2} 334 | m_StaticBatchInfo: 335 | firstSubMesh: 0 336 | subMeshCount: 0 337 | m_StaticBatchRoot: {fileID: 0} 338 | m_ProbeAnchor: {fileID: 0} 339 | m_LightProbeVolumeOverride: {fileID: 0} 340 | m_ScaleInLightmap: 1 341 | m_ReceiveGI: 1 342 | m_PreserveUVs: 0 343 | m_IgnoreNormalsForChartDetection: 0 344 | m_ImportantGI: 0 345 | m_StitchLightmapSeams: 1 346 | m_SelectedEditorRenderState: 3 347 | m_MinimumChartSize: 4 348 | m_AutoUVMaxDistance: 0.5 349 | m_AutoUVMaxAngle: 89 350 | m_LightmapParameters: {fileID: 0} 351 | m_SortingLayerID: 0 352 | m_SortingLayer: 0 353 | m_SortingOrder: 0 354 | m_AdditionalVertexStreams: {fileID: 0} 355 | --- !u!1 &9215737759918594999 356 | GameObject: 357 | m_ObjectHideFlags: 0 358 | m_CorrespondingSourceObject: {fileID: 0} 359 | m_PrefabInstance: {fileID: 0} 360 | m_PrefabAsset: {fileID: 0} 361 | serializedVersion: 6 362 | m_Component: 363 | - component: {fileID: 5581722689723464186} 364 | m_Layer: 0 365 | m_Name: VelocityPivot 366 | m_TagString: Untagged 367 | m_Icon: {fileID: 0} 368 | m_NavMeshLayer: 0 369 | m_StaticEditorFlags: 0 370 | m_IsActive: 1 371 | --- !u!4 &5581722689723464186 372 | Transform: 373 | m_ObjectHideFlags: 0 374 | m_CorrespondingSourceObject: {fileID: 0} 375 | m_PrefabInstance: {fileID: 0} 376 | m_PrefabAsset: {fileID: 0} 377 | m_GameObject: {fileID: 9215737759918594999} 378 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 379 | m_LocalPosition: {x: 0, y: 0, z: 0} 380 | m_LocalScale: {x: 1, y: 1, z: 1} 381 | m_Children: 382 | - {fileID: 6820061578582001486} 383 | m_Father: {fileID: 9127892026477570148} 384 | m_RootOrder: 1 385 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 386 | -------------------------------------------------------------------------------- /Prefabs/Debug/AugmentaObject.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d1029461073db394a800b516377c2ab4 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Prefabs/Debug/AugmentaScene.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &7870137636367897960 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 7870137636367897962} 12 | - component: {fileID: 7870137636367897961} 13 | m_Layer: 0 14 | m_Name: AugmentaScene 15 | m_TagString: Untagged 16 | m_Icon: {fileID: 0} 17 | m_NavMeshLayer: 0 18 | m_StaticEditorFlags: 0 19 | m_IsActive: 1 20 | --- !u!4 &7870137636367897962 21 | Transform: 22 | m_ObjectHideFlags: 0 23 | m_CorrespondingSourceObject: {fileID: 0} 24 | m_PrefabInstance: {fileID: 0} 25 | m_PrefabAsset: {fileID: 0} 26 | m_GameObject: {fileID: 7870137636367897960} 27 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 28 | m_LocalPosition: {x: 0, y: 0, z: 0} 29 | m_LocalScale: {x: 1, y: 1, z: 1} 30 | m_Children: 31 | - {fileID: 7870137636474112465} 32 | m_Father: {fileID: 0} 33 | m_RootOrder: 0 34 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 35 | --- !u!114 &7870137636367897961 36 | MonoBehaviour: 37 | m_ObjectHideFlags: 0 38 | m_CorrespondingSourceObject: {fileID: 0} 39 | m_PrefabInstance: {fileID: 0} 40 | m_PrefabAsset: {fileID: 0} 41 | m_GameObject: {fileID: 7870137636367897960} 42 | m_Enabled: 1 43 | m_EditorHideFlags: 0 44 | m_Script: {fileID: 11500000, guid: 3c5d064b252206c4faf00b5f22dae6b1, type: 3} 45 | m_Name: 46 | m_EditorClassIdentifier: 47 | augmentaManager: {fileID: 0} 48 | showDebug: 0 49 | debugObject: {fileID: 7870137636474112464} 50 | width: 0 51 | height: 0 52 | augmentaObjectCount: 0 53 | --- !u!1 &7870137636474112464 54 | GameObject: 55 | m_ObjectHideFlags: 0 56 | m_CorrespondingSourceObject: {fileID: 0} 57 | m_PrefabInstance: {fileID: 0} 58 | m_PrefabAsset: {fileID: 0} 59 | serializedVersion: 6 60 | m_Component: 61 | - component: {fileID: 7870137636474112465} 62 | - component: {fileID: 7870137636474112468} 63 | - component: {fileID: 7870137636474112467} 64 | m_Layer: 0 65 | m_Name: Debug 66 | m_TagString: Untagged 67 | m_Icon: {fileID: 0} 68 | m_NavMeshLayer: 0 69 | m_StaticEditorFlags: 0 70 | m_IsActive: 1 71 | --- !u!4 &7870137636474112465 72 | Transform: 73 | m_ObjectHideFlags: 0 74 | m_CorrespondingSourceObject: {fileID: 0} 75 | m_PrefabInstance: {fileID: 0} 76 | m_PrefabAsset: {fileID: 0} 77 | m_GameObject: {fileID: 7870137636474112464} 78 | m_LocalRotation: {x: 0.7071068, y: 0, z: 0, w: 0.7071068} 79 | m_LocalPosition: {x: 0, y: 0, z: 0} 80 | m_LocalScale: {x: 1, y: 1, z: 1} 81 | m_Children: [] 82 | m_Father: {fileID: 7870137636367897962} 83 | m_RootOrder: 0 84 | m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0} 85 | --- !u!33 &7870137636474112468 86 | MeshFilter: 87 | m_ObjectHideFlags: 0 88 | m_CorrespondingSourceObject: {fileID: 0} 89 | m_PrefabInstance: {fileID: 0} 90 | m_PrefabAsset: {fileID: 0} 91 | m_GameObject: {fileID: 7870137636474112464} 92 | m_Mesh: {fileID: 10210, guid: 0000000000000000e000000000000000, type: 0} 93 | --- !u!23 &7870137636474112467 94 | MeshRenderer: 95 | m_ObjectHideFlags: 0 96 | m_CorrespondingSourceObject: {fileID: 0} 97 | m_PrefabInstance: {fileID: 0} 98 | m_PrefabAsset: {fileID: 0} 99 | m_GameObject: {fileID: 7870137636474112464} 100 | m_Enabled: 1 101 | m_CastShadows: 1 102 | m_ReceiveShadows: 1 103 | m_DynamicOccludee: 1 104 | m_MotionVectors: 1 105 | m_LightProbeUsage: 1 106 | m_ReflectionProbeUsage: 1 107 | m_RayTracingMode: 2 108 | m_RayTraceProcedural: 0 109 | m_RenderingLayerMask: 1 110 | m_RendererPriority: 0 111 | m_Materials: 112 | - {fileID: 2100000, guid: d895c72d4749de34c910f12e6fc4048b, type: 2} 113 | m_StaticBatchInfo: 114 | firstSubMesh: 0 115 | subMeshCount: 0 116 | m_StaticBatchRoot: {fileID: 0} 117 | m_ProbeAnchor: {fileID: 0} 118 | m_LightProbeVolumeOverride: {fileID: 0} 119 | m_ScaleInLightmap: 1 120 | m_ReceiveGI: 1 121 | m_PreserveUVs: 0 122 | m_IgnoreNormalsForChartDetection: 0 123 | m_ImportantGI: 0 124 | m_StitchLightmapSeams: 1 125 | m_SelectedEditorRenderState: 3 126 | m_MinimumChartSize: 4 127 | m_AutoUVMaxDistance: 0.5 128 | m_AutoUVMaxAngle: 89 129 | m_LightmapParameters: {fileID: 0} 130 | m_SortingLayerID: 0 131 | m_SortingLayer: 0 132 | m_SortingOrder: 0 133 | m_AdditionalVertexStreams: {fileID: 0} 134 | -------------------------------------------------------------------------------- /Prefabs/Debug/AugmentaScene.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f88dc5aedbc8814b9b3f0bf73b3c6b6 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Augmenta plugin for Unity 2 | 3 | AugmentaUnity is a Unity plugin that allows you to create interactive content that uses Augmenta data. 4 | 5 | Get it here : [Augmenta Unity Asset (Asset Store)](https://assetstore.unity.com/packages/tools/integration/augmenta-for-unity-206658). 6 | 7 | ## Getting started 8 | 9 | Doc, tutorial and example projects : 👉 [https://docs.augmenta.tech/create-content/unity](https://docs.augmenta.tech/create-content/unity). 10 | -------------------------------------------------------------------------------- /README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d84cb4c2b1bfb29469c45243f23689c5 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2e43c09f1d99079418bb6cadffd871b2 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/AugmentaCamera.cs: -------------------------------------------------------------------------------- 1 | using Augmenta; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | 7 | /// 8 | /// A camera that can will always adapt its field of view to perfectly match the Augmenta scene. 9 | /// It can be orthographic, perspective or offCenter. 10 | /// If it is orthographic or perspective, it should be centered on the Augmenta scene for the field of view to match the scene perfectly. 11 | /// 12 | 13 | namespace Augmenta 14 | { 15 | [RequireComponent(typeof(Camera))] 16 | public class AugmentaCamera : MonoBehaviour 17 | { 18 | public enum CameraType { Orthographic, Perspective, OffCenter }; 19 | public CameraType cameraType = CameraType.Perspective; 20 | 21 | public new Camera camera { 22 | get { if (!_camera) _camera = GetComponent(); 23 | return _camera; 24 | } 25 | } 26 | 27 | private Camera _camera; 28 | 29 | #region Camera Update Functions 30 | 31 | /// 32 | /// Compute the size and aspect for an orthographic camera 33 | /// 34 | protected void ComputeOrthoCamera(float width, float height) { 35 | 36 | camera.orthographic = true; 37 | camera.aspect = width / height; 38 | camera.orthographicSize = height * 0.5f; 39 | 40 | camera.ResetProjectionMatrix(); 41 | } 42 | 43 | /// 44 | /// Compute the size and aspect for a perspective camera 45 | /// 46 | protected void ComputePerspectiveCamera(float width, float height, float distance) { 47 | 48 | camera.orthographic = false; 49 | camera.ResetProjectionMatrix(); 50 | 51 | camera.fieldOfView = 2.0f * Mathf.Rad2Deg * Mathf.Atan2(height * 0.5f, distance); 52 | 53 | camera.aspect = width / height; 54 | 55 | } 56 | 57 | /// 58 | /// Compute the projection matrix for an off center camera 59 | /// 60 | protected void ComputeOffCenterCamera(Vector3 botLeftCorner, Vector3 botRightCorner, Vector3 topLeftCorner, Vector3 topRightCorner) { 61 | 62 | camera.orthographic = false; 63 | camera.ResetAspect(); 64 | 65 | Vector3 pa, pb, pc, pd; 66 | pa = botLeftCorner; //Bottom-Left 67 | pb = botRightCorner; //Bottom-Right 68 | pc = topLeftCorner; //Top-Left 69 | pd = topRightCorner; //Top-Right 70 | 71 | Vector3 pe = camera.transform.position;// eye position 72 | 73 | Vector3 vr = (pb - pa).normalized; // right axis of screen 74 | Vector3 vu = (pc - pa).normalized; // up axis of screen 75 | Vector3 vn = Vector3.Cross(vr, vu).normalized; // normal vector of screen 76 | 77 | Vector3 va = pa - pe; // from pe to pa 78 | Vector3 vb = pb - pe; // from pe to pb 79 | Vector3 vc = pc - pe; // from pe to pc 80 | Vector3 vd = pd - pe; // from pe to pd 81 | 82 | float n = camera.nearClipPlane; // distance to the near clip plane (screen) 83 | float f = camera.farClipPlane; // distance of far clipping plane 84 | float d = Vector3.Dot(va, vn); // distance from eye to screen 85 | float l = Vector3.Dot(vr, va) * n / d; // distance to left screen edge from the 'center' 86 | float r = Vector3.Dot(vr, vb) * n / d; // distance to right screen edge from 'center' 87 | float b = Vector3.Dot(vu, va) * n / d; // distance to bottom screen edge from 'center' 88 | float t = Vector3.Dot(vu, vc) * n / d; // distance to top screen edge from 'center' 89 | 90 | Matrix4x4 p = new Matrix4x4(); // Projection matrix 91 | p[0, 0] = 2.0f * n / (r - l); 92 | p[0, 2] = (r + l) / (r - l); 93 | p[1, 1] = 2.0f * n / (t - b); 94 | p[1, 2] = (t + b) / (t - b); 95 | p[2, 2] = (f + n) / (n - f); 96 | p[2, 3] = 2.0f * f * n / (n - f); 97 | p[3, 2] = -1.0f; 98 | 99 | try { 100 | camera.projectionMatrix = p; // Assign matrix to camera 101 | } catch (Exception e) { 102 | Debug.LogWarning("Frustrum error, matrix invalid : " + e.Message); 103 | } 104 | } 105 | 106 | #endregion 107 | } 108 | } 109 | -------------------------------------------------------------------------------- /Scripts/AugmentaCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 659ecb6c523dbe74ba63f27084c8627a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/AugmentaManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2a6216aad597d8a4e94fe7c0ef766a37 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/AugmentaObject.cs: -------------------------------------------------------------------------------- 1 | //using System; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// 6 | /// Hold the object values from the Augmenta protocol and update the object debug view. 7 | /// 8 | namespace Augmenta 9 | { 10 | public class AugmentaObject : MonoBehaviour 11 | { 12 | [Header("Augmenta Object Settings")] 13 | public AugmentaManager augmentaManager; 14 | public bool showDebug = false; 15 | public GameObject debugObject; 16 | public GameObject debugVelocityPivot; 17 | public GameObject debugVelocity; 18 | public GameObject debugOrientationPivot; 19 | public GameObject debugOrientation; 20 | 21 | [Header("Augmenta Object Values")] 22 | public int id; 23 | public int oid; 24 | public int ageInFrames; 25 | public float ageInSeconds; 26 | public Vector2 centroid; 27 | public Vector2 velocity; 28 | public float orientation; 29 | public float depth; 30 | public Rect boundingRect; 31 | public float boundingRectRotation; 32 | public Vector3 highest; 33 | public float distanceToSensor; 34 | public float reflectivity; 35 | 36 | [Header("Unity Object Values")] 37 | public float inactiveTime; 38 | [Tooltip("Object center position on the Augmenta Scene plane, ignoring its height.")] 39 | public Vector3 worldPosition2D; 40 | [Tooltip("Object center position above the Augmenta Scene plane, taking its height into account.")] 41 | public Vector3 worldPosition3D; 42 | [Tooltip("Object size in meters.")] 43 | public Vector3 worldScale; 44 | [Tooltip("Object velocity on the Augmenta Scene plane in meters per second.")] 45 | public Vector3 worldVelocity2D; 46 | [Tooltip("Object velocity in meters per second.")] 47 | public Vector3 worldVelocity3D; 48 | 49 | [HideInInspector] public bool useCustomObject; 50 | 51 | private GameObject _customObject; 52 | private IAugmentaObjectBehaviour _customObjectBehaviour; 53 | 54 | private Material _augmentaObjectMaterialInstance; 55 | 56 | private Vector3 _previousWorldPosition2D; 57 | private Vector3 _previousWorldPosition3D; 58 | 59 | private bool _initialized = false; 60 | private bool _previousPositionIsValid = false; 61 | 62 | #region MonoBehaviour Functions 63 | 64 | private void OnEnable() { 65 | 66 | //Initialization 67 | if (!_initialized) 68 | Initialize(); 69 | } 70 | 71 | void Update() { 72 | 73 | //Initialization 74 | if (!_initialized) 75 | Initialize(); 76 | 77 | //Update debug state if incoherent 78 | if (showDebug != debugObject.activeSelf) 79 | ShowDebug(showDebug); 80 | } 81 | 82 | void OnDrawGizmos() { 83 | 84 | Gizmos.color = Color.red; 85 | DrawGizmoCube(debugObject.transform.position, 86 | debugObject.transform.rotation, 87 | debugObject.transform.localScale); 88 | 89 | 90 | //Gizmos.DrawLine(worldPosition2D, worldPosition2D + worldVelocity2D); 91 | } 92 | 93 | void OnDisable() { 94 | 95 | CleanUp(); 96 | } 97 | 98 | #endregion 99 | 100 | #region Object Handling Functions 101 | 102 | /// 103 | /// Initialize the augmenta object 104 | /// 105 | void Initialize() { 106 | 107 | if (!augmentaManager) 108 | return; 109 | 110 | //Get an instance of the debug material 111 | _augmentaObjectMaterialInstance = debugObject.GetComponent().material; 112 | 113 | //Apply a random color to the material 114 | Random.InitState(id); 115 | _augmentaObjectMaterialInstance.SetColor("_Color", Color.HSVToRGB(Random.value, 0.85f, 0.75f)); 116 | 117 | _initialized = true; 118 | } 119 | 120 | /// 121 | /// Clean up the augmenta object before removing or disabling it 122 | /// 123 | void CleanUp() 124 | { 125 | if (!_initialized) 126 | return; 127 | 128 | Destroy(_augmentaObjectMaterialInstance); 129 | 130 | //Destroy custom object 131 | DestroyCustomObject(); 132 | 133 | _previousPositionIsValid = false; 134 | _initialized = false; 135 | } 136 | 137 | /// 138 | /// Update the Augmenta object Unity parameters 139 | /// 140 | /// 141 | public void UpdateAugmentaObject() { 142 | 143 | //Initialization 144 | if (!_initialized) 145 | Initialize(); 146 | 147 | //Update object values 148 | worldPosition2D = GetAugmentaObjectWorldPosition(false); 149 | worldPosition3D = GetAugmentaObjectWorldPosition(true); 150 | worldScale = GetAugmentaObjectWorldScale(); 151 | 152 | if (_previousPositionIsValid) { 153 | worldVelocity2D = Vector3.Lerp(worldVelocity2D, (worldPosition2D - _previousWorldPosition2D) / Time.deltaTime, Time.deltaTime / Mathf.Max(augmentaManager.velocitySmoothing, 0.001f)); 154 | worldVelocity3D = Vector3.Lerp(worldVelocity3D, (worldPosition3D - _previousWorldPosition3D) / Time.deltaTime, Time.deltaTime / Mathf.Max(augmentaManager.velocitySmoothing, 0.001f)); 155 | } 156 | 157 | _previousWorldPosition2D = worldPosition2D; 158 | _previousWorldPosition3D = worldPosition3D; 159 | _previousPositionIsValid = true; 160 | 161 | worldPosition2D += worldVelocity2D * augmentaManager.positionOffsetFromVelocity; 162 | worldPosition3D += worldVelocity3D * augmentaManager.positionOffsetFromVelocity; 163 | 164 | //Update debug object size 165 | debugObject.transform.position = worldPosition3D; 166 | debugObject.transform.localRotation = Quaternion.Euler(0.0f, -boundingRectRotation, 0.0f); 167 | debugObject.transform.localScale = worldScale; 168 | 169 | //Update debug velocity 170 | debugVelocityPivot.transform.position = debugObject.transform.position; 171 | debugVelocity.transform.localPosition = new Vector3(0, highest.z * 0.5f, velocity.magnitude * 0.5f); 172 | debugVelocityPivot.transform.localRotation = Quaternion.Euler(0, Mathf.Atan2(velocity.y, velocity.x) * Mathf.Rad2Deg + 90, 0); 173 | debugVelocity.transform.localScale = new Vector3(debugVelocity.transform.localScale.x, debugVelocity.transform.localScale.y, velocity.magnitude); 174 | debugVelocityPivot.transform.localScale = new Vector3(worldScale.x, 1, worldScale.z); 175 | 176 | //Update debug orientation 177 | debugOrientationPivot.transform.position = debugObject.transform.position; 178 | debugOrientation.transform.localPosition = new Vector3(0, highest.z * 0.5f, 0.25f); 179 | debugOrientationPivot.transform.localRotation = Quaternion.Euler(0, 90.0f-orientation, 0); 180 | debugOrientationPivot.transform.localScale = new Vector3(worldScale.x, 1, worldScale.z); 181 | 182 | //Update custom object 183 | if (useCustomObject) { 184 | 185 | //Instantiate it 186 | if (!_customObject) { 187 | InstantiateCustomObject(); 188 | } 189 | 190 | //Update custom object 191 | UpdateCustomObject(); 192 | } 193 | } 194 | 195 | /// 196 | /// Return the Augmenta object world position from the Augmenta scene position, offsetted by half the object height or not. 197 | /// 198 | /// 199 | Vector3 GetAugmentaObjectWorldPosition(bool offset) { 200 | 201 | Vector2 normalizedPosition = augmentaManager.positionFromBoundingBox ? boundingRect.position : centroid; 202 | 203 | return augmentaManager.augmentaScene.transform.TransformPoint((normalizedPosition.x - 0.5f) * augmentaManager.augmentaScene.width * augmentaManager.scaling.x, 204 | offset ? highest.z * 0.5f : 0, 205 | -(normalizedPosition.y - 0.5f) * augmentaManager.augmentaScene.height * augmentaManager.scaling.y); 206 | } 207 | 208 | /// 209 | /// Return the Augmenta object scale 210 | /// 211 | /// 212 | Vector3 GetAugmentaObjectWorldScale() { 213 | 214 | return new Vector3(boundingRect.width * augmentaManager.augmentaScene.width, 215 | highest.z, 216 | boundingRect.height * augmentaManager.augmentaScene.height); 217 | } 218 | 219 | #endregion 220 | 221 | #region Custom Object Handling Functions 222 | 223 | /// 224 | /// Instantiate the custom object 225 | /// 226 | void InstantiateCustomObject() { 227 | 228 | _customObject = Instantiate(augmentaManager.customObjectPrefab, transform.parent); 229 | _customObject.name += (" " + id.ToString()); 230 | 231 | //If it has a behaviour, launch Spawn 232 | _customObjectBehaviour = _customObject.GetComponentInChildren(); 233 | if (_customObjectBehaviour != null) 234 | _customObjectBehaviour.Spawn(); 235 | } 236 | 237 | /// 238 | /// Update the custom object 239 | /// 240 | void UpdateCustomObject() { 241 | 242 | //Update position 243 | switch (augmentaManager.customObjectPositionType) { 244 | case AugmentaManager.CustomObjectPositionType.World2D: _customObject.transform.position = worldPosition2D; break; 245 | case AugmentaManager.CustomObjectPositionType.World3D: _customObject.transform.position = worldPosition3D; break; 246 | } 247 | 248 | //Update rotation 249 | switch (augmentaManager.customObjectRotationType) { 250 | case AugmentaManager.CustomObjectRotationType.AugmentaRotation: _customObject.transform.localRotation = Quaternion.Euler(0.0f, -boundingRectRotation, 0.0f); break; 251 | case AugmentaManager.CustomObjectRotationType.AugmentaOrientation: _customObject.transform.localRotation = Quaternion.Euler(0.0f, orientation, 0.0f); break; 252 | } 253 | 254 | //Update scale 255 | switch (augmentaManager.customObjectScalingType) { 256 | case AugmentaManager.CustomObjectScalingType.AugmentaSize: _customObject.transform.localScale = worldScale; break; 257 | } 258 | } 259 | 260 | /// 261 | /// Update the custom object prefab 262 | /// 263 | public void ChangeCustomObject() { 264 | 265 | //Destroy the custom object 266 | //It will be instantiated at the next update with the updated prefab if necessary 267 | DestroyCustomObject(); 268 | } 269 | 270 | /// 271 | /// Destroy the custom object instantiated 272 | /// 273 | void DestroyCustomObject() { 274 | 275 | if (!_customObject) 276 | return; 277 | 278 | //If it has a behaviour, call Destroy, otherwise destroy it directly 279 | if (_customObjectBehaviour != null) { 280 | _customObjectBehaviour.Destroy(); 281 | _customObject = null; 282 | } else { 283 | Destroy(_customObject); 284 | _customObject = null; 285 | } 286 | } 287 | 288 | #endregion 289 | 290 | #region Gizmos Functions 291 | 292 | public void DrawGizmoCube(Vector3 position, Quaternion rotation, Vector3 scale) { 293 | 294 | Matrix4x4 cubeTransform = Matrix4x4.TRS(position, rotation, scale); 295 | Matrix4x4 oldGizmosMatrix = Gizmos.matrix; 296 | 297 | Gizmos.matrix *= cubeTransform; 298 | 299 | Gizmos.DrawWireCube(Vector3.zero, Vector3.one); 300 | 301 | Gizmos.matrix = oldGizmosMatrix; 302 | } 303 | 304 | #endregion 305 | 306 | #region Debug Functions 307 | 308 | /// 309 | /// Activate/desactivate debug object 310 | /// 311 | /// 312 | public void ShowDebug(bool show) { 313 | 314 | debugObject.SetActive(show); 315 | debugOrientationPivot.SetActive(show); 316 | debugVelocityPivot.SetActive(show); 317 | } 318 | 319 | #endregion 320 | } 321 | } -------------------------------------------------------------------------------- /Scripts/AugmentaObject.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 630ed87da88e5bb419c5e1e3a58ae74d 3 | timeCreated: 1519727297 4 | licenseType: Free 5 | MonoImporter: 6 | externalObjects: {} 7 | serializedVersion: 2 8 | defaultReferences: [] 9 | executionOrder: 0 10 | icon: {instanceID: 0} 11 | userData: 12 | assetBundleName: 13 | assetBundleVariant: 14 | -------------------------------------------------------------------------------- /Scripts/AugmentaObjectBehaviour.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | namespace Augmenta 6 | { 7 | /// 8 | /// Interface to implement custom spawn and destroy behaviour for Augmenta objects 9 | /// 10 | public interface IAugmentaObjectBehaviour 11 | { 12 | /// 13 | /// Called when the object is instantiated 14 | /// 15 | void Spawn(); 16 | 17 | /// 18 | /// Called when the object should be destroyed 19 | /// 20 | void Destroy(); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /Scripts/AugmentaObjectBehaviour.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3e64ca29b0882c648a1f3d563e06ad65 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/AugmentaScene.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | 5 | /// 6 | /// Hold the scene values from the Augmenta protocol and update the scene debug view. 7 | /// 8 | namespace Augmenta 9 | { 10 | public class AugmentaScene : MonoBehaviour 11 | { 12 | 13 | [Header("Scene Settings")] 14 | public AugmentaManager augmentaManager; 15 | public bool showDebug = false; 16 | public GameObject debugObject; 17 | 18 | [Header("Augmenta Scene Values")] 19 | public float width = 1; 20 | public float height = 1; 21 | public int augmentaObjectCount; //Object count from the scene updated message /!\ Because of personTimeOut, it can be different from the instantiated person count /!\ 22 | 23 | private Material _debugMaterial; 24 | 25 | private bool _initialized = false; 26 | 27 | #region MonoBehaviour Functions 28 | 29 | private void OnEnable() { 30 | 31 | if (!_initialized) 32 | Initialize(); 33 | } 34 | 35 | private void Update() { 36 | 37 | //Initialization 38 | if (!_initialized) 39 | Initialize(); 40 | 41 | //Update debug state if incoherent 42 | if (showDebug != debugObject.activeSelf) 43 | ShowDebug(showDebug); 44 | } 45 | 46 | private void OnDisable() { 47 | 48 | CleanUp(); 49 | } 50 | 51 | void OnDrawGizmos() { 52 | 53 | Gizmos.color = Color.blue; 54 | if(augmentaManager) 55 | DrawGizmoCube(transform.position, transform.rotation, new Vector3(width * augmentaManager.scaling.x, 0, height * augmentaManager.scaling.y)); 56 | else 57 | DrawGizmoCube(transform.position, transform.rotation, new Vector3(width, 0, height)); 58 | } 59 | 60 | #endregion 61 | 62 | #region Scene Handling Functions 63 | 64 | /// 65 | /// Initialize the scene 66 | /// 67 | void Initialize() { 68 | 69 | if (!augmentaManager) 70 | return; 71 | 72 | //Connect to Augmenta SceneUpdated event 73 | augmentaManager.sceneUpdated += UpdateScene; 74 | 75 | //Get the debug material 76 | _debugMaterial = debugObject.GetComponent().material; 77 | 78 | _initialized = true; 79 | } 80 | 81 | /// 82 | /// Clean up the scene elements before removing or disabling the scene 83 | /// 84 | void CleanUp() 85 | { 86 | if (!_initialized) 87 | return; 88 | 89 | //Disconnect from Augmenta SceneUpdated event 90 | augmentaManager.sceneUpdated -= UpdateScene; 91 | 92 | //Destroy instantiated material 93 | Destroy(_debugMaterial); 94 | 95 | _initialized = false; 96 | } 97 | 98 | /// 99 | /// Update the scene object. 100 | /// 101 | public void UpdateScene() { 102 | 103 | //Initialization 104 | if (!_initialized) 105 | Initialize(); 106 | 107 | //Update debug object size 108 | debugObject.transform.localScale = new Vector3(width * augmentaManager.scaling.x, height * augmentaManager.scaling.y, 0); 109 | 110 | //Update debug material tiling 111 | _debugMaterial.mainTextureScale = debugObject.transform.localScale * 0.5f; 112 | _debugMaterial.mainTextureOffset = Vector2.down * debugObject.transform.localScale.y * 0.5f; 113 | } 114 | 115 | #endregion 116 | 117 | #region Gizmos Functions 118 | 119 | public void DrawGizmoCube(Vector3 position, Quaternion rotation, Vector3 scale) { 120 | Matrix4x4 cubeTransform = Matrix4x4.TRS(position, rotation, scale); 121 | Matrix4x4 oldGizmosMatrix = Gizmos.matrix; 122 | 123 | Gizmos.matrix *= cubeTransform; 124 | 125 | Gizmos.DrawWireCube(Vector3.zero, Vector3.one); 126 | 127 | Gizmos.matrix = oldGizmosMatrix; 128 | } 129 | 130 | #endregion 131 | 132 | #region Debug Functions 133 | 134 | /// 135 | /// Activate/desactivate debug object 136 | /// 137 | /// 138 | public void ShowDebug(bool show) { 139 | 140 | debugObject.SetActive(show); 141 | } 142 | 143 | #endregion 144 | 145 | } 146 | } 147 | -------------------------------------------------------------------------------- /Scripts/AugmentaScene.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c5d064b252206c4faf00b5f22dae6b1 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/AugmentaSceneCamera.cs: -------------------------------------------------------------------------------- 1 | using Augmenta; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | 7 | /// 8 | /// A camera that can will always adapt its field of view to perfectly match the Augmenta scene. 9 | /// It can be orthographic, perspective or offCenter. 10 | /// If it is orthographic or perspective, it should be centered on the Augmenta scene for the field of view to match the scene perfectly. 11 | /// 12 | 13 | namespace Augmenta 14 | { 15 | public class AugmentaSceneCamera : AugmentaCamera 16 | { 17 | public AugmentaManager augmentaManager; 18 | 19 | public float distanceToScene = 10.0f; 20 | 21 | private Vector3 _botLeftCorner; 22 | private Vector3 _botRightCorner; 23 | private Vector3 _topLeftCorner; 24 | private Vector3 _topRightCorner; 25 | 26 | private Vector3 _sceneUp; 27 | private Vector3 _sceneForward; 28 | 29 | // Update is called once per frame 30 | void Update() { 31 | //Don't update if there is no Augmenta scene 32 | if (!augmentaManager.augmentaScene) 33 | return; 34 | 35 | //Don't update if Augmenta scene size is 0 36 | if (augmentaManager.augmentaScene.width <= 0 || augmentaManager.augmentaScene.height <= 0) 37 | return; 38 | 39 | UpdateAugmentaSceneCorners(); 40 | OrientCamera(); 41 | 42 | switch (cameraType) { 43 | 44 | case CameraType.Orthographic: 45 | CenterCamera(); 46 | ComputeOrthoCamera(augmentaManager.augmentaScene.width * augmentaManager.scaling.x, augmentaManager.augmentaScene.height * augmentaManager.scaling.y); 47 | break; 48 | 49 | case CameraType.Perspective: 50 | CenterCamera(); 51 | ComputePerspectiveCamera(augmentaManager.augmentaScene.width * augmentaManager.scaling.x, augmentaManager.augmentaScene.height * augmentaManager.scaling.y, distanceToScene); 52 | break; 53 | 54 | case CameraType.OffCenter: 55 | ComputeOffCenterCamera(_botLeftCorner, _botRightCorner, _topLeftCorner, _topRightCorner); 56 | break; 57 | 58 | } 59 | } 60 | 61 | /// 62 | /// Update the positions of the Augmenta scene corners 63 | /// 64 | void UpdateAugmentaSceneCorners() { 65 | _botLeftCorner = augmentaManager.augmentaScene.debugObject.transform.TransformPoint(new Vector3(-0.5f, -0.5f, 0)); 66 | _botRightCorner = augmentaManager.augmentaScene.debugObject.transform.TransformPoint(new Vector3(0.5f, -0.5f, 0)); 67 | _topLeftCorner = augmentaManager.augmentaScene.debugObject.transform.TransformPoint(new Vector3(-0.5f, 0.5f, 0)); 68 | _topRightCorner = augmentaManager.augmentaScene.debugObject.transform.TransformPoint(new Vector3(0.5f, 0.5f, 0)); 69 | } 70 | 71 | void CenterCamera() { 72 | 73 | camera.transform.position = augmentaManager.augmentaScene.debugObject.transform.TransformPoint(Vector3.zero) - _sceneForward * distanceToScene; 74 | } 75 | 76 | void OrientCamera() { 77 | 78 | _sceneUp = (_topLeftCorner - _botLeftCorner).normalized; 79 | _sceneForward = Vector3.Cross((_topRightCorner - _topLeftCorner).normalized, _sceneUp).normalized; 80 | 81 | camera.transform.rotation = Quaternion.LookRotation(_sceneForward, _sceneUp); 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Scripts/AugmentaSceneCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65d27036d52cbbd4db8cc98ef8b3edf9 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/AugmentaVideoOutput.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Security.Principal; 4 | using UnityEngine; 5 | 6 | namespace Augmenta 7 | { 8 | /// 9 | /// Handle a video output to a texture according to the data from Fusion. 10 | /// 11 | public class AugmentaVideoOutput : MonoBehaviour 12 | { 13 | public AugmentaManager augmentaManager; 14 | 15 | public enum CameraMode { None, VideoOutput, External } 16 | public CameraMode cameraMode { 17 | get { return _cameraMode; } 18 | set { _cameraMode = value; Initialize(); } 19 | } 20 | 21 | public new Camera camera; 22 | 23 | public RenderTexture videoOutputTexture { 24 | get { return cameraMode == CameraMode.External ? _outputCustomRenderTexture : _outputRenderTexture; } 25 | } 26 | 27 | public Color paddingColor = Color.black; 28 | 29 | [Tooltip("Use data from Fusion to determine the output size in pixels.")] 30 | public bool autoOutputSizeInPixels = true; 31 | [Tooltip("Use data from Fusion to determine the output size in meters.")] 32 | public bool autoOutputSizeInMeters = true; 33 | [Tooltip("Use data from Fusion to determine the output offset.")] 34 | public bool autoOutputOffset = true; 35 | 36 | public Vector2Int videoOutputSizeInPixels { 37 | get { return autoOutputSizeInPixels ? augmentaManager.videoOutputSizeInPixels : _videoOutputSizeInPixels; } 38 | set { _videoOutputSizeInPixels = value; RefreshVideoTexture(); } 39 | } 40 | 41 | public Vector2 videoOutputSizeInMeters { 42 | get { return autoOutputSizeInMeters ? augmentaManager.videoOutputSizeInMeters : _videoOutputSizeInMeters; } 43 | set { _videoOutputSizeInMeters = value; } 44 | } 45 | 46 | public Vector2 videoOutputOffset { 47 | get { return autoOutputOffset ? augmentaManager.videoOutputOffset : _videoOutputOffset; } 48 | set { _videoOutputOffset = value; } 49 | } 50 | 51 | public Vector3 botLeftCorner = Vector3.zero; 52 | public Vector3 botRightCorner = Vector3.zero; 53 | public Vector3 topLeftCorner = Vector3.zero; 54 | public Vector3 topRightCorner = Vector3.zero; 55 | 56 | public delegate void VideoOutputTextureUpdated(); 57 | public event VideoOutputTextureUpdated videoOutputTextureUpdated; 58 | 59 | public bool renderVideoOutputCameraToTexture = true; 60 | 61 | [SerializeField] private Vector2Int _videoOutputSizeInPixels = new Vector2Int(); 62 | [SerializeField] private Vector2 _videoOutputSizeInMeters = new Vector2(); 63 | [SerializeField] private Vector2 _videoOutputOffset = new Vector2(); 64 | 65 | [SerializeField] private CameraMode _cameraMode; 66 | 67 | private RenderTexture _outputRenderTexture; 68 | private CustomRenderTexture _outputCustomRenderTexture; 69 | 70 | private Material outputCRTMaterial { 71 | get { if(!_outputCRTMaterial) _outputCRTMaterial = new Material(Shader.Find("Augmenta/CameraDisplayTexture")); 72 | return _outputCRTMaterial; 73 | } 74 | } 75 | private Material _outputCRTMaterial; 76 | private Matrix4x4 _cameraVPMatrix; 77 | private Vector4 _botLeftCameraUV; 78 | private Vector4 _botRightCameraUV; 79 | private Vector4 _topLeftCameraUV; 80 | private Vector4 _topRightCameraUV; 81 | 82 | private Vector3 _offset; 83 | 84 | private bool _initialized = false; 85 | 86 | #region MonoBehavious Functions 87 | 88 | private void OnEnable() { 89 | 90 | if (!_initialized) 91 | Initialize(); 92 | } 93 | 94 | private void Update() { 95 | 96 | if (!_initialized) 97 | Initialize(); 98 | 99 | UpdateVideoOutputCorners(); 100 | 101 | if (cameraMode == CameraMode.External) 102 | UpdateCRTMaterial(); 103 | } 104 | 105 | private void OnDisable() { 106 | 107 | if (_initialized) 108 | CleanUp(); 109 | } 110 | 111 | private void OnDrawGizmos() { 112 | 113 | 114 | Gizmos.color = Color.magenta; 115 | 116 | Gizmos.DrawLine(botLeftCorner, botRightCorner); 117 | Gizmos.DrawLine(botRightCorner, topRightCorner); 118 | Gizmos.DrawLine(topRightCorner, topLeftCorner); 119 | Gizmos.DrawLine(topLeftCorner, botLeftCorner); 120 | } 121 | 122 | #endregion 123 | 124 | #region Setup 125 | 126 | public void Initialize() { 127 | 128 | if (_initialized) 129 | CleanUp(); 130 | 131 | if (!augmentaManager) { 132 | Debug.LogError("AugmentaManager is not specified in AugmentaVideoOutput " + name+"."); 133 | return; 134 | } 135 | 136 | if (cameraMode == CameraMode.VideoOutput) { 137 | AugmentaVideoOutputCamera augmentaVideoOutputCamera = GetComponentInChildren(); 138 | 139 | if (!augmentaVideoOutputCamera) { 140 | Debug.LogError("Could not find an AugmentaVideoOutputCamera in " + name + " hierarchy."); 141 | return; 142 | } else { 143 | camera = augmentaVideoOutputCamera.camera; 144 | } 145 | } else if (cameraMode == CameraMode.External) { 146 | if (!camera) { 147 | Debug.LogError("No camera specified in " + name + " which is set to use an external camera."); 148 | return; 149 | } 150 | } 151 | 152 | //Initialize videoOutputTexture 153 | RefreshVideoTexture(); 154 | 155 | augmentaManager.fusionUpdated += OnFusionUpdated; 156 | 157 | _initialized = true; 158 | } 159 | 160 | void CleanUp() { 161 | 162 | augmentaManager.fusionUpdated -= OnFusionUpdated; 163 | } 164 | 165 | #endregion 166 | 167 | #region Augmenta Events 168 | 169 | void OnFusionUpdated() { 170 | 171 | if (cameraMode == CameraMode.None) 172 | return; 173 | 174 | if (!videoOutputTexture) 175 | RefreshVideoTexture(); 176 | 177 | //Check video texture size 178 | if (videoOutputSizeInPixels.x != videoOutputTexture.width || videoOutputSizeInPixels.y != videoOutputTexture.height) { 179 | RefreshVideoTexture(); 180 | } 181 | 182 | } 183 | 184 | #endregion 185 | 186 | #region Video Texture 187 | 188 | public void RefreshVideoTexture() { 189 | 190 | if (cameraMode == CameraMode.None || !camera) 191 | return; 192 | 193 | if (videoOutputSizeInPixels.x == 0 || videoOutputSizeInPixels.y == 0) 194 | return; 195 | 196 | if (videoOutputTexture) { 197 | if (videoOutputSizeInPixels.x != videoOutputTexture.width || videoOutputSizeInPixels.y != videoOutputTexture.height) { 198 | videoOutputTexture.Release(); 199 | } else { 200 | return; 201 | } 202 | } 203 | 204 | //Create texture 205 | CreateOutputRenderTexture(); 206 | 207 | if (cameraMode == CameraMode.External) 208 | CreateOutputCustomRenderTexture(); 209 | 210 | //Send texture updated event 211 | videoOutputTextureUpdated?.Invoke(); 212 | 213 | } 214 | 215 | void CreateOutputRenderTexture() { 216 | 217 | _outputRenderTexture = new RenderTexture(videoOutputSizeInPixels.x, videoOutputSizeInPixels.y, 0, RenderTextureFormat.ARGB64, RenderTextureReadWrite.Default); 218 | _outputRenderTexture.Create(); 219 | 220 | if (!(cameraMode == CameraMode.VideoOutput && !renderVideoOutputCameraToTexture)) { 221 | //Assign texture as render target of video output camera 222 | camera.targetTexture = _outputRenderTexture; 223 | } 224 | } 225 | 226 | void CreateOutputCustomRenderTexture() { 227 | 228 | _outputCustomRenderTexture = new CustomRenderTexture(videoOutputSizeInPixels.x, videoOutputSizeInPixels.y, RenderTextureFormat.ARGB32, RenderTextureReadWrite.Default); 229 | _outputCustomRenderTexture.updateMode = CustomRenderTextureUpdateMode.Realtime; 230 | _outputCustomRenderTexture.Create(); 231 | 232 | _outputCustomRenderTexture.material = outputCRTMaterial; 233 | 234 | _outputCRTMaterial.SetTexture("_MainTex", _outputRenderTexture); 235 | 236 | } 237 | 238 | void UpdateVideoOutputCorners() { 239 | 240 | if (!augmentaManager.augmentaScene) 241 | return; 242 | 243 | _offset = augmentaManager.augmentaScene.debugObject.transform.TransformDirection(new Vector3(videoOutputOffset.x, -videoOutputOffset.y, 0)); 244 | topLeftCorner = augmentaManager.augmentaScene.debugObject.transform.TransformPoint(new Vector3(-0.5f, 0.5f, 0)) + _offset; 245 | botLeftCorner = topLeftCorner + augmentaManager.augmentaScene.debugObject.transform.TransformDirection(Vector3.down * videoOutputSizeInMeters.y * augmentaManager.scaling); 246 | botRightCorner = botLeftCorner + augmentaManager.augmentaScene.debugObject.transform.TransformDirection(Vector3.right * videoOutputSizeInMeters.x * augmentaManager.scaling); 247 | topRightCorner = botRightCorner + augmentaManager.augmentaScene.debugObject.transform.TransformDirection(Vector3.up * videoOutputSizeInMeters.y * augmentaManager.scaling); 248 | } 249 | 250 | #endregion 251 | 252 | #region External Camera 253 | 254 | void UpdateCRTMaterial() { 255 | 256 | UpdateCameraDisplayMatrix(); 257 | UpdateCameraUV(); 258 | 259 | outputCRTMaterial.SetColor("_PaddingColor", paddingColor); 260 | outputCRTMaterial.SetVector("_BotCamUV", new Vector4(_botLeftCameraUV.x, _botLeftCameraUV.y, _botRightCameraUV.x, _botRightCameraUV.y)); 261 | outputCRTMaterial.SetVector("_TopCamUV", new Vector4(_topLeftCameraUV.x, _topLeftCameraUV.y, _topRightCameraUV.x, _topRightCameraUV.y)); 262 | } 263 | 264 | void UpdateCameraDisplayMatrix() { 265 | 266 | Matrix4x4 V = camera.worldToCameraMatrix; 267 | Matrix4x4 P = camera.projectionMatrix; 268 | 269 | //bool d3d = SystemInfo.graphicsDeviceVersion.IndexOf("Direct3D") > -1; 270 | 271 | //if (d3d) { 272 | // // Invert Y for rendering to a render texture 273 | // for (int j = 0; j < 4; j++) { 274 | // P[1, j] = -P[1, j]; 275 | // } 276 | // // Scale and bias from OpenGL -> D3D depth range 277 | // for (int j = 0; j < 4; j++) { 278 | // P[2, j] = P[2, j] * 0.5f + P[3, j] * 0.5f; 279 | // } 280 | //} 281 | 282 | _cameraVPMatrix = P * V; 283 | } 284 | 285 | void UpdateCameraUV() { 286 | 287 | _botLeftCameraUV = _cameraVPMatrix * new Vector4(botLeftCorner.x, botLeftCorner.y, botLeftCorner.z, 1); 288 | _botLeftCameraUV = (_botLeftCameraUV / _botLeftCameraUV.w) * 0.5f + Vector4.one * 0.5f; 289 | 290 | _botRightCameraUV = _cameraVPMatrix * new Vector4(botRightCorner.x, botRightCorner.y, botRightCorner.z, 1); 291 | _botRightCameraUV = (_botRightCameraUV / _botRightCameraUV.w) * 0.5f + Vector4.one * 0.5f; 292 | 293 | _topLeftCameraUV = _cameraVPMatrix * new Vector4(topLeftCorner.x, topLeftCorner.y, topLeftCorner.z, 1); 294 | _topLeftCameraUV = (_topLeftCameraUV / _topLeftCameraUV.w) * 0.5f + Vector4.one * 0.5f; 295 | 296 | _topRightCameraUV = _cameraVPMatrix * new Vector4(topRightCorner.x, topRightCorner.y, topRightCorner.z, 1); 297 | _topRightCameraUV = (_topRightCameraUV / _topRightCameraUV.w) * 0.5f + Vector4.one * 0.5f; 298 | } 299 | 300 | #endregion 301 | } 302 | } 303 | -------------------------------------------------------------------------------- /Scripts/AugmentaVideoOutput.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2bc981ad089ad4e468a94af62c1203b8 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/AugmentaVideoOutputCamera.cs: -------------------------------------------------------------------------------- 1 | using Augmenta; 2 | using System; 3 | using System.Collections; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | 7 | /// 8 | /// A camera that can will always adapt its field of view to perfectly match the Augmenta video output from Fusion. 9 | /// It can be orthographic, perspective or offCenter. 10 | /// If it is orthographic or perspective, it should be centered on the Augmenta scene for the field of view to match the output perfectly. 11 | /// 12 | 13 | namespace Augmenta 14 | { 15 | public class AugmentaVideoOutputCamera : AugmentaCamera 16 | { 17 | public AugmentaVideoOutput augmentaVideoOutput; 18 | 19 | public float distanceToVideoOutput = 10.0f; 20 | 21 | private Vector3 _videoOutputUp; 22 | private Vector3 _videoOutputForward; 23 | 24 | // Update is called once per frame 25 | void Update() { 26 | 27 | //Don't update if Augmenta scene size is 0 28 | if (augmentaVideoOutput.videoOutputSizeInMeters.x <= 0 || augmentaVideoOutput.videoOutputSizeInMeters.y <= 0) 29 | return; 30 | 31 | OrientCamera(); 32 | 33 | switch (cameraType) { 34 | 35 | case CameraType.Orthographic: 36 | CenterCamera(); 37 | ComputeOrthoCamera(augmentaVideoOutput.videoOutputSizeInMeters.x, augmentaVideoOutput.videoOutputSizeInMeters.y); 38 | break; 39 | 40 | case CameraType.Perspective: 41 | CenterCamera(); 42 | ComputePerspectiveCamera(augmentaVideoOutput.videoOutputSizeInMeters.x, augmentaVideoOutput.videoOutputSizeInMeters.y, distanceToVideoOutput); 43 | break; 44 | 45 | case CameraType.OffCenter: 46 | ComputeOffCenterCamera(augmentaVideoOutput.botLeftCorner, augmentaVideoOutput.botRightCorner, augmentaVideoOutput.topLeftCorner, augmentaVideoOutput.topRightCorner); 47 | break; 48 | 49 | } 50 | } 51 | 52 | void CenterCamera() { 53 | 54 | camera.transform.position = augmentaVideoOutput.botLeftCorner + 0.5f * (augmentaVideoOutput.topLeftCorner - augmentaVideoOutput.botLeftCorner) + 0.5f * (augmentaVideoOutput.topRightCorner - augmentaVideoOutput.topLeftCorner) - _videoOutputForward * distanceToVideoOutput; 55 | } 56 | 57 | void OrientCamera() { 58 | 59 | _videoOutputUp = (augmentaVideoOutput.topLeftCorner - augmentaVideoOutput.botLeftCorner).normalized; 60 | _videoOutputForward = Vector3.Cross((augmentaVideoOutput.topRightCorner - augmentaVideoOutput.topLeftCorner).normalized, _videoOutputUp).normalized; 61 | 62 | camera.transform.rotation = Quaternion.LookRotation(_videoOutputForward, _videoOutputUp); 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Scripts/AugmentaVideoOutputCamera.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 48c22896cd63ce544b3c2b1635387b3a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Editor.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 61ae79dc161e36d4e883e94ac8dd4666 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Scripts/Editor/AugmentaManagerEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace Augmenta 7 | { 8 | [CustomEditor(typeof(AugmentaManager))] 9 | public class AugmentaManagerEditor : Editor 10 | { 11 | SerializedProperty augmentaId; 12 | SerializedProperty inputPort; 13 | SerializedProperty protocolVersion; 14 | SerializedProperty pixelSize; 15 | SerializedProperty scaling; 16 | SerializedProperty flipX; 17 | SerializedProperty flipY; 18 | SerializedProperty augmentaObjectTimeOut; 19 | SerializedProperty desiredAugmentaObjectType; 20 | SerializedProperty desiredAugmentaObjectCount; 21 | SerializedProperty velocitySmoothing; 22 | SerializedProperty positionOffsetFromVelocity; 23 | SerializedProperty positionFromBoundingBox; 24 | SerializedProperty augmentaScenePrefab; 25 | SerializedProperty augmentaObjectPrefab; 26 | SerializedProperty customObjectPrefab; 27 | SerializedProperty customObjectPositionType; 28 | SerializedProperty customObjectRotationType; 29 | SerializedProperty customObjectScalingType; 30 | SerializedProperty mute; 31 | SerializedProperty showSceneDebug; 32 | SerializedProperty showObjectDebug; 33 | 34 | void OnEnable() { 35 | 36 | augmentaId = serializedObject.FindProperty("augmentaId"); 37 | inputPort = serializedObject.FindProperty("_inputPort"); 38 | protocolVersion = serializedObject.FindProperty("protocolVersion"); 39 | pixelSize = serializedObject.FindProperty("pixelSize"); 40 | scaling = serializedObject.FindProperty("scaling"); 41 | flipX = serializedObject.FindProperty("flipX"); 42 | flipY = serializedObject.FindProperty("flipY"); 43 | augmentaObjectTimeOut = serializedObject.FindProperty("augmentaObjectTimeOut"); 44 | desiredAugmentaObjectType = serializedObject.FindProperty("desiredAugmentaObjectType"); 45 | desiredAugmentaObjectCount = serializedObject.FindProperty("desiredAugmentaObjectCount"); 46 | velocitySmoothing = serializedObject.FindProperty("velocitySmoothing"); 47 | positionOffsetFromVelocity = serializedObject.FindProperty("positionOffsetFromVelocity"); 48 | positionFromBoundingBox = serializedObject.FindProperty("positionFromBoundingBox"); 49 | augmentaScenePrefab = serializedObject.FindProperty("augmentaScenePrefab"); 50 | augmentaObjectPrefab = serializedObject.FindProperty("augmentaObjectPrefab"); 51 | customObjectPrefab = serializedObject.FindProperty("customObjectPrefab"); 52 | customObjectPositionType = serializedObject.FindProperty("customObjectPositionType"); 53 | customObjectRotationType = serializedObject.FindProperty("customObjectRotationType"); 54 | customObjectScalingType = serializedObject.FindProperty("customObjectScalingType"); 55 | mute = serializedObject.FindProperty("mute"); 56 | showSceneDebug = serializedObject.FindProperty("_showSceneDebug"); 57 | showObjectDebug = serializedObject.FindProperty("_showObjectDebug"); 58 | } 59 | 60 | public override void OnInspectorGUI() { 61 | 62 | AugmentaManager augmentaManager = target as AugmentaManager; 63 | 64 | serializedObject.Update(); 65 | 66 | EditorGUILayout.LabelField("AUGMENTA ID", EditorStyles.boldLabel); 67 | EditorGUILayout.PropertyField(augmentaId, new GUIContent("Augmenta ID")); 68 | 69 | EditorGUILayout.Space(); 70 | EditorGUILayout.LabelField("OSC SETTINGS", EditorStyles.boldLabel); 71 | //Input port change handling 72 | EditorGUI.BeginChangeCheck(); 73 | EditorGUILayout.PropertyField(inputPort, new GUIContent("Input Port")); 74 | if (EditorGUI.EndChangeCheck() && Application.isPlaying) { 75 | serializedObject.ApplyModifiedProperties(); 76 | augmentaManager.CreateAugmentaOSCReceiver(); 77 | } 78 | 79 | if (Application.isPlaying) { 80 | if (!augmentaManager.portBinded) { 81 | EditorGUILayout.HelpBox("Port not binded", MessageType.Error); 82 | } else { 83 | if (!augmentaManager.receivingData) { 84 | EditorGUILayout.HelpBox("Waiting for data", MessageType.Info); 85 | } else { 86 | EditorGUILayout.HelpBox("Receiving data", MessageType.Info); 87 | } 88 | } 89 | } 90 | 91 | EditorGUILayout.PropertyField(protocolVersion, new GUIContent("Protocol Version")); 92 | 93 | EditorGUILayout.Space(); 94 | EditorGUILayout.LabelField("AUGMENTA SCENE SETTINGS", EditorStyles.boldLabel); 95 | if (protocolVersion.enumValueIndex == 0) { 96 | EditorGUILayout.PropertyField(pixelSize, new GUIContent("Pixel Size")); 97 | } 98 | EditorGUILayout.PropertyField(scaling, new GUIContent("Scaling")); 99 | 100 | EditorGUILayout.Space(); 101 | EditorGUILayout.LabelField("AUGMENTA OBJECTS SETTINGS", EditorStyles.boldLabel); 102 | EditorGUILayout.PropertyField(flipX, new GUIContent("Flip X")); 103 | EditorGUILayout.PropertyField(flipY, new GUIContent("Flip Y")); 104 | EditorGUILayout.PropertyField(augmentaObjectTimeOut, new GUIContent("Augmenta Object TimeOut")); 105 | EditorGUILayout.PropertyField(desiredAugmentaObjectType, new GUIContent("Desired Augmenta Object Type")); 106 | if(desiredAugmentaObjectType.enumValueIndex > 0) { 107 | EditorGUILayout.PropertyField(desiredAugmentaObjectCount, new GUIContent("Desired Augmenta Object Count")); 108 | } 109 | 110 | EditorGUILayout.Space(); 111 | EditorGUILayout.PropertyField(velocitySmoothing, new GUIContent("Velocity Smoothing")); 112 | EditorGUILayout.PropertyField(positionOffsetFromVelocity, new GUIContent("Position Offset From Velocity")); 113 | 114 | EditorGUILayout.Space(); 115 | EditorGUILayout.PropertyField(positionFromBoundingBox, new GUIContent("Position From Bounding Box", "Place the object according to the bounding box position, the centroid is used otherwise. Usually this should only be true if you represent the bounding box visually.")); 116 | 117 | EditorGUILayout.Space(); 118 | EditorGUILayout.LabelField("AUGMENTA PREFABS", EditorStyles.boldLabel); 119 | EditorGUILayout.PropertyField(augmentaScenePrefab, new GUIContent("Augmenta Scene Prefab")); 120 | EditorGUILayout.PropertyField(augmentaObjectPrefab, new GUIContent("Augmenta Object Prefab")); 121 | 122 | EditorGUILayout.Space(); 123 | EditorGUILayout.LabelField("CUSTOM OBJECT", EditorStyles.boldLabel); 124 | EditorGUILayout.PropertyField(customObjectPrefab, new GUIContent("Custom Object Prefab")); 125 | if(customObjectPrefab.objectReferenceValue != null) { 126 | EditorGUILayout.PropertyField(customObjectPositionType, new GUIContent("Custom Object Position")); 127 | EditorGUILayout.PropertyField(customObjectRotationType, new GUIContent("Custom Object Rotation")); 128 | EditorGUILayout.PropertyField(customObjectScalingType, new GUIContent("Custom Object Scaling")); 129 | } 130 | 131 | EditorGUILayout.Space(); 132 | EditorGUILayout.LabelField("DEBUG", EditorStyles.boldLabel); 133 | EditorGUILayout.PropertyField(mute, new GUIContent("Mute")); 134 | 135 | //Show debug change handling 136 | EditorGUI.BeginChangeCheck(); 137 | EditorGUILayout.PropertyField(showSceneDebug, new GUIContent("Show Scene Debug")); 138 | EditorGUILayout.PropertyField(showObjectDebug, new GUIContent("Show Object Debug")); 139 | if (EditorGUI.EndChangeCheck() && Application.isPlaying) { 140 | serializedObject.ApplyModifiedProperties(); 141 | augmentaManager.ShowDebug(showSceneDebug.boolValue, showObjectDebug.boolValue); 142 | } 143 | 144 | serializedObject.ApplyModifiedProperties(); 145 | 146 | } 147 | } 148 | } 149 | -------------------------------------------------------------------------------- /Scripts/Editor/AugmentaManagerEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f6fcd9074ce89644ab2082929e4f3f5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Editor/AugmentaSceneCameraEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace Augmenta 7 | { 8 | [CustomEditor(typeof(AugmentaSceneCamera))] 9 | public class AugmentaSceneCameraEditor : Editor 10 | { 11 | SerializedProperty augmentaManager; 12 | SerializedProperty cameraType; 13 | SerializedProperty distanceToScene; 14 | 15 | void OnEnable() { 16 | 17 | augmentaManager = serializedObject.FindProperty("augmentaManager"); 18 | cameraType = serializedObject.FindProperty("cameraType"); 19 | distanceToScene = serializedObject.FindProperty("distanceToScene"); 20 | } 21 | 22 | public override void OnInspectorGUI() { 23 | 24 | serializedObject.Update(); 25 | 26 | EditorGUILayout.PropertyField(augmentaManager, new GUIContent("Augmenta Manager")); 27 | EditorGUILayout.Space(); 28 | 29 | EditorGUILayout.PropertyField(cameraType, new GUIContent("Camera Type")); 30 | EditorGUILayout.Space(); 31 | 32 | switch (cameraType.enumValueIndex) { 33 | 34 | case 0: //Orthographic 35 | EditorGUILayout.PropertyField(distanceToScene, new GUIContent("Distance To Scene")); 36 | EditorGUILayout.Space(); 37 | EditorGUILayout.HelpBox("In Orthographic mode, the camera is always facing and centered on the Augmenta Scene.", MessageType.Info); 38 | break; 39 | 40 | case 1: //Perspective 41 | EditorGUILayout.PropertyField(distanceToScene, new GUIContent("Distance To Scene")); 42 | EditorGUILayout.Space(); 43 | EditorGUILayout.HelpBox("In Perspective mode, the camera is always facing and centered on the Augmenta Scene.", MessageType.Info); 44 | break; 45 | 46 | case 2: //Offcenter 47 | EditorGUILayout.HelpBox("In OffCenter mode, you can move the camera freely but it will always be facing the Augmenta Scene.", MessageType.Info); 48 | break; 49 | } 50 | 51 | serializedObject.ApplyModifiedProperties(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Scripts/Editor/AugmentaSceneCameraEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b446f1b70eb6336438998902939ce81d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Editor/AugmentaVideoOutputCameraEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace Augmenta 7 | { 8 | [CustomEditor(typeof(AugmentaVideoOutputCamera))] 9 | public class AugmentaVideoOutputCameraEditor : Editor 10 | { 11 | SerializedProperty augmentaVideoOutput; 12 | SerializedProperty cameraType; 13 | SerializedProperty distanceToVideoOutput; 14 | 15 | void OnEnable() { 16 | 17 | augmentaVideoOutput = serializedObject.FindProperty("augmentaVideoOutput"); 18 | cameraType = serializedObject.FindProperty("cameraType"); 19 | distanceToVideoOutput = serializedObject.FindProperty("distanceToVideoOutput"); 20 | } 21 | 22 | public override void OnInspectorGUI() { 23 | 24 | serializedObject.Update(); 25 | 26 | EditorGUILayout.PropertyField(augmentaVideoOutput, new GUIContent("Augmenta Video Output")); 27 | EditorGUILayout.Space(); 28 | 29 | EditorGUILayout.PropertyField(cameraType, new GUIContent("Camera Type")); 30 | EditorGUILayout.Space(); 31 | 32 | switch (cameraType.enumValueIndex) { 33 | 34 | case 0: //Orthographic 35 | EditorGUILayout.PropertyField(distanceToVideoOutput, new GUIContent("Distance To Video Output")); 36 | EditorGUILayout.Space(); 37 | EditorGUILayout.HelpBox("In Orthographic mode, the camera is always facing and centered on the Video Output.", MessageType.Info); 38 | break; 39 | 40 | case 1: //Perspective 41 | EditorGUILayout.PropertyField(distanceToVideoOutput, new GUIContent("Distance To Video Output")); 42 | EditorGUILayout.Space(); 43 | EditorGUILayout.HelpBox("In Perspective mode, the camera is always facing and centered on the Video Output.", MessageType.Info); 44 | break; 45 | 46 | case 2: //Offcenter 47 | EditorGUILayout.HelpBox("In OffCenter mode, you can move the camera freely but it will always be facing the Video Output.", MessageType.Info); 48 | break; 49 | } 50 | 51 | serializedObject.ApplyModifiedProperties(); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Scripts/Editor/AugmentaVideoOutputCameraEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bcd352b33984bf44fbf922753fc8961f 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Scripts/Editor/AugmentaVideoOutputEditor.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using UnityEngine; 4 | using UnityEditor; 5 | 6 | namespace Augmenta 7 | { 8 | [CustomEditor(typeof(AugmentaVideoOutput))] 9 | public class AugmentaVideoOutputEditor : Editor 10 | { 11 | SerializedProperty augmentaManager; 12 | SerializedProperty augmentaVideoOutputCamera; 13 | 14 | SerializedProperty cameraMode; 15 | SerializedProperty paddingColor; 16 | SerializedProperty renderVideoOutputCameraToTexture; 17 | 18 | SerializedProperty autoOutputSizeInPixels; 19 | SerializedProperty autoOutputSizeInMeters; 20 | SerializedProperty autoOutputOffset; 21 | 22 | SerializedProperty videoOutputSizeInPixels; 23 | SerializedProperty videoOutputSizeInMeters; 24 | SerializedProperty videoOutputOffset; 25 | 26 | void OnEnable() { 27 | 28 | augmentaManager = serializedObject.FindProperty("augmentaManager"); 29 | augmentaVideoOutputCamera = serializedObject.FindProperty("camera"); 30 | 31 | cameraMode = serializedObject.FindProperty("_cameraMode"); 32 | paddingColor = serializedObject.FindProperty("paddingColor"); 33 | renderVideoOutputCameraToTexture = serializedObject.FindProperty("renderVideoOutputCameraToTexture"); 34 | 35 | autoOutputSizeInPixels = serializedObject.FindProperty("autoOutputSizeInPixels"); 36 | autoOutputSizeInMeters = serializedObject.FindProperty("autoOutputSizeInMeters"); 37 | autoOutputOffset = serializedObject.FindProperty("autoOutputOffset"); 38 | 39 | videoOutputSizeInPixels = serializedObject.FindProperty("_videoOutputSizeInPixels"); 40 | videoOutputSizeInMeters = serializedObject.FindProperty("_videoOutputSizeInMeters"); 41 | videoOutputOffset = serializedObject.FindProperty("_videoOutputOffset"); 42 | } 43 | 44 | public override void OnInspectorGUI() { 45 | 46 | AugmentaVideoOutput augmentaVideoOutput = target as AugmentaVideoOutput; 47 | 48 | serializedObject.Update(); 49 | 50 | EditorGUILayout.LabelField("AUGMENTA COMPONENTS", EditorStyles.boldLabel); 51 | EditorGUILayout.PropertyField(augmentaManager, new GUIContent("Augmenta Manager")); 52 | EditorGUILayout.Space(); 53 | 54 | EditorGUI.BeginChangeCheck(); 55 | EditorGUILayout.PropertyField(cameraMode, new GUIContent("Camera Mode", "None: no camera used with this video output.\nVideoOutput: the script will look for an AugmentaVideoOutputCamera in its hierarchy.\nExternal: any camera from the scene can be used. Note that the specified camera will be assigned a render texture target.")); 56 | if (EditorGUI.EndChangeCheck() && Application.isPlaying) { 57 | serializedObject.ApplyModifiedProperties(); 58 | augmentaVideoOutput.Initialize(); 59 | } 60 | EditorGUILayout.Space(); 61 | 62 | if (cameraMode.enumValueIndex == 1) { 63 | EditorGUILayout.PropertyField(renderVideoOutputCameraToTexture, new GUIContent("Render VideoOutput Camera To Texture")); 64 | EditorGUILayout.Space(); 65 | } else if (cameraMode.enumValueIndex == 2) { 66 | EditorGUILayout.PropertyField(augmentaVideoOutputCamera, new GUIContent("Output Camera")); 67 | EditorGUILayout.PropertyField(paddingColor, new GUIContent("Texture Padding Color")); 68 | EditorGUILayout.Space(); 69 | } 70 | 71 | EditorGUILayout.LabelField("VIDEO OUTPUT SETTINGS", EditorStyles.boldLabel); 72 | 73 | EditorGUILayout.PropertyField(autoOutputSizeInPixels, new GUIContent("Auto Size Output in Pixels", "Use data from Fusion to determine the output size in pixels.")); 74 | 75 | if (!autoOutputSizeInPixels.boolValue) { 76 | EditorGUI.BeginChangeCheck(); 77 | EditorGUILayout.PropertyField(videoOutputSizeInPixels, new GUIContent("Output Size in Pixels")); 78 | if (EditorGUI.EndChangeCheck() && Application.isPlaying) { 79 | serializedObject.ApplyModifiedProperties(); 80 | augmentaVideoOutput.RefreshVideoTexture(); 81 | } 82 | 83 | EditorGUILayout.Space(); 84 | } 85 | 86 | EditorGUILayout.PropertyField(autoOutputSizeInMeters, new GUIContent("Auto Size Output in Meters", "Use data from Fusion to determine the output size in meters.")); 87 | 88 | if (!autoOutputSizeInMeters.boolValue) { 89 | EditorGUILayout.PropertyField(videoOutputSizeInMeters, new GUIContent("Output Size in Meters")); 90 | 91 | EditorGUILayout.Space(); 92 | } 93 | 94 | EditorGUILayout.PropertyField(autoOutputOffset, new GUIContent("Auto Output Offset", "Use data from Fusion to determine the output offset.")); 95 | 96 | if (!autoOutputOffset.boolValue) { 97 | EditorGUILayout.PropertyField(videoOutputOffset, new GUIContent("Output Offset")); 98 | } 99 | 100 | serializedObject.ApplyModifiedProperties(); 101 | 102 | } 103 | } 104 | } 105 | -------------------------------------------------------------------------------- /Scripts/Editor/AugmentaVideoOutputEditor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 87f8e37c3ff960e41b776d2393188097 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aecfefc2436548d46921a87acd5f2780 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Shaders/CameraDisplayTexture.shader: -------------------------------------------------------------------------------- 1 | Shader "Augmenta/CameraDisplayTexture" 2 | { 3 | Properties 4 | { 5 | _MainTex("Main Tex",2D) = "white"{} 6 | _PaddingColor("Padding Color", Color) = (0, 0, 0, 1) 7 | } 8 | 9 | CGINCLUDE 10 | 11 | #include "UnityCustomRenderTexture.cginc" 12 | 13 | sampler2D _MainTex; 14 | float4 _MainTex_ST; 15 | 16 | float4 _PaddingColor; 17 | float4 _BotCamUV; //x,y = botLeft; z,w = botRight 18 | float4 _TopCamUV; //x,y = topLeft; z,w = topRight 19 | 20 | float2 GetCamUV(float2 uv) { 21 | 22 | float2 topCamUV = lerp(_TopCamUV.xy, _TopCamUV.zw, uv.x); 23 | float2 botCamUV = lerp(_BotCamUV.xy, _BotCamUV.zw, uv.x); 24 | 25 | return lerp(botCamUV, topCamUV, uv.y); 26 | } 27 | 28 | half4 frag(v2f_customrendertexture i) : SV_Target 29 | { 30 | float2 uv = i.globalTexcoord; 31 | 32 | float2 camUV = GetCamUV(uv); 33 | 34 | bool isInside; 35 | 36 | isInside = camUV.x >= 0 && camUV.y >= 0 && camUV.x <= 1 && camUV.y <= 1; 37 | 38 | 39 | if (!isInside) 40 | { 41 | //If not seen by camera, return padding color 42 | return _PaddingColor; 43 | 44 | } else { 45 | //Read camera texture 46 | return tex2D(_MainTex, camUV); 47 | } 48 | } 49 | 50 | ENDCG 51 | 52 | SubShader 53 | { 54 | Cull Off ZWrite Off ZTest Always 55 | Pass 56 | { 57 | Name "Update" 58 | CGPROGRAM 59 | #pragma vertex CustomRenderTextureVertexShader 60 | #pragma fragment frag 61 | ENDCG 62 | } 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /Shaders/CameraDisplayTexture.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: baac4e2f03c0f93428cf8d763aa1854e 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Shaders/UnlitTextureAlwaysOnTop.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/TextureColorAlwaysOnTop" 2 | { 3 | Properties 4 | { 5 | _MainTex("Texture", 2D) = "white" {} 6 | _Color("Color", color) = (1,1,1,1) 7 | } 8 | SubShader 9 | { 10 | Tags { "RenderType" = "Transparent" "Queue" = "Transparent+100" } 11 | 12 | ZTest Always 13 | ZWrite On 14 | 15 | Pass 16 | { 17 | CGPROGRAM 18 | #pragma vertex vert 19 | #pragma fragment frag 20 | // make fog work 21 | #pragma multi_compile_fog 22 | 23 | #include "UnityCG.cginc" 24 | 25 | struct appdata 26 | { 27 | float4 vertex : POSITION; 28 | float2 uv : TEXCOORD0; 29 | }; 30 | 31 | struct v2f 32 | { 33 | float2 uv : TEXCOORD0; 34 | UNITY_FOG_COORDS(1) 35 | float4 vertex : SV_POSITION; 36 | }; 37 | 38 | sampler2D _MainTex; 39 | float4 _MainTex_ST; 40 | float4 _Color; 41 | 42 | v2f vert(appdata v) 43 | { 44 | v2f o; 45 | o.vertex = UnityObjectToClipPos(v.vertex); 46 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 47 | UNITY_TRANSFER_FOG(o,o.vertex); 48 | return o; 49 | } 50 | 51 | float4 frag(v2f i) : SV_Target 52 | { 53 | // sample the texture 54 | float4 col = _Color * tex2D(_MainTex, i.uv); 55 | // apply fog 56 | UNITY_APPLY_FOG(i.fogCoord, col); 57 | return col; 58 | } 59 | ENDCG 60 | } 61 | } 62 | } 63 | -------------------------------------------------------------------------------- /Shaders/UnlitTextureAlwaysOnTop.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e80878a898323ed4c95a04a70803d344 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | preprocessorOverride: 0 8 | userData: 9 | assetBundleName: 10 | assetBundleVariant: 11 | -------------------------------------------------------------------------------- /Shaders/UnlitTextureColor.shader: -------------------------------------------------------------------------------- 1 | Shader "Unlit/TextureColor" 2 | { 3 | Properties 4 | { 5 | _MainTex ("Texture", 2D) = "white" {} 6 | _Color ("Color", color) = (1,1,1,1) 7 | } 8 | SubShader 9 | { 10 | Tags { "RenderType"="Opaque" } 11 | LOD 100 12 | 13 | Pass 14 | { 15 | CGPROGRAM 16 | #pragma vertex vert 17 | #pragma fragment frag 18 | // make fog work 19 | #pragma multi_compile_fog 20 | 21 | #include "UnityCG.cginc" 22 | 23 | struct appdata 24 | { 25 | float4 vertex : POSITION; 26 | float2 uv : TEXCOORD0; 27 | }; 28 | 29 | struct v2f 30 | { 31 | float2 uv : TEXCOORD0; 32 | UNITY_FOG_COORDS(1) 33 | float4 vertex : SV_POSITION; 34 | }; 35 | 36 | sampler2D _MainTex; 37 | float4 _MainTex_ST; 38 | float4 _Color; 39 | 40 | v2f vert (appdata v) 41 | { 42 | v2f o; 43 | o.vertex = UnityObjectToClipPos(v.vertex); 44 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 45 | UNITY_TRANSFER_FOG(o,o.vertex); 46 | return o; 47 | } 48 | 49 | float4 frag (v2f i) : SV_Target 50 | { 51 | // sample the texture 52 | float4 col = _Color * tex2D(_MainTex, i.uv); 53 | // apply fog 54 | UNITY_APPLY_FOG(i.fogCoord, col); 55 | return col; 56 | } 57 | ENDCG 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Shaders/UnlitTextureColor.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0eea18b359b788a46bd2301d86894c00 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Textures.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce05da820acda2b4bb742d99d5b4a2ec 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Textures/Black.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Augmenta-tech/AugmentaUnity/f007508bf0d81e48e1380dfc87830b1e72ccf178/Textures/Black.png -------------------------------------------------------------------------------- /Textures/Black.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e2901950ccab3d04b94804bcb733ca3c 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Textures/Transparent.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Augmenta-tech/AugmentaUnity/f007508bf0d81e48e1380dfc87830b1e72ccf178/Textures/Transparent.png -------------------------------------------------------------------------------- /Textures/Transparent.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9c487853a507d43478e4164e7c6c65f3 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 1 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | - serializedVersion: 2 73 | buildTarget: Standalone 74 | maxTextureSize: 2048 75 | resizeAlgorithm: 0 76 | textureFormat: -1 77 | textureCompression: 1 78 | compressionQuality: 50 79 | crunchedCompression: 0 80 | allowsAlphaSplitting: 0 81 | overridden: 0 82 | androidETC2FallbackOverride: 0 83 | spriteSheet: 84 | serializedVersion: 2 85 | sprites: [] 86 | outline: [] 87 | physicsShape: [] 88 | bones: [] 89 | spriteID: 90 | vertices: [] 91 | indices: 92 | edges: [] 93 | weights: [] 94 | spritePackingTag: 95 | pSDRemoveMatte: 0 96 | pSDShowRemoveMatteOption: 0 97 | userData: 98 | assetBundleName: 99 | assetBundleVariant: 100 | -------------------------------------------------------------------------------- /Textures/White.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Augmenta-tech/AugmentaUnity/f007508bf0d81e48e1380dfc87830b1e72ccf178/Textures/White.png -------------------------------------------------------------------------------- /Textures/White.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 66fed280cedb97342a984f5889941c7d 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 7 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Textures/checker.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Augmenta-tech/AugmentaUnity/f007508bf0d81e48e1380dfc87830b1e72ccf178/Textures/checker.png -------------------------------------------------------------------------------- /Textures/checker.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b779b90a173440d4ea9971d2257d2cd8 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 5 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | serializedVersion: 2 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapU: -1 36 | wrapV: -1 37 | wrapW: -1 38 | nPOTScale: 1 39 | lightmap: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spritePixelsToUnits: 100 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spriteGenerateFallbackPhysicsShape: 1 49 | alphaUsage: 1 50 | alphaIsTransparency: 0 51 | spriteTessellationDetail: -1 52 | textureType: 0 53 | textureShape: 1 54 | singleChannelComponent: 0 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - serializedVersion: 2 60 | buildTarget: DefaultTexturePlatform 61 | maxTextureSize: 2048 62 | resizeAlgorithm: 0 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | androidETC2FallbackOverride: 0 70 | spriteSheet: 71 | serializedVersion: 2 72 | sprites: [] 73 | outline: [] 74 | physicsShape: [] 75 | bones: [] 76 | spriteID: 77 | vertices: [] 78 | indices: 79 | edges: [] 80 | weights: [] 81 | spritePackingTag: 82 | userData: 83 | assetBundleName: 84 | assetBundleVariant: 85 | -------------------------------------------------------------------------------- /Textures/cross.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Augmenta-tech/AugmentaUnity/f007508bf0d81e48e1380dfc87830b1e72ccf178/Textures/cross.png -------------------------------------------------------------------------------- /Textures/cross.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: feb7bdbeada8b984b9b00b2773bd8f62 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 5 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | grayScaleToAlpha: 0 25 | generateCubemap: 6 26 | cubemapConvolution: 0 27 | seamlessCubemap: 0 28 | textureFormat: 1 29 | maxTextureSize: 2048 30 | textureSettings: 31 | serializedVersion: 2 32 | filterMode: -1 33 | aniso: -1 34 | mipBias: -1 35 | wrapU: -1 36 | wrapV: -1 37 | wrapW: -1 38 | nPOTScale: 1 39 | lightmap: 0 40 | compressionQuality: 50 41 | spriteMode: 0 42 | spriteExtrude: 1 43 | spriteMeshType: 1 44 | alignment: 0 45 | spritePivot: {x: 0.5, y: 0.5} 46 | spritePixelsToUnits: 100 47 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 48 | spriteGenerateFallbackPhysicsShape: 1 49 | alphaUsage: 1 50 | alphaIsTransparency: 1 51 | spriteTessellationDetail: -1 52 | textureType: 0 53 | textureShape: 1 54 | singleChannelComponent: 0 55 | maxTextureSizeSet: 0 56 | compressionQualitySet: 0 57 | textureFormatSet: 0 58 | platformSettings: 59 | - serializedVersion: 2 60 | buildTarget: DefaultTexturePlatform 61 | maxTextureSize: 2048 62 | resizeAlgorithm: 0 63 | textureFormat: -1 64 | textureCompression: 1 65 | compressionQuality: 50 66 | crunchedCompression: 0 67 | allowsAlphaSplitting: 0 68 | overridden: 0 69 | androidETC2FallbackOverride: 0 70 | - serializedVersion: 2 71 | buildTarget: Standalone 72 | maxTextureSize: 2048 73 | resizeAlgorithm: 0 74 | textureFormat: -1 75 | textureCompression: 1 76 | compressionQuality: 50 77 | crunchedCompression: 0 78 | allowsAlphaSplitting: 0 79 | overridden: 0 80 | androidETC2FallbackOverride: 0 81 | - serializedVersion: 2 82 | buildTarget: WebGL 83 | maxTextureSize: 2048 84 | resizeAlgorithm: 0 85 | textureFormat: -1 86 | textureCompression: 1 87 | compressionQuality: 50 88 | crunchedCompression: 0 89 | allowsAlphaSplitting: 0 90 | overridden: 0 91 | androidETC2FallbackOverride: 0 92 | spriteSheet: 93 | serializedVersion: 2 94 | sprites: [] 95 | outline: [] 96 | physicsShape: [] 97 | bones: [] 98 | spriteID: 99 | vertices: [] 100 | indices: 101 | edges: [] 102 | weights: [] 103 | spritePackingTag: 104 | userData: 105 | assetBundleName: 106 | assetBundleVariant: 107 | -------------------------------------------------------------------------------- /Textures/cross_borders.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Augmenta-tech/AugmentaUnity/f007508bf0d81e48e1380dfc87830b1e72ccf178/Textures/cross_borders.png -------------------------------------------------------------------------------- /Textures/cross_borders.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: dc8326fbacbbea1429b478e3d7bb4f08 3 | TextureImporter: 4 | internalIDToNameTable: [] 5 | externalObjects: {} 6 | serializedVersion: 11 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | applyGammaDecoding: 0 61 | platformSettings: 62 | - serializedVersion: 3 63 | buildTarget: DefaultTexturePlatform 64 | maxTextureSize: 2048 65 | resizeAlgorithm: 0 66 | textureFormat: -1 67 | textureCompression: 1 68 | compressionQuality: 50 69 | crunchedCompression: 0 70 | allowsAlphaSplitting: 0 71 | overridden: 0 72 | androidETC2FallbackOverride: 0 73 | forceMaximumCompressionQuality_BC6H_BC7: 0 74 | spriteSheet: 75 | serializedVersion: 2 76 | sprites: [] 77 | outline: [] 78 | physicsShape: [] 79 | bones: [] 80 | spriteID: 81 | internalID: 0 82 | vertices: [] 83 | indices: 84 | edges: [] 85 | weights: [] 86 | secondaryTextures: [] 87 | spritePackingTag: 88 | pSDRemoveMatte: 0 89 | pSDShowRemoveMatteOption: 0 90 | userData: 91 | assetBundleName: 92 | assetBundleVariant: 93 | --------------------------------------------------------------------------------