├── .gitignore ├── README.md ├── screenshot.jpg └── unity ├── .gitignore ├── Assets ├── AzureKinectDK.meta └── AzureKinectDK │ ├── Examples.meta │ ├── Examples │ ├── Scenes.meta │ ├── Scenes │ │ ├── SampleScene.unity │ │ └── SampleScene.unity.meta │ ├── Scripts.meta │ └── Scripts │ │ ├── DebugRenderer.cs │ │ └── DebugRenderer.cs.meta │ ├── Scripts.meta │ └── Scripts │ ├── M4A.meta │ ├── M4A │ ├── AzureKinectException.cs │ ├── AzureKinectException.cs.meta │ ├── BGRA.cs │ ├── BGRA.cs.meta │ ├── Calibration.cs │ ├── Calibration.cs.meta │ ├── Capture.cs │ ├── Capture.cs.meta │ ├── ColorControlCommand.cs │ ├── ColorControlCommand.cs.meta │ ├── ColorControlMode.cs │ ├── ColorControlMode.cs.meta │ ├── ColorResolution.cs │ ├── ColorResolution.cs.meta │ ├── DepthMode.cs │ ├── DepthMode.cs.meta │ ├── Device.cs │ ├── Device.cs.meta │ ├── DeviceConfiguration.cs │ ├── DeviceConfiguration.cs.meta │ ├── FPS.cs │ ├── FPS.cs.meta │ ├── FirmwareBuild.cs │ ├── FirmwareBuild.cs.meta │ ├── FirmwareSignature.cs │ ├── FirmwareSignature.cs.meta │ ├── Hardwareversion.cs │ ├── Hardwareversion.cs.meta │ ├── Image.cs │ ├── Image.cs.meta │ ├── ImageFormat.cs │ ├── ImageFormat.cs.meta │ ├── ImuSample.cs │ ├── ImuSample.cs.meta │ ├── LogLevel.cs │ ├── LogLevel.cs.meta │ ├── Native.meta │ ├── Native │ │ ├── NativeMethods.cs │ │ ├── NativeMethods.cs.meta │ │ ├── NativeReferenceAttributes.cs │ │ └── NativeReferenceAttributes.cs.meta │ ├── Short3.cs │ ├── Short3.cs.meta │ ├── Transformation.cs │ ├── Transformation.cs.meta │ ├── WiredSyncMode.cs │ └── WiredSyncMode.cs.meta │ ├── M4ABT.meta │ └── M4ABT │ ├── BodyFrame.cs │ ├── BodyFrame.cs.meta │ ├── BodyTracker.cs │ ├── BodyTracker.cs.meta │ ├── JointId.cs │ ├── JointId.cs.meta │ ├── Native.meta │ ├── Native │ ├── BodyTrackingNativeMethods.cs │ └── BodyTrackingNativeMethods.cs.meta │ ├── SensorOrientation.cs │ ├── SensorOrientation.cs.meta │ ├── Skeleton.cs │ ├── Skeleton.cs.meta │ ├── TrackerCalibration.cs │ └── TrackerCalibration.cs.meta ├── Packages └── manifest.json └── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── XRSettings.asset /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | dnn_model.onnx 3 | k4a.dll 4 | k4abt.dll 5 | onnxruntime.dll 6 | depthengine_1_0.dll 7 | depthengine_2_0.dll 8 | dnn_model_2_0.onnx 9 | 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # azure-kinect-dk-unity 2 | 3 | Unity example to use Azure Kinect DK (works with both Sensor SDK and Body Tracking SDK). 4 | 5 | ![Screenshot](screenshot.jpg?raw=true "ScreenShot") 6 | 7 | ## Tested environment 8 | As of Oct 19, 2019, this repo has been tested under the following environment. 9 | - Windows 10 Pro (ver 1903) 10 | - [Azure Kinect Sensor SDK](https://docs.microsoft.com/ja-jp/azure/Kinect-dk/sensor-sdk-download) v1.3.0 11 | - [Azure Kinect Body Tracking SDK](https://docs.microsoft.com/ja-jp/azure/Kinect-dk/body-sdk-download) v0.9.4 12 | - Unity 2019.1.14f1 13 | - CUDA v10.0 14 | - cudnn v7.5.1.10 15 | 16 | ## Get Started 17 | 1. Clone this repo. 18 | 2. Copy following files from Azure Kinect Sensor SDK or Azure Kinect Body Tracking SDK to *directly under the unity folder* 19 | - k4a.dll 20 | - k4abt.dll 21 | - onnxruntime.dll 22 | - depthengine_2_0.dll 23 | - dnn_model_2_0.onnx 24 | 3. Open Assets/AzureKinectDK/Example/Scenes/SampleScene 25 | 4. Play the scene and see how it works. 26 | 27 | ## License 28 | Files under `unity/Assets/AzureKinectDK/Scripts/M4A` are copied from https://github.com/microsoft/Azure-Kinect-Sensor-SDK and modified by Takahiro Horikawa which is licensed under MIT License. 29 | Other files are licensed under MIT license. -------------------------------------------------------------------------------- /screenshot.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/curiosity-inc/azure-kinect-dk-unity/c41d9197a5ae84c24243360b2454ec822347bdca/screenshot.jpg -------------------------------------------------------------------------------- /unity/.gitignore: -------------------------------------------------------------------------------- 1 | # This .gitignore file should be placed at the root of your Unity project directory 2 | # 3 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 4 | # 5 | /[Ll]ibrary/ 6 | /[Tt]emp/ 7 | /[Oo]bj/ 8 | /[Bb]uild/ 9 | /[Bb]uilds/ 10 | /[Ll]ogs/ 11 | /[Mm]emoryCaptures/ 12 | 13 | # Never ignore Asset meta data 14 | !/[Aa]ssets/**/*.meta 15 | 16 | # Uncomment this line if you wish to ignore the asset store tools plugin 17 | # /[Aa]ssets/AssetStoreTools* 18 | 19 | # TextMesh Pro files 20 | [Aa]ssets/TextMesh*Pro/ 21 | 22 | # Autogenerated Jetbrains Rider plugin 23 | [Aa]ssets/Plugins/Editor/JetBrains* 24 | 25 | # Visual Studio cache directory 26 | .vs/ 27 | 28 | # Gradle cache directory 29 | .gradle/ 30 | 31 | # Autogenerated VS/MD/Consulo solution and project files 32 | ExportedObj/ 33 | .consulo/ 34 | *.csproj 35 | *.unityproj 36 | *.sln 37 | *.suo 38 | *.tmp 39 | *.user 40 | *.userprefs 41 | *.pidb 42 | *.booproj 43 | *.svd 44 | *.pdb 45 | *.mdb 46 | *.opendb 47 | *.VC.db 48 | 49 | # Unity3D generated meta files 50 | *.pidb.meta 51 | *.pdb.meta 52 | *.mdb.meta 53 | 54 | # Unity3D generated file on crash reports 55 | sysinfo.txt 56 | 57 | # Builds 58 | *.apk 59 | *.unitypackage 60 | 61 | # Crashlytics generated file 62 | crashlytics-build.properties 63 | win-build 64 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 908a916d4197746c2a2e6def51afba17 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3cc32fe031a284696a727ac4269b300c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Examples/Scenes.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1f9fa5b1c407a4b3eb7518f60ef215fb 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Examples/Scenes/SampleScene.unity: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!29 &1 4 | OcclusionCullingSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_OcclusionBakeSettings: 8 | smallestOccluder: 5 9 | smallestHole: 0.25 10 | backfaceThreshold: 100 11 | m_SceneGUID: 00000000000000000000000000000000 12 | m_OcclusionCullingData: {fileID: 0} 13 | --- !u!104 &2 14 | RenderSettings: 15 | m_ObjectHideFlags: 0 16 | serializedVersion: 9 17 | m_Fog: 0 18 | m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} 19 | m_FogMode: 3 20 | m_FogDensity: 0.01 21 | m_LinearFogStart: 0 22 | m_LinearFogEnd: 300 23 | m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} 24 | m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} 25 | m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} 26 | m_AmbientIntensity: 1 27 | m_AmbientMode: 0 28 | m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} 29 | m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} 30 | m_HaloStrength: 0.5 31 | m_FlareStrength: 1 32 | m_FlareFadeSpeed: 3 33 | m_HaloTexture: {fileID: 0} 34 | m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} 35 | m_DefaultReflectionMode: 0 36 | m_DefaultReflectionResolution: 128 37 | m_ReflectionBounces: 1 38 | m_ReflectionIntensity: 1 39 | m_CustomReflection: {fileID: 0} 40 | m_Sun: {fileID: 705507994} 41 | m_IndirectSpecularColor: {r: 0.44657898, g: 0.4964133, b: 0.5748178, a: 1} 42 | m_UseRadianceAmbientProbe: 0 43 | --- !u!157 &3 44 | LightmapSettings: 45 | m_ObjectHideFlags: 0 46 | serializedVersion: 11 47 | m_GIWorkflowMode: 0 48 | m_GISettings: 49 | serializedVersion: 2 50 | m_BounceScale: 1 51 | m_IndirectOutputScale: 1 52 | m_AlbedoBoost: 1 53 | m_EnvironmentLightingMode: 0 54 | m_EnableBakedLightmaps: 1 55 | m_EnableRealtimeLightmaps: 1 56 | m_LightmapEditorSettings: 57 | serializedVersion: 12 58 | m_Resolution: 2 59 | m_BakeResolution: 40 60 | m_AtlasSize: 1024 61 | m_AO: 0 62 | m_AOMaxDistance: 1 63 | m_CompAOExponent: 1 64 | m_CompAOExponentDirect: 0 65 | m_ExtractAmbientOcclusion: 0 66 | m_Padding: 2 67 | m_LightmapParameters: {fileID: 0} 68 | m_LightmapsBakeMode: 1 69 | m_TextureCompression: 1 70 | m_FinalGather: 0 71 | m_FinalGatherFiltering: 1 72 | m_FinalGatherRayCount: 256 73 | m_ReflectionCompression: 2 74 | m_MixedBakeMode: 2 75 | m_BakeBackend: 1 76 | m_PVRSampling: 1 77 | m_PVRDirectSampleCount: 32 78 | m_PVRSampleCount: 500 79 | m_PVRBounces: 2 80 | m_PVREnvironmentSampleCount: 500 81 | m_PVREnvironmentReferencePointCount: 2048 82 | m_PVRFilteringMode: 2 83 | m_PVRDenoiserTypeDirect: 0 84 | m_PVRDenoiserTypeIndirect: 0 85 | m_PVRDenoiserTypeAO: 0 86 | m_PVRFilterTypeDirect: 0 87 | m_PVRFilterTypeIndirect: 0 88 | m_PVRFilterTypeAO: 0 89 | m_PVREnvironmentMIS: 0 90 | m_PVRCulling: 1 91 | m_PVRFilteringGaussRadiusDirect: 1 92 | m_PVRFilteringGaussRadiusIndirect: 5 93 | m_PVRFilteringGaussRadiusAO: 2 94 | m_PVRFilteringAtrousPositionSigmaDirect: 0.5 95 | m_PVRFilteringAtrousPositionSigmaIndirect: 2 96 | m_PVRFilteringAtrousPositionSigmaAO: 1 97 | m_ShowResolutionOverlay: 1 98 | m_ExportTrainingData: 0 99 | m_LightingDataAsset: {fileID: 0} 100 | m_UseShadowmask: 1 101 | --- !u!196 &4 102 | NavMeshSettings: 103 | serializedVersion: 2 104 | m_ObjectHideFlags: 0 105 | m_BuildSettings: 106 | serializedVersion: 2 107 | agentTypeID: 0 108 | agentRadius: 0.5 109 | agentHeight: 2 110 | agentSlope: 45 111 | agentClimb: 0.4 112 | ledgeDropHeight: 0 113 | maxJumpAcrossDistance: 0 114 | minRegionArea: 2 115 | manualCellSize: 0 116 | cellSize: 0.16666667 117 | manualTileSize: 0 118 | tileSize: 256 119 | accuratePlacement: 0 120 | debug: 121 | m_Flags: 0 122 | m_NavMeshData: {fileID: 0} 123 | --- !u!1 &705507993 124 | GameObject: 125 | m_ObjectHideFlags: 0 126 | m_CorrespondingSourceObject: {fileID: 0} 127 | m_PrefabInstance: {fileID: 0} 128 | m_PrefabAsset: {fileID: 0} 129 | serializedVersion: 6 130 | m_Component: 131 | - component: {fileID: 705507995} 132 | - component: {fileID: 705507994} 133 | m_Layer: 0 134 | m_Name: Directional Light 135 | m_TagString: Untagged 136 | m_Icon: {fileID: 0} 137 | m_NavMeshLayer: 0 138 | m_StaticEditorFlags: 0 139 | m_IsActive: 1 140 | --- !u!108 &705507994 141 | Light: 142 | m_ObjectHideFlags: 0 143 | m_CorrespondingSourceObject: {fileID: 0} 144 | m_PrefabInstance: {fileID: 0} 145 | m_PrefabAsset: {fileID: 0} 146 | m_GameObject: {fileID: 705507993} 147 | m_Enabled: 1 148 | serializedVersion: 9 149 | m_Type: 1 150 | m_Color: {r: 1, g: 0.95686275, b: 0.8392157, a: 1} 151 | m_Intensity: 1 152 | m_Range: 10 153 | m_SpotAngle: 30 154 | m_InnerSpotAngle: 21.80208 155 | m_CookieSize: 10 156 | m_Shadows: 157 | m_Type: 2 158 | m_Resolution: -1 159 | m_CustomResolution: -1 160 | m_Strength: 1 161 | m_Bias: 0.05 162 | m_NormalBias: 0.4 163 | m_NearPlane: 0.2 164 | m_CullingMatrixOverride: 165 | e00: 1 166 | e01: 0 167 | e02: 0 168 | e03: 0 169 | e10: 0 170 | e11: 1 171 | e12: 0 172 | e13: 0 173 | e20: 0 174 | e21: 0 175 | e22: 1 176 | e23: 0 177 | e30: 0 178 | e31: 0 179 | e32: 0 180 | e33: 1 181 | m_UseCullingMatrixOverride: 0 182 | m_Cookie: {fileID: 0} 183 | m_DrawHalo: 0 184 | m_Flare: {fileID: 0} 185 | m_RenderMode: 0 186 | m_CullingMask: 187 | serializedVersion: 2 188 | m_Bits: 4294967295 189 | m_RenderingLayerMask: 1 190 | m_Lightmapping: 1 191 | m_LightShadowCasterMode: 0 192 | m_AreaSize: {x: 1, y: 1} 193 | m_BounceIntensity: 1 194 | m_ColorTemperature: 6570 195 | m_UseColorTemperature: 0 196 | m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} 197 | m_UseBoundingSphereOverride: 0 198 | m_ShadowRadius: 0 199 | m_ShadowAngle: 0 200 | --- !u!4 &705507995 201 | Transform: 202 | m_ObjectHideFlags: 0 203 | m_CorrespondingSourceObject: {fileID: 0} 204 | m_PrefabInstance: {fileID: 0} 205 | m_PrefabAsset: {fileID: 0} 206 | m_GameObject: {fileID: 705507993} 207 | m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} 208 | m_LocalPosition: {x: 0, y: 3, z: 0} 209 | m_LocalScale: {x: 1, y: 1, z: 1} 210 | m_Children: [] 211 | m_Father: {fileID: 0} 212 | m_RootOrder: 1 213 | m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} 214 | --- !u!1 &907009269 215 | GameObject: 216 | m_ObjectHideFlags: 0 217 | m_CorrespondingSourceObject: {fileID: 0} 218 | m_PrefabInstance: {fileID: 0} 219 | m_PrefabAsset: {fileID: 0} 220 | serializedVersion: 6 221 | m_Component: 222 | - component: {fileID: 907009273} 223 | - component: {fileID: 907009272} 224 | - component: {fileID: 907009271} 225 | - component: {fileID: 907009270} 226 | m_Layer: 0 227 | m_Name: Cube 228 | m_TagString: Untagged 229 | m_Icon: {fileID: 0} 230 | m_NavMeshLayer: 0 231 | m_StaticEditorFlags: 0 232 | m_IsActive: 1 233 | --- !u!65 &907009270 234 | BoxCollider: 235 | m_ObjectHideFlags: 0 236 | m_CorrespondingSourceObject: {fileID: 0} 237 | m_PrefabInstance: {fileID: 0} 238 | m_PrefabAsset: {fileID: 0} 239 | m_GameObject: {fileID: 907009269} 240 | m_Material: {fileID: 0} 241 | m_IsTrigger: 0 242 | m_Enabled: 1 243 | serializedVersion: 2 244 | m_Size: {x: 1, y: 1, z: 1} 245 | m_Center: {x: 0, y: 0, z: 0} 246 | --- !u!23 &907009271 247 | MeshRenderer: 248 | m_ObjectHideFlags: 0 249 | m_CorrespondingSourceObject: {fileID: 0} 250 | m_PrefabInstance: {fileID: 0} 251 | m_PrefabAsset: {fileID: 0} 252 | m_GameObject: {fileID: 907009269} 253 | m_Enabled: 1 254 | m_CastShadows: 1 255 | m_ReceiveShadows: 1 256 | m_DynamicOccludee: 1 257 | m_MotionVectors: 1 258 | m_LightProbeUsage: 1 259 | m_ReflectionProbeUsage: 1 260 | m_RenderingLayerMask: 1 261 | m_RendererPriority: 0 262 | m_Materials: 263 | - {fileID: 10754, guid: 0000000000000000f000000000000000, type: 0} 264 | m_StaticBatchInfo: 265 | firstSubMesh: 0 266 | subMeshCount: 0 267 | m_StaticBatchRoot: {fileID: 0} 268 | m_ProbeAnchor: {fileID: 0} 269 | m_LightProbeVolumeOverride: {fileID: 0} 270 | m_ScaleInLightmap: 1 271 | m_PreserveUVs: 0 272 | m_IgnoreNormalsForChartDetection: 0 273 | m_ImportantGI: 0 274 | m_StitchLightmapSeams: 1 275 | m_SelectedEditorRenderState: 3 276 | m_MinimumChartSize: 4 277 | m_AutoUVMaxDistance: 0.5 278 | m_AutoUVMaxAngle: 89 279 | m_LightmapParameters: {fileID: 0} 280 | m_SortingLayerID: 0 281 | m_SortingLayer: 0 282 | m_SortingOrder: 0 283 | --- !u!33 &907009272 284 | MeshFilter: 285 | m_ObjectHideFlags: 0 286 | m_CorrespondingSourceObject: {fileID: 0} 287 | m_PrefabInstance: {fileID: 0} 288 | m_PrefabAsset: {fileID: 0} 289 | m_GameObject: {fileID: 907009269} 290 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 291 | --- !u!4 &907009273 292 | Transform: 293 | m_ObjectHideFlags: 0 294 | m_CorrespondingSourceObject: {fileID: 0} 295 | m_PrefabInstance: {fileID: 0} 296 | m_PrefabAsset: {fileID: 0} 297 | m_GameObject: {fileID: 907009269} 298 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 299 | m_LocalPosition: {x: 8.5, y: 2, z: 10} 300 | m_LocalScale: {x: 8, y: 4.5, z: 1} 301 | m_Children: [] 302 | m_Father: {fileID: 0} 303 | m_RootOrder: 3 304 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 305 | --- !u!1 &963194225 306 | GameObject: 307 | m_ObjectHideFlags: 0 308 | m_CorrespondingSourceObject: {fileID: 0} 309 | m_PrefabInstance: {fileID: 0} 310 | m_PrefabAsset: {fileID: 0} 311 | serializedVersion: 6 312 | m_Component: 313 | - component: {fileID: 963194228} 314 | - component: {fileID: 963194227} 315 | - component: {fileID: 963194226} 316 | m_Layer: 0 317 | m_Name: Main Camera 318 | m_TagString: MainCamera 319 | m_Icon: {fileID: 0} 320 | m_NavMeshLayer: 0 321 | m_StaticEditorFlags: 0 322 | m_IsActive: 1 323 | --- !u!81 &963194226 324 | AudioListener: 325 | m_ObjectHideFlags: 0 326 | m_CorrespondingSourceObject: {fileID: 0} 327 | m_PrefabInstance: {fileID: 0} 328 | m_PrefabAsset: {fileID: 0} 329 | m_GameObject: {fileID: 963194225} 330 | m_Enabled: 1 331 | --- !u!20 &963194227 332 | Camera: 333 | m_ObjectHideFlags: 0 334 | m_CorrespondingSourceObject: {fileID: 0} 335 | m_PrefabInstance: {fileID: 0} 336 | m_PrefabAsset: {fileID: 0} 337 | m_GameObject: {fileID: 963194225} 338 | m_Enabled: 1 339 | serializedVersion: 2 340 | m_ClearFlags: 1 341 | m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} 342 | m_projectionMatrixMode: 1 343 | m_GateFitMode: 2 344 | m_FOVAxisMode: 0 345 | m_SensorSize: {x: 36, y: 24} 346 | m_LensShift: {x: 0, y: 0} 347 | m_FocalLength: 50 348 | m_NormalizedViewPortRect: 349 | serializedVersion: 2 350 | x: 0 351 | y: 0 352 | width: 1 353 | height: 1 354 | near clip plane: 0.3 355 | far clip plane: 1000 356 | field of view: 60 357 | orthographic: 1 358 | orthographic size: 5 359 | m_Depth: -1 360 | m_CullingMask: 361 | serializedVersion: 2 362 | m_Bits: 4294967295 363 | m_RenderingPath: -1 364 | m_TargetTexture: {fileID: 0} 365 | m_TargetDisplay: 0 366 | m_TargetEye: 3 367 | m_HDR: 1 368 | m_AllowMSAA: 1 369 | m_AllowDynamicResolution: 0 370 | m_ForceIntoRT: 0 371 | m_OcclusionCulling: 1 372 | m_StereoConvergence: 10 373 | m_StereoSeparation: 0.022 374 | --- !u!4 &963194228 375 | Transform: 376 | m_ObjectHideFlags: 0 377 | m_CorrespondingSourceObject: {fileID: 0} 378 | m_PrefabInstance: {fileID: 0} 379 | m_PrefabAsset: {fileID: 0} 380 | m_GameObject: {fileID: 963194225} 381 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 382 | m_LocalPosition: {x: 4, y: 0, z: -3} 383 | m_LocalScale: {x: 1, y: 1, z: 1} 384 | m_Children: [] 385 | m_Father: {fileID: 0} 386 | m_RootOrder: 0 387 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 388 | --- !u!1 &1630789622 389 | GameObject: 390 | m_ObjectHideFlags: 0 391 | m_CorrespondingSourceObject: {fileID: 0} 392 | m_PrefabInstance: {fileID: 0} 393 | m_PrefabAsset: {fileID: 0} 394 | serializedVersion: 6 395 | m_Component: 396 | - component: {fileID: 1630789623} 397 | - component: {fileID: 1630789624} 398 | m_Layer: 0 399 | m_Name: GameObject 400 | m_TagString: Untagged 401 | m_Icon: {fileID: 0} 402 | m_NavMeshLayer: 0 403 | m_StaticEditorFlags: 0 404 | m_IsActive: 1 405 | --- !u!4 &1630789623 406 | Transform: 407 | m_ObjectHideFlags: 0 408 | m_CorrespondingSourceObject: {fileID: 0} 409 | m_PrefabInstance: {fileID: 0} 410 | m_PrefabAsset: {fileID: 0} 411 | m_GameObject: {fileID: 1630789622} 412 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 413 | m_LocalPosition: {x: 0.4083594, y: 0.8439909, z: 0} 414 | m_LocalScale: {x: 1, y: 1, z: 1} 415 | m_Children: [] 416 | m_Father: {fileID: 0} 417 | m_RootOrder: 2 418 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 419 | --- !u!114 &1630789624 420 | MonoBehaviour: 421 | m_ObjectHideFlags: 0 422 | m_CorrespondingSourceObject: {fileID: 0} 423 | m_PrefabInstance: {fileID: 0} 424 | m_PrefabAsset: {fileID: 0} 425 | m_GameObject: {fileID: 1630789622} 426 | m_Enabled: 1 427 | m_EditorHideFlags: 0 428 | m_Script: {fileID: 11500000, guid: 704f4b8d442a3974b9c2f67bbfe361bf, type: 3} 429 | m_Name: 430 | m_EditorClassIdentifier: 431 | renderer: {fileID: 907009271} 432 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Examples/Scenes/SampleScene.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9fc0d4010bbf28b4594072e72b8655ab 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Examples/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6f8c229ed81ec3045bb8006422747db1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Examples/Scripts/DebugRenderer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using UnityEngine; 5 | using Microsoft.Azure.Kinect.Sensor; 6 | using Microsoft.Azure.Kinect.Sensor.BodyTracking; 7 | 8 | public class DebugRenderer : MonoBehaviour 9 | { 10 | Device device; 11 | BodyTracker tracker; 12 | Skeleton skeleton; 13 | GameObject[] debugObjects; 14 | public Renderer renderer; 15 | 16 | private void OnEnable() 17 | { 18 | this.device = Device.Open(0); 19 | var config = new DeviceConfiguration 20 | { 21 | ColorResolution = ColorResolution.r720p, 22 | ColorFormat = ImageFormat.ColorBGRA32, 23 | DepthMode = DepthMode.NFOV_Unbinned 24 | }; 25 | device.StartCameras(config); 26 | 27 | var calibration = device.GetCalibration(config.DepthMode, config.ColorResolution); 28 | this.tracker = BodyTracker.Create(calibration); 29 | debugObjects = new GameObject[(int)JointId.Count]; 30 | for (var i = 0; i < (int)JointId.Count; i++) 31 | { 32 | var cube = GameObject.CreatePrimitive(PrimitiveType.Cube); 33 | cube.name = Enum.GetName(typeof(JointId), i); 34 | cube.transform.localScale = Vector3.one * 0.4f; 35 | debugObjects[i] = cube; 36 | } 37 | } 38 | 39 | private void OnDisable() 40 | { 41 | if (tracker != null) 42 | { 43 | tracker.Dispose(); 44 | } 45 | if (device != null) 46 | { 47 | device.Dispose(); 48 | } 49 | } 50 | 51 | void Update() 52 | { 53 | using (Capture capture = device.GetCapture()) 54 | { 55 | tracker.EnqueueCapture(capture); 56 | var color = capture.Color; 57 | if (color.WidthPixels > 0) 58 | { 59 | Texture2D tex = new Texture2D(color.WidthPixels, color.HeightPixels, TextureFormat.BGRA32, false); 60 | tex.LoadRawTextureData(color.GetBufferCopy()); 61 | tex.Apply(); 62 | renderer.material.mainTexture = tex; 63 | } 64 | } 65 | 66 | using (var frame = tracker.PopResult()) 67 | { 68 | Debug.LogFormat("{0} bodies found.", frame.NumBodies); 69 | if (frame.NumBodies > 0) 70 | { 71 | var bodyId = frame.GetBodyId(0); 72 | Debug.LogFormat("bodyId={0}", bodyId); 73 | this.skeleton = frame.GetSkeleton(0); 74 | for (var i = 0; i < (int)JointId.Count; i++) 75 | { 76 | var joint = this.skeleton.Joints[i]; 77 | var pos = joint.Position; 78 | var rot = joint.Orientation; 79 | var v = new Vector3(pos[0], -pos[1], pos[2]) * 0.004f; 80 | var r = new Quaternion(rot[1], rot[2], rot[3], rot[0]); 81 | var obj = debugObjects[i]; 82 | obj.transform.SetPositionAndRotation(v, r); 83 | } 84 | 85 | } 86 | } 87 | } 88 | } 89 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Examples/Scripts/DebugRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 704f4b8d442a3974b9c2f67bbfe361bf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2c727f0bca23c394ab036b35820b81c9 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0985633d8597b2448dfb213b0ba9ddd 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/AzureKinectException.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // Licensed under the MIT License. 5 | // 6 | //------------------------------------------------------------------------------ 7 | using System; 8 | using System.Runtime.Serialization; 9 | 10 | namespace Microsoft.Azure.Kinect.Sensor 11 | { 12 | /// 13 | /// Represents errors that occur when interactive with the Azure Kinect Sensor SDK. 14 | /// 15 | [Serializable] 16 | public class AzureKinectException : Exception 17 | { 18 | /// 19 | /// Initializes a new instance of the class. 20 | /// 21 | public AzureKinectException() 22 | { 23 | } 24 | 25 | /// 26 | /// Initializes a new instance of the class with a specified error message. 27 | /// 28 | /// The message that describes the error. 29 | public AzureKinectException(string message) 30 | : base(message) 31 | { 32 | } 33 | 34 | /// 35 | /// Initializes a new instance of the class with a specified error message and a reference to the inner exception that is the cause of this exception. 36 | /// 37 | /// The error message that explains the reason for the exception. 38 | /// The exception that is the cause of the current exception, or a null reference (Nothing in Visual Basic) if no inner exception is specified. 39 | public AzureKinectException(string message, Exception innerException) 40 | : base(message, innerException) 41 | { 42 | } 43 | 44 | /// 45 | /// Initializes a new instance of the class with serialized data. 46 | /// 47 | /// The that holds the serialized object data about the exception being thrown. 48 | /// The System.Runtime.Serialization.StreamingContext that contains contextual information about the source or destination. 49 | protected AzureKinectException(SerializationInfo info, StreamingContext context) 50 | : base(info, context) 51 | { 52 | } 53 | 54 | /// 55 | /// Throws an if the result is not . 56 | /// 57 | /// The result to check. 58 | internal static void ThrowIfNotSuccess(NativeMethods.k4a_result_t result) 59 | { 60 | if (result != NativeMethods.k4a_result_t.K4A_RESULT_SUCCEEDED) 61 | { 62 | throw new AzureKinectException($"result = {result}"); 63 | } 64 | } 65 | 66 | /// 67 | /// Throws an if the result is not . 68 | /// 69 | /// The result to check. 70 | internal static void ThrowIfNotSuccess(NativeMethods.k4a_wait_result_t result) 71 | { 72 | if (result != NativeMethods.k4a_wait_result_t.K4A_WAIT_RESULT_SUCCEEDED) 73 | { 74 | throw new AzureKinectException($"result = {result}"); 75 | } 76 | } 77 | 78 | /// 79 | /// Throws an if the result is not . 80 | /// 81 | /// The result to check. 82 | internal static void ThrowIfNotSuccess(NativeMethods.k4a_buffer_result_t result) 83 | { 84 | if (result != NativeMethods.k4a_buffer_result_t.K4A_BUFFER_RESULT_SUCCEEDED) 85 | { 86 | throw new AzureKinectException($"result = {result}"); 87 | } 88 | } 89 | } 90 | } 91 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/AzureKinectException.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 691fc592c91e5254f89ebaa4a427bdac 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/BGRA.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Copyright (c) Microsoft Corporation. All rights reserved. 3 | // Licensed under the MIT License. 4 | // 5 | using System; 6 | using System.Runtime.InteropServices; 7 | 8 | namespace Microsoft.Azure.Kinect.Sensor 9 | { 10 | /// 11 | /// Describes a pixel of color in terms of blue, green, red, and alpha channels. 12 | /// 13 | [StructLayout(LayoutKind.Explicit)] 14 | public struct BGRA : IEquatable 15 | { 16 | [FieldOffset(0)] 17 | private byte blue; 18 | [FieldOffset(1)] 19 | private byte green; 20 | [FieldOffset(2)] 21 | private byte red; 22 | [FieldOffset(3)] 23 | private byte alpha; 24 | 25 | [FieldOffset(0)] 26 | private int value; 27 | 28 | /// 29 | /// Initializes a new instance of the structure. 30 | /// 31 | /// The blue channel value of the color. 32 | /// The green channel value of the color. 33 | /// The red channel value of the color. 34 | /// The alpha channel value of the color. 35 | public BGRA(byte blue, byte green, byte red, byte alpha = 0) 36 | { 37 | this.value = 0; 38 | this.blue = blue; 39 | this.green = green; 40 | this.red = red; 41 | this.alpha = alpha; 42 | } 43 | 44 | /// 45 | /// Gets or sets the BGRA alpha channel value of the color. 46 | /// 47 | public byte A { get => this.alpha; set => this.alpha = value; } 48 | 49 | /// 50 | /// Gets or sets the BGRA red channel value of the color. 51 | /// 52 | public byte R { get => this.red; set => this.red = value; } 53 | 54 | /// 55 | /// Gets or sets the BGRA green channel value of the color. 56 | /// 57 | public byte G { get => this.green; set => this.green = value; } 58 | 59 | /// 60 | /// Gets or sets the BGRA blue channel value of the color. 61 | /// 62 | public byte B { get => this.blue; set => this.blue = value; } 63 | 64 | /// 65 | /// Gets or sets the combined BGRA value of the color. 66 | /// 67 | public int Value { get => this.value; set => this.value = value; } 68 | 69 | /// 70 | /// Tests whether two structures are identical. 71 | /// 72 | /// The first structure to compare. 73 | /// The second structure to compare. 74 | /// true if and are exactly identical; otherwise, flase. 75 | public static bool operator ==(BGRA bgra1, BGRA bgra2) 76 | { 77 | return bgra1.Value == bgra2.Value; 78 | } 79 | 80 | /// 81 | /// Tests whether two structures are not identical. 82 | /// 83 | /// The first structure to compare. 84 | /// The second structure to compare. 85 | /// true if and are note equal; otherwise, flase. 86 | public static bool operator !=(BGRA bgra1, BGRA bgra2) 87 | { 88 | return bgra1.Value != bgra2.Value; 89 | } 90 | 91 | /// 92 | /// Tests whether the specified object is a structure and is equivalent to this . 93 | /// 94 | /// The object to compare to this structure. 95 | /// true if the specified object is a structure and is identical to the current structure; otherwise, flase. 96 | public override bool Equals(object obj) 97 | { 98 | return (obj is BGRA) ? this.Equals((BGRA)obj) : false; 99 | } 100 | 101 | /// 102 | /// Tests whether the specified structure is equivalent to this . 103 | /// 104 | /// The structure to compare to the current structure. 105 | /// true if the specified structure is identical to the current structure; otherwise, flase. 106 | public bool Equals(BGRA other) 107 | { 108 | return other.Value == this.Value; 109 | } 110 | 111 | /// 112 | /// Gets a hash code for this structure. 113 | /// 114 | /// A hash code for this structure. 115 | public override int GetHashCode() 116 | { 117 | return this.Value; 118 | } 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/BGRA.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bfee98bbaa6993344a5f032e77a15a21 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Calibration.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | using System.Numerics; 5 | using System.Runtime.InteropServices; 6 | 7 | namespace Microsoft.Azure.Kinect.Sensor 8 | { 9 | [StructLayout(LayoutKind.Sequential)] 10 | [Native.NativeReference("k4a_calibration_t")] 11 | public struct Calibration 12 | { 13 | [MarshalAs(UnmanagedType.Struct)] 14 | public Camera depth_camera_calibration; 15 | 16 | [MarshalAs(UnmanagedType.Struct)] 17 | public Camera color_camera_calibration; 18 | 19 | [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.Struct, 20 | SizeConst = ((int)(Calibration.DeviceType.Num) * ((int)(Calibration.DeviceType.Num))))] 21 | public Extrinsics[] device_extrinsics; 22 | 23 | public DepthMode depth_mode; 24 | 25 | public ColorResolution color_resolution; 26 | 27 | [StructLayout(LayoutKind.Sequential)] 28 | public struct Camera 29 | { 30 | [MarshalAs(UnmanagedType.Struct)] 31 | public Extrinsics extrinsics; 32 | 33 | [MarshalAs(UnmanagedType.Struct)] 34 | public Intrinsics intrinsics; 35 | 36 | public int resolution_width; 37 | public int resolution_height; 38 | public float metric_radius; 39 | } 40 | 41 | [StructLayout(LayoutKind.Sequential)] 42 | public struct Extrinsics 43 | { 44 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 9)] 45 | public float[] rotation; 46 | 47 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] 48 | public float[] translation; 49 | } 50 | 51 | [StructLayout(LayoutKind.Sequential)] 52 | public struct Intrinsics 53 | { 54 | public ModelType type; 55 | 56 | public int parameter_count; 57 | 58 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 15)] 59 | public float[] parameters; 60 | } 61 | 62 | [Native.NativeReference("k4a_calibration_model_type_t")] 63 | public enum ModelType 64 | { 65 | [Native.NativeReference("K4A_CALIBRATION_LENS_DISTORTION_MODEL_UNKNOWN")] 66 | Unknown = 0, 67 | [Native.NativeReference("K4A_CALIBRATION_LENS_DISTORTION_MODEL_THETA")] 68 | Theta, 69 | [Native.NativeReference("K4A_CALIBRATION_LENS_DISTORTION_MODEL_POLYNOMIAL_3K")] 70 | Polynomial3K, 71 | [Native.NativeReference("K4A_CALIBRATION_LENS_DISTORTION_MODEL_RATIONAL_6KT")] 72 | Rational6KT, 73 | [Native.NativeReference("K4A_CALIBRATION_LENS_DISTORTION_MODEL_BROWN_CONRADY")] 74 | BrownConrady 75 | } 76 | 77 | [Native.NativeReference("k4a_calibration_type_t")] 78 | public enum DeviceType 79 | { 80 | [Native.NativeReference("K4A_CALIBRATION_TYPE_UNKNOWN")] 81 | Unknown = -1, 82 | [Native.NativeReference("K4A_CALIBRATION_TYPE_DEPTH")] 83 | Depth, 84 | [Native.NativeReference("K4A_CALIBRATION_TYPE_COLOR")] 85 | Color, 86 | [Native.NativeReference("K4A_CALIBRATION_TYPE_GYRO")] 87 | Gyro, 88 | [Native.NativeReference("K4A_CALIBRATION_TYPE_ACCEL")] 89 | Accel, 90 | [Native.NativeReference("K4A_CALIBRATION_TYPE_NUM")] 91 | Num 92 | } 93 | 94 | public Vector2? TransformTo2D(Vector2 sourcePoint2D, 95 | float sourceDepth, 96 | DeviceType sourceCamera, 97 | DeviceType targetCamera) 98 | { 99 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_calibration_2d_to_2d( 100 | ref this, 101 | ref sourcePoint2D, 102 | sourceDepth, 103 | sourceCamera, 104 | targetCamera, 105 | out Vector2 target_point2d, 106 | out bool valid)); 107 | if (valid) 108 | return target_point2d; 109 | return null; 110 | } 111 | 112 | public Vector3? TransformTo3D(Vector2 sourcePoint2D, float sourceDepth, DeviceType sourceCamera, DeviceType targetCamera) 113 | { 114 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_calibration_2d_to_3d( 115 | ref this, 116 | ref sourcePoint2D, 117 | sourceDepth, 118 | sourceCamera, 119 | targetCamera, 120 | out Vector3 target_point3d, 121 | out bool valid)); 122 | 123 | if (valid) 124 | return target_point3d; 125 | return null; 126 | } 127 | 128 | public Vector2? TransformTo2D(Vector3 sourcePoint3D, DeviceType sourceCamera, DeviceType targetCamera) 129 | { 130 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_calibration_3d_to_2d( 131 | ref this, 132 | ref sourcePoint3D, 133 | sourceCamera, 134 | targetCamera, 135 | out Vector2 target_point2d, 136 | out bool valid)); 137 | 138 | if (valid) 139 | return target_point2d; 140 | return null; 141 | } 142 | 143 | public Vector3? TransformTo3D(Vector3 sourcePoint3D, DeviceType sourceCamera, DeviceType targetCamera) 144 | { 145 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_calibration_3d_to_3d( 146 | ref this, 147 | ref sourcePoint3D, 148 | sourceCamera, 149 | targetCamera, 150 | out Vector3 target_point3d)); 151 | 152 | return target_point3d; 153 | } 154 | 155 | public static Calibration GetFromRaw(byte[] raw, DepthMode depthMode, ColorResolution colorResolution) 156 | { 157 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_calibration_get_from_raw( 158 | raw, 159 | (UIntPtr)raw.Length, 160 | depthMode, 161 | colorResolution, 162 | out Calibration calibration)); 163 | 164 | return calibration; 165 | } 166 | 167 | public Transformation CreateTransformation() 168 | { 169 | return new Transformation(this); 170 | } 171 | } 172 | } 173 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Calibration.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6315af951de85c94aa49cb83b31d2174 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Capture.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | 5 | namespace Microsoft.Azure.Kinect.Sensor 6 | { 7 | public class Capture : IDisposable 8 | { 9 | internal Capture(NativeMethods.k4a_capture_t handle) 10 | { 11 | this.handle = handle; 12 | } 13 | 14 | public static Capture Create() 15 | { 16 | AzureKinectException.ThrowIfNotSuccess( 17 | NativeMethods.k4a_capture_create(out NativeMethods.k4a_capture_t handle)); 18 | 19 | return new Capture(handle); 20 | } 21 | 22 | 23 | 24 | 25 | // This function retrieves a native image handle from the native API. 26 | // 27 | // If this is the first time calling the property, we construct a new wrapper 28 | // If the handle is for an Image we have already constructed a wrapper for, we return the existing wrapper 29 | // If the handle is for a different Image, or if the wrapper has already been disposed, we construct a new wrapper and dispose the old one 30 | private Image GetImageWrapperAndDisposePrevious(Func nativeMethod, 31 | ref Image cache) 32 | { 33 | // Lock must be held to ensure the Image in cache is not replaced while we are inspecting it 34 | // It is still possible for that Image to be accessed or Disposed while this lock is held 35 | lock (this) 36 | { 37 | if (this.disposedValue) 38 | { 39 | throw new ObjectDisposedException(nameof(Capture)); 40 | } 41 | 42 | NativeMethods.k4a_image_t image = nativeMethod(this.handle); 43 | // This try block ensures that we close image 44 | try 45 | { 46 | if (cache != null) 47 | { 48 | IntPtr imageHandle = image.DangerousGetHandle(); 49 | 50 | // Only attempt to access cache in this try block 51 | try 52 | { 53 | // If cache was disposed before we called the native accessor (by the caller or another thread), 54 | // the handle could have been reused and the values would incorrectly match. However, cache.DangerousGetHandle() 55 | // will throw an exception, and we will correctly construct a new image wrapper. 56 | if (cache.DangerousGetHandle().DangerousGetHandle() != imageHandle) 57 | { 58 | // The image has changed, invalidate the current image and construct a new wrapper 59 | cache.Dispose(); 60 | cache = null; 61 | } 62 | } 63 | catch (ObjectDisposedException) 64 | { 65 | // If cache has been disposed by the caller or another thread we will discard 66 | // it and construct a new wrapper 67 | cache = null; 68 | } 69 | } 70 | 71 | if (cache == null && !image.IsInvalid) 72 | { 73 | // Construct a new wrapper and return it 74 | // The native function may have returned 75 | cache = new Image(image); 76 | 77 | // Since we have wrapped image, it is now owned by the UnsafeImage object and we should no longer close it 78 | image = null; 79 | } 80 | } 81 | finally 82 | { 83 | // Ensure the native handle is closed if we have a failure creating the Image object 84 | if (image != null) 85 | { 86 | image.Close(); 87 | } 88 | } 89 | 90 | return cache; 91 | } 92 | } 93 | 94 | private Image _Color; 95 | 96 | public Image Color 97 | { 98 | get 99 | { 100 | return this.GetImageWrapperAndDisposePrevious(NativeMethods.k4a_capture_get_color_image, ref this._Color); 101 | } 102 | set 103 | { 104 | lock (this) 105 | { 106 | if (this.disposedValue) 107 | { 108 | throw new ObjectDisposedException(nameof(Capture)); 109 | } 110 | 111 | // If the assignment is a new managed wrapper we need 112 | // to release the reference to the old wrapper. 113 | // If it is the same object though, we should not dispose it. 114 | if (this._Color != null && !object.ReferenceEquals( 115 | this._Color, value)) 116 | { 117 | this._Color.Dispose(); 118 | } 119 | this._Color = value; 120 | } 121 | } 122 | } 123 | 124 | private Image _Depth; 125 | 126 | public Image Depth { 127 | get 128 | { 129 | return this.GetImageWrapperAndDisposePrevious(NativeMethods.k4a_capture_get_depth_image, ref this._Depth); 130 | } 131 | set 132 | { 133 | lock (this) 134 | { 135 | if (this.disposedValue) 136 | { 137 | throw new ObjectDisposedException(nameof(Capture)); 138 | } 139 | 140 | // If the assignment is a new managed wrapper we need 141 | // to release the reference to the old wrapper 142 | // If it is the same object though, we should not dispose it. 143 | if (this._Depth != null && !object.ReferenceEquals( 144 | this._Depth, value)) 145 | { 146 | this._Depth.Dispose(); 147 | } 148 | this._Depth = value; 149 | } 150 | } 151 | } 152 | 153 | private Image _IR; 154 | public Image IR { 155 | get 156 | { 157 | return this.GetImageWrapperAndDisposePrevious(NativeMethods.k4a_capture_get_ir_image, ref this._IR); 158 | } 159 | set 160 | { 161 | lock (this) 162 | { 163 | if (this.disposedValue) 164 | { 165 | throw new ObjectDisposedException(nameof(Capture)); 166 | } 167 | 168 | // If the assignment is a new managed wrapper we need 169 | // to release the reference to the old wrapper 170 | // If it is the same object though, we should not dispose it. 171 | if (this._IR != null && !object.ReferenceEquals( 172 | this._IR, value)) 173 | { 174 | this._IR.Dispose(); 175 | } 176 | this._IR = value; 177 | } 178 | } 179 | } 180 | 181 | public float Temperature 182 | { 183 | get 184 | { 185 | lock (this) 186 | { 187 | if (disposedValue) 188 | throw new ObjectDisposedException(nameof(Capture)); 189 | 190 | return NativeMethods.k4a_capture_get_temperature_c(handle); 191 | } 192 | } 193 | set 194 | { 195 | lock (this) 196 | { 197 | if (disposedValue) 198 | throw new ObjectDisposedException(nameof(Capture)); 199 | 200 | NativeMethods.k4a_capture_set_temperature_c(handle, value); 201 | } 202 | } 203 | } 204 | 205 | public Capture Reference() 206 | { 207 | lock (this) 208 | { 209 | if (disposedValue) 210 | throw new ObjectDisposedException(nameof(Capture)); 211 | 212 | return new Capture(handle.DuplicateReference()); 213 | } 214 | } 215 | 216 | private NativeMethods.k4a_capture_t handle; 217 | 218 | internal NativeMethods.k4a_capture_t DangerousGetHandle() 219 | { 220 | lock (this) 221 | { 222 | if (disposedValue) 223 | throw new ObjectDisposedException(nameof(Capture)); 224 | 225 | return handle; 226 | } 227 | } 228 | 229 | #region IDisposable Support 230 | private bool disposedValue = false; // To detect redundant calls 231 | 232 | protected virtual void Dispose(bool disposing) 233 | { 234 | lock (this) 235 | { 236 | if (!disposedValue) 237 | { 238 | if (disposing) 239 | { 240 | // TODO: dispose managed state (managed objects). 241 | if (_Color != null) 242 | { 243 | _Color.Dispose(); 244 | _Color = null; 245 | } 246 | if (_Depth != null) 247 | { 248 | _Depth.Dispose(); 249 | _Depth = null; 250 | } 251 | if (_IR != null) 252 | { 253 | _IR.Dispose(); 254 | _IR = null; 255 | } 256 | } 257 | 258 | // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. 259 | // TODO: set large fields to null. 260 | handle.Close(); 261 | handle = null; 262 | 263 | disposedValue = true; 264 | } 265 | } 266 | } 267 | 268 | // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. 269 | ~Capture() 270 | { 271 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 272 | Dispose(false); 273 | } 274 | 275 | // This code added to correctly implement the disposable pattern. 276 | public void Dispose() 277 | { 278 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 279 | Dispose(true); 280 | // TODO: uncomment the following line if the finalizer is overridden above. 281 | GC.SuppressFinalize(this); 282 | } 283 | #endregion 284 | 285 | } 286 | } 287 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Capture.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b70773a1538e0204db25a5d838bfb44c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/ColorControlCommand.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.Azure.Kinect.Sensor 5 | { 6 | [Native.NativeReference("k4a_color_control_command_t")] 7 | public enum ColorControlCommand 8 | { 9 | [Native.NativeReference("K4A_COLOR_CONTROL_EXPOSURE_TIME_ABSOLUTE")] 10 | ExposureTimeAbsolute, 11 | [Native.NativeReference("K4A_COLOR_CONTROL_AUTO_EXPOSURE_PRIORITY")] 12 | AutoExposurePriority, 13 | Brightness, 14 | Contrast, 15 | Saturation, 16 | Sharpness, 17 | Whitebalance, 18 | BacklightCompensation, 19 | Gain, 20 | PowerlineFrequency 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/ColorControlCommand.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 443a44c93a90f4349bec891bc3906fda 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/ColorControlMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.Azure.Kinect.Sensor 5 | { 6 | [Native.NativeReference("k4a_color_control_mode_t")] 7 | public enum ColorControlMode 8 | { 9 | Auto = 0, 10 | Manual 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/ColorControlMode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6b7ab8e11d94272489e3db9ee8dff660 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/ColorResolution.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.Azure.Kinect.Sensor 5 | { 6 | [Native.NativeReference("k4a_color_resolution_t")] 7 | public enum ColorResolution 8 | { 9 | Off = 0, 10 | r720p, 11 | r1080p, 12 | r1440p, 13 | r1536p, 14 | r2160p, 15 | r3072p 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/ColorResolution.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d4aa58a98e00944ca305f1217c49b1d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/DepthMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | using System.Collections.Generic; 5 | using System.Text; 6 | 7 | namespace Microsoft.Azure.Kinect.Sensor 8 | { 9 | [Native.NativeReference("k4a_depth_mode_t")] 10 | public enum DepthMode 11 | { 12 | #pragma warning disable CA1707 // Identifiers should not contain underscores 13 | Off = 0, 14 | NFOV_2x2Binned, 15 | NFOV_Unbinned, 16 | WFOV_2x2Binned, 17 | WFOV_Unbinned, 18 | PassiveIR 19 | #pragma warning restore CA1707 // Identifiers should not contain underscores 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/DepthMode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8b628127963dfe44990819ab3fd12dd4 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Device.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | using System.Text; 5 | 6 | [assembly: CLSCompliant(true)] 7 | 8 | namespace Microsoft.Azure.Kinect.Sensor 9 | { 10 | public class Device : IDisposable 11 | { 12 | private Device(NativeMethods.k4a_device_t handle) 13 | { 14 | this.handle = handle; 15 | } 16 | public static int GetInstalledCount() 17 | { 18 | return (int)NativeMethods.k4a_device_get_installed_count(); 19 | } 20 | 21 | public static Device Open(int index = 0) 22 | { 23 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_open((uint)index, out NativeMethods.k4a_device_t handle)); 24 | return new Device(handle); 25 | } 26 | 27 | 28 | private string serialNum = null; 29 | 30 | public string SerialNum 31 | { 32 | get 33 | { 34 | lock (this) 35 | { 36 | if (disposedValue) 37 | throw new ObjectDisposedException(nameof(Device)); 38 | 39 | if (serialNum != null) 40 | { 41 | return serialNum; 42 | } 43 | else 44 | { 45 | // Determine the required string size 46 | UIntPtr size = new UIntPtr(0); 47 | if (NativeMethods.k4a_buffer_result_t.K4A_BUFFER_RESULT_TOO_SMALL != NativeMethods.k4a_device_get_serialnum(handle, null, ref size)) 48 | { 49 | throw new System.InvalidOperationException($"Unexpected internal state calling { nameof(NativeMethods.k4a_device_get_serialnum) }"); 50 | } 51 | 52 | // Allocate a string buffer 53 | StringBuilder serialno = new StringBuilder((int)size.ToUInt32()); 54 | 55 | // Get the serial number 56 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_get_serialnum(handle, serialno, ref size)); 57 | 58 | this.serialNum = serialno.ToString(); 59 | 60 | return this.serialNum; 61 | } 62 | } 63 | } 64 | } 65 | 66 | public Calibration GetCalibration(DepthMode depthMode, ColorResolution colorResolution) 67 | { 68 | lock (this) 69 | { 70 | if (disposedValue) 71 | throw new ObjectDisposedException(nameof(Device)); 72 | 73 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_get_calibration(handle, depthMode, colorResolution, out Calibration calibration)); 74 | return calibration; 75 | } 76 | 77 | } 78 | 79 | public DepthMode CurrentDepthMode { get; private set; } = DepthMode.Off; 80 | public ColorResolution CurrentColorResolution { get; private set; } = ColorResolution.Off; 81 | 82 | public Calibration GetCalibration() 83 | { 84 | if (CurrentColorResolution == ColorResolution.Off && CurrentDepthMode == DepthMode.Off) 85 | { 86 | throw new AzureKinectException("Cameras not started"); 87 | } 88 | 89 | return GetCalibration(CurrentDepthMode, CurrentColorResolution); 90 | } 91 | 92 | public byte[] GetRawCalibration() 93 | { 94 | lock (this) 95 | { 96 | if (disposedValue) 97 | throw new ObjectDisposedException(nameof(Device)); 98 | 99 | // Determine the required calibration size 100 | UIntPtr size = new UIntPtr(0); 101 | if (NativeMethods.k4a_buffer_result_t.K4A_BUFFER_RESULT_TOO_SMALL != NativeMethods.k4a_device_get_raw_calibration(handle, null, ref size)) 102 | { 103 | throw new AzureKinectException($"Unexpected result calling { nameof(NativeMethods.k4a_device_get_raw_calibration) }"); 104 | } 105 | 106 | // Allocate a string buffer 107 | byte[] raw = new byte[size.ToUInt32()]; 108 | 109 | // Get the raw calibration 110 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_get_raw_calibration(handle, raw, ref size)); 111 | 112 | return raw; 113 | } 114 | } 115 | 116 | public Capture GetCapture(int timeoutInMS = -1) 117 | { 118 | lock (this) 119 | { 120 | if (disposedValue) 121 | throw new ObjectDisposedException(nameof(Device)); 122 | 123 | NativeMethods.k4a_wait_result_t result = NativeMethods.k4a_device_get_capture(handle, out NativeMethods.k4a_capture_t capture, timeoutInMS); 124 | 125 | if (result == NativeMethods.k4a_wait_result_t.K4A_WAIT_RESULT_TIMEOUT) 126 | { 127 | throw new TimeoutException("Timed out waiting for capture"); 128 | } 129 | 130 | AzureKinectException.ThrowIfNotSuccess(result); 131 | 132 | if (capture.IsInvalid) 133 | { 134 | throw new Microsoft.Azure.Kinect.Sensor.AzureKinectException("k4a_device_get_capture did not return a valid capture handle"); 135 | } 136 | 137 | return new Capture(capture); 138 | } 139 | } 140 | 141 | public ImuSample GetImuSample(int timeoutInMS = -1) 142 | { 143 | lock (this) 144 | { 145 | if (disposedValue) 146 | throw new ObjectDisposedException(nameof(Device)); 147 | 148 | ImuSample sample = new ImuSample(); 149 | NativeMethods.k4a_wait_result_t result = NativeMethods.k4a_device_get_imu_sample(handle, sample, timeoutInMS); 150 | 151 | if (result == NativeMethods.k4a_wait_result_t.K4A_WAIT_RESULT_TIMEOUT) 152 | { 153 | throw new TimeoutException("Timed out waiting for imu sample"); 154 | } 155 | 156 | AzureKinectException.ThrowIfNotSuccess(result); 157 | 158 | return sample; 159 | } 160 | } 161 | 162 | 163 | public Int32 GetColorControl(ColorControlCommand command) 164 | { 165 | lock (this) 166 | { 167 | if (disposedValue) 168 | throw new ObjectDisposedException(nameof(Device)); 169 | 170 | return this.GetColorControl(command, out ColorControlMode mode); 171 | } 172 | } 173 | 174 | public Int32 GetColorControl(ColorControlCommand command, out ColorControlMode mode) 175 | { 176 | lock (this) 177 | { 178 | if (disposedValue) 179 | throw new ObjectDisposedException(nameof(Device)); 180 | 181 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_get_color_control(handle, command, out mode, out int value)); 182 | return value; 183 | } 184 | } 185 | 186 | public void SetColorControl(ColorControlCommand command, ColorControlMode mode, Int32 value) 187 | { 188 | lock (this) 189 | { 190 | if (disposedValue) 191 | throw new ObjectDisposedException(nameof(Device)); 192 | 193 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_set_color_control(handle, command, mode, value)); 194 | } 195 | } 196 | 197 | public bool SyncInJackConnected 198 | { 199 | get 200 | { 201 | lock (this) 202 | { 203 | if (disposedValue) 204 | throw new ObjectDisposedException(nameof(Device)); 205 | 206 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_get_sync_jack(handle, 207 | out bool sync_in, 208 | out bool sync_out)); 209 | return sync_in; 210 | } 211 | } 212 | } 213 | 214 | public bool SyncOutJackConnected 215 | { 216 | get 217 | { 218 | lock (this) 219 | { 220 | if (disposedValue) 221 | throw new ObjectDisposedException(nameof(Device)); 222 | 223 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_get_sync_jack(handle, 224 | out bool sync_in, 225 | out bool sync_out)); 226 | return sync_out; 227 | } 228 | } 229 | } 230 | 231 | // Cache the version information so we don't need to re-marshal it for each 232 | // access since it is not allowed to change 233 | private HardwareVersion version = null; 234 | 235 | public HardwareVersion Version 236 | { 237 | get 238 | { 239 | lock (this) 240 | { 241 | if (disposedValue) 242 | throw new ObjectDisposedException(nameof(Device)); 243 | 244 | if (version != null) 245 | return version; 246 | 247 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_get_version(handle, 248 | out NativeMethods.k4a_hardware_version_t nativeVersion)); 249 | 250 | version = nativeVersion.ToHardwareVersion(); 251 | return version; 252 | } 253 | } 254 | } 255 | 256 | public void StartCameras(DeviceConfiguration configuration) 257 | { 258 | if (configuration == null) 259 | throw new ArgumentNullException(nameof(configuration)); 260 | 261 | lock (this) 262 | { 263 | if (disposedValue) 264 | throw new ObjectDisposedException(nameof(Device)); 265 | 266 | NativeMethods.k4a_device_configuration_t nativeConfig = configuration.GetNativeConfiguration(); 267 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_start_cameras(handle, ref nativeConfig)); 268 | 269 | this.CurrentDepthMode = configuration.DepthMode; 270 | this.CurrentColorResolution = configuration.ColorResolution; 271 | } 272 | } 273 | 274 | public void StopCameras() 275 | { 276 | lock (this) 277 | { 278 | if (disposedValue) 279 | throw new ObjectDisposedException(nameof(Device)); 280 | 281 | NativeMethods.k4a_device_stop_cameras(handle); 282 | 283 | this.CurrentDepthMode = DepthMode.Off; 284 | this.CurrentColorResolution = ColorResolution.Off; 285 | } 286 | } 287 | 288 | public void StartImu() 289 | { 290 | lock (this) 291 | { 292 | if (disposedValue) 293 | throw new ObjectDisposedException(nameof(Device)); 294 | 295 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_device_start_imu(handle)); 296 | } 297 | } 298 | 299 | public void StopImu() 300 | { 301 | lock (this) 302 | { 303 | if (disposedValue) 304 | throw new ObjectDisposedException(nameof(Device)); 305 | 306 | NativeMethods.k4a_device_stop_imu(handle); 307 | } 308 | } 309 | 310 | private NativeMethods.k4a_device_t handle; 311 | 312 | #region IDisposable Support 313 | private bool disposedValue = false; // To detect redundant calls 314 | 315 | protected virtual void Dispose(bool disposing) 316 | { 317 | if (!disposedValue) 318 | { 319 | if (disposing) 320 | { 321 | // TODO: dispose managed state (managed objects). 322 | } 323 | 324 | // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. 325 | // TODO: set large fields to null. 326 | handle.Close(); 327 | handle = null; 328 | 329 | disposedValue = true; 330 | } 331 | } 332 | 333 | // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. 334 | ~Device() { 335 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 336 | Dispose(false); 337 | } 338 | 339 | // This code added to correctly implement the disposable pattern. 340 | public void Dispose() 341 | { 342 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 343 | Dispose(true); 344 | // TODO: uncomment the following line if the finalizer is overridden above. 345 | GC.SuppressFinalize(this); 346 | } 347 | #endregion 348 | } 349 | } 350 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Device.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: fdaf82c373c5be34d8f75b628bea2c3a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/DeviceConfiguration.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | 5 | namespace Microsoft.Azure.Kinect.Sensor 6 | { 7 | public class DeviceConfiguration 8 | { 9 | // Initialize values to the configuration sepcified by 10 | // K4A_DEVICE_CONFIG_INIT_DISABLE_ALL 11 | 12 | public ImageFormat ColorFormat { get; set; } = ImageFormat.ColorMJPG; 13 | public ColorResolution ColorResolution { get; set; } = ColorResolution.Off; 14 | public DepthMode DepthMode { get; set; } = DepthMode.Off; 15 | public FPS CameraFPS { get; set; } = FPS.fps30; 16 | public bool SynchronizedImagesOnly { get; set; } = false; 17 | public TimeSpan DepthDelayOffColor { get; set; } = TimeSpan.Zero; 18 | public WiredSyncMode WiredSyncMode { get; set; } = WiredSyncMode.Standalone; 19 | public TimeSpan SuboridinateDelayOffMaster { get; set; } = TimeSpan.Zero; 20 | public bool DisableStreamingIndicator { get; set; } = false; 21 | 22 | internal NativeMethods.k4a_device_configuration_t GetNativeConfiguration() 23 | { 24 | // Ticks are in 100ns units 25 | 26 | int depth_delay_off_color_usec = checked((int)( 27 | this.DepthDelayOffColor.Ticks / 10 28 | )); 29 | 30 | uint subordinate_delay_off_master_usec = checked((uint)( 31 | this.SuboridinateDelayOffMaster.Ticks / 10 32 | )); 33 | 34 | return new NativeMethods.k4a_device_configuration_t 35 | { 36 | color_format = this.ColorFormat, 37 | color_resolution = this.ColorResolution, 38 | depth_mode = this.DepthMode, 39 | camera_fps = this.CameraFPS, 40 | synchronized_images_only = this.SynchronizedImagesOnly, 41 | depth_delay_off_color_usec = depth_delay_off_color_usec, 42 | wired_sync_mode = this.WiredSyncMode, 43 | subordinate_delay_off_master_usec = subordinate_delay_off_master_usec, 44 | disable_streaming_indicator = this.DisableStreamingIndicator 45 | }; 46 | } 47 | } 48 | } 49 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/DeviceConfiguration.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b053bfc500d50c449831056a2dea5df2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/FPS.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.Azure.Kinect.Sensor 5 | { 6 | [Native.NativeReference("k4a_fps_t")] 7 | #pragma warning disable CA1717 // Only FlagsAttribute enums should have plural names 8 | public enum FPS 9 | { 10 | #pragma warning disable CA1712 // Do not prefix enum values with type name 11 | fps5 = 0, 12 | fps15, 13 | fps30 14 | #pragma warning restore CA1712 // Do not prefix enum values with type name 15 | } 16 | 17 | #pragma warning restore CA1717 // Only FlagsAttribute enums should have plural names 18 | } 19 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/FPS.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a8189e4a03b2c0d42b6d5e56b4c04c20 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/FirmwareBuild.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.Azure.Kinect.Sensor 5 | { 6 | [Native.NativeReference("k4a_firmware_build_t")] 7 | public enum FirmwareBuild 8 | { 9 | Release = 0, 10 | Debug 11 | } 12 | } 13 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/FirmwareBuild.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 35273f3227407554886ee9ae118bdff3 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/FirmwareSignature.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.Azure.Kinect.Sensor 5 | { 6 | [Native.NativeReference("k4a_firmware_signature_t")] 7 | public enum FirmwareSignature 8 | { 9 | Msft, 10 | Test, 11 | NotSigned 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/FirmwareSignature.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 304af7c2ad5cc144cbf9971df6e891b2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Hardwareversion.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | 5 | namespace Microsoft.Azure.Kinect.Sensor 6 | { 7 | public class HardwareVersion : IEquatable 8 | { 9 | public Version RGB { get; set; } 10 | public Version Depth { get; set; } 11 | public Version Audio { get; set; } 12 | public Version DepthSensor { get; set; } 13 | public FirmwareBuild FirmwareBuild { get; set; } 14 | public FirmwareSignature FirmwareSignature { get; set; } 15 | 16 | public override bool Equals(object obj) 17 | { 18 | return obj is HardwareVersion ? this.Equals((HardwareVersion)obj) : false; 19 | } 20 | 21 | public bool Equals(HardwareVersion other) 22 | { 23 | return other != null && 24 | this.RGB.Equals(other.RGB) && 25 | this.Depth.Equals(other.Depth) && 26 | this.Audio.Equals(other.Audio) && 27 | this.DepthSensor.Equals(other.DepthSensor) && 28 | this.FirmwareBuild.Equals(other.FirmwareBuild) && 29 | this.FirmwareSignature.Equals(other.FirmwareSignature); 30 | } 31 | 32 | public override int GetHashCode() 33 | { 34 | int hash = 7; 35 | hash = (hash * 7) ^ RGB.GetHashCode(); 36 | hash = (hash * 7) ^ Depth.GetHashCode(); 37 | hash = (hash * 7) ^ Audio.GetHashCode(); 38 | hash = (hash * 7) ^ DepthSensor.GetHashCode(); 39 | hash = (hash * 7) ^ FirmwareBuild.GetHashCode(); 40 | hash = (hash * 7) ^ FirmwareSignature.GetHashCode(); 41 | return hash; 42 | } 43 | 44 | public static bool operator==(HardwareVersion a, HardwareVersion b) 45 | { 46 | if (a is null) return b is null; 47 | 48 | return a.Equals(b); 49 | } 50 | 51 | public static bool operator!=(HardwareVersion a, HardwareVersion b) 52 | { 53 | if (a is null) return !(b is null); 54 | 55 | if (object.ReferenceEquals(a, null)) 56 | return !object.ReferenceEquals(b, null); 57 | 58 | return !a.Equals(b); 59 | } 60 | 61 | 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Hardwareversion.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7ed10c64a6856ed479173d9baee7fbc2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Image.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace Microsoft.Azure.Kinect.Sensor 7 | { 8 | 9 | public class ArrayImage : Image where T : unmanaged 10 | { 11 | 12 | private class CallbackContext 13 | { 14 | public GCHandle BufferPin { get; set; } 15 | public NativeMethods.k4a_memory_destroy_cb_t CallbackDelegate { get; set; } 16 | } 17 | 18 | private static NativeMethods.k4a_image_t CreateHandle(ImageFormat format, int width_pixels, int height_pixels, out T[] data) 19 | { 20 | int pixelSize; 21 | switch (format) 22 | { 23 | case ImageFormat.ColorBGRA32: 24 | pixelSize = 4; 25 | break; 26 | case ImageFormat.Depth16: 27 | case ImageFormat.IR16: 28 | pixelSize = 2; 29 | break; 30 | default: 31 | throw new AzureKinectException($"Unable to allocate {typeof(T).Name} array for format {format}"); 32 | } 33 | 34 | int stride_bytes = pixelSize * width_pixels; 35 | 36 | if (stride_bytes % Marshal.SizeOf(typeof(T)) != 0) 37 | { 38 | throw new AzureKinectException($"{typeof(T).Name} does not fit evenly on a line of {width_pixels} pixels of type {format}"); 39 | } 40 | 41 | // Allocate the buffer 42 | data = new T[height_pixels * stride_bytes / Marshal.SizeOf(typeof(T))]; 43 | 44 | CallbackContext context = new CallbackContext() 45 | { 46 | BufferPin = GCHandle.Alloc(data, GCHandleType.Pinned), 47 | CallbackDelegate = new NativeMethods.k4a_memory_destroy_cb_t(MemoryDestroyCallback) 48 | }; 49 | 50 | GCHandle ContextPin = GCHandle.Alloc(context); 51 | try 52 | { 53 | int size = height_pixels * stride_bytes; 54 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_image_create_from_buffer(format, 55 | width_pixels, 56 | height_pixels, 57 | stride_bytes, 58 | context.BufferPin.AddrOfPinnedObject(), 59 | (UIntPtr)size, 60 | context.CallbackDelegate, 61 | (IntPtr)ContextPin, 62 | out NativeMethods.k4a_image_t handle 63 | )); 64 | 65 | return handle; 66 | } 67 | catch 68 | { 69 | context?.BufferPin.Free(); 70 | ContextPin.Free(); 71 | 72 | throw; 73 | } 74 | } 75 | 76 | 77 | public ArrayImage(ImageFormat format, int width_pixels, int height_pixels) : 78 | base(CreateHandle(format, width_pixels, height_pixels, out T[] data)) 79 | { 80 | Buffer = data; 81 | } 82 | 83 | public T[] Buffer { get; private set; } 84 | 85 | private static void MemoryDestroyCallback(IntPtr buffer, IntPtr context) 86 | { 87 | GCHandle contextPin = (GCHandle)context; 88 | CallbackContext ctx = (CallbackContext)contextPin.Target; 89 | ctx.BufferPin.Free(); 90 | contextPin.Free(); 91 | } 92 | } 93 | 94 | public class Image : IDisposable 95 | { 96 | public Image(ImageFormat format, int width_pixels, int height_pixels, int stride_bytes) 97 | { 98 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_image_create(format, 99 | width_pixels, 100 | height_pixels, 101 | stride_bytes, 102 | out this.handle)); 103 | } 104 | 105 | 106 | internal Image(NativeMethods.k4a_image_t handle) 107 | { 108 | this.handle = handle; 109 | } 110 | 111 | 112 | 113 | public unsafe byte[] GetBufferCopy() 114 | { 115 | lock (this) 116 | { 117 | if (disposedValue) 118 | throw new ObjectDisposedException(nameof(Image)); 119 | 120 | byte[] copy = new byte[this.Size]; 121 | System.Runtime.InteropServices.Marshal.Copy((IntPtr)this.Buffer, copy, 0, checked((int)this.Size)); 122 | return copy; 123 | } 124 | } 125 | 126 | public void CopyBytesTo(byte[] destination, int destinationOffset, int sourceOffset, int count) 127 | { 128 | lock (this) 129 | { 130 | if (disposedValue) 131 | throw new ObjectDisposedException(nameof(Image)); 132 | 133 | if (destination == null) 134 | throw new ArgumentNullException(nameof(destination)); 135 | if (destinationOffset < 0) 136 | throw new ArgumentOutOfRangeException(nameof(destinationOffset)); 137 | if (sourceOffset < 0) 138 | throw new ArgumentOutOfRangeException(nameof(sourceOffset)); 139 | if (count < 0) 140 | throw new ArgumentOutOfRangeException(nameof(count)); 141 | if (destination.Length < checked(destinationOffset + count)) 142 | throw new ArgumentException("Destination buffer not long enough", nameof(destination)); 143 | if (this.Size < checked((long)(sourceOffset + count))) 144 | throw new ArgumentException("Source buffer not long enough"); 145 | 146 | unsafe 147 | { 148 | System.Runtime.InteropServices.Marshal.Copy((IntPtr)this.Buffer, destination, destinationOffset, count); 149 | } 150 | } 151 | } 152 | 153 | public void CopyTo(T[] destination, int destinationOffset, int sourceOffsetElements, int countElements) where T : unmanaged 154 | { 155 | lock (this) 156 | { 157 | if (disposedValue) 158 | throw new ObjectDisposedException(nameof(Image)); 159 | 160 | unsafe 161 | { 162 | int elementSize = sizeof(T); 163 | 164 | if (destination == null) 165 | throw new ArgumentNullException(nameof(destination)); 166 | if (destinationOffset < 0) 167 | throw new ArgumentOutOfRangeException(nameof(destinationOffset)); 168 | if (sourceOffsetElements < 0) 169 | throw new ArgumentOutOfRangeException(nameof(sourceOffsetElements)); 170 | if (countElements < 0) 171 | throw new ArgumentOutOfRangeException(nameof(countElements)); 172 | if (destination.Length < checked(destinationOffset + countElements)) 173 | throw new ArgumentException("Destination buffer not long enough", nameof(destination)); 174 | if (this.Size < checked((long)((sourceOffsetElements + countElements) * elementSize))) 175 | throw new ArgumentException("Source buffer not long enough"); 176 | 177 | fixed(T* destinationPointer = &destination[destinationOffset]) 178 | { 179 | this.CopyBytesTo(destinationPointer, 180 | (destination.Length - destinationOffset) * elementSize, 181 | 0, sourceOffsetElements * elementSize, 182 | countElements * elementSize); 183 | } 184 | 185 | //System.Runtime.InteropServices.Marshal.Copy(UnmanagedBufferPointer, destination, destinationOffset, count); 186 | } 187 | } 188 | } 189 | 190 | public void CopyBytesTo(Image destination, int destinationOffset, int sourceOffset, int count) 191 | { 192 | lock (this) 193 | { 194 | if (disposedValue) 195 | throw new ObjectDisposedException(nameof(Image)); 196 | 197 | // Take a new reference on the destinaion image to ensure that if the destinaion object 198 | // is disposed by another thread, the underlying native memory cannot be freed 199 | using (Image referenceDestination= destination.Reference()) 200 | { 201 | unsafe 202 | { 203 | void* destinationPointer = referenceDestination.Buffer; 204 | 205 | this.CopyBytesTo( 206 | destinationPointer, 207 | checked((int)referenceDestination.Size), 208 | destinationOffset, 209 | sourceOffset, 210 | count); 211 | } 212 | } 213 | } 214 | } 215 | 216 | public void CopyBytesFrom(byte[] source, int sourceOffset, int destinationOffset, int count) 217 | { 218 | lock (this) 219 | { 220 | if (disposedValue) 221 | throw new ObjectDisposedException(nameof(Image)); 222 | 223 | if (source == null) 224 | throw new ArgumentNullException(nameof(source)); 225 | if (sourceOffset < 0) 226 | throw new ArgumentOutOfRangeException(nameof(sourceOffset)); 227 | if (destinationOffset < 0) 228 | throw new ArgumentOutOfRangeException(nameof(destinationOffset)); 229 | if (count < 0) 230 | throw new ArgumentOutOfRangeException(nameof(count)); 231 | if (source.Length < checked(sourceOffset + count)) 232 | throw new ArgumentException("Source buffer not long enough", nameof(source)); 233 | if (this.Size < checked((long)(destinationOffset + count))) 234 | throw new ArgumentException("Destination buffer not long enough"); 235 | 236 | unsafe 237 | { 238 | System.Runtime.InteropServices.Marshal.Copy(source, sourceOffset, (IntPtr)this.Buffer, count); 239 | } 240 | } 241 | } 242 | 243 | public void CopyBytesFrom(Image source, int sourceOffset, int destinationOffset, int count) 244 | { 245 | lock (this) 246 | { 247 | if (disposedValue) 248 | throw new ObjectDisposedException(nameof(Image)); 249 | 250 | // Take a new reference on the source Image to ensure that if the source object 251 | // is disposed by another thread, the underlying native memory cannot be freed 252 | using (Image sourceReference = source.Reference()) 253 | { 254 | unsafe 255 | { 256 | void* sourcePointer = sourceReference.Buffer; 257 | 258 | this.CopyBytesFrom( 259 | sourcePointer, 260 | checked((int)sourceReference.Size), 261 | sourceOffset, 262 | destinationOffset, 263 | count); 264 | } 265 | } 266 | } 267 | } 268 | 269 | private IntPtr _Buffer = IntPtr.Zero; 270 | 271 | 272 | public unsafe void* Buffer 273 | { 274 | get 275 | { 276 | if (_Buffer != IntPtr.Zero) 277 | { 278 | if (disposedValue) 279 | throw new ObjectDisposedException(nameof(Image)); 280 | 281 | return (void*)_Buffer; 282 | } 283 | 284 | lock (this) 285 | { 286 | if (disposedValue) 287 | throw new ObjectDisposedException(nameof(Image)); 288 | 289 | _Buffer = NativeMethods.k4a_image_get_buffer(handle); 290 | if (_Buffer == IntPtr.Zero) 291 | { 292 | throw new AzureKinectException("Image has NULL buffer"); 293 | } 294 | 295 | return (void*)_Buffer; 296 | } 297 | } 298 | } 299 | 300 | protected unsafe void CopyBytesTo(void* destination, int destinationLength, int destinationOffset, int sourceOffset, int count) 301 | { 302 | lock (this) 303 | { 304 | // We don't need to check to see if we are disposed since the call to UnmanagedBufferPointer will 305 | // perform that check 306 | 307 | if (destination == null) 308 | throw new ArgumentNullException(nameof(destination)); 309 | if (destinationOffset < 0) 310 | throw new ArgumentOutOfRangeException(nameof(destination)); 311 | if (sourceOffset < 0) 312 | throw new ArgumentOutOfRangeException(nameof(sourceOffset)); 313 | if (count < 0) 314 | throw new ArgumentOutOfRangeException(nameof(count)); 315 | if (destinationLength < checked(destinationOffset + count)) 316 | throw new ArgumentException("Destination buffer not long enough", nameof(destination)); 317 | if (this.Size < checked((long)(sourceOffset + count))) 318 | throw new ArgumentException("Source buffer not long enough"); 319 | 320 | System.Buffer.MemoryCopy(this.Buffer, destination, destinationLength, count); 321 | } 322 | } 323 | 324 | protected unsafe void CopyBytesFrom(void* source, int sourceLength, int sourceOffset, int destinationOffset, int count) 325 | { 326 | lock (this) 327 | { 328 | // We don't need to check to see if we are disposed since the call to this.UnsafeBufferPointer will 329 | // perform that check 330 | 331 | if (source == null) 332 | throw new ArgumentNullException(nameof(source)); 333 | if (sourceOffset < 0) 334 | throw new ArgumentOutOfRangeException(nameof(sourceOffset)); 335 | if (destinationOffset < 0) 336 | throw new ArgumentOutOfRangeException(nameof(destinationOffset)); 337 | if (count < 0) 338 | throw new ArgumentOutOfRangeException(nameof(count)); 339 | if (sourceLength < checked(sourceOffset + count)) 340 | throw new ArgumentException("Source buffer not long enough", nameof(source)); 341 | if (this.Size < checked((long)(destinationOffset + count))) 342 | throw new ArgumentException("Destination buffer not long enough"); 343 | 344 | unsafe 345 | { 346 | System.Buffer.MemoryCopy((void*)source, (void*)this.Buffer, this.Size, (long)count); 347 | } 348 | } 349 | } 350 | 351 | public TimeSpan Exposure 352 | { 353 | get 354 | { 355 | lock (this) 356 | { 357 | if (disposedValue) 358 | throw new ObjectDisposedException(nameof(Image)); 359 | 360 | ulong exposure = NativeMethods.k4a_image_get_exposure_usec(handle); 361 | return TimeSpan.FromTicks(checked((long)exposure) * 10); 362 | } 363 | } 364 | set 365 | { 366 | lock (this) 367 | { 368 | if (disposedValue) 369 | throw new ObjectDisposedException(nameof(Image)); 370 | 371 | NativeMethods.k4a_image_set_exposure_time_usec(handle, checked((ulong)value.Ticks / 10)); 372 | } 373 | } 374 | } 375 | 376 | private ImageFormat? _Format = null; 377 | 378 | public ImageFormat Format 379 | { 380 | get 381 | { 382 | if (_Format.HasValue) return _Format.Value; 383 | 384 | lock (this) 385 | { 386 | if (disposedValue) 387 | throw new ObjectDisposedException(nameof(Image)); 388 | 389 | _Format = NativeMethods.k4a_image_get_format(handle); 390 | return _Format.Value; 391 | } 392 | } 393 | } 394 | 395 | 396 | private int _HeightPixels = -1; 397 | 398 | public int HeightPixels 399 | { 400 | get 401 | { 402 | if (_HeightPixels >= 0) return _HeightPixels; 403 | 404 | lock (this) 405 | { 406 | if (disposedValue) 407 | throw new ObjectDisposedException(nameof(Image)); 408 | 409 | _HeightPixels = NativeMethods.k4a_image_get_height_pixels(handle); 410 | return _HeightPixels; 411 | } 412 | } 413 | } 414 | 415 | private int _WidthPixels = -1; 416 | public int WidthPixels 417 | { 418 | get 419 | { 420 | if (_WidthPixels >= 0) return _WidthPixels; 421 | 422 | lock (this) 423 | { 424 | 425 | 426 | if (disposedValue) 427 | throw new ObjectDisposedException(nameof(Image)); 428 | 429 | _WidthPixels = NativeMethods.k4a_image_get_width_pixels(handle); 430 | return _WidthPixels; 431 | } 432 | } 433 | } 434 | 435 | private int _StrideBytes = -1; 436 | 437 | public int StrideBytes 438 | { 439 | get 440 | { 441 | 442 | if (_StrideBytes >= 0) return _StrideBytes; 443 | 444 | lock (this) 445 | { 446 | if (disposedValue) 447 | throw new ObjectDisposedException(nameof(Image)); 448 | 449 | _StrideBytes = NativeMethods.k4a_image_get_stride_bytes(handle); 450 | 451 | return _StrideBytes; 452 | } 453 | } 454 | } 455 | 456 | private long _Size = -1; 457 | 458 | public long Size 459 | { 460 | get 461 | { 462 | 463 | if (_Size >= 0) return _Size; 464 | 465 | lock (this) 466 | { 467 | if (disposedValue) 468 | throw new ObjectDisposedException(nameof(Image)); 469 | 470 | _Size = checked((long)NativeMethods.k4a_image_get_size(handle).ToUInt64()); 471 | 472 | return _Size; 473 | } 474 | } 475 | } 476 | 477 | public TimeSpan Timestamp 478 | { 479 | get 480 | { 481 | lock (this) 482 | { 483 | if (disposedValue) 484 | throw new ObjectDisposedException(nameof(Image)); 485 | 486 | ulong timestamp = NativeMethods.k4a_image_get_timestamp_usec(handle); 487 | return TimeSpan.FromTicks(checked((long)timestamp) * 10); 488 | } 489 | } 490 | set 491 | { 492 | lock (this) 493 | { 494 | if (disposedValue) 495 | throw new ObjectDisposedException(nameof(Image)); 496 | 497 | NativeMethods.k4a_image_set_timestamp_usec(handle, checked((ulong)value.Ticks / 10)); 498 | } 499 | } 500 | } 501 | 502 | public int ISOSpeed 503 | { 504 | get 505 | { 506 | lock (this) 507 | { 508 | if (disposedValue) 509 | throw new ObjectDisposedException(nameof(Image)); 510 | 511 | return checked((int)NativeMethods.k4a_image_get_iso_speed(handle)); 512 | } 513 | } 514 | set 515 | { 516 | lock (this) 517 | { 518 | if (disposedValue) 519 | throw new ObjectDisposedException(nameof(Image)); 520 | 521 | NativeMethods.k4a_image_set_iso_speed(handle, checked((uint)value)); 522 | } 523 | } 524 | } 525 | 526 | 527 | public int WhiteBalance 528 | { 529 | get 530 | { 531 | lock (this) 532 | { 533 | if (disposedValue) 534 | throw new ObjectDisposedException(nameof(Image)); 535 | 536 | return checked((int)NativeMethods.k4a_image_get_white_balance(handle)); 537 | } 538 | } 539 | set 540 | { 541 | lock (this) 542 | { 543 | if (disposedValue) 544 | throw new ObjectDisposedException(nameof(Image)); 545 | 546 | NativeMethods.k4a_image_set_white_balance(handle, checked((uint)value)); 547 | } 548 | } 549 | } 550 | 551 | private NativeMethods.k4a_image_t handle; 552 | 553 | internal NativeMethods.k4a_image_t DangerousGetHandle() 554 | { 555 | lock (this) 556 | { 557 | if (disposedValue) 558 | throw new ObjectDisposedException(nameof(Image)); 559 | 560 | return handle; 561 | } 562 | } 563 | 564 | public Image Reference() 565 | { 566 | lock (this) 567 | { 568 | if (disposedValue) 569 | throw new ObjectDisposedException(nameof(Image)); 570 | 571 | return new Image(handle.DuplicateReference()); 572 | } 573 | } 574 | 575 | #region IDisposable Support 576 | private bool disposedValue = false; // To detect redundant calls 577 | 578 | protected virtual void Dispose(bool disposing) 579 | { 580 | if (!disposedValue) 581 | { 582 | lock (this) 583 | { 584 | if (disposing) 585 | { 586 | // TODO: dispose managed state (managed objects). 587 | } 588 | 589 | handle.Close(); 590 | handle = null; 591 | 592 | disposedValue = true; 593 | } 594 | } 595 | } 596 | 597 | // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. 598 | // ~Image() 599 | // { 600 | // // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 601 | // Dispose(false); 602 | // } 603 | 604 | // This code added to correctly implement the disposable pattern. 605 | public void Dispose() 606 | { 607 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 608 | Dispose(true); 609 | // TODO: uncomment the following line if the finalizer is overridden above. 610 | // GC.SuppressFinalize(this); 611 | } 612 | #endregion 613 | } 614 | } 615 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Image.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d07b891086828814bada8c4c62589234 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/ImageFormat.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.Azure.Kinect.Sensor 5 | { 6 | [Native.NativeReference("k4a_image_format_t")] 7 | public enum ImageFormat 8 | { 9 | ColorMJPG = 0, 10 | ColorNV12, 11 | ColorYUY2, 12 | ColorBGRA32, 13 | Depth16, 14 | IR16, 15 | Custom 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/ImageFormat.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b389898a5e7535c4e88b219dbe83248c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/ImuSample.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | using System.Numerics; 5 | using System.Runtime.InteropServices; 6 | 7 | namespace Microsoft.Azure.Kinect.Sensor 8 | { 9 | [StructLayout(LayoutKind.Sequential)] 10 | [Native.NativeReference("k4a_imu_sample_t")] 11 | public class ImuSample 12 | { 13 | public float Temperature { get; set; } 14 | public Vector3 AccelerometerSample { get; set; } 15 | public Int64 AccelerometerTimestampInUsec { get; set; } 16 | public Vector3 GyroSample { get; set; } 17 | public Int64 GyroTimestampInUsec { get; set; } 18 | 19 | } 20 | } 21 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/ImuSample.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 7deddab362aa7c04d902be4f52ce92af 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/LogLevel.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // Licensed under the MIT License. 5 | // 6 | //------------------------------------------------------------------------------ 7 | 8 | namespace Microsoft.Azure.Kinect.Sensor 9 | { 10 | /// 11 | /// Verbosity levels of debug messaging. 12 | /// 13 | [Native.NativeReference("k4a_log_level_t")] 14 | public enum LogLevel 15 | { 16 | /// 17 | /// The most severe level of debug messaging. 18 | /// 19 | [Native.NativeReference("K4A_LOG_LEVEL_CRITICAL")] 20 | Critical = 0, 21 | 22 | /// 23 | /// The second most severe level of debug messaging. 24 | /// 25 | [Native.NativeReference("K4A_LOG_LEVEL_ERROR")] 26 | Error, 27 | 28 | /// 29 | /// The third most severe level of debug messaging. 30 | /// 31 | [Native.NativeReference("K4A_LOG_LEVEL_WARNING")] 32 | Warning, 33 | 34 | /// 35 | /// The second least severe level of debug messaging. 36 | /// 37 | [Native.NativeReference("K4A_LOG_LEVEL_INFO")] 38 | Information, 39 | 40 | /// 41 | /// The lest severe level of debug messaging. This is the most verbose messaging possible. 42 | /// 43 | [Native.NativeReference("K4A_LOG_LEVEL_TRACE")] 44 | Trace, 45 | 46 | /// 47 | /// No logging is performed. 48 | /// 49 | [Native.NativeReference("K4A_LOG_LEVEL_OFF")] 50 | Off, 51 | } 52 | } 53 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/LogLevel.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c6a8c165539a636458cba05441f5582c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5e66a46673992bd499f6da6ebd1cbd37 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Native/NativeMethods.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // Licensed under the MIT License. 5 | // 6 | //------------------------------------------------------------------------------ 7 | using System; 8 | using System.Numerics; 9 | using System.Runtime.InteropServices; 10 | using System.Text; 11 | using Microsoft.Azure.Kinect.Sensor.Native; 12 | 13 | namespace Microsoft.Azure.Kinect.Sensor 14 | { 15 | #pragma warning disable IDE1006 // Naming Styles 16 | 17 | internal class NativeMethods 18 | { 19 | // These types are used internally by the interop dll for marshaling purposes and are not exposed 20 | // over the public surface of the managed dll. 21 | 22 | #region Handle Types 23 | 24 | public class k4a_device_t : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid 25 | { 26 | private k4a_device_t() : base(true) 27 | { 28 | } 29 | 30 | protected override bool ReleaseHandle() 31 | { 32 | NativeMethods.k4a_device_close(handle); 33 | return true; 34 | } 35 | } 36 | 37 | public class k4a_capture_t : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid 38 | { 39 | private k4a_capture_t() : base(true) 40 | { 41 | } 42 | 43 | public k4a_capture_t DuplicateReference() 44 | { 45 | k4a_capture_t duplicate = new k4a_capture_t(); 46 | 47 | NativeMethods.k4a_capture_reference(handle); 48 | 49 | duplicate.handle = this.handle; 50 | return duplicate; 51 | 52 | } 53 | 54 | protected override bool ReleaseHandle() 55 | { 56 | NativeMethods.k4a_capture_release(handle); 57 | return true; 58 | } 59 | } 60 | 61 | public class k4a_image_t : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid 62 | { 63 | private k4a_image_t() : base(true) 64 | { 65 | } 66 | 67 | public k4a_image_t DuplicateReference() 68 | { 69 | k4a_image_t duplicate = new k4a_image_t(); 70 | 71 | NativeMethods.k4a_image_reference(handle); 72 | duplicate.handle = this.handle; 73 | return duplicate; 74 | } 75 | protected override bool ReleaseHandle() 76 | { 77 | NativeMethods.k4a_image_release(handle); 78 | return true; 79 | } 80 | } 81 | 82 | public class k4a_transformation_t : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid 83 | { 84 | private k4a_transformation_t() : base(true) 85 | { 86 | } 87 | 88 | protected override bool ReleaseHandle() 89 | { 90 | NativeMethods.k4a_transformation_destroy(handle); 91 | return true; 92 | } 93 | } 94 | 95 | #endregion 96 | 97 | #region Enumerations 98 | [NativeReference] 99 | public enum k4a_buffer_result_t 100 | { 101 | K4A_BUFFER_RESULT_SUCCEEDED = 0, 102 | K4A_BUFFER_RESULT_FAILED, 103 | K4A_BUFFER_RESULT_TOO_SMALL 104 | } 105 | 106 | [NativeReference] 107 | public enum k4a_wait_result_t 108 | { 109 | K4A_WAIT_RESULT_SUCCEEDED = 0, 110 | K4A_WAIT_RESULT_FAILED, 111 | K4A_WAIT_RESULT_TIMEOUT 112 | } 113 | 114 | [NativeReference] 115 | public enum k4a_result_t 116 | { 117 | K4A_RESULT_SUCCEEDED = 0, 118 | K4A_RESULT_FAILED, 119 | } 120 | 121 | [NativeReference] 122 | public enum k4a_stream_result_t 123 | { 124 | K4A_STREAM_RESULT_SUCCEEDED = 0, 125 | K4A_STREAM_RESULT_FAILED, 126 | K4A_STREAM_RESULT_EOF 127 | } 128 | 129 | #endregion 130 | 131 | #region Structures 132 | 133 | [NativeReference] 134 | [StructLayout(LayoutKind.Sequential)] 135 | public struct k4a_version_t 136 | { 137 | public int major; 138 | public int minor; 139 | public int revision; 140 | 141 | public Version ToVersion() 142 | { 143 | return new Version(major, minor, revision); 144 | } 145 | } 146 | 147 | [NativeReference] 148 | [StructLayout(LayoutKind.Sequential)] 149 | public struct k4a_hardware_version_t 150 | { 151 | public k4a_version_t rgb; 152 | public k4a_version_t depth; 153 | public k4a_version_t audio; 154 | public k4a_version_t depth_sensor; 155 | public FirmwareBuild firmware_build; 156 | public FirmwareSignature firmware_signature; 157 | 158 | public HardwareVersion ToHardwareVersion() 159 | { 160 | return new HardwareVersion 161 | { 162 | RGB = this.rgb.ToVersion(), 163 | Depth = this.depth.ToVersion(), 164 | Audio = this.audio.ToVersion(), 165 | DepthSensor = this.depth_sensor.ToVersion(), 166 | FirmwareBuild = this.firmware_build, 167 | FirmwareSignature = this.firmware_signature 168 | }; 169 | } 170 | } 171 | 172 | [NativeReference] 173 | [StructLayout(LayoutKind.Sequential)] 174 | public struct k4a_device_configuration_t 175 | { 176 | public ImageFormat color_format; 177 | public ColorResolution color_resolution; 178 | public DepthMode depth_mode; 179 | public FPS camera_fps; 180 | public bool synchronized_images_only; 181 | public int depth_delay_off_color_usec; 182 | public WiredSyncMode wired_sync_mode; 183 | public uint subordinate_delay_off_master_usec; 184 | public bool disable_streaming_indicator; 185 | } 186 | 187 | 188 | #endregion 189 | 190 | #region Functions 191 | 192 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 193 | [NativeReference] 194 | public static extern k4a_result_t k4a_calibration_2d_to_2d( 195 | [In] ref Calibration calibration, 196 | ref Vector2 source_point2d, 197 | float source_depth, 198 | Calibration.DeviceType source_camera, 199 | Calibration.DeviceType target_camera, 200 | out Vector2 target_point2d, 201 | out bool valid); 202 | 203 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 204 | [NativeReference] 205 | public static extern k4a_result_t k4a_calibration_2d_to_3d( 206 | [In] ref Calibration calibration, 207 | ref Vector2 source_point2d, 208 | float source_depth, 209 | Calibration.DeviceType source_camera, 210 | Calibration.DeviceType target_camera, 211 | out Vector3 target_point3d, 212 | out bool valid); 213 | 214 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 215 | [NativeReference] 216 | public static extern k4a_result_t k4a_calibration_3d_to_2d( 217 | [In] ref Calibration calibration, 218 | ref Vector3 source_point3d, 219 | Calibration.DeviceType source_camera, 220 | Calibration.DeviceType target_camera, 221 | out Vector2 target_point2d, 222 | out bool valid); 223 | 224 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 225 | [NativeReference] 226 | public static extern k4a_result_t k4a_calibration_3d_to_3d( 227 | [In] ref Calibration calibration, 228 | ref Vector3 source_point3d, 229 | Calibration.DeviceType source_camera, 230 | Calibration.DeviceType target_camera, 231 | out Vector3 target_point3d); 232 | 233 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 234 | [NativeReference] 235 | public static extern k4a_result_t k4a_calibration_get_from_raw( 236 | byte[] raw_calibration, 237 | UIntPtr raw_calibration_size, 238 | DepthMode depth_mode, 239 | ColorResolution color_resolution, 240 | out Calibration calibration); 241 | 242 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 243 | [NativeReference] 244 | public static extern k4a_transformation_t k4a_transformation_create([In] ref Calibration calibration); 245 | 246 | 247 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 248 | [NativeReference] 249 | public static extern k4a_result_t k4a_transformation_destroy(IntPtr transformation_handle); 250 | 251 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 252 | [NativeReference] 253 | public static extern k4a_result_t k4a_transformation_depth_image_to_color_camera( 254 | k4a_transformation_t transformation_handle, 255 | k4a_image_t depth_image, 256 | k4a_image_t transformed_depth_image); 257 | 258 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 259 | [NativeReference] 260 | public static extern k4a_result_t k4a_transformation_color_image_to_depth_camera( 261 | k4a_transformation_t transformation_handle, 262 | k4a_image_t depth_image, 263 | k4a_image_t color_image, 264 | k4a_image_t transformed_color_image); 265 | 266 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 267 | [NativeReference] 268 | public static extern k4a_result_t k4a_transformation_depth_image_to_point_cloud( 269 | k4a_transformation_t transformation_handle, 270 | k4a_image_t depth_image, 271 | Calibration.DeviceType camera, 272 | k4a_image_t xyz_image); 273 | 274 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 275 | [NativeReference] 276 | public static extern void k4a_device_close(IntPtr device_handle); 277 | 278 | 279 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 280 | [NativeReference] 281 | public static extern k4a_result_t k4a_capture_create(out k4a_capture_t capture_handle); 282 | 283 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 284 | [NativeReference] 285 | public static extern k4a_image_t k4a_capture_get_color_image(k4a_capture_t capture_handle); 286 | 287 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 288 | [NativeReference] 289 | public static extern k4a_image_t k4a_capture_get_depth_image(k4a_capture_t capture_handle); 290 | 291 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 292 | [NativeReference] 293 | public static extern k4a_image_t k4a_capture_get_ir_image(k4a_capture_t capture_handle); 294 | 295 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 296 | [NativeReference] 297 | public static extern float k4a_capture_get_temperature_c(k4a_capture_t capture_handle); 298 | 299 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 300 | [NativeReference] 301 | public static extern void k4a_capture_set_color_image(k4a_capture_t capture_handle, k4a_image_t image_handle); 302 | 303 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 304 | [NativeReference] 305 | public static extern void k4a_capture_set_depth_image(k4a_capture_t capture_handle, k4a_image_t image_handle); 306 | 307 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 308 | [NativeReference] 309 | public static extern void k4a_capture_set_ir_image(k4a_capture_t capture_handle, k4a_image_t image_handle); 310 | 311 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 312 | [NativeReference] 313 | public static extern void k4a_capture_set_temperature_c(k4a_capture_t capture_handle, float temperature_c); 314 | 315 | 316 | 317 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 318 | [NativeReference] 319 | public static extern void k4a_capture_reference(IntPtr capture_handle); 320 | 321 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 322 | [NativeReference] 323 | public static extern void k4a_capture_release(IntPtr capture_handle); 324 | 325 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 326 | [NativeReference] 327 | public static extern k4a_result_t k4a_image_create(ImageFormat format, 328 | int width_pixels, 329 | int height_pixels, 330 | int stride_bytes, 331 | out k4a_image_t image_handle); 332 | 333 | public delegate void k4a_memory_destroy_cb_t(IntPtr buffer, IntPtr context); 334 | 335 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 336 | [NativeReference] 337 | public static extern k4a_result_t k4a_image_create_from_buffer( 338 | ImageFormat format, 339 | int width_pixels, 340 | int height_pixels, 341 | int stride_bytes, 342 | IntPtr buffer, 343 | UIntPtr buffer_size, 344 | k4a_memory_destroy_cb_t buffer_release_cb, 345 | IntPtr buffer_release_cb_context, 346 | out k4a_image_t image_handle 347 | ); 348 | 349 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 350 | [NativeReference] 351 | public static extern void k4a_image_reference(IntPtr image_handle); 352 | 353 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 354 | [NativeReference] 355 | public static extern void k4a_image_release(IntPtr image_handle); 356 | 357 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 358 | [NativeReference] 359 | public static extern UInt32 k4a_device_get_installed_count(); 360 | 361 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 362 | [NativeReference] 363 | public static extern k4a_result_t k4a_device_get_calibration( 364 | k4a_device_t device_handle, 365 | DepthMode depth_mode, 366 | ColorResolution color_resolution, 367 | out Calibration calibration); 368 | 369 | 370 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 371 | [NativeReference] 372 | public static extern k4a_wait_result_t k4a_device_get_capture( 373 | k4a_device_t device_handle, 374 | out k4a_capture_t capture_handle, 375 | Int32 timeout_in_ms); 376 | 377 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 378 | [NativeReference] 379 | public static extern k4a_wait_result_t k4a_device_get_imu_sample( 380 | k4a_device_t device_handle, 381 | ImuSample imu_sample, 382 | Int32 timeout_in_ms); 383 | 384 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 385 | [NativeReference] 386 | public static extern k4a_result_t k4a_device_get_sync_jack( 387 | k4a_device_t device_handle, 388 | out bool sync_in_jack_connected, 389 | out bool sync_out_jack_connected); 390 | 391 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 392 | [NativeReference] 393 | public static extern k4a_result_t k4a_device_get_version( 394 | k4a_device_t device_handle, 395 | out k4a_hardware_version_t version); 396 | 397 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 398 | [NativeReference] 399 | public static extern k4a_buffer_result_t k4a_device_get_raw_calibration(k4a_device_t device_handle, [Out] byte[] data, ref UIntPtr data_size); 400 | 401 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 402 | [NativeReference] 403 | public static extern k4a_result_t k4a_device_set_color_control(k4a_device_t device_handle, ColorControlCommand command, ColorControlMode mode, Int32 value); 404 | 405 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 406 | [NativeReference] 407 | public static extern k4a_result_t k4a_device_get_color_control(k4a_device_t device_handle, ColorControlCommand command, out ColorControlMode mode, out Int32 value); 408 | 409 | 410 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 411 | [NativeReference] 412 | public static extern k4a_result_t k4a_device_start_cameras(k4a_device_t device_handle, [In] ref k4a_device_configuration_t config); 413 | 414 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 415 | [NativeReference] 416 | public static extern void k4a_device_stop_cameras(k4a_device_t device_handle); 417 | 418 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 419 | [NativeReference] 420 | public static extern k4a_result_t k4a_device_start_imu(k4a_device_t device_handle); 421 | 422 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 423 | [NativeReference] 424 | public static extern void k4a_device_stop_imu(k4a_device_t device_handle); 425 | 426 | 427 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 428 | [NativeReference] 429 | public static extern k4a_result_t k4a_device_open(UInt32 index, out k4a_device_t device_handle); 430 | 431 | 432 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi, BestFitMapping = false, ThrowOnUnmappableChar = true)] 433 | [NativeReference] 434 | public static extern k4a_buffer_result_t k4a_device_get_serialnum(k4a_device_t device_handle, StringBuilder serial_number, ref UIntPtr data_size); 435 | 436 | 437 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 438 | [NativeReference] 439 | public static extern UInt64 k4a_image_get_exposure_usec(k4a_image_t image_handle); 440 | 441 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 442 | [NativeReference] 443 | public static extern void k4a_image_set_exposure_time_usec(k4a_image_t image_handle, UInt64 value); 444 | 445 | 446 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 447 | [NativeReference] 448 | public static extern ImageFormat k4a_image_get_format(k4a_image_t image_handle); 449 | 450 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 451 | [NativeReference] 452 | public static extern int k4a_image_get_height_pixels(k4a_image_t image_handle); 453 | 454 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 455 | [NativeReference] 456 | public static extern int k4a_image_get_width_pixels(k4a_image_t image_handle); 457 | 458 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 459 | [NativeReference] 460 | public static extern int k4a_image_get_stride_bytes(k4a_image_t image_handle); 461 | 462 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 463 | [NativeReference] 464 | public static extern UIntPtr k4a_image_get_size(k4a_image_t image_handle); 465 | 466 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 467 | [NativeReference] 468 | public static extern UInt32 k4a_image_get_iso_speed(k4a_image_t image_handle); 469 | 470 | 471 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 472 | [NativeReference] 473 | public static extern void k4a_image_set_iso_speed(k4a_image_t image_handle, UInt32 value); 474 | 475 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 476 | [NativeReference] 477 | public static extern UInt32 k4a_image_get_white_balance(k4a_image_t image_handle); 478 | 479 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 480 | [NativeReference] 481 | public static extern void k4a_image_set_white_balance(k4a_image_t image_handle, UInt32 value); 482 | 483 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 484 | [NativeReference] 485 | public static extern UInt64 k4a_image_get_timestamp_usec(k4a_image_t image_handle); 486 | 487 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 488 | [NativeReference] 489 | public static extern void k4a_image_set_timestamp_usec(k4a_image_t image_handle, UInt64 value); 490 | 491 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 492 | [NativeReference] 493 | public static extern IntPtr k4a_image_get_buffer(k4a_image_t image_handle); 494 | 495 | public delegate void k4a_logging_message_cb_t(IntPtr context, LogLevel level, [MarshalAs(UnmanagedType.LPStr)] string file, int line, [MarshalAs(UnmanagedType.LPStr)] string message); 496 | 497 | [DllImport("k4a", CallingConvention = CallingConvention.Cdecl)] 498 | [NativeReference] 499 | public static extern k4a_result_t k4a_set_debug_message_handler( 500 | k4a_logging_message_cb_t message_cb, 501 | IntPtr message_cb_context, 502 | LogLevel min_level); 503 | 504 | #endregion 505 | 506 | } 507 | #pragma warning restore IDE1006 // Naming Styles 508 | } 509 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Native/NativeMethods.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b7f69a8048945ab47949d5c15b0a53fd 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Native/NativeReferenceAttributes.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Copyright (c) Microsoft Corporation. All rights reserved. 4 | // Licensed under the MIT License. 5 | // 6 | //------------------------------------------------------------------------------ 7 | using System; 8 | 9 | namespace Microsoft.Azure.Kinect.Sensor.Native 10 | { 11 | /// 12 | /// Attribute indicating the native equivalent. 13 | /// 14 | [System.AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = false)] 15 | public sealed class NativeReferenceAttribute : Attribute 16 | { 17 | /// 18 | /// Initializes a new instance of the class. 19 | /// 20 | public NativeReferenceAttribute() 21 | { 22 | this.ReferenceName = null; 23 | } 24 | 25 | /// 26 | /// Initializes a new instance of the class with the specified name. 27 | /// 28 | /// The name of the native function, handle, enumeration, callback, or structure entity that is being referenced. 29 | public NativeReferenceAttribute(string referenceName) 30 | { 31 | this.ReferenceName = referenceName; 32 | } 33 | 34 | /// 35 | /// Gets the name of the native function, handle, enumeration, callback, or structure entity that is being referenced. 36 | /// 37 | public string ReferenceName { get; private set; } 38 | } 39 | } -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Native/NativeReferenceAttributes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2f31fefa852b2d247aae04560240c1d5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Short3.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | using System.Runtime.InteropServices; 5 | 6 | namespace Microsoft.Azure.Kinect.Sensor 7 | { 8 | [StructLayout(LayoutKind.Sequential)] 9 | public struct Short3 10 | { 11 | public Short3(Int16 X, Int16 Y, Int16 Z) 12 | { 13 | this.X = X; 14 | this.Y = Y; 15 | this.Z = Z; 16 | } 17 | 18 | public Int16 X { get; set; } 19 | public Int16 Y { get; set; } 20 | public Int16 Z { get; set; } 21 | 22 | } 23 | } 24 | 25 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Short3.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bbf3367c5a7d95943a811743141e4201 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Transformation.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | 5 | namespace Microsoft.Azure.Kinect.Sensor 6 | { 7 | public class Transformation : IDisposable 8 | { 9 | readonly NativeMethods.k4a_transformation_t handle; 10 | 11 | readonly Calibration calibration; 12 | public Transformation(Calibration calibration) 13 | { 14 | this.calibration = calibration; 15 | this.handle = NativeMethods.k4a_transformation_create(ref calibration); 16 | if (this.handle == null) 17 | { 18 | throw new AzureKinectException("Failed to create transformation object"); 19 | } 20 | } 21 | 22 | public ArrayImage DepthImageToColorCamera(Capture capture) 23 | { 24 | return DepthImageToColorCamera(capture.Depth); 25 | } 26 | 27 | public ArrayImage DepthImageToColorCamera(Image depth) 28 | { 29 | ArrayImage image = new ArrayImage(ImageFormat.Depth16, 30 | calibration.color_camera_calibration.resolution_width, 31 | calibration.color_camera_calibration.resolution_height) 32 | { 33 | Timestamp = depth.Timestamp 34 | }; 35 | 36 | DepthImageToColorCamera(depth, image); 37 | 38 | return image; 39 | } 40 | 41 | public void DepthImageToColorCamera(Capture capture, Image transformed) 42 | { 43 | DepthImageToColorCamera(capture.Depth, transformed); 44 | } 45 | 46 | public void DepthImageToColorCamera(Image depth, Image transformed) 47 | { 48 | lock (this) 49 | { 50 | if (disposedValue) 51 | throw new ObjectDisposedException(nameof(Transformation)); 52 | 53 | // Create a new reference to the Image objects so that they cannot be disposed while 54 | // we are performing the transformation 55 | using (Image depthReference = depth.Reference()) 56 | using (Image transformedReference = transformed.Reference()) 57 | { 58 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_transformation_depth_image_to_color_camera( 59 | handle, 60 | depthReference.DangerousGetHandle(), 61 | transformedReference.DangerousGetHandle() 62 | )); 63 | } 64 | } 65 | } 66 | 67 | public ArrayImage ColorImageToDepthCamera(Capture capture) 68 | { 69 | return ColorImageToDepthCamera(capture.Depth, capture.Color); 70 | } 71 | 72 | public ArrayImage ColorImageToDepthCamera(Image depth, Image color) 73 | { 74 | ArrayImage transformed = new ArrayImage(ImageFormat.ColorBGRA32, 75 | calibration.depth_camera_calibration.resolution_width, 76 | calibration.depth_camera_calibration.resolution_height) 77 | { 78 | Exposure = color.Exposure, 79 | ISOSpeed = color.ISOSpeed, 80 | Timestamp = color.Timestamp, 81 | WhiteBalance = color.WhiteBalance 82 | }; 83 | 84 | 85 | ColorImageToDepthCamera(depth, color, transformed); 86 | 87 | return transformed; 88 | } 89 | 90 | public void ColorImageToDepthCamera(Capture capture, Image transformed) 91 | { 92 | ColorImageToDepthCamera(capture.Depth, capture.Color, transformed); 93 | } 94 | 95 | public void ColorImageToDepthCamera(Image depth, Image color, Image transformed) 96 | { 97 | lock (this) 98 | { 99 | if (disposedValue) 100 | throw new ObjectDisposedException(nameof(Transformation)); 101 | 102 | // Create a new reference to the Image objects so that they cannot be disposed while 103 | // we are performing the transformation 104 | using (Image depthReference = depth.Reference()) 105 | using (Image colorReference = color.Reference()) 106 | using (Image transformedReference = transformed.Reference()) 107 | { 108 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_transformation_color_image_to_depth_camera( 109 | handle, 110 | depthReference.DangerousGetHandle(), 111 | colorReference.DangerousGetHandle(), 112 | transformedReference.DangerousGetHandle())); 113 | } 114 | } 115 | } 116 | 117 | public ArrayImage DepthImageToPointCloud(Image depth, Calibration.DeviceType camera = Calibration.DeviceType.Depth) 118 | { 119 | ArrayImage pointCloud = new ArrayImage(ImageFormat.Custom, 120 | depth.WidthPixels, depth.HeightPixels); 121 | 122 | DepthImageToPointCloud(depth, pointCloud, camera); 123 | 124 | return pointCloud; 125 | } 126 | 127 | public void DepthImageToPointCloud(Image depth, Image pointCloud, Calibration.DeviceType camera = Calibration.DeviceType.Depth) 128 | { 129 | lock (this) 130 | { 131 | if (disposedValue) 132 | throw new ObjectDisposedException(nameof(Transformation)); 133 | 134 | // Create a new reference to the Image objects so that they cannot be disposed while 135 | // we are performing the transformation 136 | using (Image depthReference = depth.Reference()) 137 | using (Image pointCloudReference = pointCloud.Reference()) 138 | { 139 | AzureKinectException.ThrowIfNotSuccess(NativeMethods.k4a_transformation_depth_image_to_point_cloud( 140 | handle, 141 | depthReference.DangerousGetHandle(), 142 | camera, 143 | pointCloudReference.DangerousGetHandle())); 144 | } 145 | } 146 | } 147 | 148 | #region IDisposable Support 149 | private bool disposedValue = false; // To detect redundant calls 150 | 151 | protected virtual void Dispose(bool disposing) 152 | { 153 | if (!disposedValue) 154 | { 155 | if (disposing) 156 | { 157 | // TODO: dispose managed state (managed objects). 158 | } 159 | 160 | // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. 161 | // TODO: set large fields to null. 162 | handle.Close(); 163 | 164 | disposedValue = true; 165 | } 166 | } 167 | 168 | // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. 169 | ~Transformation() 170 | { 171 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 172 | Dispose(false); 173 | } 174 | 175 | // This code added to correctly implement the disposable pattern. 176 | public void Dispose() 177 | { 178 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 179 | Dispose(true); 180 | // TODO: uncomment the following line if the finalizer is overridden above. 181 | GC.SuppressFinalize(this); 182 | } 183 | #endregion 184 | 185 | 186 | } 187 | } 188 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/Transformation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 16961084e3d66d04f956f8e8dd12bba6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/WiredSyncMode.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.Azure.Kinect.Sensor 5 | { 6 | [Native.NativeReference("k4a_wired_sync_mode_t")] 7 | public enum WiredSyncMode 8 | { 9 | Standalone, 10 | Master, 11 | Subordinate 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4A/WiredSyncMode.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c2db4a8c1e971848988cb75d11f1656 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 09f5e8ae0e75fb544b3092bf588959dc 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/BodyFrame.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Takahiro Horikawa. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | 5 | namespace Microsoft.Azure.Kinect.Sensor.BodyTracking 6 | { 7 | public class BodyFrame : IDisposable 8 | { 9 | internal BodyFrame(BodyTrackingNativeMethods.k4abt_frame_t handle) 10 | { 11 | this.handle = handle; 12 | } 13 | 14 | public UInt32 NumBodies 15 | { 16 | get 17 | { 18 | lock (this) 19 | { 20 | if (disposedValue) 21 | throw new ObjectDisposedException(nameof(BodyFrame)); 22 | 23 | return BodyTrackingNativeMethods.k4abt_frame_get_num_bodies(handle); 24 | } 25 | } 26 | } 27 | 28 | public Skeleton GetSkeleton(UInt32 index) 29 | { 30 | lock (this) 31 | { 32 | if (disposedValue) 33 | throw new ObjectDisposedException(nameof(BodyFrame)); 34 | BodyTrackingNativeMethods.k4abt_frame_get_body_skeleton(handle, index, out Skeleton skeleton); 35 | return skeleton; 36 | } 37 | } 38 | 39 | public UInt32 GetBodyId(UInt32 index) 40 | { 41 | lock (this) 42 | { 43 | if (disposedValue) 44 | throw new ObjectDisposedException(nameof(BodyFrame)); 45 | return BodyTrackingNativeMethods.k4abt_frame_get_body_id(handle, index); 46 | } 47 | } 48 | 49 | // This function retrieves a native image handle from the native API. 50 | // 51 | // If this is the first time calling the property, we construct a new wrapper 52 | // If the handle is for an Image we have already constructed a wrapper for, we return the existing wrapper 53 | // If the handle is for a different Image, or if the wrapper has already been disposed, we construct a new wrapper and dispose the old one 54 | private Image GetImageWrapperAndDisposePrevious(Func nativeMethod, 55 | ref Image cache) 56 | { 57 | // Lock must be held to ensure the Image in cache is not replaced while we are inspecting it 58 | // It is still possible for that Image to be accessed or Disposed while this lock is held 59 | lock (this) 60 | { 61 | if (this.disposedValue) 62 | { 63 | throw new ObjectDisposedException(nameof(Capture)); 64 | } 65 | 66 | NativeMethods.k4a_image_t image = nativeMethod(this.handle); 67 | // This try block ensures that we close image 68 | try 69 | { 70 | if (cache != null) 71 | { 72 | IntPtr imageHandle = image.DangerousGetHandle(); 73 | 74 | // Only attempt to access cache in this try block 75 | try 76 | { 77 | // If cache was disposed before we called the native accessor (by the caller or another thread), 78 | // the handle could have been reused and the values would incorrectly match. However, cache.DangerousGetHandle() 79 | // will throw an exception, and we will correctly construct a new image wrapper. 80 | if (cache.DangerousGetHandle().DangerousGetHandle() != imageHandle) 81 | { 82 | // The image has changed, invalidate the current image and construct a new wrapper 83 | cache.Dispose(); 84 | cache = null; 85 | } 86 | } 87 | catch (ObjectDisposedException) 88 | { 89 | // If cache has been disposed by the caller or another thread we will discard 90 | // it and construct a new wrapper 91 | cache = null; 92 | } 93 | } 94 | 95 | if (cache == null && !image.IsInvalid) 96 | { 97 | // Construct a new wrapper and return it 98 | // The native function may have returned 99 | cache = new Image(image); 100 | 101 | // Since we have wrapped image, it is now owned by the UnsafeImage object and we should no longer close it 102 | image = null; 103 | } 104 | } 105 | finally 106 | { 107 | // Ensure the native handle is closed if we have a failure creating the Image object 108 | if (image != null) 109 | { 110 | image.Close(); 111 | } 112 | } 113 | 114 | return cache; 115 | } 116 | } 117 | 118 | private Image _BodyIndexMap; 119 | 120 | public Image BodyIndexMap 121 | { 122 | get 123 | { 124 | return this.GetImageWrapperAndDisposePrevious(BodyTrackingNativeMethods.k4abt_frame_get_body_index_map, ref this._BodyIndexMap); 125 | } 126 | set 127 | { 128 | lock (this) 129 | { 130 | if (this.disposedValue) 131 | { 132 | throw new ObjectDisposedException(nameof(BodyFrame)); 133 | } 134 | 135 | // If the assignment is a new managed wrapper we need 136 | // to release the reference to the old wrapper. 137 | // If it is the same object though, we should not dispose it. 138 | if (this._BodyIndexMap != null && !object.ReferenceEquals( 139 | this._BodyIndexMap, value)) 140 | { 141 | this._BodyIndexMap.Dispose(); 142 | } 143 | this._BodyIndexMap = value; 144 | } 145 | } 146 | } 147 | 148 | public BodyFrame Reference() 149 | { 150 | lock (this) 151 | { 152 | if (disposedValue) 153 | throw new ObjectDisposedException(nameof(BodyFrame)); 154 | 155 | return new BodyFrame(handle.DuplicateReference()); 156 | } 157 | } 158 | 159 | private BodyTrackingNativeMethods.k4abt_frame_t handle; 160 | 161 | #region IDisposable Support 162 | private bool disposedValue = false; // To detect redundant calls 163 | 164 | protected virtual void Dispose(bool disposing) 165 | { 166 | lock (this) 167 | { 168 | if (!disposedValue) 169 | { 170 | if (disposing) 171 | { 172 | } 173 | 174 | // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. 175 | // TODO: set large fields to null. 176 | handle.Close(); 177 | handle = null; 178 | 179 | disposedValue = true; 180 | } 181 | } 182 | } 183 | 184 | // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. 185 | ~BodyFrame() 186 | { 187 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 188 | Dispose(false); 189 | } 190 | 191 | // This code added to correctly implement the disposable pattern. 192 | public void Dispose() 193 | { 194 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 195 | Dispose(true); 196 | // TODO: uncomment the following line if the finalizer is overridden above. 197 | GC.SuppressFinalize(this); 198 | } 199 | #endregion 200 | 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/BodyFrame.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 518e82b271ca7d84cb07ae51de8ef153 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/BodyTracker.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | // Copyright (c) Takahiro Horikawa. All rights reserved. 8 | // Licensed under the MIT License. 9 | 10 | namespace Microsoft.Azure.Kinect.Sensor.BodyTracking 11 | { 12 | public class BodyTracker : IDisposable 13 | { 14 | internal BodyTracker(BodyTrackingNativeMethods.k4abt_tracker_t handle) 15 | { 16 | this.handle = handle; 17 | } 18 | 19 | public static BodyTracker Create(Calibration sensorCalibration) 20 | { 21 | AzureKinectException.ThrowIfNotSuccess( 22 | BodyTrackingNativeMethods.k4abt_tracker_create(sensorCalibration, new TrackerCalibration 23 | { 24 | sensor_orientation = SensorOrientation.K4ABT_SENSOR_ORIENTATION_DEFAULT, 25 | cpu_only_mode = 0 26 | }, out BodyTrackingNativeMethods.k4abt_tracker_t handle)); 27 | 28 | return new BodyTracker(handle); 29 | } 30 | 31 | public void EnqueueCapture(Capture capture, int timeoutInMS = -1) 32 | { 33 | lock (this) 34 | { 35 | if (disposedValue) 36 | throw new ObjectDisposedException(nameof(Device)); 37 | 38 | NativeMethods.k4a_wait_result_t result = BodyTrackingNativeMethods.k4abt_tracker_enqueue_capture(handle, capture.DangerousGetHandle(), timeoutInMS); 39 | 40 | if (result == NativeMethods.k4a_wait_result_t.K4A_WAIT_RESULT_TIMEOUT) 41 | { 42 | throw new TimeoutException("Timed out waiting for capture"); 43 | } 44 | 45 | AzureKinectException.ThrowIfNotSuccess(result); 46 | } 47 | } 48 | 49 | public BodyFrame PopResult(int timeoutInMS = -1) 50 | { 51 | lock (this) 52 | { 53 | if (disposedValue) 54 | throw new ObjectDisposedException(nameof(Device)); 55 | 56 | NativeMethods.k4a_wait_result_t result = BodyTrackingNativeMethods.k4abt_tracker_pop_result(handle, out BodyTrackingNativeMethods.k4abt_frame_t frame, timeoutInMS); 57 | 58 | if (result == NativeMethods.k4a_wait_result_t.K4A_WAIT_RESULT_TIMEOUT) 59 | { 60 | throw new TimeoutException("Timed out waiting for capture"); 61 | } 62 | 63 | AzureKinectException.ThrowIfNotSuccess(result); 64 | 65 | return new BodyFrame(frame); 66 | } 67 | } 68 | 69 | private BodyTrackingNativeMethods.k4abt_tracker_t handle; 70 | 71 | #region IDisposable Support 72 | private bool disposedValue = false; // To detect redundant calls 73 | 74 | protected virtual void Dispose(bool disposing) 75 | { 76 | lock (this) 77 | { 78 | if (!disposedValue) 79 | { 80 | if (disposing) 81 | { 82 | } 83 | 84 | // TODO: free unmanaged resources (unmanaged objects) and override a finalizer below. 85 | // TODO: set large fields to null. 86 | handle.Close(); 87 | handle = null; 88 | 89 | disposedValue = true; 90 | } 91 | } 92 | } 93 | 94 | // TODO: override a finalizer only if Dispose(bool disposing) above has code to free unmanaged resources. 95 | ~BodyTracker() 96 | { 97 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 98 | Dispose(false); 99 | } 100 | 101 | // This code added to correctly implement the disposable pattern. 102 | public void Dispose() 103 | { 104 | // Do not change this code. Put cleanup code in Dispose(bool disposing) above. 105 | Dispose(true); 106 | // TODO: uncomment the following line if the finalizer is overridden above. 107 | GC.SuppressFinalize(this); 108 | } 109 | #endregion 110 | 111 | } 112 | } 113 | 114 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/BodyTracker.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f94bf07ee7f72b842a8d13e7d868ffc6 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/JointId.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Takahiro Horikawa. All rights reserved. 2 | // Licensed under the MIT License. 3 | 4 | namespace Microsoft.Azure.Kinect.Sensor.BodyTracking 5 | { 6 | [Native.NativeReference("k4abt_joint_id_t")] 7 | public enum JointId 8 | { 9 | Pelvis = 0, SpineNaval, SpineChest, Neck, 10 | ClavicleLeft, ShoulderLeft, ElbowLeft, WristLeft, 11 | HandLeft, HandTipLeft, ThumbLeft, 12 | ClavicleRight, ShoulderRight, ElbowRight, WristRight, 13 | HandRight, HandTipRight, ThumbRight, 14 | HipLeft, KneeLeft, AnkleLeft, FootLeft, 15 | HipRight, KneeRight, AnkleRight, FootRight, 16 | Head, Nose, EyeLeft, EarLeft, 17 | EyeRight, EarRight, Count 18 | } 19 | } 20 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/JointId.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3d71b393391ec54a95377e4f0bf2f1d 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/Native.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b627716d21f67c44a593e23f2aa909a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/Native/BodyTrackingNativeMethods.cs: -------------------------------------------------------------------------------- 1 | //------------------------------------------------------------------------------ 2 | // 3 | // Copyright (c) Takahiro Horikawa. All rights reserved. 4 | // Licensed under the MIT License. 5 | // 6 | //------------------------------------------------------------------------------ 7 | using System; 8 | using System.Numerics; 9 | using System.Runtime.InteropServices; 10 | using System.Text; 11 | using Microsoft.Azure.Kinect.Sensor.Native; 12 | 13 | namespace Microsoft.Azure.Kinect.Sensor.BodyTracking 14 | { 15 | #pragma warning disable IDE1006 // Naming Styles 16 | 17 | internal class BodyTrackingNativeMethods 18 | { 19 | // These types are used internally by the interop dll for marshaling purposes and are not exposed 20 | // over the public surface of the managed dll. 21 | 22 | #region Handle Types 23 | 24 | public class k4abt_tracker_t : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid 25 | { 26 | private k4abt_tracker_t() : base(true) 27 | { 28 | } 29 | 30 | protected override bool ReleaseHandle() 31 | { 32 | BodyTrackingNativeMethods.k4abt_tracker_destroy(handle); 33 | return true; 34 | } 35 | } 36 | 37 | public class k4abt_frame_t : Microsoft.Win32.SafeHandles.SafeHandleZeroOrMinusOneIsInvalid 38 | { 39 | private k4abt_frame_t() : base(true) 40 | { 41 | } 42 | 43 | public k4abt_frame_t DuplicateReference() 44 | { 45 | k4abt_frame_t duplicate = new k4abt_frame_t(); 46 | 47 | BodyTrackingNativeMethods.k4abt_frame_reference(handle); 48 | duplicate.handle = this.handle; 49 | return duplicate; 50 | } 51 | protected override bool ReleaseHandle() 52 | { 53 | BodyTrackingNativeMethods.k4abt_frame_release(handle); 54 | return true; 55 | } 56 | } 57 | 58 | #endregion 59 | 60 | #region Enumerations 61 | #endregion 62 | 63 | #region Structures 64 | 65 | #endregion 66 | 67 | #region Functions 68 | 69 | [DllImport("k4abt", CallingConvention = CallingConvention.Cdecl)] 70 | [NativeReference] 71 | public static extern NativeMethods.k4a_result_t k4abt_tracker_create(Calibration sensorCalibration, TrackerCalibration trackerCalibration, out k4abt_tracker_t tracker_handle); 72 | 73 | [DllImport("k4abt", CallingConvention = CallingConvention.Cdecl)] 74 | [NativeReference] 75 | public static extern void k4abt_tracker_destroy(IntPtr tracker_handle); 76 | 77 | [DllImport("k4abt", CallingConvention = CallingConvention.Cdecl)] 78 | [NativeReference] 79 | public static extern NativeMethods.k4a_wait_result_t k4abt_tracker_enqueue_capture(k4abt_tracker_t tracker_handle, NativeMethods.k4a_capture_t sensor_capture_handle, Int32 timeout_in_ms); 80 | 81 | [DllImport("k4abt", CallingConvention = CallingConvention.Cdecl)] 82 | [NativeReference] 83 | public static extern NativeMethods.k4a_wait_result_t k4abt_tracker_pop_result(k4abt_tracker_t tracker_handle, out k4abt_frame_t body_frame_handle, Int32 timeout_in_ms); 84 | 85 | [DllImport("k4abt", CallingConvention = CallingConvention.Cdecl)] 86 | [NativeReference] 87 | public static extern void k4abt_frame_release(IntPtr body_frame_handle); 88 | 89 | [DllImport("k4abt", CallingConvention = CallingConvention.Cdecl)] 90 | [NativeReference] 91 | public static extern void k4abt_frame_reference(IntPtr body_frame_handle); 92 | 93 | [DllImport("k4abt", CallingConvention = CallingConvention.Cdecl)] 94 | [NativeReference] 95 | public static extern UInt32 k4abt_frame_get_num_bodies(k4abt_frame_t body_frame_handle); 96 | 97 | [DllImport("k4abt", CallingConvention = CallingConvention.Cdecl)] 98 | [NativeReference] 99 | public static extern NativeMethods.k4a_result_t k4abt_frame_get_body_skeleton(k4abt_frame_t body_frame_handle, UInt32 index, out Skeleton skeleton); 100 | 101 | [DllImport("k4abt", CallingConvention = CallingConvention.Cdecl)] 102 | [NativeReference] 103 | public static extern UInt32 k4abt_frame_get_body_id(k4abt_frame_t body_frame_handle, UInt32 index); 104 | 105 | [DllImport("k4abt", CallingConvention = CallingConvention.Cdecl)] 106 | [NativeReference] 107 | public static extern NativeMethods.k4a_image_t k4abt_frame_get_body_index_map(k4abt_frame_t body_frame_handle); 108 | 109 | #endregion 110 | 111 | } 112 | #pragma warning restore IDE1006 // Naming Styles 113 | } 114 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/Native/BodyTrackingNativeMethods.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d37e88f14759b4a4687156dce3627464 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/SensorOrientation.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | using System.Numerics; 5 | using System.Runtime.InteropServices; 6 | 7 | namespace Microsoft.Azure.Kinect.Sensor 8 | { 9 | [Native.NativeReference("k4abt_sensor_orientation_t ")] 10 | public enum SensorOrientation 11 | { 12 | /// 13 | /// Mount the sensor at its default orientation. 14 | /// 15 | K4ABT_SENSOR_ORIENTATION_DEFAULT = 0, 16 | /// 17 | /// Clockwisely rotate the sensor 90 degree. 18 | /// 19 | K4ABT_SENSOR_ORIENTATION_CLOCKWISE90, 20 | /// 21 | /// Counter-clockwisely rotate the sensor 90 degrees. 22 | /// 23 | K4ABT_SENSOR_ORIENTATION_COUNTERCLOCKWISE90, 24 | /// 25 | /// Mount the sensor upside-down. 26 | /// 27 | K4ABT_SENSOR_ORIENTATION_FLIP180, 28 | 29 | } 30 | } 31 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/SensorOrientation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b699270bb7035d4488096e81d4b1f6eb 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/Skeleton.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Takahiro Horikawa. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | using System.Numerics; 5 | using System.Runtime.InteropServices; 6 | 7 | namespace Microsoft.Azure.Kinect.Sensor.BodyTracking 8 | { 9 | [StructLayout(LayoutKind.Sequential)] 10 | [Native.NativeReference("k4abt_skeleton_t")] 11 | public struct Skeleton 12 | { 13 | [MarshalAs(UnmanagedType.ByValArray, ArraySubType = UnmanagedType.Struct, SizeConst = (int)JointId.Count)] 14 | public Joint[] Joints; 15 | } 16 | 17 | 18 | [Native.NativeReference("k4abt_joint_confidence_level_t")] 19 | public enum JointConfidenceLevel 20 | { 21 | /// 22 | /// The joint is out of range (too far from depth camera) 23 | /// 24 | K4ABT_JOINT_CONFIDENCE_NONE = 0, 25 | /// 26 | /// The joint is not observed (likely due to occlusion), predicted joint pose. 27 | /// 28 | K4ABT_JOINT_CONFIDENCE_LOW, 29 | /// 30 | /// Medium confidence in joint pose. 31 | /// 32 | /// Current SDK will only provide joints up to this confidence level 33 | /// 34 | K4ABT_JOINT_CONFIDENCE_MEDIUM, 35 | /// 36 | /// High confidence in joint pose. 37 | /// 38 | /// Placeholder for future SDK 39 | /// 40 | K4ABT_JOINT_CONFIDENCE_HIGH, 41 | /// 42 | /// The total number of confidence levels. 43 | /// 44 | K4ABT_JOINT_CONFIDENCE_LEVELS_COUNT 45 | } 46 | 47 | [StructLayout(LayoutKind.Sequential)] 48 | [Native.NativeReference("k4abt_joint_t")] 49 | public struct Joint 50 | { 51 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 3)] 52 | public float[] Position; 53 | 54 | [MarshalAs(UnmanagedType.ByValArray, SizeConst = 4)] 55 | public float[] Orientation; 56 | 57 | public JointConfidenceLevel confidence_level; 58 | } 59 | } 60 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/Skeleton.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b91e69dc920c7240ac4230b643b8050 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/TrackerCalibration.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | using System; 4 | using System.Numerics; 5 | using System.Runtime.InteropServices; 6 | 7 | namespace Microsoft.Azure.Kinect.Sensor 8 | { 9 | [StructLayout(LayoutKind.Sequential)] 10 | [Native.NativeReference("k4abt_tracker_configuration_t ")] 11 | public struct TrackerCalibration 12 | { 13 | 14 | public SensorOrientation sensor_orientation; 15 | 16 | public int cpu_only_mode; 17 | } 18 | } 19 | -------------------------------------------------------------------------------- /unity/Assets/AzureKinectDK/Scripts/M4ABT/TrackerCalibration.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 521d953196e3e2e4d927de76e0df64df 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /unity/Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.ads": "2.0.8", 4 | "com.unity.analytics": "3.3.2", 5 | "com.unity.collab-proxy": "1.2.16", 6 | "com.unity.package-manager-ui": "2.1.2", 7 | "com.unity.purchasing": "2.0.6", 8 | "com.unity.textmeshpro": "2.0.1", 9 | "com.unity.timeline": "1.0.0", 10 | "com.unity.modules.ai": "1.0.0", 11 | "com.unity.modules.animation": "1.0.0", 12 | "com.unity.modules.assetbundle": "1.0.0", 13 | "com.unity.modules.audio": "1.0.0", 14 | "com.unity.modules.cloth": "1.0.0", 15 | "com.unity.modules.director": "1.0.0", 16 | "com.unity.modules.imageconversion": "1.0.0", 17 | "com.unity.modules.imgui": "1.0.0", 18 | "com.unity.modules.jsonserialize": "1.0.0", 19 | "com.unity.modules.particlesystem": "1.0.0", 20 | "com.unity.modules.physics": "1.0.0", 21 | "com.unity.modules.physics2d": "1.0.0", 22 | "com.unity.modules.screencapture": "1.0.0", 23 | "com.unity.modules.terrain": "1.0.0", 24 | "com.unity.modules.terrainphysics": "1.0.0", 25 | "com.unity.modules.tilemap": "1.0.0", 26 | "com.unity.modules.ui": "1.0.0", 27 | "com.unity.modules.uielements": "1.0.0", 28 | "com.unity.modules.umbra": "1.0.0", 29 | "com.unity.modules.unityanalytics": "1.0.0", 30 | "com.unity.modules.unitywebrequest": "1.0.0", 31 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 32 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 33 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 34 | "com.unity.modules.unitywebrequestwww": "1.0.0", 35 | "com.unity.modules.vehicles": "1.0.0", 36 | "com.unity.modules.video": "1.0.0", 37 | "com.unity.modules.vr": "1.0.0", 38 | "com.unity.modules.wind": "1.0.0", 39 | "com.unity.modules.xr": "1.0.0" 40 | } 41 | } 42 | -------------------------------------------------------------------------------- /unity/ProjectSettings/AudioManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!11 &1 4 | AudioManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Volume: 1 8 | Rolloff Scale: 1 9 | Doppler Factor: 1 10 | Default Speaker Mode: 2 11 | m_SampleRate: 0 12 | m_DSPBufferSize: 1024 13 | m_VirtualVoiceCount: 512 14 | m_RealVoiceCount: 32 15 | m_SpatializerPlugin: 16 | m_AmbisonicDecoderPlugin: 17 | m_DisableAudio: 0 18 | m_VirtualizeEffects: 1 19 | m_RequestedDSPBufferSize: 1024 20 | -------------------------------------------------------------------------------- /unity/ProjectSettings/ClusterInputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!236 &1 4 | ClusterInputManager: 5 | m_ObjectHideFlags: 0 6 | m_Inputs: [] 7 | -------------------------------------------------------------------------------- /unity/ProjectSettings/DynamicsManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!55 &1 4 | PhysicsManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 11 7 | m_Gravity: {x: 0, y: -9.81, z: 0} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_BounceThreshold: 2 10 | m_SleepThreshold: 0.005 11 | m_DefaultContactOffset: 0.01 12 | m_DefaultSolverIterations: 6 13 | m_DefaultSolverVelocityIterations: 1 14 | m_QueriesHitBackfaces: 0 15 | m_QueriesHitTriggers: 1 16 | m_EnableAdaptiveForce: 0 17 | m_ClothInterCollisionDistance: 0 18 | m_ClothInterCollisionStiffness: 0 19 | m_ContactsGeneration: 1 20 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 21 | m_AutoSimulation: 1 22 | m_AutoSyncTransforms: 0 23 | m_ReuseCollisionCallbacks: 1 24 | m_ClothInterCollisionSettingsToggle: 0 25 | m_ContactPairsMode: 0 26 | m_BroadphaseType: 0 27 | m_WorldBounds: 28 | m_Center: {x: 0, y: 0, z: 0} 29 | m_Extent: {x: 250, y: 250, z: 250} 30 | m_WorldSubdivisions: 8 31 | m_FrictionType: 0 32 | m_EnableEnhancedDeterminism: 0 33 | m_EnableUnifiedHeightmaps: 1 34 | m_DefaultMaxAngluarSpeed: 7 35 | -------------------------------------------------------------------------------- /unity/ProjectSettings/EditorBuildSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1045 &1 4 | EditorBuildSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Scenes: [] 8 | m_configObjects: {} 9 | -------------------------------------------------------------------------------- /unity/ProjectSettings/EditorSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!159 &1 4 | EditorSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 7 7 | m_ExternalVersionControlSupport: Visible Meta Files 8 | m_SerializationMode: 2 9 | m_LineEndingsForNewScripts: 2 10 | m_DefaultBehaviorMode: 0 11 | m_PrefabRegularEnvironment: {fileID: 0} 12 | m_PrefabUIEnvironment: {fileID: 0} 13 | m_SpritePackerMode: 0 14 | m_SpritePackerPaddingPower: 1 15 | m_EtcTextureCompressorBehavior: 1 16 | m_EtcTextureFastCompressor: 1 17 | m_EtcTextureNormalCompressor: 2 18 | m_EtcTextureBestCompressor: 4 19 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd;asmdef;rsp 20 | m_ProjectGenerationRootNamespace: 21 | m_CollabEditorSettings: 22 | inProgressEnabled: 1 23 | m_EnableTextureStreamingInEditMode: 1 24 | m_EnableTextureStreamingInPlayMode: 1 25 | m_AsyncShaderCompilation: 1 26 | -------------------------------------------------------------------------------- /unity/ProjectSettings/GraphicsSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!30 &1 4 | GraphicsSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 12 7 | m_Deferred: 8 | m_Mode: 1 9 | m_Shader: {fileID: 69, guid: 0000000000000000f000000000000000, type: 0} 10 | m_DeferredReflections: 11 | m_Mode: 1 12 | m_Shader: {fileID: 74, guid: 0000000000000000f000000000000000, type: 0} 13 | m_ScreenSpaceShadows: 14 | m_Mode: 1 15 | m_Shader: {fileID: 64, guid: 0000000000000000f000000000000000, type: 0} 16 | m_LegacyDeferred: 17 | m_Mode: 1 18 | m_Shader: {fileID: 63, guid: 0000000000000000f000000000000000, type: 0} 19 | m_DepthNormals: 20 | m_Mode: 1 21 | m_Shader: {fileID: 62, guid: 0000000000000000f000000000000000, type: 0} 22 | m_MotionVectors: 23 | m_Mode: 1 24 | m_Shader: {fileID: 75, guid: 0000000000000000f000000000000000, type: 0} 25 | m_LightHalo: 26 | m_Mode: 1 27 | m_Shader: {fileID: 105, guid: 0000000000000000f000000000000000, type: 0} 28 | m_LensFlare: 29 | m_Mode: 1 30 | m_Shader: {fileID: 102, guid: 0000000000000000f000000000000000, type: 0} 31 | m_AlwaysIncludedShaders: 32 | - {fileID: 7, guid: 0000000000000000f000000000000000, type: 0} 33 | - {fileID: 15104, guid: 0000000000000000f000000000000000, type: 0} 34 | - {fileID: 15105, guid: 0000000000000000f000000000000000, type: 0} 35 | - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} 36 | - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} 37 | - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} 38 | - {fileID: 16000, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16001, guid: 0000000000000000f000000000000000, type: 0} 40 | - {fileID: 17000, guid: 0000000000000000f000000000000000, type: 0} 41 | m_PreloadedShaders: [] 42 | m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, 43 | type: 0} 44 | m_CustomRenderPipeline: {fileID: 0} 45 | m_TransparencySortMode: 0 46 | m_TransparencySortAxis: {x: 0, y: 0, z: 1} 47 | m_DefaultRenderingPath: 1 48 | m_DefaultMobileRenderingPath: 1 49 | m_TierSettings: [] 50 | m_LightmapStripping: 0 51 | m_FogStripping: 0 52 | m_InstancingStripping: 0 53 | m_LightmapKeepPlain: 1 54 | m_LightmapKeepDirCombined: 1 55 | m_LightmapKeepDynamicPlain: 1 56 | m_LightmapKeepDynamicDirCombined: 1 57 | m_LightmapKeepShadowMask: 1 58 | m_LightmapKeepSubtractive: 1 59 | m_FogKeepLinear: 1 60 | m_FogKeepExp: 1 61 | m_FogKeepExp2: 1 62 | m_AlbedoSwatchInfos: [] 63 | m_LightsUseLinearIntensity: 0 64 | m_LightsUseColorTemperature: 0 65 | -------------------------------------------------------------------------------- /unity/ProjectSettings/InputManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!13 &1 4 | InputManager: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | m_Axes: 8 | - serializedVersion: 3 9 | m_Name: Horizontal 10 | descriptiveName: 11 | descriptiveNegativeName: 12 | negativeButton: left 13 | positiveButton: right 14 | altNegativeButton: a 15 | altPositiveButton: d 16 | gravity: 3 17 | dead: 0.001 18 | sensitivity: 3 19 | snap: 1 20 | invert: 0 21 | type: 0 22 | axis: 0 23 | joyNum: 0 24 | - serializedVersion: 3 25 | m_Name: Vertical 26 | descriptiveName: 27 | descriptiveNegativeName: 28 | negativeButton: down 29 | positiveButton: up 30 | altNegativeButton: s 31 | altPositiveButton: w 32 | gravity: 3 33 | dead: 0.001 34 | sensitivity: 3 35 | snap: 1 36 | invert: 0 37 | type: 0 38 | axis: 0 39 | joyNum: 0 40 | - serializedVersion: 3 41 | m_Name: Fire1 42 | descriptiveName: 43 | descriptiveNegativeName: 44 | negativeButton: 45 | positiveButton: left ctrl 46 | altNegativeButton: 47 | altPositiveButton: mouse 0 48 | gravity: 1000 49 | dead: 0.001 50 | sensitivity: 1000 51 | snap: 0 52 | invert: 0 53 | type: 0 54 | axis: 0 55 | joyNum: 0 56 | - serializedVersion: 3 57 | m_Name: Fire2 58 | descriptiveName: 59 | descriptiveNegativeName: 60 | negativeButton: 61 | positiveButton: left alt 62 | altNegativeButton: 63 | altPositiveButton: mouse 1 64 | gravity: 1000 65 | dead: 0.001 66 | sensitivity: 1000 67 | snap: 0 68 | invert: 0 69 | type: 0 70 | axis: 0 71 | joyNum: 0 72 | - serializedVersion: 3 73 | m_Name: Fire3 74 | descriptiveName: 75 | descriptiveNegativeName: 76 | negativeButton: 77 | positiveButton: left shift 78 | altNegativeButton: 79 | altPositiveButton: mouse 2 80 | gravity: 1000 81 | dead: 0.001 82 | sensitivity: 1000 83 | snap: 0 84 | invert: 0 85 | type: 0 86 | axis: 0 87 | joyNum: 0 88 | - serializedVersion: 3 89 | m_Name: Jump 90 | descriptiveName: 91 | descriptiveNegativeName: 92 | negativeButton: 93 | positiveButton: space 94 | altNegativeButton: 95 | altPositiveButton: 96 | gravity: 1000 97 | dead: 0.001 98 | sensitivity: 1000 99 | snap: 0 100 | invert: 0 101 | type: 0 102 | axis: 0 103 | joyNum: 0 104 | - serializedVersion: 3 105 | m_Name: Mouse X 106 | descriptiveName: 107 | descriptiveNegativeName: 108 | negativeButton: 109 | positiveButton: 110 | altNegativeButton: 111 | altPositiveButton: 112 | gravity: 0 113 | dead: 0 114 | sensitivity: 0.1 115 | snap: 0 116 | invert: 0 117 | type: 1 118 | axis: 0 119 | joyNum: 0 120 | - serializedVersion: 3 121 | m_Name: Mouse Y 122 | descriptiveName: 123 | descriptiveNegativeName: 124 | negativeButton: 125 | positiveButton: 126 | altNegativeButton: 127 | altPositiveButton: 128 | gravity: 0 129 | dead: 0 130 | sensitivity: 0.1 131 | snap: 0 132 | invert: 0 133 | type: 1 134 | axis: 1 135 | joyNum: 0 136 | - serializedVersion: 3 137 | m_Name: Mouse ScrollWheel 138 | descriptiveName: 139 | descriptiveNegativeName: 140 | negativeButton: 141 | positiveButton: 142 | altNegativeButton: 143 | altPositiveButton: 144 | gravity: 0 145 | dead: 0 146 | sensitivity: 0.1 147 | snap: 0 148 | invert: 0 149 | type: 1 150 | axis: 2 151 | joyNum: 0 152 | - serializedVersion: 3 153 | m_Name: Horizontal 154 | descriptiveName: 155 | descriptiveNegativeName: 156 | negativeButton: 157 | positiveButton: 158 | altNegativeButton: 159 | altPositiveButton: 160 | gravity: 0 161 | dead: 0.19 162 | sensitivity: 1 163 | snap: 0 164 | invert: 0 165 | type: 2 166 | axis: 0 167 | joyNum: 0 168 | - serializedVersion: 3 169 | m_Name: Vertical 170 | descriptiveName: 171 | descriptiveNegativeName: 172 | negativeButton: 173 | positiveButton: 174 | altNegativeButton: 175 | altPositiveButton: 176 | gravity: 0 177 | dead: 0.19 178 | sensitivity: 1 179 | snap: 0 180 | invert: 1 181 | type: 2 182 | axis: 1 183 | joyNum: 0 184 | - serializedVersion: 3 185 | m_Name: Fire1 186 | descriptiveName: 187 | descriptiveNegativeName: 188 | negativeButton: 189 | positiveButton: joystick button 0 190 | altNegativeButton: 191 | altPositiveButton: 192 | gravity: 1000 193 | dead: 0.001 194 | sensitivity: 1000 195 | snap: 0 196 | invert: 0 197 | type: 0 198 | axis: 0 199 | joyNum: 0 200 | - serializedVersion: 3 201 | m_Name: Fire2 202 | descriptiveName: 203 | descriptiveNegativeName: 204 | negativeButton: 205 | positiveButton: joystick button 1 206 | altNegativeButton: 207 | altPositiveButton: 208 | gravity: 1000 209 | dead: 0.001 210 | sensitivity: 1000 211 | snap: 0 212 | invert: 0 213 | type: 0 214 | axis: 0 215 | joyNum: 0 216 | - serializedVersion: 3 217 | m_Name: Fire3 218 | descriptiveName: 219 | descriptiveNegativeName: 220 | negativeButton: 221 | positiveButton: joystick button 2 222 | altNegativeButton: 223 | altPositiveButton: 224 | gravity: 1000 225 | dead: 0.001 226 | sensitivity: 1000 227 | snap: 0 228 | invert: 0 229 | type: 0 230 | axis: 0 231 | joyNum: 0 232 | - serializedVersion: 3 233 | m_Name: Jump 234 | descriptiveName: 235 | descriptiveNegativeName: 236 | negativeButton: 237 | positiveButton: joystick button 3 238 | altNegativeButton: 239 | altPositiveButton: 240 | gravity: 1000 241 | dead: 0.001 242 | sensitivity: 1000 243 | snap: 0 244 | invert: 0 245 | type: 0 246 | axis: 0 247 | joyNum: 0 248 | - serializedVersion: 3 249 | m_Name: Submit 250 | descriptiveName: 251 | descriptiveNegativeName: 252 | negativeButton: 253 | positiveButton: return 254 | altNegativeButton: 255 | altPositiveButton: joystick button 0 256 | gravity: 1000 257 | dead: 0.001 258 | sensitivity: 1000 259 | snap: 0 260 | invert: 0 261 | type: 0 262 | axis: 0 263 | joyNum: 0 264 | - serializedVersion: 3 265 | m_Name: Submit 266 | descriptiveName: 267 | descriptiveNegativeName: 268 | negativeButton: 269 | positiveButton: enter 270 | altNegativeButton: 271 | altPositiveButton: space 272 | gravity: 1000 273 | dead: 0.001 274 | sensitivity: 1000 275 | snap: 0 276 | invert: 0 277 | type: 0 278 | axis: 0 279 | joyNum: 0 280 | - serializedVersion: 3 281 | m_Name: Cancel 282 | descriptiveName: 283 | descriptiveNegativeName: 284 | negativeButton: 285 | positiveButton: escape 286 | altNegativeButton: 287 | altPositiveButton: joystick button 1 288 | gravity: 1000 289 | dead: 0.001 290 | sensitivity: 1000 291 | snap: 0 292 | invert: 0 293 | type: 0 294 | axis: 0 295 | joyNum: 0 296 | -------------------------------------------------------------------------------- /unity/ProjectSettings/NavMeshAreas.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!126 &1 4 | NavMeshProjectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 2 7 | areas: 8 | - name: Walkable 9 | cost: 1 10 | - name: Not Walkable 11 | cost: 1 12 | - name: Jump 13 | cost: 2 14 | - name: 15 | cost: 1 16 | - name: 17 | cost: 1 18 | - name: 19 | cost: 1 20 | - name: 21 | cost: 1 22 | - name: 23 | cost: 1 24 | - name: 25 | cost: 1 26 | - name: 27 | cost: 1 28 | - name: 29 | cost: 1 30 | - name: 31 | cost: 1 32 | - name: 33 | cost: 1 34 | - name: 35 | cost: 1 36 | - name: 37 | cost: 1 38 | - name: 39 | cost: 1 40 | - name: 41 | cost: 1 42 | - name: 43 | cost: 1 44 | - name: 45 | cost: 1 46 | - name: 47 | cost: 1 48 | - name: 49 | cost: 1 50 | - name: 51 | cost: 1 52 | - name: 53 | cost: 1 54 | - name: 55 | cost: 1 56 | - name: 57 | cost: 1 58 | - name: 59 | cost: 1 60 | - name: 61 | cost: 1 62 | - name: 63 | cost: 1 64 | - name: 65 | cost: 1 66 | - name: 67 | cost: 1 68 | - name: 69 | cost: 1 70 | - name: 71 | cost: 1 72 | m_LastAgentTypeID: -887442657 73 | m_Settings: 74 | - serializedVersion: 2 75 | agentTypeID: 0 76 | agentRadius: 0.5 77 | agentHeight: 2 78 | agentSlope: 45 79 | agentClimb: 0.75 80 | ledgeDropHeight: 0 81 | maxJumpAcrossDistance: 0 82 | minRegionArea: 2 83 | manualCellSize: 0 84 | cellSize: 0.16666667 85 | manualTileSize: 0 86 | tileSize: 256 87 | accuratePlacement: 0 88 | debug: 89 | m_Flags: 0 90 | m_SettingNames: 91 | - Humanoid 92 | -------------------------------------------------------------------------------- /unity/ProjectSettings/Physics2DSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!19 &1 4 | Physics2DSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 4 7 | m_Gravity: {x: 0, y: -9.81} 8 | m_DefaultMaterial: {fileID: 0} 9 | m_VelocityIterations: 8 10 | m_PositionIterations: 3 11 | m_VelocityThreshold: 1 12 | m_MaxLinearCorrection: 0.2 13 | m_MaxAngularCorrection: 8 14 | m_MaxTranslationSpeed: 100 15 | m_MaxRotationSpeed: 360 16 | m_BaumgarteScale: 0.2 17 | m_BaumgarteTimeOfImpactScale: 0.75 18 | m_TimeToSleep: 0.5 19 | m_LinearSleepTolerance: 0.01 20 | m_AngularSleepTolerance: 2 21 | m_DefaultContactOffset: 0.01 22 | m_JobOptions: 23 | serializedVersion: 2 24 | useMultithreading: 0 25 | useConsistencySorting: 0 26 | m_InterpolationPosesPerJob: 100 27 | m_NewContactsPerJob: 30 28 | m_CollideContactsPerJob: 100 29 | m_ClearFlagsPerJob: 200 30 | m_ClearBodyForcesPerJob: 200 31 | m_SyncDiscreteFixturesPerJob: 50 32 | m_SyncContinuousFixturesPerJob: 50 33 | m_FindNearestContactsPerJob: 100 34 | m_UpdateTriggerContactsPerJob: 100 35 | m_IslandSolverCostThreshold: 100 36 | m_IslandSolverBodyCostScale: 1 37 | m_IslandSolverContactCostScale: 10 38 | m_IslandSolverJointCostScale: 10 39 | m_IslandSolverBodiesPerJob: 50 40 | m_IslandSolverContactsPerJob: 50 41 | m_AutoSimulation: 1 42 | m_QueriesHitTriggers: 1 43 | m_QueriesStartInColliders: 1 44 | m_CallbacksOnDisable: 1 45 | m_ReuseCollisionCallbacks: 1 46 | m_AutoSyncTransforms: 0 47 | m_AlwaysShowColliders: 0 48 | m_ShowColliderSleep: 1 49 | m_ShowColliderContacts: 0 50 | m_ShowColliderAABB: 0 51 | m_ContactArrowScale: 0.2 52 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 53 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 54 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 55 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 56 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 57 | -------------------------------------------------------------------------------- /unity/ProjectSettings/PresetManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1386491679 &1 4 | PresetManager: 5 | m_ObjectHideFlags: 0 6 | m_DefaultList: [] 7 | -------------------------------------------------------------------------------- /unity/ProjectSettings/ProjectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!129 &1 4 | PlayerSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 16 7 | productGUID: 842aab59f63aa494b9eded70c143fe94 8 | AndroidProfiler: 0 9 | AndroidFilterTouchesWhenObscured: 0 10 | AndroidEnableSustainedPerformanceMode: 0 11 | defaultScreenOrientation: 4 12 | targetDevice: 2 13 | useOnDemandResources: 0 14 | accelerometerFrequency: 60 15 | companyName: DefaultCompany 16 | productName: azure-kinect-dk-unity 17 | defaultCursor: {fileID: 0} 18 | cursorHotspot: {x: 0, y: 0} 19 | m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} 20 | m_ShowUnitySplashScreen: 1 21 | m_ShowUnitySplashLogo: 1 22 | m_SplashScreenOverlayOpacity: 1 23 | m_SplashScreenAnimation: 1 24 | m_SplashScreenLogoStyle: 1 25 | m_SplashScreenDrawMode: 0 26 | m_SplashScreenBackgroundAnimationZoom: 1 27 | m_SplashScreenLogoAnimationZoom: 1 28 | m_SplashScreenBackgroundLandscapeAspect: 1 29 | m_SplashScreenBackgroundPortraitAspect: 1 30 | m_SplashScreenBackgroundLandscapeUvs: 31 | serializedVersion: 2 32 | x: 0 33 | y: 0 34 | width: 1 35 | height: 1 36 | m_SplashScreenBackgroundPortraitUvs: 37 | serializedVersion: 2 38 | x: 0 39 | y: 0 40 | width: 1 41 | height: 1 42 | m_SplashScreenLogos: [] 43 | m_VirtualRealitySplashScreen: {fileID: 0} 44 | m_HolographicTrackingLossScreen: {fileID: 0} 45 | defaultScreenWidth: 1024 46 | defaultScreenHeight: 768 47 | defaultScreenWidthWeb: 960 48 | defaultScreenHeightWeb: 600 49 | m_StereoRenderingPath: 0 50 | m_ActiveColorSpace: 0 51 | m_MTRendering: 1 52 | m_StackTraceTypes: 010000000100000001000000010000000100000001000000 53 | iosShowActivityIndicatorOnLoading: -1 54 | androidShowActivityIndicatorOnLoading: -1 55 | iosAppInBackgroundBehavior: 0 56 | displayResolutionDialog: 0 57 | iosAllowHTTPDownload: 1 58 | allowedAutorotateToPortrait: 1 59 | allowedAutorotateToPortraitUpsideDown: 1 60 | allowedAutorotateToLandscapeRight: 1 61 | allowedAutorotateToLandscapeLeft: 1 62 | useOSAutorotation: 1 63 | use32BitDisplayBuffer: 1 64 | preserveFramebufferAlpha: 0 65 | disableDepthAndStencilBuffers: 0 66 | androidStartInFullscreen: 1 67 | androidRenderOutsideSafeArea: 1 68 | androidBlitType: 0 69 | defaultIsNativeResolution: 1 70 | macRetinaSupport: 1 71 | runInBackground: 1 72 | captureSingleScreen: 0 73 | muteOtherAudioSources: 0 74 | Prepare IOS For Recording: 0 75 | Force IOS Speakers When Recording: 0 76 | deferSystemGesturesMode: 0 77 | hideHomeButton: 0 78 | submitAnalytics: 1 79 | usePlayerLog: 1 80 | bakeCollisionMeshes: 0 81 | forceSingleInstance: 0 82 | useFlipModelSwapchain: 1 83 | resizableWindow: 0 84 | useMacAppStoreValidation: 0 85 | macAppStoreCategory: public.app-category.games 86 | gpuSkinning: 1 87 | graphicsJobs: 0 88 | xboxPIXTextureCapture: 0 89 | xboxEnableAvatar: 0 90 | xboxEnableKinect: 0 91 | xboxEnableKinectAutoTracking: 0 92 | xboxEnableFitness: 0 93 | visibleInBackground: 1 94 | allowFullscreenSwitch: 1 95 | graphicsJobMode: 0 96 | fullscreenMode: 1 97 | xboxSpeechDB: 0 98 | xboxEnableHeadOrientation: 0 99 | xboxEnableGuest: 0 100 | xboxEnablePIXSampling: 0 101 | metalFramebufferOnly: 0 102 | xboxOneResolution: 0 103 | xboxOneSResolution: 0 104 | xboxOneXResolution: 3 105 | xboxOneMonoLoggingLevel: 0 106 | xboxOneLoggingLevel: 1 107 | xboxOneDisableEsram: 0 108 | xboxOnePresentImmediateThreshold: 0 109 | switchQueueCommandMemory: 0 110 | switchQueueControlMemory: 16384 111 | switchQueueComputeMemory: 262144 112 | switchNVNShaderPoolsGranularity: 33554432 113 | switchNVNDefaultPoolsGranularity: 16777216 114 | switchNVNOtherPoolsGranularity: 16777216 115 | vulkanEnableSetSRGBWrite: 0 116 | m_SupportedAspectRatios: 117 | 4:3: 1 118 | 5:4: 1 119 | 16:10: 1 120 | 16:9: 1 121 | Others: 1 122 | bundleVersion: 0.1 123 | preloadedAssets: [] 124 | metroInputSource: 0 125 | wsaTransparentSwapchain: 0 126 | m_HolographicPauseOnTrackingLoss: 1 127 | xboxOneDisableKinectGpuReservation: 1 128 | xboxOneEnable7thCore: 1 129 | vrSettings: 130 | cardboard: 131 | depthFormat: 0 132 | enableTransitionView: 0 133 | daydream: 134 | depthFormat: 0 135 | useSustainedPerformanceMode: 0 136 | enableVideoLayer: 0 137 | useProtectedVideoMemory: 0 138 | minimumSupportedHeadTracking: 0 139 | maximumSupportedHeadTracking: 1 140 | hololens: 141 | depthFormat: 1 142 | depthBufferSharingEnabled: 1 143 | lumin: 144 | depthFormat: 0 145 | frameTiming: 2 146 | enableGLCache: 0 147 | glCacheMaxBlobSize: 524288 148 | glCacheMaxFileSize: 8388608 149 | oculus: 150 | sharedDepthBuffer: 1 151 | dashSupport: 1 152 | enable360StereoCapture: 0 153 | isWsaHolographicRemotingEnabled: 0 154 | protectGraphicsMemory: 0 155 | enableFrameTimingStats: 0 156 | useHDRDisplay: 0 157 | m_ColorGamuts: 00000000 158 | targetPixelDensity: 30 159 | resolutionScalingMode: 0 160 | androidSupportedAspectRatio: 1 161 | androidMaxAspectRatio: 2.1 162 | applicationIdentifier: {} 163 | buildNumber: {} 164 | AndroidBundleVersionCode: 1 165 | AndroidMinSdkVersion: 16 166 | AndroidTargetSdkVersion: 0 167 | AndroidPreferredInstallLocation: 1 168 | aotOptions: 169 | stripEngineCode: 1 170 | iPhoneStrippingLevel: 0 171 | iPhoneScriptCallOptimization: 0 172 | ForceInternetPermission: 0 173 | ForceSDCardPermission: 0 174 | CreateWallpaper: 0 175 | APKExpansionFiles: 0 176 | keepLoadedShadersAlive: 0 177 | StripUnusedMeshComponents: 1 178 | VertexChannelCompressionMask: 4054 179 | iPhoneSdkVersion: 988 180 | iOSTargetOSVersionString: 9.0 181 | tvOSSdkVersion: 0 182 | tvOSRequireExtendedGameController: 0 183 | tvOSTargetOSVersionString: 9.0 184 | uIPrerenderedIcon: 0 185 | uIRequiresPersistentWiFi: 0 186 | uIRequiresFullScreen: 1 187 | uIStatusBarHidden: 1 188 | uIExitOnSuspend: 0 189 | uIStatusBarStyle: 0 190 | iPhoneSplashScreen: {fileID: 0} 191 | iPhoneHighResSplashScreen: {fileID: 0} 192 | iPhoneTallHighResSplashScreen: {fileID: 0} 193 | iPhone47inSplashScreen: {fileID: 0} 194 | iPhone55inPortraitSplashScreen: {fileID: 0} 195 | iPhone55inLandscapeSplashScreen: {fileID: 0} 196 | iPhone58inPortraitSplashScreen: {fileID: 0} 197 | iPhone58inLandscapeSplashScreen: {fileID: 0} 198 | iPadPortraitSplashScreen: {fileID: 0} 199 | iPadHighResPortraitSplashScreen: {fileID: 0} 200 | iPadLandscapeSplashScreen: {fileID: 0} 201 | iPadHighResLandscapeSplashScreen: {fileID: 0} 202 | iPhone65inPortraitSplashScreen: {fileID: 0} 203 | iPhone65inLandscapeSplashScreen: {fileID: 0} 204 | iPhone61inPortraitSplashScreen: {fileID: 0} 205 | iPhone61inLandscapeSplashScreen: {fileID: 0} 206 | appleTVSplashScreen: {fileID: 0} 207 | appleTVSplashScreen2x: {fileID: 0} 208 | tvOSSmallIconLayers: [] 209 | tvOSSmallIconLayers2x: [] 210 | tvOSLargeIconLayers: [] 211 | tvOSLargeIconLayers2x: [] 212 | tvOSTopShelfImageLayers: [] 213 | tvOSTopShelfImageLayers2x: [] 214 | tvOSTopShelfImageWideLayers: [] 215 | tvOSTopShelfImageWideLayers2x: [] 216 | iOSLaunchScreenType: 0 217 | iOSLaunchScreenPortrait: {fileID: 0} 218 | iOSLaunchScreenLandscape: {fileID: 0} 219 | iOSLaunchScreenBackgroundColor: 220 | serializedVersion: 2 221 | rgba: 0 222 | iOSLaunchScreenFillPct: 100 223 | iOSLaunchScreenSize: 100 224 | iOSLaunchScreenCustomXibPath: 225 | iOSLaunchScreeniPadType: 0 226 | iOSLaunchScreeniPadImage: {fileID: 0} 227 | iOSLaunchScreeniPadBackgroundColor: 228 | serializedVersion: 2 229 | rgba: 0 230 | iOSLaunchScreeniPadFillPct: 100 231 | iOSLaunchScreeniPadSize: 100 232 | iOSLaunchScreeniPadCustomXibPath: 233 | iOSUseLaunchScreenStoryboard: 0 234 | iOSLaunchScreenCustomStoryboardPath: 235 | iOSDeviceRequirements: [] 236 | iOSURLSchemes: [] 237 | iOSBackgroundModes: 0 238 | iOSMetalForceHardShadows: 0 239 | metalEditorSupport: 1 240 | metalAPIValidation: 1 241 | iOSRenderExtraFrameOnPause: 0 242 | appleDeveloperTeamID: 243 | iOSManualSigningProvisioningProfileID: 244 | tvOSManualSigningProvisioningProfileID: 245 | iOSManualSigningProvisioningProfileType: 0 246 | tvOSManualSigningProvisioningProfileType: 0 247 | appleEnableAutomaticSigning: 0 248 | iOSRequireARKit: 0 249 | iOSAutomaticallyDetectAndAddCapabilities: 1 250 | appleEnableProMotion: 0 251 | clonedFromGUID: c0afd0d1d80e3634a9dac47e8a0426ea 252 | templatePackageId: com.unity.template.3d@2.3.3 253 | templateDefaultScene: Assets/Scenes/SampleScene.unity 254 | AndroidTargetArchitectures: 1 255 | AndroidSplashScreenScale: 0 256 | androidSplashScreen: {fileID: 0} 257 | AndroidKeystoreName: '{inproject}: ' 258 | AndroidKeyaliasName: 259 | AndroidBuildApkPerCpuArchitecture: 0 260 | AndroidTVCompatibility: 0 261 | AndroidIsGame: 1 262 | AndroidEnableTango: 0 263 | androidEnableBanner: 1 264 | androidUseLowAccuracyLocation: 0 265 | androidUseCustomKeystore: 0 266 | m_AndroidBanners: 267 | - width: 320 268 | height: 180 269 | banner: {fileID: 0} 270 | androidGamepadSupportLevel: 0 271 | resolutionDialogBanner: {fileID: 0} 272 | m_BuildTargetIcons: [] 273 | m_BuildTargetPlatformIcons: [] 274 | m_BuildTargetBatching: 275 | - m_BuildTarget: Standalone 276 | m_StaticBatching: 1 277 | m_DynamicBatching: 0 278 | - m_BuildTarget: tvOS 279 | m_StaticBatching: 1 280 | m_DynamicBatching: 0 281 | - m_BuildTarget: Android 282 | m_StaticBatching: 1 283 | m_DynamicBatching: 0 284 | - m_BuildTarget: iPhone 285 | m_StaticBatching: 1 286 | m_DynamicBatching: 0 287 | - m_BuildTarget: WebGL 288 | m_StaticBatching: 0 289 | m_DynamicBatching: 0 290 | m_BuildTargetGraphicsAPIs: 291 | - m_BuildTarget: AndroidPlayer 292 | m_APIs: 150000000b000000 293 | m_Automatic: 0 294 | - m_BuildTarget: iOSSupport 295 | m_APIs: 10000000 296 | m_Automatic: 1 297 | - m_BuildTarget: AppleTVSupport 298 | m_APIs: 10000000 299 | m_Automatic: 0 300 | - m_BuildTarget: WebGLSupport 301 | m_APIs: 0b000000 302 | m_Automatic: 1 303 | m_BuildTargetVRSettings: 304 | - m_BuildTarget: Standalone 305 | m_Enabled: 0 306 | m_Devices: 307 | - Oculus 308 | - OpenVR 309 | m_BuildTargetEnableVuforiaSettings: [] 310 | openGLRequireES31: 0 311 | openGLRequireES31AEP: 0 312 | openGLRequireES32: 0 313 | m_TemplateCustomTags: {} 314 | mobileMTRendering: 315 | Android: 1 316 | iPhone: 1 317 | tvOS: 1 318 | m_BuildTargetGroupLightmapEncodingQuality: [] 319 | m_BuildTargetGroupLightmapSettings: [] 320 | playModeTestRunnerEnabled: 0 321 | runPlayModeTestAsEditModeTest: 0 322 | actionOnDotNetUnhandledException: 1 323 | enableInternalProfiler: 0 324 | logObjCUncaughtExceptions: 1 325 | enableCrashReportAPI: 0 326 | cameraUsageDescription: 327 | locationUsageDescription: 328 | microphoneUsageDescription: 329 | switchNetLibKey: 330 | switchSocketMemoryPoolSize: 6144 331 | switchSocketAllocatorPoolSize: 128 332 | switchSocketConcurrencyLimit: 14 333 | switchScreenResolutionBehavior: 2 334 | switchUseCPUProfiler: 0 335 | switchApplicationID: 0x01004b9000490000 336 | switchNSODependencies: 337 | switchTitleNames_0: 338 | switchTitleNames_1: 339 | switchTitleNames_2: 340 | switchTitleNames_3: 341 | switchTitleNames_4: 342 | switchTitleNames_5: 343 | switchTitleNames_6: 344 | switchTitleNames_7: 345 | switchTitleNames_8: 346 | switchTitleNames_9: 347 | switchTitleNames_10: 348 | switchTitleNames_11: 349 | switchTitleNames_12: 350 | switchTitleNames_13: 351 | switchTitleNames_14: 352 | switchPublisherNames_0: 353 | switchPublisherNames_1: 354 | switchPublisherNames_2: 355 | switchPublisherNames_3: 356 | switchPublisherNames_4: 357 | switchPublisherNames_5: 358 | switchPublisherNames_6: 359 | switchPublisherNames_7: 360 | switchPublisherNames_8: 361 | switchPublisherNames_9: 362 | switchPublisherNames_10: 363 | switchPublisherNames_11: 364 | switchPublisherNames_12: 365 | switchPublisherNames_13: 366 | switchPublisherNames_14: 367 | switchIcons_0: {fileID: 0} 368 | switchIcons_1: {fileID: 0} 369 | switchIcons_2: {fileID: 0} 370 | switchIcons_3: {fileID: 0} 371 | switchIcons_4: {fileID: 0} 372 | switchIcons_5: {fileID: 0} 373 | switchIcons_6: {fileID: 0} 374 | switchIcons_7: {fileID: 0} 375 | switchIcons_8: {fileID: 0} 376 | switchIcons_9: {fileID: 0} 377 | switchIcons_10: {fileID: 0} 378 | switchIcons_11: {fileID: 0} 379 | switchIcons_12: {fileID: 0} 380 | switchIcons_13: {fileID: 0} 381 | switchIcons_14: {fileID: 0} 382 | switchSmallIcons_0: {fileID: 0} 383 | switchSmallIcons_1: {fileID: 0} 384 | switchSmallIcons_2: {fileID: 0} 385 | switchSmallIcons_3: {fileID: 0} 386 | switchSmallIcons_4: {fileID: 0} 387 | switchSmallIcons_5: {fileID: 0} 388 | switchSmallIcons_6: {fileID: 0} 389 | switchSmallIcons_7: {fileID: 0} 390 | switchSmallIcons_8: {fileID: 0} 391 | switchSmallIcons_9: {fileID: 0} 392 | switchSmallIcons_10: {fileID: 0} 393 | switchSmallIcons_11: {fileID: 0} 394 | switchSmallIcons_12: {fileID: 0} 395 | switchSmallIcons_13: {fileID: 0} 396 | switchSmallIcons_14: {fileID: 0} 397 | switchManualHTML: 398 | switchAccessibleURLs: 399 | switchLegalInformation: 400 | switchMainThreadStackSize: 1048576 401 | switchPresenceGroupId: 402 | switchLogoHandling: 0 403 | switchReleaseVersion: 0 404 | switchDisplayVersion: 1.0.0 405 | switchStartupUserAccount: 0 406 | switchTouchScreenUsage: 0 407 | switchSupportedLanguagesMask: 0 408 | switchLogoType: 0 409 | switchApplicationErrorCodeCategory: 410 | switchUserAccountSaveDataSize: 0 411 | switchUserAccountSaveDataJournalSize: 0 412 | switchApplicationAttribute: 0 413 | switchCardSpecSize: -1 414 | switchCardSpecClock: -1 415 | switchRatingsMask: 0 416 | switchRatingsInt_0: 0 417 | switchRatingsInt_1: 0 418 | switchRatingsInt_2: 0 419 | switchRatingsInt_3: 0 420 | switchRatingsInt_4: 0 421 | switchRatingsInt_5: 0 422 | switchRatingsInt_6: 0 423 | switchRatingsInt_7: 0 424 | switchRatingsInt_8: 0 425 | switchRatingsInt_9: 0 426 | switchRatingsInt_10: 0 427 | switchRatingsInt_11: 0 428 | switchLocalCommunicationIds_0: 429 | switchLocalCommunicationIds_1: 430 | switchLocalCommunicationIds_2: 431 | switchLocalCommunicationIds_3: 432 | switchLocalCommunicationIds_4: 433 | switchLocalCommunicationIds_5: 434 | switchLocalCommunicationIds_6: 435 | switchLocalCommunicationIds_7: 436 | switchParentalControl: 0 437 | switchAllowsScreenshot: 1 438 | switchAllowsVideoCapturing: 1 439 | switchAllowsRuntimeAddOnContentInstall: 0 440 | switchDataLossConfirmation: 0 441 | switchUserAccountLockEnabled: 0 442 | switchSystemResourceMemory: 16777216 443 | switchSupportedNpadStyles: 3 444 | switchNativeFsCacheSize: 32 445 | switchIsHoldTypeHorizontal: 0 446 | switchSupportedNpadCount: 8 447 | switchSocketConfigEnabled: 0 448 | switchTcpInitialSendBufferSize: 32 449 | switchTcpInitialReceiveBufferSize: 64 450 | switchTcpAutoSendBufferSizeMax: 256 451 | switchTcpAutoReceiveBufferSizeMax: 256 452 | switchUdpSendBufferSize: 9 453 | switchUdpReceiveBufferSize: 42 454 | switchSocketBufferEfficiency: 4 455 | switchSocketInitializeEnabled: 1 456 | switchNetworkInterfaceManagerInitializeEnabled: 1 457 | switchPlayerConnectionEnabled: 1 458 | ps4NPAgeRating: 12 459 | ps4NPTitleSecret: 460 | ps4NPTrophyPackPath: 461 | ps4ParentalLevel: 11 462 | ps4ContentID: ED1633-NPXX51362_00-0000000000000000 463 | ps4Category: 0 464 | ps4MasterVersion: 01.00 465 | ps4AppVersion: 01.00 466 | ps4AppType: 0 467 | ps4ParamSfxPath: 468 | ps4VideoOutPixelFormat: 0 469 | ps4VideoOutInitialWidth: 1920 470 | ps4VideoOutBaseModeInitialWidth: 1920 471 | ps4VideoOutReprojectionRate: 60 472 | ps4PronunciationXMLPath: 473 | ps4PronunciationSIGPath: 474 | ps4BackgroundImagePath: 475 | ps4StartupImagePath: 476 | ps4StartupImagesFolder: 477 | ps4IconImagesFolder: 478 | ps4SaveDataImagePath: 479 | ps4SdkOverride: 480 | ps4BGMPath: 481 | ps4ShareFilePath: 482 | ps4ShareOverlayImagePath: 483 | ps4PrivacyGuardImagePath: 484 | ps4NPtitleDatPath: 485 | ps4RemotePlayKeyAssignment: -1 486 | ps4RemotePlayKeyMappingDir: 487 | ps4PlayTogetherPlayerCount: 0 488 | ps4EnterButtonAssignment: 1 489 | ps4ApplicationParam1: 0 490 | ps4ApplicationParam2: 0 491 | ps4ApplicationParam3: 0 492 | ps4ApplicationParam4: 0 493 | ps4DownloadDataSize: 0 494 | ps4GarlicHeapSize: 2048 495 | ps4ProGarlicHeapSize: 2560 496 | playerPrefsMaxSize: 32768 497 | ps4Passcode: frAQBc8Wsa1xVPfvJcrgRYwTiizs2trQ 498 | ps4pnSessions: 1 499 | ps4pnPresence: 1 500 | ps4pnFriends: 1 501 | ps4pnGameCustomData: 1 502 | playerPrefsSupport: 0 503 | enableApplicationExit: 0 504 | resetTempFolder: 1 505 | restrictedAudioUsageRights: 0 506 | ps4UseResolutionFallback: 0 507 | ps4ReprojectionSupport: 0 508 | ps4UseAudio3dBackend: 0 509 | ps4SocialScreenEnabled: 0 510 | ps4ScriptOptimizationLevel: 0 511 | ps4Audio3dVirtualSpeakerCount: 14 512 | ps4attribCpuUsage: 0 513 | ps4PatchPkgPath: 514 | ps4PatchLatestPkgPath: 515 | ps4PatchChangeinfoPath: 516 | ps4PatchDayOne: 0 517 | ps4attribUserManagement: 0 518 | ps4attribMoveSupport: 0 519 | ps4attrib3DSupport: 0 520 | ps4attribShareSupport: 0 521 | ps4attribExclusiveVR: 0 522 | ps4disableAutoHideSplash: 0 523 | ps4videoRecordingFeaturesUsed: 0 524 | ps4contentSearchFeaturesUsed: 0 525 | ps4attribEyeToEyeDistanceSettingVR: 0 526 | ps4IncludedModules: [] 527 | monoEnv: 528 | splashScreenBackgroundSourceLandscape: {fileID: 0} 529 | splashScreenBackgroundSourcePortrait: {fileID: 0} 530 | spritePackerPolicy: 531 | webGLMemorySize: 16 532 | webGLExceptionSupport: 1 533 | webGLNameFilesAsHashes: 0 534 | webGLDataCaching: 1 535 | webGLDebugSymbols: 0 536 | webGLEmscriptenArgs: 537 | webGLModulesDirectory: 538 | webGLTemplate: APPLICATION:Default 539 | webGLAnalyzeBuildSize: 0 540 | webGLUseEmbeddedResources: 0 541 | webGLCompressionFormat: 1 542 | webGLLinkerTarget: 1 543 | webGLThreadsSupport: 0 544 | webGLWasmStreaming: 0 545 | scriptingDefineSymbols: {} 546 | platformArchitecture: {} 547 | scriptingBackend: {} 548 | il2cppCompilerConfiguration: {} 549 | managedStrippingLevel: {} 550 | incrementalIl2cppBuild: {} 551 | allowUnsafeCode: 1 552 | additionalIl2CppArgs: 553 | scriptingRuntimeVersion: 1 554 | gcIncremental: 0 555 | gcWBarrierValidation: 0 556 | apiCompatibilityLevelPerPlatform: 557 | Standalone: 3 558 | m_RenderingPath: 1 559 | m_MobileRenderingPath: 1 560 | metroPackageName: Template_3D 561 | metroPackageVersion: 562 | metroCertificatePath: 563 | metroCertificatePassword: 564 | metroCertificateSubject: 565 | metroCertificateIssuer: 566 | metroCertificateNotAfter: 0000000000000000 567 | metroApplicationDescription: Template_3D 568 | wsaImages: {} 569 | metroTileShortName: 570 | metroTileShowName: 0 571 | metroMediumTileShowName: 0 572 | metroLargeTileShowName: 0 573 | metroWideTileShowName: 0 574 | metroSupportStreamingInstall: 0 575 | metroLastRequiredScene: 0 576 | metroDefaultTileSize: 1 577 | metroTileForegroundText: 2 578 | metroTileBackgroundColor: {r: 0.13333334, g: 0.17254902, b: 0.21568628, a: 0} 579 | metroSplashScreenBackgroundColor: {r: 0.12941177, g: 0.17254902, b: 0.21568628, 580 | a: 1} 581 | metroSplashScreenUseBackgroundColor: 0 582 | platformCapabilities: {} 583 | metroTargetDeviceFamilies: {} 584 | metroFTAName: 585 | metroFTAFileTypes: [] 586 | metroProtocolName: 587 | XboxOneProductId: 588 | XboxOneUpdateKey: 589 | XboxOneSandboxId: 590 | XboxOneContentId: 591 | XboxOneTitleId: 592 | XboxOneSCId: 593 | XboxOneGameOsOverridePath: 594 | XboxOnePackagingOverridePath: 595 | XboxOneAppManifestOverridePath: 596 | XboxOneVersion: 1.0.0.0 597 | XboxOnePackageEncryption: 0 598 | XboxOnePackageUpdateGranularity: 2 599 | XboxOneDescription: 600 | XboxOneLanguage: 601 | - enus 602 | XboxOneCapability: [] 603 | XboxOneGameRating: {} 604 | XboxOneIsContentPackage: 0 605 | XboxOneEnableGPUVariability: 1 606 | XboxOneSockets: {} 607 | XboxOneSplashScreen: {fileID: 0} 608 | XboxOneAllowedProductIds: [] 609 | XboxOnePersistentLocalStorageSize: 0 610 | XboxOneXTitleMemory: 8 611 | xboxOneScriptCompiler: 1 612 | XboxOneOverrideIdentityName: 613 | vrEditorSettings: 614 | daydream: 615 | daydreamIconForeground: {fileID: 0} 616 | daydreamIconBackground: {fileID: 0} 617 | cloudServicesEnabled: 618 | UNet: 1 619 | luminIcon: 620 | m_Name: 621 | m_ModelFolderPath: 622 | m_PortalFolderPath: 623 | luminCert: 624 | m_CertPath: 625 | m_SignPackage: 1 626 | luminIsChannelApp: 0 627 | luminVersion: 628 | m_VersionCode: 1 629 | m_VersionName: 630 | facebookSdkVersion: 7.9.4 631 | facebookAppId: 632 | facebookCookies: 1 633 | facebookLogging: 1 634 | facebookStatus: 1 635 | facebookXfbml: 0 636 | facebookFrictionlessRequests: 1 637 | apiCompatibilityLevel: 6 638 | cloudProjectId: 639 | framebufferDepthMemorylessMode: 0 640 | projectName: 641 | organizationId: 642 | cloudEnabled: 0 643 | enableNativePlatformBackendsForNewInputSystem: 0 644 | disableOldInputManagerSupport: 0 645 | legacyClampBlendShapeWeights: 0 646 | -------------------------------------------------------------------------------- /unity/ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.1.11f1 2 | m_EditorVersionWithRevision: 2019.1.11f1 (9b001d489a54) 3 | -------------------------------------------------------------------------------- /unity/ProjectSettings/QualitySettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!47 &1 4 | QualitySettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 5 7 | m_CurrentQuality: 5 8 | m_QualitySettings: 9 | - serializedVersion: 2 10 | name: Very Low 11 | pixelLightCount: 0 12 | shadows: 0 13 | shadowResolution: 0 14 | shadowProjection: 1 15 | shadowCascades: 1 16 | shadowDistance: 15 17 | shadowNearPlaneOffset: 3 18 | shadowCascade2Split: 0.33333334 19 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 20 | shadowmaskMode: 0 21 | blendWeights: 1 22 | textureQuality: 1 23 | anisotropicTextures: 0 24 | antiAliasing: 0 25 | softParticles: 0 26 | softVegetation: 0 27 | realtimeReflectionProbes: 0 28 | billboardsFaceCameraPosition: 0 29 | vSyncCount: 0 30 | lodBias: 0.3 31 | maximumLODLevel: 0 32 | streamingMipmapsActive: 0 33 | streamingMipmapsAddAllCameras: 1 34 | streamingMipmapsMemoryBudget: 512 35 | streamingMipmapsRenderersPerFrame: 512 36 | streamingMipmapsMaxLevelReduction: 2 37 | streamingMipmapsMaxFileIORequests: 1024 38 | particleRaycastBudget: 4 39 | asyncUploadTimeSlice: 2 40 | asyncUploadBufferSize: 16 41 | asyncUploadPersistentBuffer: 1 42 | resolutionScalingFixedDPIFactor: 1 43 | excludedTargetPlatforms: [] 44 | - serializedVersion: 2 45 | name: Low 46 | pixelLightCount: 0 47 | shadows: 0 48 | shadowResolution: 0 49 | shadowProjection: 1 50 | shadowCascades: 1 51 | shadowDistance: 20 52 | shadowNearPlaneOffset: 3 53 | shadowCascade2Split: 0.33333334 54 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 55 | shadowmaskMode: 0 56 | blendWeights: 2 57 | textureQuality: 0 58 | anisotropicTextures: 0 59 | antiAliasing: 0 60 | softParticles: 0 61 | softVegetation: 0 62 | realtimeReflectionProbes: 0 63 | billboardsFaceCameraPosition: 0 64 | vSyncCount: 0 65 | lodBias: 0.4 66 | maximumLODLevel: 0 67 | streamingMipmapsActive: 0 68 | streamingMipmapsAddAllCameras: 1 69 | streamingMipmapsMemoryBudget: 512 70 | streamingMipmapsRenderersPerFrame: 512 71 | streamingMipmapsMaxLevelReduction: 2 72 | streamingMipmapsMaxFileIORequests: 1024 73 | particleRaycastBudget: 16 74 | asyncUploadTimeSlice: 2 75 | asyncUploadBufferSize: 16 76 | asyncUploadPersistentBuffer: 1 77 | resolutionScalingFixedDPIFactor: 1 78 | excludedTargetPlatforms: [] 79 | - serializedVersion: 2 80 | name: Medium 81 | pixelLightCount: 1 82 | shadows: 1 83 | shadowResolution: 0 84 | shadowProjection: 1 85 | shadowCascades: 1 86 | shadowDistance: 20 87 | shadowNearPlaneOffset: 3 88 | shadowCascade2Split: 0.33333334 89 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 90 | shadowmaskMode: 0 91 | blendWeights: 2 92 | textureQuality: 0 93 | anisotropicTextures: 1 94 | antiAliasing: 0 95 | softParticles: 0 96 | softVegetation: 0 97 | realtimeReflectionProbes: 0 98 | billboardsFaceCameraPosition: 0 99 | vSyncCount: 1 100 | lodBias: 0.7 101 | maximumLODLevel: 0 102 | streamingMipmapsActive: 0 103 | streamingMipmapsAddAllCameras: 1 104 | streamingMipmapsMemoryBudget: 512 105 | streamingMipmapsRenderersPerFrame: 512 106 | streamingMipmapsMaxLevelReduction: 2 107 | streamingMipmapsMaxFileIORequests: 1024 108 | particleRaycastBudget: 64 109 | asyncUploadTimeSlice: 2 110 | asyncUploadBufferSize: 16 111 | asyncUploadPersistentBuffer: 1 112 | resolutionScalingFixedDPIFactor: 1 113 | excludedTargetPlatforms: [] 114 | - serializedVersion: 2 115 | name: High 116 | pixelLightCount: 2 117 | shadows: 2 118 | shadowResolution: 1 119 | shadowProjection: 1 120 | shadowCascades: 2 121 | shadowDistance: 40 122 | shadowNearPlaneOffset: 3 123 | shadowCascade2Split: 0.33333334 124 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 125 | shadowmaskMode: 1 126 | blendWeights: 2 127 | textureQuality: 0 128 | anisotropicTextures: 1 129 | antiAliasing: 0 130 | softParticles: 0 131 | softVegetation: 1 132 | realtimeReflectionProbes: 1 133 | billboardsFaceCameraPosition: 1 134 | vSyncCount: 1 135 | lodBias: 1 136 | maximumLODLevel: 0 137 | streamingMipmapsActive: 0 138 | streamingMipmapsAddAllCameras: 1 139 | streamingMipmapsMemoryBudget: 512 140 | streamingMipmapsRenderersPerFrame: 512 141 | streamingMipmapsMaxLevelReduction: 2 142 | streamingMipmapsMaxFileIORequests: 1024 143 | particleRaycastBudget: 256 144 | asyncUploadTimeSlice: 2 145 | asyncUploadBufferSize: 16 146 | asyncUploadPersistentBuffer: 1 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Very High 151 | pixelLightCount: 3 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 2 156 | shadowDistance: 70 157 | shadowNearPlaneOffset: 3 158 | shadowCascade2Split: 0.33333334 159 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 160 | shadowmaskMode: 1 161 | blendWeights: 4 162 | textureQuality: 0 163 | anisotropicTextures: 2 164 | antiAliasing: 2 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 1.5 171 | maximumLODLevel: 0 172 | streamingMipmapsActive: 0 173 | streamingMipmapsAddAllCameras: 1 174 | streamingMipmapsMemoryBudget: 512 175 | streamingMipmapsRenderersPerFrame: 512 176 | streamingMipmapsMaxLevelReduction: 2 177 | streamingMipmapsMaxFileIORequests: 1024 178 | particleRaycastBudget: 1024 179 | asyncUploadTimeSlice: 2 180 | asyncUploadBufferSize: 16 181 | asyncUploadPersistentBuffer: 1 182 | resolutionScalingFixedDPIFactor: 1 183 | excludedTargetPlatforms: [] 184 | - serializedVersion: 2 185 | name: Ultra 186 | pixelLightCount: 4 187 | shadows: 2 188 | shadowResolution: 2 189 | shadowProjection: 1 190 | shadowCascades: 4 191 | shadowDistance: 150 192 | shadowNearPlaneOffset: 3 193 | shadowCascade2Split: 0.33333334 194 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 195 | shadowmaskMode: 1 196 | blendWeights: 4 197 | textureQuality: 0 198 | anisotropicTextures: 2 199 | antiAliasing: 2 200 | softParticles: 1 201 | softVegetation: 1 202 | realtimeReflectionProbes: 1 203 | billboardsFaceCameraPosition: 1 204 | vSyncCount: 1 205 | lodBias: 2 206 | maximumLODLevel: 0 207 | streamingMipmapsActive: 0 208 | streamingMipmapsAddAllCameras: 1 209 | streamingMipmapsMemoryBudget: 512 210 | streamingMipmapsRenderersPerFrame: 512 211 | streamingMipmapsMaxLevelReduction: 2 212 | streamingMipmapsMaxFileIORequests: 1024 213 | particleRaycastBudget: 4096 214 | asyncUploadTimeSlice: 2 215 | asyncUploadBufferSize: 16 216 | asyncUploadPersistentBuffer: 1 217 | resolutionScalingFixedDPIFactor: 1 218 | excludedTargetPlatforms: [] 219 | m_PerPlatformDefaultQuality: 220 | Android: 2 221 | Lumin: 5 222 | Nintendo 3DS: 5 223 | Nintendo Switch: 5 224 | PS4: 5 225 | PSP2: 2 226 | Standalone: 5 227 | WebGL: 3 228 | Windows Store Apps: 5 229 | XboxOne: 5 230 | iPhone: 2 231 | tvOS: 2 232 | -------------------------------------------------------------------------------- /unity/ProjectSettings/TagManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!78 &1 4 | TagManager: 5 | serializedVersion: 2 6 | tags: [] 7 | layers: 8 | - Default 9 | - TransparentFX 10 | - Ignore Raycast 11 | - 12 | - Water 13 | - UI 14 | - 15 | - 16 | - 17 | - 18 | - 19 | - 20 | - 21 | - 22 | - 23 | - 24 | - 25 | - 26 | - 27 | - 28 | - 29 | - 30 | - 31 | - 32 | - 33 | - 34 | - 35 | - 36 | - 37 | - 38 | - 39 | - 40 | m_SortingLayers: 41 | - name: Default 42 | uniqueID: 0 43 | locked: 0 44 | -------------------------------------------------------------------------------- /unity/ProjectSettings/TimeManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!5 &1 4 | TimeManager: 5 | m_ObjectHideFlags: 0 6 | Fixed Timestep: 0.02 7 | Maximum Allowed Timestep: 0.33333334 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /unity/ProjectSettings/UnityConnectSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!310 &1 4 | UnityConnectSettings: 5 | m_ObjectHideFlags: 0 6 | serializedVersion: 1 7 | m_Enabled: 1 8 | m_TestMode: 0 9 | m_EventOldUrl: https://api.uca.cloud.unity3d.com/v1/events 10 | m_EventUrl: https://cdp.cloud.unity3d.com/v1/events 11 | m_ConfigUrl: https://config.uca.cloud.unity3d.com 12 | m_TestInitMode: 0 13 | CrashReportingSettings: 14 | m_EventUrl: https://perf-events.cloud.unity3d.com 15 | m_Enabled: 0 16 | m_LogBufferSize: 10 17 | m_CaptureEditorExceptions: 1 18 | UnityPurchasingSettings: 19 | m_Enabled: 0 20 | m_TestMode: 0 21 | UnityAnalyticsSettings: 22 | m_Enabled: 0 23 | m_TestMode: 0 24 | m_InitializeOnStartup: 1 25 | UnityAdsSettings: 26 | m_Enabled: 0 27 | m_InitializeOnStartup: 1 28 | m_TestMode: 0 29 | m_IosGameId: 30 | m_AndroidGameId: 31 | m_GameIds: {} 32 | m_GameId: 33 | PerformanceReportingSettings: 34 | m_Enabled: 0 35 | -------------------------------------------------------------------------------- /unity/ProjectSettings/VFXManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!937362698 &1 4 | VFXManager: 5 | m_ObjectHideFlags: 0 6 | m_IndirectShader: {fileID: 0} 7 | m_CopyBufferShader: {fileID: 0} 8 | m_SortShader: {fileID: 0} 9 | m_RenderPipeSettingsPath: 10 | m_FixedTimeStep: 0.016666668 11 | m_MaxDeltaTime: 0.05 12 | -------------------------------------------------------------------------------- /unity/ProjectSettings/XRSettings.asset: -------------------------------------------------------------------------------- 1 | { 2 | "m_SettingKeys": [ 3 | "VR Device Disabled", 4 | "VR Device User Alert" 5 | ], 6 | "m_SettingValues": [ 7 | "False", 8 | "False" 9 | ] 10 | } --------------------------------------------------------------------------------