├── .gitignore ├── Assets ├── AzureKinect4Unity.meta ├── AzureKinect4Unity │ ├── Examples.meta │ ├── Examples │ │ ├── AzureKineceExamples.unity │ │ ├── AzureKineceExamples.unity.meta │ │ ├── Domain.meta │ │ ├── Domain │ │ │ ├── AzureKinectFloorDetector.cs │ │ │ ├── AzureKinectFloorDetector.cs.meta │ │ │ ├── AzureKinectOrientationEstimation.cs │ │ │ ├── AzureKinectOrientationEstimation.cs.meta │ │ │ ├── AzureKinectPointCloudVisualizer.cs │ │ │ ├── AzureKinectPointCloudVisualizer.cs.meta │ │ │ ├── AzureKinectSimpleVisualizer.cs │ │ │ └── AzureKinectSimpleVisualizer.cs.meta │ │ ├── Presentation.meta │ │ ├── Presentation │ │ │ ├── Presenter.meta │ │ │ ├── Presenter │ │ │ │ ├── DeviceManagerPresenter.cs │ │ │ │ ├── DeviceManagerPresenter.cs.meta │ │ │ │ ├── FloorDetectorPresenter.cs │ │ │ │ ├── FloorDetectorPresenter.cs.meta │ │ │ │ ├── OrientationEstimationPresenter.cs │ │ │ │ └── OrientationEstimationPresenter.cs.meta │ │ │ ├── View.meta │ │ │ └── View │ │ │ │ ├── DeviceManagerView.cs │ │ │ │ └── DeviceManagerView.cs.meta │ │ ├── ResourceFiles.meta │ │ ├── ResourceFiles │ │ │ ├── UnlitTexture.mat │ │ │ └── UnlitTexture.mat.meta │ │ ├── _old.meta │ │ └── _old │ │ │ ├── AzureKinectPointCloudVisualizer.unity │ │ │ ├── AzureKinectPointCloudVisualizer.unity.meta │ │ │ ├── AzureKinectSimpleVisualizer.unity │ │ │ └── AzureKinectSimpleVisualizer.unity.meta │ ├── Images.meta │ ├── Images │ │ ├── AzureKinect4Unity_DLL.png │ │ ├── AzureKinect4Unity_DLL.png.meta │ │ ├── AzureKinect4Unity_ImportPackage.png │ │ ├── AzureKinect4Unity_ImportPackage.png.meta │ │ ├── AzureKinect4Unity_NuGet.png │ │ ├── AzureKinect4Unity_NuGet.png.meta │ │ ├── AzureKinect4Unity_OrientationEstimator.jpg │ │ ├── AzureKinect4Unity_OrientationEstimator.jpg.meta │ │ ├── AzureKinect4Unity_SimpleVisualizer.png │ │ └── AzureKinect4Unity_SimpleVisualizer.png.meta │ ├── LICENSE │ ├── LICENSE.meta │ ├── Materials.meta │ ├── Materials │ │ ├── DepthPointCloud.mat │ │ ├── DepthPointCloud.mat.meta │ │ ├── UnlitTexture.mat │ │ └── UnlitTexture.mat.meta │ ├── README.md │ ├── README.md.meta │ ├── Scripts.meta │ ├── Scripts │ │ ├── AzureKinectManager.cs │ │ ├── AzureKinectManager.cs.meta │ │ ├── AzureKinectSensor.cs │ │ ├── AzureKinectSensor.cs.meta │ │ ├── ButterworthFilter.cs │ │ ├── ButterworthFilter.cs.meta │ │ ├── ExponentialSmoothingLowPassFilter.cs │ │ ├── ExponentialSmoothingLowPassFilter.cs.meta │ │ ├── LowPassFilterInterface.cs │ │ ├── LowPassFilterInterface.cs.meta │ │ ├── OrientationEstimator.cs │ │ ├── OrientationEstimator.cs.meta │ │ ├── PointCloudRenderer.cs │ │ └── PointCloudRenderer.cs.meta │ ├── Shaders.meta │ ├── Shaders │ │ ├── DepthPointCloud.shader │ │ ├── DepthPointCloud.shader.meta │ │ ├── DepthVisualizer.shader │ │ └── DepthVisualizer.shader.meta │ ├── Utilities.meta │ ├── Utilities │ │ ├── Materials.meta │ │ ├── Materials │ │ │ ├── XMaterial.mat │ │ │ ├── XMaterial.mat.meta │ │ │ ├── YMaterial.mat │ │ │ ├── YMaterial.mat.meta │ │ │ ├── ZMaterial.mat │ │ │ └── ZMaterial.mat.meta │ │ ├── Prefabs.meta │ │ ├── Prefabs │ │ │ ├── XYZ-Axis.prefab │ │ │ └── XYZ-Axis.prefab.meta │ │ ├── Scripts.meta │ │ └── Scripts │ │ │ ├── CameraController.cs │ │ │ └── CameraController.cs.meta │ ├── _K4ATransformation.meta │ └── _K4ATransformation │ │ ├── LICENSE │ │ ├── LICENSE.meta │ │ ├── README.md │ │ ├── README.md.meta │ │ ├── src.meta │ │ ├── src │ │ ├── ExtrinsicTransformation.cs │ │ ├── ExtrinsicTransformation.cs.meta │ │ ├── IntrinsicTransformation.cs │ │ ├── IntrinsicTransformation.cs.meta │ │ ├── K4ATypes.cs │ │ ├── K4ATypes.cs.meta │ │ ├── Math.cs │ │ ├── Math.cs.meta │ │ ├── Transformation.cs │ │ └── Transformation.cs.meta │ │ ├── tests.meta │ │ └── tests │ │ ├── MathTest.cs │ │ └── MathTest.cs.meta ├── AzureKinectToolkit.meta ├── AzureKinectToolkit │ ├── Runtime.meta │ └── Runtime │ │ ├── FloorDetection.meta │ │ ├── FloorDetection │ │ ├── FloorDetector.cs │ │ ├── FloorDetector.cs.meta │ │ ├── Plane.cs │ │ ├── Plane.cs.meta │ │ ├── README.md │ │ └── README.md.meta │ │ ├── SensorOrientation.meta │ │ └── SensorOrientation │ │ ├── SensorOrientationEstimator.cs │ │ └── SensorOrientationEstimator.cs.meta ├── Plugins.meta └── Plugins │ ├── AzureKinectSDK.1.4.0.meta │ ├── AzureKinectSDK.1.4.0 │ ├── LICENSE.txt │ ├── LICENSE.txt.meta │ ├── Microsoft.Azure.Kinect.Sensor.dll │ ├── Microsoft.Azure.Kinect.Sensor.dll.meta │ ├── depthengine_2_0.dll │ ├── depthengine_2_0.dll.meta │ ├── k4a.dll │ └── k4a.dll.meta │ ├── System.Buffers.4.4.0.meta │ ├── System.Buffers.4.4.0 │ ├── LICENSE.TXT │ ├── LICENSE.TXT.meta │ ├── System.Buffers.dll │ ├── System.Buffers.dll.meta │ ├── THIRD-PARTY-NOTICES.TXT │ └── THIRD-PARTY-NOTICES.TXT.meta │ ├── System.Memory.4.5.3.meta │ ├── System.Memory.4.5.3 │ ├── LICENSE.TXT │ ├── LICENSE.TXT.meta │ ├── System.Memory.dll │ ├── System.Memory.dll.meta │ ├── THIRD-PARTY-NOTICES.TXT │ └── THIRD-PARTY-NOTICES.TXT.meta │ ├── System.Numerics.Vectors.4.5.0.meta │ ├── System.Numerics.Vectors.4.5.0 │ ├── LICENSE.TXT │ ├── LICENSE.TXT.meta │ ├── System.Numerics.Vectors.dll │ ├── System.Numerics.Vectors.dll.meta │ ├── THIRD-PARTY-NOTICES.TXT │ └── THIRD-PARTY-NOTICES.TXT.meta │ ├── System.Runtime.CompilerServices.Unsafe.4.5.2.meta │ └── System.Runtime.CompilerServices.Unsafe.4.5.2 │ ├── LICENSE.TXT │ ├── LICENSE.TXT.meta │ ├── System.Runtime.CompilerServices.Unsafe.dll │ ├── System.Runtime.CompilerServices.Unsafe.dll.meta │ ├── THIRD-PARTY-NOTICES.TXT │ └── THIRD-PARTY-NOTICES.TXT.meta ├── LICENSE ├── Packages ├── manifest.json └── packages-lock.json ├── ProjectSettings ├── AudioManager.asset ├── ClusterInputManager.asset ├── DynamicsManager.asset ├── EditorBuildSettings.asset ├── EditorSettings.asset ├── GraphicsSettings.asset ├── InputManager.asset ├── NavMeshAreas.asset ├── NetworkManager.asset ├── PackageManagerSettings.asset ├── Physics2DSettings.asset ├── PresetManager.asset ├── ProjectSettings.asset ├── ProjectVersion.txt ├── QualitySettings.asset ├── TagManager.asset ├── TimeManager.asset ├── UnityConnectSettings.asset ├── VFXManager.asset └── XRSettings.asset └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | # ======================================== # 2 | # Initial setting (All assets are ignored) 3 | # ======================================== # 4 | Assets/* 5 | _gitignores/ 6 | 7 | # ======================== # 8 | # Project specific setting 9 | # ======================== # 10 | !Assets/Plugins/ 11 | !Assets/Plugins.meta 12 | Assets/Plugins/* 13 | 14 | # ============================================================== # 15 | # Project specific assets and my own assets (Not ignored assets) 16 | # ============================================================== # 17 | !Assets/AzureKinect4Unity/ 18 | !Assets/AzureKinect4Unity.meta 19 | !Assets/AzureKinectToolkit/ 20 | !Assets/AzureKinectToolkit.meta 21 | 22 | # ======================================= # 23 | # Third party assets (Not ignored assets) 24 | # ======================================= # 25 | !Assets/Plugins/AzureKinectSDK.1.4.0/ 26 | !Assets/Plugins/AzureKinectSDK.1.4.0.meta 27 | 28 | !Assets/Plugins/System.Buffers.4.4.0/ 29 | !Assets/Plugins/System.Buffers.4.4.0.meta 30 | 31 | !Assets/Plugins/System.Memory.4.5.3/ 32 | !Assets/Plugins/System.Memory.4.5.3.meta 33 | 34 | !Assets/Plugins/System.Numerics.Vectors.4.5.0/ 35 | !Assets/Plugins/System.Numerics.Vectors.4.5.0.meta 36 | 37 | !Assets/Plugins/System.Runtime.CompilerServices.Unsafe.4.5.2/ 38 | !Assets/Plugins/System.Runtime.CompilerServices.Unsafe.4.5.2.meta 39 | 40 | # 41 | # This .gitignore file should be placed at the root of your Unity project directory 42 | # 43 | # Get latest from https://github.com/github/gitignore/blob/master/Unity.gitignore 44 | # 45 | /[Aa]pp/ 46 | /[Ll]ibrary/ 47 | /[Tt]emp/ 48 | /[Oo]bj/ 49 | /[Bb]uild/ 50 | /[Bb]uilds/ 51 | /[Ll]ogs/ 52 | /[Uu]ser[Ss]ettings/ 53 | 54 | # MemoryCaptures can get excessive in size. 55 | # They also could contain extremely sensitive data 56 | /[Mm]emoryCaptures/ 57 | 58 | # Uncomment this line if you wish to ignore the asset store tools plugin 59 | # /[Aa]ssets/AssetStoreTools* 60 | 61 | # Autogenerated Jetbrains Rider plugin 62 | /[Aa]ssets/Plugins/Editor/JetBrains* 63 | 64 | # Visual Studio cache directory 65 | .vs/ 66 | .vscode/ 67 | 68 | # Gradle cache directory 69 | .gradle/ 70 | 71 | # Autogenerated VS/MD/Consulo solution and project files 72 | ExportedObj/ 73 | .consulo/ 74 | *.csproj 75 | *.unityproj 76 | *.sln 77 | *.suo 78 | *.tmp 79 | *.user 80 | *.userprefs 81 | *.pidb 82 | *.booproj 83 | *.svd 84 | *.pdb 85 | *.mdb 86 | *.opendb 87 | *.VC.db 88 | 89 | # Unity3D generated meta files 90 | *.pidb.meta 91 | *.pdb.meta 92 | *.mdb.meta 93 | 94 | # Unity3D generated file on crash reports 95 | sysinfo.txt 96 | 97 | # Builds 98 | *.apk 99 | *.unitypackage 100 | 101 | # Crashlytics generated file 102 | crashlytics-build.properties 103 | 104 | # Packed Addressables 105 | /[Aa]ssets/[Aa]ddressable[Aa]ssets[Dd]ata/*/*.bin* 106 | 107 | # Temporary auto-generated Android Assets 108 | /[Aa]ssets/[Ss]treamingAssets/aa.meta 109 | /[Aa]ssets/[Ss]treamingAssets/aa/* -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e6483fe1bd36a5d49899590c6d8e3e49 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b68adf75e2bffdd4995ba4ae7569a961 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/AzureKineceExamples.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 65d3bf1e2f1e42c48a1231da45435527 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Domain.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6965b69d537c51c498d10d7fbad0df09 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Domain/AzureKinectFloorDetector.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using AzureKinectToolkit.FloorDetection; 3 | 4 | namespace AzureKinect4Unity.Examples 5 | { 6 | public class AzureKinectFloorDetector : MonoBehaviour 7 | { 8 | [SerializeField] GameObject _KinectObject; 9 | 10 | [SerializeField] bool _LowPassFilterEnabled = true; 11 | [SerializeField] uint _Order = 3; 12 | [SerializeField] float _CutoffFrequency = 1; // [Hz] 13 | [SerializeField] float _SamplingFrequency = 60; // [Hz] 14 | 15 | AzureKinectSensor _KinectSensor; 16 | FloorDetector _FloorDetector; 17 | 18 | ILowPassFilter _LowPassFilter; 19 | float [] _KinectPos = new float[3]; 20 | float [] _KinectPosOut = new float[3]; 21 | 22 | public bool Initialized => _Initialized; 23 | private bool _Initialized; 24 | 25 | void Awake() 26 | { 27 | _FloorDetector = new FloorDetector(); 28 | } 29 | 30 | void OnDestroy() 31 | { 32 | _FloorDetector.Dispose(); 33 | } 34 | 35 | public void Initialize(AzureKinectSensor kinectSensor) 36 | { 37 | if (!_Initialized) 38 | { 39 | _KinectSensor = kinectSensor; 40 | if (_KinectSensor != null) 41 | { 42 | _LowPassFilter = new ButterworthFilter(_Order, _SamplingFrequency, _CutoffFrequency, (uint)_KinectPos.Length); 43 | _Initialized = true; 44 | } 45 | } 46 | } 47 | 48 | void Update() 49 | { 50 | if (_KinectSensor != null) 51 | { 52 | if (_KinectSensor.PointCloud != null && _KinectSensor.ImuSample != null) 53 | { 54 | int downsampleStep = 2; 55 | int minimumFloorPointCount = 1024 / (downsampleStep * downsampleStep); 56 | if (_FloorDetector.TryDetectFloorPlane(out AzureKinectToolkit.Plane? plane, _KinectSensor.PointCloud, 57 | _KinectSensor.DepthImageWidth, _KinectSensor.DepthImageHeight, downsampleStep, 58 | _KinectSensor.ImuSample, _KinectSensor.DeviceCalibration, minimumFloorPointCount)) 59 | { 60 | Vector3 planeOrigin = new Vector3(plane.Value.Origin.X, plane.Value.Origin.Y, plane.Value.Origin.Z); 61 | Vector3 planeNormal = Vector3.Normalize(new Vector3(plane.Value.Normal.X, plane.Value.Normal.Y, plane.Value.Normal.Z)); 62 | 63 | // Vector3 forwardDirection = planeOrigin - Vector3.Dot(planeOrigin, planeNormal) * planeNormal; 64 | // float forwardDistance = forwardDirection.magnitude; 65 | 66 | float height = Vector3.Dot(planeOrigin, planeNormal); 67 | 68 | // Vector3 kinectPos = new Vector3(0, -height, -forwardDistance); 69 | Vector3 kinectPos = new Vector3(0, -height, 0); 70 | if (_LowPassFilterEnabled) 71 | { 72 | _KinectPos[0] = kinectPos.x; 73 | _KinectPos[1] = kinectPos.y; 74 | _KinectPos[2] = kinectPos.z; 75 | _LowPassFilter.Apply(_KinectPos, ref _KinectPosOut); 76 | kinectPos.x = _KinectPosOut[0]; 77 | kinectPos.y = _KinectPosOut[1]; 78 | kinectPos.z = _KinectPosOut[2]; 79 | } 80 | 81 | _KinectObject.transform.position = kinectPos; 82 | } 83 | } 84 | } 85 | } 86 | } 87 | } -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Domain/AzureKinectFloorDetector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b0713354defa19c459e9e6003b65bd42 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Domain/AzureKinectOrientationEstimation.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | using Microsoft.Azure.Kinect.Sensor; 3 | 4 | namespace AzureKinect4Unity 5 | { 6 | [RequireComponent(typeof(PointCloudRenderer))] 7 | public class AzureKinectOrientationEstimation : MonoBehaviour 8 | { 9 | [SerializeField] bool LowPassFilter = true; 10 | 11 | [SerializeField] uint _Order = 3; 12 | [SerializeField] float _CutoffFrequency = 1; // [Hz] 13 | [SerializeField] float _SamplingFrequency = 60; // [Hz] 14 | 15 | AzureKinectSensor _KinectSensor; 16 | ILowPassFilter _LowPassFilter; 17 | float [] _Accel = new float[3]; 18 | float [] _AccelOut = new float[3]; 19 | 20 | PointCloudRenderer _PointCloudRenderer; 21 | byte[] _DepthRawData; 22 | 23 | public bool Initialized => _Initialized; 24 | private bool _Initialized; 25 | 26 | public void Initialize(AzureKinectSensor kinectSensor) 27 | { 28 | if (!_Initialized) 29 | { 30 | _KinectSensor = kinectSensor; 31 | if (_KinectSensor != null) 32 | { 33 | Debug.Log("ColorResolution: " + _KinectSensor.ColorImageWidth + "x" + _KinectSensor.ColorImageHeight); 34 | Debug.Log("DepthResolution: " + _KinectSensor.DepthImageWidth + "x" + _KinectSensor.DepthImageHeight); 35 | 36 | // _LowPassFilter = new ExponentialSmoothingLowPassFilter((uint)_Accel.Length, 0.05f); 37 | // _LowPassFilter = new DoubleExponentialSmoothingLowPassFilter((uint)_Accel.Length, 0.3f, 0.3f); 38 | _LowPassFilter = new ButterworthFilter(_Order, _SamplingFrequency, _CutoffFrequency, (uint)_Accel.Length); 39 | 40 | _DepthRawData = new byte[_KinectSensor.DepthImageWidth * _KinectSensor.DepthImageHeight * sizeof(ushort)]; 41 | _PointCloudRenderer = GetComponent(); 42 | 43 | CameraCalibration deviceDepthCameraCalibration = _KinectSensor.DeviceCalibration.DepthCameraCalibration; 44 | CameraCalibration deviceColorCameraCalibration = _KinectSensor.DeviceCalibration.ColorCameraCalibration; 45 | 46 | K4A.Calibration calibration = new K4A.Calibration(); 47 | calibration.DepthCameraCalibration = CreateCalibrationCamera(deviceDepthCameraCalibration, _KinectSensor.DepthImageWidth, _KinectSensor.DepthImageHeight); 48 | calibration.ColorCameraCalibration = CreateCalibrationCamera(deviceColorCameraCalibration, _KinectSensor.ColorImageWidth, _KinectSensor.ColorImageHeight); 49 | 50 | _PointCloudRenderer.GenerateMesh(calibration, K4A.CalibrationType.Depth); 51 | 52 | _Initialized = true; 53 | } 54 | } 55 | } 56 | 57 | private K4A.CalibrationCamera CreateCalibrationCamera(CameraCalibration cameraCalibration, int width, int height) 58 | { 59 | K4A.CalibrationCamera calibrationCamera = new K4A.CalibrationCamera(); 60 | 61 | float[] intrinsicsParameters = cameraCalibration.Intrinsics.Parameters; 62 | Extrinsics extrinsics = cameraCalibration.Extrinsics; 63 | 64 | calibrationCamera.resolutionWidth = width; 65 | calibrationCamera.resolutionHeight = height; 66 | calibrationCamera.metricRadius = cameraCalibration.MetricRadius; 67 | 68 | calibrationCamera.intrinsics.cx = intrinsicsParameters[0]; 69 | calibrationCamera.intrinsics.cy = intrinsicsParameters[1]; 70 | calibrationCamera.intrinsics.fx = intrinsicsParameters[2]; 71 | calibrationCamera.intrinsics.fy = intrinsicsParameters[3]; 72 | calibrationCamera.intrinsics.k1 = intrinsicsParameters[4]; 73 | calibrationCamera.intrinsics.k2 = intrinsicsParameters[5]; 74 | calibrationCamera.intrinsics.k3 = intrinsicsParameters[6]; 75 | calibrationCamera.intrinsics.k4 = intrinsicsParameters[7]; 76 | calibrationCamera.intrinsics.k5 = intrinsicsParameters[8]; 77 | calibrationCamera.intrinsics.k6 = intrinsicsParameters[9]; 78 | calibrationCamera.intrinsics.codx = intrinsicsParameters[10]; 79 | calibrationCamera.intrinsics.cody = intrinsicsParameters[11]; 80 | calibrationCamera.intrinsics.p2 = intrinsicsParameters[12]; // p2: tangential distortion coefficient y 81 | calibrationCamera.intrinsics.p1 = intrinsicsParameters[13]; // p1: tangential distortion coefficient x 82 | calibrationCamera.intrinsics.metricRadius = intrinsicsParameters[14]; 83 | 84 | calibrationCamera.extrinsics.rotation[0][0] = extrinsics.Rotation[0]; 85 | calibrationCamera.extrinsics.rotation[0][1] = extrinsics.Rotation[1]; 86 | calibrationCamera.extrinsics.rotation[0][2] = extrinsics.Rotation[2]; 87 | calibrationCamera.extrinsics.rotation[1][0] = extrinsics.Rotation[3]; 88 | calibrationCamera.extrinsics.rotation[1][1] = extrinsics.Rotation[4]; 89 | calibrationCamera.extrinsics.rotation[1][2] = extrinsics.Rotation[5]; 90 | calibrationCamera.extrinsics.rotation[2][0] = extrinsics.Rotation[6]; 91 | calibrationCamera.extrinsics.rotation[2][1] = extrinsics.Rotation[7]; 92 | calibrationCamera.extrinsics.rotation[2][2] = extrinsics.Rotation[8]; 93 | calibrationCamera.extrinsics.translation[0] = extrinsics.Translation[0]; 94 | calibrationCamera.extrinsics.translation[1] = extrinsics.Translation[1]; 95 | calibrationCamera.extrinsics.translation[2] = extrinsics.Translation[2]; 96 | 97 | return calibrationCamera; 98 | } 99 | 100 | void Update() 101 | { 102 | if (_KinectSensor != null) 103 | { 104 | if (_KinectSensor.RawDepthImage != null) 105 | { 106 | short[] depthImage = _KinectSensor.RawDepthImage; 107 | System.Buffer.BlockCopy(depthImage, 0, _DepthRawData, 0, _DepthRawData.Length); 108 | 109 | // _PointCloudRenderer.UpdateColorTexture(_KinectSensor.TransformedColorImage); 110 | _PointCloudRenderer.UpdateDepthTexture(_DepthRawData); 111 | } 112 | 113 | System.Numerics.Vector3 accel = _KinectSensor.ImuSample.AccelerometerSample; 114 | if (LowPassFilter) 115 | { 116 | _Accel[0] = accel.X; 117 | _Accel[1] = accel.Y; 118 | _Accel[2] = accel.Z; 119 | _LowPassFilter.Apply(_Accel, ref _AccelOut); 120 | accel.X = _AccelOut[0]; 121 | accel.Y = _AccelOut[1]; 122 | accel.Z = _AccelOut[2]; 123 | } 124 | 125 | UnityEngine.Vector3 kinectOrientation = OrientationEstimator.EstimateForAzureKinect(accel); 126 | 127 | this.transform.eulerAngles = kinectOrientation; 128 | } 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Domain/AzureKinectOrientationEstimation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9d48f29a16f144c47aa2fb7f615a2441 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Domain/AzureKinectPointCloudVisualizer.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using Microsoft.Azure.Kinect.Sensor; 4 | 5 | namespace AzureKinect4Unity 6 | { 7 | [RequireComponent(typeof(PointCloudRenderer))] 8 | public class AzureKinectPointCloudVisualizer : MonoBehaviour 9 | { 10 | [SerializeField] AzureKinectManager _AzureKinectManager; 11 | [SerializeField] int _DeviceNumber = 0; 12 | 13 | AzureKinectSensor _KinectSensor; 14 | 15 | PointCloudRenderer _PointCloudRenderer; 16 | byte[] _DepthRawData; 17 | 18 | void Start() 19 | { 20 | List kinectSensors = _AzureKinectManager.SensorList; 21 | if (_DeviceNumber < kinectSensors.Count) 22 | { 23 | _KinectSensor = _AzureKinectManager.SensorList[_DeviceNumber]; 24 | if (_KinectSensor != null) 25 | { 26 | Debug.Log("ColorResolution: " + _KinectSensor.ColorImageWidth + "x" + _KinectSensor.ColorImageHeight); 27 | Debug.Log("DepthResolution: " + _KinectSensor.DepthImageWidth + "x" + _KinectSensor.DepthImageHeight); 28 | 29 | _DepthRawData = new byte[_KinectSensor.DepthImageWidth * _KinectSensor.DepthImageHeight * sizeof(ushort)]; 30 | 31 | CameraCalibration deviceDepthCameraCalibration = _KinectSensor.DeviceCalibration.DepthCameraCalibration; 32 | CameraCalibration deviceColorCameraCalibration = _KinectSensor.DeviceCalibration.ColorCameraCalibration; 33 | 34 | K4A.Calibration calibration = new K4A.Calibration(); 35 | calibration.DepthCameraCalibration = CreateCalibrationCamera(deviceDepthCameraCalibration, _KinectSensor.DepthImageWidth, _KinectSensor.DepthImageHeight); 36 | calibration.ColorCameraCalibration = CreateCalibrationCamera(deviceColorCameraCalibration, _KinectSensor.ColorImageWidth, _KinectSensor.ColorImageHeight); 37 | 38 | _PointCloudRenderer = GetComponent(); 39 | _PointCloudRenderer.GenerateMesh(calibration, K4A.CalibrationType.Depth); 40 | 41 | _AzureKinectManager.OpenDevice(_DeviceNumber); 42 | } 43 | } 44 | } 45 | 46 | void Update() 47 | { 48 | _KinectSensor = _AzureKinectManager.SensorList[_DeviceNumber]; 49 | if (_KinectSensor != null) 50 | { 51 | if (_KinectSensor.RawDepthImage != null) 52 | { 53 | short[] depthImage = _KinectSensor.RawDepthImage; 54 | System.Buffer.BlockCopy(depthImage, 0, _DepthRawData, 0, _DepthRawData.Length); 55 | 56 | _PointCloudRenderer.UpdateColorTexture(_KinectSensor.TransformedColorImage); 57 | _PointCloudRenderer.UpdateDepthTexture(_DepthRawData); 58 | } 59 | } 60 | } 61 | 62 | void OnDestroy() 63 | { 64 | _AzureKinectManager.CloseDevice(_DeviceNumber); 65 | Debug.Log("Close Azure Kinect Device"); 66 | } 67 | 68 | private K4A.CalibrationCamera CreateCalibrationCamera(CameraCalibration cameraCalibration, int width, int height) 69 | { 70 | K4A.CalibrationCamera calibrationCamera = new K4A.CalibrationCamera(); 71 | 72 | float[] intrinsicsParameters = cameraCalibration.Intrinsics.Parameters; 73 | Extrinsics extrinsics = cameraCalibration.Extrinsics; 74 | 75 | calibrationCamera.resolutionWidth = width; 76 | calibrationCamera.resolutionHeight = height; 77 | calibrationCamera.metricRadius = cameraCalibration.MetricRadius; 78 | 79 | calibrationCamera.intrinsics.cx = intrinsicsParameters[0]; 80 | calibrationCamera.intrinsics.cy = intrinsicsParameters[1]; 81 | calibrationCamera.intrinsics.fx = intrinsicsParameters[2]; 82 | calibrationCamera.intrinsics.fy = intrinsicsParameters[3]; 83 | calibrationCamera.intrinsics.k1 = intrinsicsParameters[4]; 84 | calibrationCamera.intrinsics.k2 = intrinsicsParameters[5]; 85 | calibrationCamera.intrinsics.k3 = intrinsicsParameters[6]; 86 | calibrationCamera.intrinsics.k4 = intrinsicsParameters[7]; 87 | calibrationCamera.intrinsics.k5 = intrinsicsParameters[8]; 88 | calibrationCamera.intrinsics.k6 = intrinsicsParameters[9]; 89 | calibrationCamera.intrinsics.codx = intrinsicsParameters[10]; 90 | calibrationCamera.intrinsics.cody = intrinsicsParameters[11]; 91 | calibrationCamera.intrinsics.p2 = intrinsicsParameters[12]; // p2: tangential distortion coefficient y 92 | calibrationCamera.intrinsics.p1 = intrinsicsParameters[13]; // p1: tangential distortion coefficient x 93 | calibrationCamera.intrinsics.metricRadius = intrinsicsParameters[14]; 94 | 95 | calibrationCamera.extrinsics.rotation[0][0] = extrinsics.Rotation[0]; 96 | calibrationCamera.extrinsics.rotation[0][1] = extrinsics.Rotation[1]; 97 | calibrationCamera.extrinsics.rotation[0][2] = extrinsics.Rotation[2]; 98 | calibrationCamera.extrinsics.rotation[1][0] = extrinsics.Rotation[3]; 99 | calibrationCamera.extrinsics.rotation[1][1] = extrinsics.Rotation[4]; 100 | calibrationCamera.extrinsics.rotation[1][2] = extrinsics.Rotation[5]; 101 | calibrationCamera.extrinsics.rotation[2][0] = extrinsics.Rotation[6]; 102 | calibrationCamera.extrinsics.rotation[2][1] = extrinsics.Rotation[7]; 103 | calibrationCamera.extrinsics.rotation[2][2] = extrinsics.Rotation[8]; 104 | calibrationCamera.extrinsics.translation[0] = extrinsics.Translation[0]; 105 | calibrationCamera.extrinsics.translation[1] = extrinsics.Translation[1]; 106 | calibrationCamera.extrinsics.translation[2] = extrinsics.Translation[2]; 107 | 108 | return calibrationCamera; 109 | } 110 | 111 | } 112 | } 113 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Domain/AzureKinectPointCloudVisualizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0839a6caf059814bbcd7e380b6e1573 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Domain/AzureKinectSimpleVisualizer.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using UnityEngine; 3 | 4 | namespace AzureKinect4Unity 5 | { 6 | public class AzureKinectSimpleVisualizer : MonoBehaviour 7 | { 8 | [SerializeField] AzureKinectManager _AzureKinectManager; 9 | [SerializeField] int _DeviceNumber = 0; 10 | [SerializeField] Shader _DepthVisualizer; 11 | [SerializeField] Material _UnlitTextureMaterial; 12 | [SerializeField] GameObject _ColorImageObject; 13 | [SerializeField] GameObject _TransformedColorImageObject; 14 | [SerializeField] GameObject _DepthImageObject; 15 | [SerializeField] GameObject _TransformedDepthImageObject; 16 | 17 | Texture2D _ColorImageTexture; 18 | Texture2D _TransformedColorImageTexture; 19 | 20 | Material _DepthVisualizerMaterial; 21 | Material _TransformedDepthVisualizerMaterial; 22 | ComputeBuffer _DepthBuffer; 23 | ComputeBuffer _TransformedDepthBuffer; 24 | 25 | AzureKinectSensor _KinectSensor; 26 | 27 | void Start() 28 | { 29 | var kinectSensors = _AzureKinectManager.SensorList; 30 | if (_DeviceNumber < kinectSensors.Count) 31 | { 32 | _KinectSensor = kinectSensors[_DeviceNumber]; 33 | if (_KinectSensor != null) 34 | { 35 | _ColorImageTexture = new Texture2D(_KinectSensor.ColorImageWidth, _KinectSensor.ColorImageHeight, TextureFormat.BGRA32, false); 36 | _TransformedColorImageTexture = new Texture2D(_KinectSensor.DepthImageWidth, _KinectSensor.DepthImageHeight, TextureFormat.BGRA32, false); 37 | 38 | int depthImageSize = _KinectSensor.DepthImageWidth * _KinectSensor.DepthImageHeight; 39 | int transformedDepthImageSize = _KinectSensor.ColorImageWidth * _KinectSensor.ColorImageHeight; 40 | 41 | _DepthBuffer = new ComputeBuffer(depthImageSize / 2, sizeof(uint)); 42 | _TransformedDepthBuffer = new ComputeBuffer(transformedDepthImageSize / 2, sizeof(uint)); 43 | 44 | MeshRenderer colorMeshRenderer = _ColorImageObject.GetComponent(); 45 | colorMeshRenderer.sharedMaterial = new Material(_UnlitTextureMaterial); 46 | colorMeshRenderer.sharedMaterial.SetTexture("_MainTex", _ColorImageTexture); 47 | 48 | MeshRenderer transformedColorMeshRenderer = _TransformedColorImageObject.GetComponent(); 49 | transformedColorMeshRenderer.sharedMaterial = new Material(_UnlitTextureMaterial); 50 | transformedColorMeshRenderer.sharedMaterial.SetTexture("_MainTex", _TransformedColorImageTexture); 51 | 52 | _DepthVisualizerMaterial = new Material(_DepthVisualizer); 53 | _DepthVisualizerMaterial.SetInt("_Width", _KinectSensor.DepthImageWidth); 54 | _DepthVisualizerMaterial.SetInt("_Height", _KinectSensor.DepthImageHeight); 55 | MeshRenderer depthMeshRenderer = _DepthImageObject.GetComponent(); 56 | depthMeshRenderer.sharedMaterial = _DepthVisualizerMaterial; 57 | 58 | _TransformedDepthVisualizerMaterial = new Material(_DepthVisualizer); 59 | _TransformedDepthVisualizerMaterial.SetInt("_Width", _KinectSensor.ColorImageWidth); 60 | _TransformedDepthVisualizerMaterial.SetInt("_Height", _KinectSensor.ColorImageHeight); 61 | MeshRenderer transformedDepthMeshRenderer = _TransformedDepthImageObject.GetComponent(); 62 | transformedDepthMeshRenderer.sharedMaterial = _TransformedDepthVisualizerMaterial; 63 | } 64 | 65 | Debug.Log("ColorResolution: " + _KinectSensor.ColorImageWidth + "x" + _KinectSensor.ColorImageHeight); 66 | Debug.Log("DepthResolution: " + _KinectSensor.DepthImageWidth + "x" + _KinectSensor.DepthImageHeight); 67 | } 68 | } 69 | 70 | void OnDestroy() 71 | { 72 | _DepthBuffer?.Dispose(); 73 | _TransformedDepthBuffer?.Dispose(); 74 | } 75 | 76 | void Update() 77 | { 78 | if (_KinectSensor != null) 79 | { 80 | if (_KinectSensor.RawColorImage != null) 81 | { 82 | _ColorImageTexture.LoadRawTextureData(_KinectSensor.RawColorImage); 83 | _ColorImageTexture.Apply(); 84 | } 85 | 86 | if (_KinectSensor.TransformedColorImage != null) 87 | { 88 | _TransformedColorImageTexture.LoadRawTextureData(_KinectSensor.TransformedColorImage); 89 | _TransformedColorImageTexture.Apply(); 90 | } 91 | 92 | if (_KinectSensor.RawDepthImage != null) 93 | { 94 | _DepthBuffer.SetData(_KinectSensor.RawDepthImage); 95 | _DepthVisualizerMaterial.SetBuffer("_DepthBuffer", _DepthBuffer); 96 | } 97 | 98 | if (_KinectSensor.TransformedDepthImage != null) 99 | { 100 | _TransformedDepthBuffer.SetData(_KinectSensor.TransformedDepthImage); 101 | _TransformedDepthVisualizerMaterial.SetBuffer("_DepthBuffer", _TransformedDepthBuffer); 102 | } 103 | } 104 | } 105 | } 106 | } 107 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Domain/AzureKinectSimpleVisualizer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 79bacf70155f0064586e7d74f70254e2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 789b64e4deb5e7c4894ceddc8c52323b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation/Presenter.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5f1debe4483f1204088072a11078b63f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation/Presenter/DeviceManagerPresenter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace AzureKinect4Unity.Examples 4 | { 5 | public class DeviceManagerPresenter : MonoBehaviour 6 | { 7 | [SerializeField] DeviceManagerView _View; 8 | [SerializeField] AzureKinectManager _DeviceManager; 9 | 10 | void Awake() 11 | { 12 | if(!_DeviceManager.Initialized) 13 | { 14 | _DeviceManager.Initialize(); 15 | } 16 | 17 | _View.UpdateDeviceNameList(_DeviceManager.DeviceSerialNumList); 18 | 19 | _View.OnClickedOpenDevice.AddListener(() => 20 | { 21 | int deviceIndex = _View.CurrentDeviceIndex; 22 | _DeviceManager.OpenDevice(deviceIndex); 23 | }); 24 | } 25 | } 26 | } -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation/Presenter/DeviceManagerPresenter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 795076affbd7dc840a4a4379e454c81b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation/Presenter/FloorDetectorPresenter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace AzureKinect4Unity.Examples 4 | { 5 | public class FloorDetectorPresenter : MonoBehaviour 6 | { 7 | [SerializeField] DeviceManagerView _View; 8 | [SerializeField] AzureKinectManager _DeviceManager; 9 | [SerializeField] AzureKinectFloorDetector _FloorDetector; 10 | 11 | void Awake() 12 | { 13 | _View.OnClickedOpenDevice.AddListener(() => 14 | { 15 | int deviceIndex = _View.CurrentDeviceIndex; 16 | var kinectSensor = _DeviceManager.OpenDevice(deviceIndex); 17 | _FloorDetector.Initialize(kinectSensor); 18 | }); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation/Presenter/FloorDetectorPresenter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4e106fd25df38c4499eb6f9cecb59090 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation/Presenter/OrientationEstimationPresenter.cs: -------------------------------------------------------------------------------- 1 | using UnityEngine; 2 | 3 | namespace AzureKinect4Unity.Examples 4 | { 5 | public class OrientationEstimationPresenter : MonoBehaviour 6 | { 7 | [SerializeField] DeviceManagerView _View; 8 | [SerializeField] AzureKinectManager _DeviceManager; 9 | [SerializeField] AzureKinectOrientationEstimation _OrientationEstimator; 10 | 11 | void Awake() 12 | { 13 | _View.OnClickedOpenDevice.AddListener(() => 14 | { 15 | int deviceIndex = _View.CurrentDeviceIndex; 16 | var kinectSensor = _DeviceManager.OpenDevice(deviceIndex); 17 | _OrientationEstimator.Initialize(kinectSensor); 18 | }); 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation/Presenter/OrientationEstimationPresenter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c4994f6749a6db44096bfe0c70477e2c 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation/View.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0cf8e187e4f9ccf409ff1acac628148b 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation/View/DeviceManagerView.cs: -------------------------------------------------------------------------------- 1 | using System.Collections.Generic; 2 | using UnityEngine; 3 | using UnityEngine.Events; 4 | using UnityEngine.UI; 5 | 6 | namespace AzureKinect4Unity.Examples 7 | { 8 | public class DeviceManagerView : MonoBehaviour 9 | { 10 | [SerializeField] Dropdown _Dropdown_Device; 11 | [SerializeField] Button _Button_OpenDevice; 12 | 13 | public UnityEvent OnClickedOpenDevice; 14 | 15 | public int CurrentDeviceIndex => _CurrentDeviceIndex; 16 | private int _CurrentDeviceIndex = 0; 17 | 18 | public void UpdateDeviceNameList(IReadOnlyList deviceNameList) 19 | { 20 | _Dropdown_Device.options.Clear(); 21 | 22 | foreach (string deviceName in deviceNameList) 23 | { 24 | _Dropdown_Device.options.Add(new Dropdown.OptionData(deviceName)); 25 | } 26 | } 27 | 28 | void Awake() 29 | { 30 | _Dropdown_Device.onValueChanged.AddListener(index => 31 | { 32 | _CurrentDeviceIndex = index; 33 | }); 34 | 35 | _Button_OpenDevice.onClick.AddListener(() => 36 | { 37 | OnClickedOpenDevice?.Invoke(); 38 | }); 39 | } 40 | 41 | void OnDestroy() 42 | { 43 | _Dropdown_Device.onValueChanged.RemoveAllListeners(); 44 | _Button_OpenDevice.onClick.RemoveAllListeners(); 45 | } 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/Presentation/View/DeviceManagerView.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 10179cc952dadee489859ed37948e456 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/ResourceFiles.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3f24ccdc225cc34458cb280af573c35c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/ResourceFiles/UnlitTexture.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: UnlitTexture 11 | m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/ResourceFiles/UnlitTexture.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0b63389eb779fd941b943ecdaf178218 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/_old.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e0a8b5d83d0549b458526b211693025e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/_old/AzureKinectPointCloudVisualizer.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d0150bda798a1f14095de20a9d3b4dad 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Examples/_old/AzureKinectSimpleVisualizer.unity.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e30682d6698e061448bce07a8ca819e6 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce5d259afd90445498f5446c7d7c6217 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images/AzureKinect4Unity_DLL.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/AzureKinect4Unity/Images/AzureKinect4Unity_DLL.png -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images/AzureKinect4Unity_DLL.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c1a17e9b1422d4f4d873bebf8460db61 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images/AzureKinect4Unity_ImportPackage.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/AzureKinect4Unity/Images/AzureKinect4Unity_ImportPackage.png -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images/AzureKinect4Unity_ImportPackage.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 445104decce652048ad27124070ecf6c 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images/AzureKinect4Unity_NuGet.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/AzureKinect4Unity/Images/AzureKinect4Unity_NuGet.png -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images/AzureKinect4Unity_NuGet.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: aaf0b0ee4311bbd49875e47a8d0777b2 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images/AzureKinect4Unity_OrientationEstimator.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/AzureKinect4Unity/Images/AzureKinect4Unity_OrientationEstimator.jpg -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images/AzureKinect4Unity_OrientationEstimator.jpg.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: cfc9d12c1be47e742a22beca2a363e13 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images/AzureKinect4Unity_SimpleVisualizer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/AzureKinect4Unity/Images/AzureKinect4Unity_SimpleVisualizer.png -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Images/AzureKinect4Unity_SimpleVisualizer.png.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 480e04e2a6a0cca4e841088ee17c354b 3 | TextureImporter: 4 | fileIDToRecycleName: {} 5 | externalObjects: {} 6 | serializedVersion: 9 7 | mipmaps: 8 | mipMapMode: 0 9 | enableMipMap: 1 10 | sRGBTexture: 1 11 | linearTexture: 0 12 | fadeOut: 0 13 | borderMipMap: 0 14 | mipMapsPreserveCoverage: 0 15 | alphaTestReferenceValue: 0.5 16 | mipMapFadeDistanceStart: 1 17 | mipMapFadeDistanceEnd: 3 18 | bumpmap: 19 | convertToNormalMap: 0 20 | externalNormalMap: 0 21 | heightScale: 0.25 22 | normalMapFilter: 0 23 | isReadable: 0 24 | streamingMipmaps: 0 25 | streamingMipmapsPriority: 0 26 | grayScaleToAlpha: 0 27 | generateCubemap: 6 28 | cubemapConvolution: 0 29 | seamlessCubemap: 0 30 | textureFormat: 1 31 | maxTextureSize: 2048 32 | textureSettings: 33 | serializedVersion: 2 34 | filterMode: -1 35 | aniso: -1 36 | mipBias: -100 37 | wrapU: -1 38 | wrapV: -1 39 | wrapW: -1 40 | nPOTScale: 1 41 | lightmap: 0 42 | compressionQuality: 50 43 | spriteMode: 0 44 | spriteExtrude: 1 45 | spriteMeshType: 1 46 | alignment: 0 47 | spritePivot: {x: 0.5, y: 0.5} 48 | spritePixelsToUnits: 100 49 | spriteBorder: {x: 0, y: 0, z: 0, w: 0} 50 | spriteGenerateFallbackPhysicsShape: 1 51 | alphaUsage: 1 52 | alphaIsTransparency: 0 53 | spriteTessellationDetail: -1 54 | textureType: 0 55 | textureShape: 1 56 | singleChannelComponent: 0 57 | maxTextureSizeSet: 0 58 | compressionQualitySet: 0 59 | textureFormatSet: 0 60 | platformSettings: 61 | - serializedVersion: 2 62 | buildTarget: DefaultTexturePlatform 63 | maxTextureSize: 2048 64 | resizeAlgorithm: 0 65 | textureFormat: -1 66 | textureCompression: 1 67 | compressionQuality: 50 68 | crunchedCompression: 0 69 | allowsAlphaSplitting: 0 70 | overridden: 0 71 | androidETC2FallbackOverride: 0 72 | spriteSheet: 73 | serializedVersion: 2 74 | sprites: [] 75 | outline: [] 76 | physicsShape: [] 77 | bones: [] 78 | spriteID: 79 | vertices: [] 80 | indices: 81 | edges: [] 82 | weights: [] 83 | spritePackingTag: 84 | pSDRemoveMatte: 0 85 | pSDShowRemoveMatteOption: 0 86 | userData: 87 | assetBundleName: 88 | assetBundleVariant: 89 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Soichiro Sugimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0997324a6e68f6d4aa925118d41323dc 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c40ce04de9dae4b40bb3107da54f394e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Materials/DepthPointCloud.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: DepthPointCloud 11 | m_Shader: {fileID: 4800000, guid: 530847223b838994ebccdc91bb181794, type: 3} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DepthTex: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailAlbedoMap: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailMask: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _DetailNormalMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _EmissionMap: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MainTex: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _MetallicGlossMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _OcclusionMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | - _ParallaxMap: 59 | m_Texture: {fileID: 0} 60 | m_Scale: {x: 1, y: 1} 61 | m_Offset: {x: 0, y: 0} 62 | m_Floats: 63 | - _BumpScale: 1 64 | - _Cutoff: 0.5 65 | - _DepthScale: 1 66 | - _DetailNormalMapScale: 1 67 | - _DstBlend: 0 68 | - _GlossMapScale: 1 69 | - _Glossiness: 0.5 70 | - _GlossyReflections: 1 71 | - _Metallic: 0 72 | - _Mode: 0 73 | - _OcclusionStrength: 1 74 | - _Parallax: 0.02 75 | - _SmoothnessTextureChannel: 0 76 | - _SpecularHighlights: 1 77 | - _SrcBlend: 1 78 | - _UVSec: 0 79 | - _ZWrite: 1 80 | m_Colors: 81 | - _Color: {r: 1, g: 1, b: 1, a: 1} 82 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 83 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Materials/DepthPointCloud.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c570ecf7a8892f4eb5ec3d243b190f9 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Materials/UnlitTexture.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInstance: {fileID: 0} 9 | m_PrefabAsset: {fileID: 0} 10 | m_Name: UnlitTexture 11 | m_Shader: {fileID: 10752, guid: 0000000000000000f000000000000000, type: 0} 12 | m_ShaderKeywords: 13 | m_LightmapFlags: 4 14 | m_EnableInstancingVariants: 0 15 | m_DoubleSidedGI: 0 16 | m_CustomRenderQueue: -1 17 | stringTagMap: {} 18 | disabledShaderPasses: [] 19 | m_SavedProperties: 20 | serializedVersion: 3 21 | m_TexEnvs: 22 | - _BumpMap: 23 | m_Texture: {fileID: 0} 24 | m_Scale: {x: 1, y: 1} 25 | m_Offset: {x: 0, y: 0} 26 | - _DetailAlbedoMap: 27 | m_Texture: {fileID: 0} 28 | m_Scale: {x: 1, y: 1} 29 | m_Offset: {x: 0, y: 0} 30 | - _DetailMask: 31 | m_Texture: {fileID: 0} 32 | m_Scale: {x: 1, y: 1} 33 | m_Offset: {x: 0, y: 0} 34 | - _DetailNormalMap: 35 | m_Texture: {fileID: 0} 36 | m_Scale: {x: 1, y: 1} 37 | m_Offset: {x: 0, y: 0} 38 | - _EmissionMap: 39 | m_Texture: {fileID: 0} 40 | m_Scale: {x: 1, y: 1} 41 | m_Offset: {x: 0, y: 0} 42 | - _MainTex: 43 | m_Texture: {fileID: 0} 44 | m_Scale: {x: 1, y: 1} 45 | m_Offset: {x: 0, y: 0} 46 | - _MetallicGlossMap: 47 | m_Texture: {fileID: 0} 48 | m_Scale: {x: 1, y: 1} 49 | m_Offset: {x: 0, y: 0} 50 | - _OcclusionMap: 51 | m_Texture: {fileID: 0} 52 | m_Scale: {x: 1, y: 1} 53 | m_Offset: {x: 0, y: 0} 54 | - _ParallaxMap: 55 | m_Texture: {fileID: 0} 56 | m_Scale: {x: 1, y: 1} 57 | m_Offset: {x: 0, y: 0} 58 | m_Floats: 59 | - _BumpScale: 1 60 | - _Cutoff: 0.5 61 | - _DetailNormalMapScale: 1 62 | - _DstBlend: 0 63 | - _GlossMapScale: 1 64 | - _Glossiness: 0.5 65 | - _GlossyReflections: 1 66 | - _Metallic: 0 67 | - _Mode: 0 68 | - _OcclusionStrength: 1 69 | - _Parallax: 0.02 70 | - _SmoothnessTextureChannel: 0 71 | - _SpecularHighlights: 1 72 | - _SrcBlend: 1 73 | - _UVSec: 0 74 | - _ZWrite: 1 75 | m_Colors: 76 | - _Color: {r: 1, g: 1, b: 1, a: 1} 77 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 78 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Materials/UnlitTexture.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d119fe89266205042875185896f664d8 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 2100000 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/README.md: -------------------------------------------------------------------------------- 1 | # Azure Kinect for Unity 2 | 3 | ## Examples 4 | SimpleVisualizer 5 | 6 | 7 | 8 | OrientationEstimator 9 | 10 | 11 | 12 | ## Tested environment 13 | - Unity 2018.4.21f1 14 | - Azure Kinect SDK 1.4.0 15 | - Windows 10 16 | 17 | ## Third party assets 18 | 以下のアセットをプロジェクトに含む必要があります。 19 | You need to include the following assets in your Unity project. 20 | 21 | - Microsoft Azure Kinect Sensor SDK (1.4.0) 22 | 23 | - System.Buffers.4.4.0 24 | 25 | - System.Memory.4.5.3 26 | 27 | - System.Numerics.Vectors.4.5.0 28 | 29 | - System.Runtime.CompilerServices.Unsafe.4.5.2 30 | 31 | ## Initial setup for a new project 32 | ### 1. Install Azure Kinect SDK 33 | https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md 34 | 35 | ### 2. Setup a Unity project 36 | 2.1. Create a new Unity project 37 | 38 | 2.2. Download and import NuGetForUnity (NuGetForUnity.2.0.0.unitypackage) 39 | https://github.com/GlitchEnzo/NuGetForUnity/releases/tag/v2.0.0 40 | 41 | 2.3. Install Microsoft.Azure.Kinect.Sensor package 42 | 43 | 44 | 45 | 2.4. Copy dll files from the SDK folder 46 | Copy "depthengine_2_0.dll" and "k4a.dll" from the SDK installation folder to Plugins folder. 47 | 48 | SDK installation folder 49 | C:\Program Files\Azure Kinect SDK v1.4.0\sdk\windows-desktop\amd64\release\bin 50 | 51 | Plugins folder 52 | 53 | 54 | 55 | 2.5. Import AzureKinect4Unity 56 | 57 | 58 | 59 | ## License 60 | - MIT License 61 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 89cdca4e9866c2146a360b976a7a3b06 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b2e12d81e74cde047aa3e9b0a0661951 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/AzureKinectManager.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Soichiro Sugimoto. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System.Collections.Generic; 5 | using System.Threading; 6 | using System.Threading.Tasks; 7 | using UnityEngine; 8 | using Microsoft.Azure.Kinect.Sensor; 9 | 10 | namespace AzureKinect4Unity 11 | { 12 | public class AzureKinectManager : MonoBehaviour 13 | { 14 | public ImageFormat ColorImageFormat = ImageFormat.ColorBGRA32; 15 | public ColorCameraMode ColorCameraMode = ColorCameraMode._1920_x_1080_30fps; 16 | public DepthCameraMode DepthCameraMode = DepthCameraMode._512_x_512_30fps; 17 | 18 | public List SensorList => _AzureKinectSensorList; 19 | private List _AzureKinectSensorList = new List(); 20 | 21 | public List DeviceSerialNumList => _DeviceSerialNumList; 22 | private List _DeviceSerialNumList = new List(); 23 | 24 | private List _CancellationTokenSourceList = new List(); 25 | 26 | public bool Initialized => _Initialized; 27 | private bool _Initialized; 28 | 29 | private int _MainThreadID; 30 | 31 | void Awake() 32 | { 33 | Initialize(); 34 | } 35 | 36 | void OnDestroy() 37 | { 38 | foreach (var tokenSource in _CancellationTokenSourceList) 39 | { 40 | tokenSource.Cancel(); 41 | } 42 | 43 | foreach (var kinectSensor in _AzureKinectSensorList) 44 | { 45 | kinectSensor.CloseSensor(); 46 | } 47 | } 48 | 49 | void OnApplicationQuit() 50 | { 51 | OnDestroy(); 52 | } 53 | 54 | public void Initialize() 55 | { 56 | if (!_Initialized) 57 | { 58 | // _MainThreadID = Thread.CurrentThread.ManagedThreadId; 59 | 60 | int deviceCount = AzureKinectSensor.GetDeviceCount(); 61 | for (int i = 0; i < deviceCount; i++) 62 | { 63 | var kinectSensor = new AzureKinectSensor(ColorImageFormat, ColorCameraMode, DepthCameraMode); 64 | if (kinectSensor.OpenSensor(i)) 65 | { 66 | _AzureKinectSensorList.Add(kinectSensor); 67 | _DeviceSerialNumList.Add(kinectSensor.Device.SerialNum); 68 | _CancellationTokenSourceList.Add(new CancellationTokenSource()); 69 | 70 | kinectSensor.CloseSensor(); 71 | } 72 | } 73 | 74 | _Initialized = true; 75 | } 76 | } 77 | 78 | public AzureKinectSensor OpenDevice(int deviceIndex) 79 | { 80 | var kinectSensor = _AzureKinectSensorList[deviceIndex]; 81 | 82 | kinectSensor.OpenSensor(deviceIndex); 83 | RunAnotherThread(_CancellationTokenSourceList[deviceIndex].Token, kinectSensor); 84 | 85 | return kinectSensor; 86 | } 87 | 88 | public void CloseDevice(int deviceIndex) 89 | { 90 | _CancellationTokenSourceList[deviceIndex].Cancel(); 91 | _AzureKinectSensorList[deviceIndex].CloseSensor(); 92 | } 93 | 94 | private void RunAnotherThread(CancellationToken cancellationToken, AzureKinectSensor kinectSensor) 95 | { 96 | Task.Run(() => 97 | { 98 | // Multithread 99 | // Debug.Log("********************"); 100 | // Debug.Log(" MainThreadID: " + _MainThreadID); 101 | // Debug.Log(" AnotherThreadID: " + Thread.CurrentThread.ManagedThreadId); 102 | // Debug.Log(" KinectSerialNum: " + kinectSensor.Device.SerialNum); 103 | // Debug.Log("********************"); 104 | 105 | while(true) 106 | { 107 | cancellationToken.ThrowIfCancellationRequested(); 108 | kinectSensor.ProcessCameraFrame(); 109 | } 110 | }); 111 | } 112 | } 113 | } 114 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/AzureKinectManager.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e7ebbd875c2ef6a42ad4ceb5d17d1a18 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/AzureKinectSensor.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Soichiro Sugimoto. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | using Microsoft.Azure.Kinect.Sensor; 6 | 7 | namespace AzureKinect4Unity 8 | { 9 | public class AzureKinectSensor 10 | { 11 | private ImageFormat _ColorImageFormat = ImageFormat.ColorBGRA32; 12 | private ColorCameraMode _ColorCameraMode = ColorCameraMode._1920_x_1080_30fps; 13 | private DepthCameraMode _DepthCameraMode = DepthCameraMode._512_x_512_30fps; 14 | 15 | private Device _KinectSensor; 16 | public Device Device { get { return _KinectSensor; } } 17 | 18 | private Calibration _DeviceCalibration; 19 | public Calibration DeviceCalibration { get { return _DeviceCalibration; } } 20 | 21 | private Transformation _Transformation; 22 | private bool _IsCameraStarted = false; 23 | 24 | private int _ColorImageWidth; 25 | public int ColorImageWidth { get { return _ColorImageWidth; } } 26 | private int _ColorImageHeight; 27 | public int ColorImageHeight { get { return _ColorImageHeight; } } 28 | private int _DepthImageWidth; 29 | public int DepthImageWidth { get { return _DepthImageWidth; } } 30 | private int _DepthImageHeight; 31 | public int DepthImageHeight { get { return _DepthImageHeight; } } 32 | 33 | private byte[] _RawColorImage = null; 34 | public byte[] RawColorImage { get { return _RawColorImage; } } 35 | private byte[] _TransformedColorImage = null; 36 | public byte[] TransformedColorImage { get { return _TransformedColorImage; } } 37 | private short[] _RawDepthImage = null; 38 | public short[] RawDepthImage { get { return _RawDepthImage; } } 39 | private short[] _TransformedDepthImage = null; 40 | public short[] TransformedDepthImage { get { return _TransformedDepthImage; } } 41 | 42 | private Short3[] _PointCloud = null; 43 | public Short3[] PointCloud { get { return _PointCloud; } } 44 | 45 | private ImuSample _ImuSample = new ImuSample(); 46 | public ImuSample ImuSample => _ImuSample; 47 | 48 | public static int GetDeviceCount() 49 | { 50 | int deviceCount = Device.GetInstalledCount(); 51 | Debug.Log("Azure Kinect Device Count: " + deviceCount); 52 | return deviceCount; 53 | } 54 | 55 | public AzureKinectSensor(ImageFormat colorImageFormat, ColorCameraMode colorCameraMode, DepthCameraMode depthCameraMode) 56 | { 57 | this._ColorImageFormat = colorImageFormat; 58 | this._ColorCameraMode = colorCameraMode; 59 | this._DepthCameraMode = depthCameraMode; 60 | } 61 | 62 | public bool OpenSensor(int deviceIndex = 0) 63 | { 64 | if (_KinectSensor != null) 65 | { 66 | Debug.Log("AzureKinect [" + _KinectSensor.SerialNum + "] has already been opened."); 67 | return false; 68 | } 69 | 70 | _KinectSensor = Device.Open(deviceIndex); 71 | if (_KinectSensor == null) 72 | { 73 | Debug.Log("AzureKinect cannot be opened."); 74 | return false; 75 | } 76 | 77 | DeviceConfiguration kinectConfig = new DeviceConfiguration(); 78 | kinectConfig.ColorFormat = _ColorImageFormat; 79 | kinectConfig.ColorResolution = (ColorResolution) _ColorCameraMode; 80 | kinectConfig.DepthMode = (DepthMode) _DepthCameraMode; 81 | 82 | if (_ColorCameraMode != ColorCameraMode._4096_x_3072_15fps 83 | && _DepthCameraMode != DepthCameraMode._1024x1024_15fps) 84 | { 85 | kinectConfig.CameraFPS = FPS.FPS30; 86 | } 87 | else 88 | { 89 | kinectConfig.CameraFPS = FPS.FPS15; 90 | } 91 | 92 | _KinectSensor.StartCameras(kinectConfig); 93 | _IsCameraStarted = true; 94 | 95 | _KinectSensor.StartImu(); 96 | 97 | _DeviceCalibration = _KinectSensor.GetCalibration(); 98 | _Transformation = _DeviceCalibration.CreateTransformation(); 99 | 100 | CameraCalibration colorCamera = _DeviceCalibration.ColorCameraCalibration; 101 | _ColorImageWidth = colorCamera.ResolutionWidth; 102 | _ColorImageHeight = colorCamera.ResolutionHeight; 103 | 104 | CameraCalibration depthCamera = _DeviceCalibration.DepthCameraCalibration; 105 | _DepthImageWidth = depthCamera.ResolutionWidth; 106 | _DepthImageHeight = depthCamera.ResolutionHeight; 107 | 108 | return true; 109 | } 110 | 111 | public void CloseSensor() 112 | { 113 | if (_KinectSensor != null) 114 | { 115 | Debug.Log("AzureKinect [" + _KinectSensor.SerialNum + "] has closed."); 116 | 117 | _KinectSensor.StopImu(); 118 | 119 | _IsCameraStarted = false; 120 | _KinectSensor.StopCameras(); 121 | 122 | _KinectSensor.Dispose(); 123 | _KinectSensor = null; 124 | } 125 | } 126 | 127 | public void ProcessCameraFrame() 128 | { 129 | if (_IsCameraStarted) 130 | { 131 | Capture capture = _KinectSensor.GetCapture(); 132 | 133 | if (capture.Color != null) 134 | { 135 | _RawColorImage = capture.Color.Memory.ToArray(); 136 | _TransformedColorImage = _Transformation.ColorImageToDepthCamera(capture).Memory.ToArray(); 137 | } 138 | 139 | if (capture.Depth != null) 140 | { 141 | Image depthImage = capture.Depth; 142 | Image transformedDepthImage = _Transformation.DepthImageToColorCamera(capture); 143 | 144 | _RawDepthImage = depthImage.GetPixels().ToArray(); 145 | _TransformedDepthImage = transformedDepthImage.GetPixels().ToArray(); 146 | 147 | _PointCloud = _Transformation.DepthImageToPointCloud(depthImage) 148 | .GetPixels().ToArray(); 149 | } 150 | 151 | _ImuSample = _KinectSensor.GetImuSample(); 152 | 153 | capture.Dispose(); 154 | } 155 | } 156 | } 157 | 158 | public enum ColorCameraMode 159 | { 160 | _1280_x_720_30fps = 1, 161 | _1920_x_1080_30fps = 2, 162 | _2560_x_1440_30fps = 3, 163 | _2048_x_1536_30fps = 4, 164 | _3840_x_2160_30fps = 5, 165 | _4096_x_3072_15fps = 6 166 | } 167 | 168 | public enum DepthCameraMode 169 | { 170 | _320_x_288_30fps = 1, 171 | _640_x_576_30fps = 2, 172 | _512_x_512_30fps = 3, 173 | _1024x1024_15fps = 4, 174 | PassiveIROnly_30fps = 5 175 | } 176 | } 177 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/AzureKinectSensor.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6208219da8405cd47bed485757043348 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/ButterworthFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 4c0396161795bec4781193830c575d2a 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/ExponentialSmoothingLowPassFilter.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Soichiro Sugimoto. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | namespace AzureKinect4Unity 5 | { 6 | public class ExponentialSmoothingLowPassFilter : ILowPassFilter 7 | { 8 | float[] _LastOutput; 9 | float _Weight; 10 | 11 | public ExponentialSmoothingLowPassFilter(uint vectorSize, float weight = 0.1f) 12 | { 13 | _LastOutput = new float[vectorSize]; 14 | _Weight = weight; 15 | } 16 | 17 | public bool Apply(in float[] input, ref float[] output) 18 | { 19 | if ((input.Length != output.Length) 20 | || (input.Length != _LastOutput.Length)) 21 | { 22 | return false; 23 | } 24 | 25 | for (int k = 0; k < input.Length; k++) 26 | { 27 | output[k] = _Weight * input[k] + (1.0f - _Weight) * _LastOutput[k]; 28 | _LastOutput[k] = output[k]; 29 | } 30 | 31 | return true; 32 | } 33 | } 34 | 35 | public class DoubleExponentialSmoothingLowPassFilter : ILowPassFilter 36 | { 37 | float[] _SmoothedValue; 38 | float[] _Trend; 39 | float[] _PrevSmoothedValue; 40 | float[] _PrevTrend; 41 | float _SmoothingFactor; 42 | float _TrendSmoothingFactor; 43 | 44 | public DoubleExponentialSmoothingLowPassFilter(uint vectorSize, float smoothingFactor = 0.5f, float trendSmoothingFactor = 0.5f) 45 | { 46 | _SmoothedValue = new float[vectorSize]; 47 | _Trend = new float[vectorSize]; 48 | 49 | _PrevSmoothedValue = new float[vectorSize]; 50 | _PrevTrend = new float[vectorSize]; 51 | 52 | _SmoothingFactor = smoothingFactor; 53 | _TrendSmoothingFactor = trendSmoothingFactor; 54 | } 55 | 56 | public bool Apply(in float[] input, ref float[] output) 57 | { 58 | if ((input.Length != output.Length) 59 | || (input.Length != _SmoothedValue.Length)) 60 | { 61 | return false; 62 | } 63 | 64 | for (int k = 0; k < input.Length; k++) 65 | { 66 | _SmoothedValue[k] = _SmoothingFactor * input[k] + (1.0f - _SmoothingFactor) * (_PrevSmoothedValue[k] + _PrevTrend[k]); 67 | _Trend[k] = _TrendSmoothingFactor * (_SmoothedValue[k] - _PrevSmoothedValue[k]) + (1.0f - _TrendSmoothingFactor) * _PrevTrend[k]; 68 | } 69 | 70 | for (int k = 0; k < input.Length; k++) 71 | { 72 | _PrevSmoothedValue[k] = _SmoothedValue[k]; 73 | _PrevTrend[k] = _Trend[k]; 74 | } 75 | 76 | for (int k = 0; k < input.Length; k++) 77 | { 78 | output[k] = _SmoothedValue[k] + _Trend[k]; 79 | } 80 | 81 | return true; 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/ExponentialSmoothingLowPassFilter.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1eafa70556edf1844b4b8f5b4f162f33 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/LowPassFilterInterface.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Soichiro Sugimoto. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | namespace AzureKinect4Unity 5 | { 6 | public interface ILowPassFilter 7 | { 8 | bool Apply(in float[] input, ref float[] output); 9 | } 10 | } 11 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/LowPassFilterInterface.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: bce09f98cc2a1994fb0ee3fa2b80a6ee 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/OrientationEstimator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Soichiro Sugimoto. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | using AzureKinectToolkit; 6 | 7 | namespace AzureKinect4Unity 8 | { 9 | public static class OrientationEstimator 10 | { 11 | public static UnityEngine.Vector3 EstimateForAzureKinect(System.Numerics.Vector3 k4aImuAccSample) 12 | { 13 | UnityEngine.Vector3 estimatedAngles = UnityEngine.Vector3.zero; 14 | 15 | System.Numerics.Vector3 orientation = SensorOrientationEstimator.EstimateFromAccelerometerForAzureKinect(k4aImuAccSample); 16 | estimatedAngles.z = orientation.X; // Roll 17 | estimatedAngles.x = orientation.Y; // Pitch 18 | estimatedAngles.y = orientation.Z; // Yaw 19 | 20 | return estimatedAngles; 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/OrientationEstimator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0cdcb768df7d3de4c8dc7d6966639150 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/PointCloudRenderer.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Soichiro Sugimoto. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using UnityEngine; 5 | using UnityEngine.Rendering; 6 | 7 | namespace AzureKinect4Unity 8 | { 9 | [RequireComponent(typeof(MeshFilter), typeof(MeshRenderer))] 10 | public class PointCloudRenderer : MonoBehaviour 11 | { 12 | private Mesh _Mesh; 13 | private Texture2D _ColorTexture; 14 | private Texture2D _DepthTexture; 15 | 16 | public void UpdateVertices(Vector3[] vertices) 17 | { 18 | _Mesh.vertices = vertices; 19 | } 20 | 21 | public void UpdateColorTexture(byte[] rawTextureData) 22 | { 23 | _ColorTexture.LoadRawTextureData(rawTextureData); 24 | _ColorTexture.Apply(); 25 | } 26 | 27 | public void UpdateColorTextureImageByteArray(byte[] colorImageData) 28 | { 29 | _ColorTexture.LoadImage(colorImageData); 30 | _ColorTexture.Apply(); 31 | } 32 | 33 | public void UpdateDepthTexture(byte[] depthImageRawData) 34 | { 35 | _DepthTexture.LoadRawTextureData(depthImageRawData); 36 | _DepthTexture.Apply(); 37 | } 38 | 39 | public void GenerateMesh(K4A.Calibration calibration, K4A.CalibrationType calibrationType) 40 | { 41 | int width = 0; 42 | int height = 0; 43 | K4A.CalibrationExtrinsics extrinsics = null; 44 | 45 | switch (calibrationType) 46 | { 47 | case K4A.CalibrationType.Depth: 48 | width = calibration.DepthCameraCalibration.resolutionWidth; 49 | height = calibration.DepthCameraCalibration.resolutionHeight; 50 | 51 | extrinsics = calibration.ColorCameraCalibration.extrinsics; 52 | extrinsics.translation[0] /= 1000.0f; // [millimeters] -> [meters] 53 | extrinsics.translation[1] /= 1000.0f; // [millimeters] -> [meters] 54 | extrinsics.translation[2] /= 1000.0f; // [millimeters] -> [meters] 55 | 56 | break; 57 | case K4A.CalibrationType.Color: 58 | width = calibration.ColorCameraCalibration.resolutionWidth; 59 | height = calibration.ColorCameraCalibration.resolutionHeight; 60 | 61 | extrinsics = calibration.DepthCameraCalibration.extrinsics; 62 | 63 | break; 64 | default: 65 | Debug.LogError("Unexpected camera calibration type," + 66 | "should either be K4A.CalibrationType.Depth or K4A.CalibrationType.Color"); 67 | return; 68 | } 69 | 70 | if (width <= 0 || height <= 0) 71 | { 72 | Debug.LogError("Camera resolution is invalid: " + width + "x" + height); 73 | return; 74 | } 75 | 76 | if (_Mesh != null) 77 | { 78 | _Mesh.Clear(); 79 | } 80 | else 81 | { 82 | _Mesh = new Mesh(); 83 | _Mesh.indexFormat = IndexFormat.UInt32; 84 | } 85 | 86 | float[] srcXYZ = new float[3]; 87 | float[] dstXYZ = new float[3]; 88 | 89 | Vector3[] vertices = new Vector3[width * height]; 90 | float[] xyTables; 91 | if (K4A.Transformation.InitXyTables(calibration, calibrationType, out xyTables)) 92 | { 93 | int pixelCount = 0; 94 | for (int y = 0; y < height; y++) 95 | { 96 | for (int x = 0; x < width; x++) 97 | { 98 | int index = 2 * pixelCount; 99 | 100 | srcXYZ[0] = xyTables[index]; 101 | srcXYZ[1] = xyTables[index + 1]; 102 | srcXYZ[2] = 1.0f; 103 | 104 | K4A.ExtrinsicTransformation.ApplyExtrinsicTransformation(extrinsics, srcXYZ, ref dstXYZ); 105 | 106 | vertices[x + y * width] = new Vector3(dstXYZ[0], dstXYZ[1], dstXYZ[2]); 107 | pixelCount++; 108 | } 109 | } 110 | } 111 | else 112 | { 113 | for (int y = 0; y < height; y++) 114 | { 115 | for (int x = 0; x < width; x++) 116 | { 117 | vertices[x + y * width] = new Vector3(0f, 0f, 0f); 118 | } 119 | } 120 | } 121 | _Mesh.vertices = vertices; 122 | 123 | Vector2[] uv = new Vector2[width * height]; 124 | for (int y = 0; y < height; y++) 125 | { 126 | for (int x = 0; x < width; x++) 127 | { 128 | uv[x + y * width].x = x / (float)width; 129 | uv[x + y * width].y = y / (float)height; 130 | } 131 | } 132 | _Mesh.uv = uv; 133 | 134 | int[] indices = new int[vertices.Length]; 135 | for (int i = 0; i < vertices.Length; i++) 136 | { 137 | indices[i] = i; 138 | } 139 | _Mesh.SetIndices(indices, MeshTopology.Points, 0, false); 140 | 141 | GetComponent().mesh = _Mesh; 142 | 143 | InitializeColorTexture(width, height); 144 | InitializeDepthTexture(width, height); 145 | } 146 | 147 | private void InitializeColorTexture(int width, int height) 148 | { 149 | _ColorTexture = new Texture2D(width, height, TextureFormat.BGRA32, false, true) 150 | { 151 | wrapMode = TextureWrapMode.Clamp, 152 | filterMode = FilterMode.Point, 153 | }; 154 | MeshRenderer meshRenderer = GetComponent(); 155 | meshRenderer.sharedMaterial.SetTexture("_MainTex", _ColorTexture); 156 | } 157 | 158 | private void InitializeDepthTexture(int width, int height) 159 | { 160 | _DepthTexture = new Texture2D(width, height, TextureFormat.R16, false, true) 161 | { 162 | wrapMode = TextureWrapMode.Clamp, 163 | filterMode = FilterMode.Point, 164 | }; 165 | MeshRenderer meshRenderer = GetComponent(); 166 | meshRenderer.sharedMaterial.SetTexture("_DepthTex", _DepthTexture); 167 | } 168 | } 169 | } 170 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Scripts/PointCloudRenderer.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1c17c122b318a2f469c06386c290cb78 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Shaders.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e08e6e071d8fbe74994b9a86c15a171e 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Shaders/DepthPointCloud.shader: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2020 Soichiro Sugimoto. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | Shader "Custom/DepthPointCloud" 5 | { 6 | Properties 7 | { 8 | _MainTex ("Color Texture", 2D) = "white" {} 9 | _DepthTex ("Depth Texture", 2D) = "white" {} 10 | _DepthScale ("Depth Scale", Float) = 1.0 11 | } 12 | 13 | SubShader 14 | { 15 | Tags { "RenderType"="Opaque" } 16 | LOD 100 17 | 18 | Pass 19 | { 20 | CGPROGRAM 21 | 22 | #pragma vertex vert 23 | #pragma fragment frag 24 | 25 | #include "UnityCG.cginc" 26 | 27 | struct appdata 28 | { 29 | float4 vertex : POSITION; 30 | float2 uv : TEXCOORD0; 31 | }; 32 | 33 | struct v2f 34 | { 35 | float2 uv : TEXCOORD0; 36 | float4 vertex : SV_POSITION; 37 | }; 38 | 39 | sampler2D _MainTex; 40 | float4 _MainTex_ST; 41 | 42 | sampler2D _DepthTex; 43 | float _DepthScale; 44 | 45 | v2f vert (appdata v) 46 | { 47 | // Original depth data format is 16-bit unsigned integer 48 | float4 depth = tex2Dlod(_DepthTex, float4(v.uv, 0, 0)).r * 65535.0 / 1000.0; 49 | 50 | v2f o; 51 | o.vertex = UnityObjectToClipPos(v.vertex * depth); 52 | o.uv = TRANSFORM_TEX(v.uv, _MainTex); 53 | return o; 54 | } 55 | 56 | fixed4 frag (v2f i) : SV_Target 57 | { 58 | fixed4 col = tex2D(_MainTex, i.uv); 59 | return col; 60 | } 61 | 62 | ENDCG 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Shaders/DepthPointCloud.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 530847223b838994ebccdc91bb181794 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Shaders/DepthVisualizer.shader: -------------------------------------------------------------------------------- 1 | // Copyright (c) Soichiro Sugimoto. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | Shader "Custom/DepthVisualizer" 5 | { 6 | Properties 7 | { 8 | _DepthScale ("Depth Scale", Float) = 1.0 9 | _MaxInMeters ("Maximum Distance", Float) = 4.2 10 | _MinInMeters ("Minimum Distance", Float) = 0.2 11 | } 12 | 13 | SubShader 14 | { 15 | Tags { "RenderType"="Opaque" } 16 | 17 | Pass 18 | { 19 | CGPROGRAM 20 | 21 | #pragma vertex vert 22 | #pragma fragment frag 23 | 24 | #include "UnityCG.cginc" 25 | 26 | struct appdata 27 | { 28 | float4 vertex : POSITION; 29 | float2 uv : TEXCOORD0; 30 | }; 31 | 32 | struct v2f 33 | { 34 | float2 uv : TEXCOORD0; 35 | float4 vertex : SV_POSITION; 36 | }; 37 | 38 | Buffer _DepthBuffer; 39 | int _Width; 40 | int _Height; 41 | 42 | float _DepthScale; 43 | float _MaxInMeters; 44 | float _MinInMeters; 45 | 46 | uint uint_to_ushort(uint raw, bool high) 47 | { 48 | uint4 c4 = uint4(raw, raw >> 8, raw >> 16, raw >> 24) & 0xff; 49 | uint2 c2 = high ? c4.zw : c4.xy; 50 | return c2.x + (c2.y << 8); 51 | } 52 | 53 | v2f vert (appdata v) 54 | { 55 | v2f o; 56 | o.vertex = UnityObjectToClipPos(v.vertex); 57 | o.uv = v.uv; 58 | return o; 59 | } 60 | 61 | fixed4 frag (v2f i) : SV_Target 62 | { 63 | // Buffer index 64 | uint idx = (uint)(i.uv.x * _Width) + (uint)((1 - i.uv.y) * _Height) * _Width; 65 | 66 | // Depth sample (int16 -> float) 67 | float depth = uint_to_ushort(_DepthBuffer[idx >> 1], idx & 1) / 1000.0 * _DepthScale; 68 | 69 | float h = 300.0/360.0 * (depth - _MinInMeters) / ((_MaxInMeters - _MinInMeters) * _DepthScale); 70 | float s = 1.0; 71 | float v = 1.0; 72 | 73 | if (depth < _MinInMeters || depth > _MaxInMeters) 74 | { 75 | v = 0.0; 76 | } 77 | 78 | float r = 0.0; 79 | float g = 0.0; 80 | float b = 0.0; 81 | if (s > 0.0) 82 | { 83 | h *= 6.0; 84 | int i = (int) h; 85 | float f = h - (float) i; 86 | float aa = v * (1 - s); 87 | float bb = v * (1 - s * f); 88 | float cc = v * (1 - s * (1 - f)); 89 | switch (i) 90 | { 91 | default: 92 | case 0: 93 | r = v; 94 | g = cc; 95 | b = aa; 96 | break; 97 | case 1: 98 | r = bb; 99 | g = v; 100 | b = aa; 101 | break; 102 | case 2: 103 | r = aa; 104 | g = v; 105 | b = cc; 106 | break; 107 | case 3: 108 | r = aa; 109 | g = bb; 110 | b = v; 111 | break; 112 | case 4: 113 | r = cc; 114 | g = aa; 115 | b = v; 116 | break; 117 | case 5: 118 | r = v; 119 | g = aa; 120 | b = bb; 121 | break; 122 | } 123 | } 124 | 125 | return float4(r, g, b, 1); 126 | } 127 | 128 | ENDCG 129 | } 130 | } 131 | } 132 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Shaders/DepthVisualizer.shader.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ea9d8c86bbe2a7f4b9a437f75dd25491 3 | ShaderImporter: 4 | externalObjects: {} 5 | defaultTextures: [] 6 | nonModifiableTextures: [] 7 | userData: 8 | assetBundleName: 9 | assetBundleVariant: 10 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9af183dc0c38d3042af8367d552c89da 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Materials.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: d58d6f2d94970594c8c25ed6da0a77ca 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Materials/XMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: XMaterial 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0.9339623, g: 0.15419187, b: 0.15419187, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Materials/XMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 19a78d592f0a58442843aa156428c78d 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Materials/YMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: YMaterial 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0.18856516, g: 0.9339623, b: 0.17181383, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Materials/YMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ef2afdcacafc7da4f9034a996723ad11 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Materials/ZMaterial.mat: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!21 &2100000 4 | Material: 5 | serializedVersion: 6 6 | m_ObjectHideFlags: 0 7 | m_CorrespondingSourceObject: {fileID: 0} 8 | m_PrefabInternal: {fileID: 0} 9 | m_Name: ZMaterial 10 | m_Shader: {fileID: 46, guid: 0000000000000000f000000000000000, type: 0} 11 | m_ShaderKeywords: 12 | m_LightmapFlags: 4 13 | m_EnableInstancingVariants: 0 14 | m_DoubleSidedGI: 0 15 | m_CustomRenderQueue: -1 16 | stringTagMap: {} 17 | disabledShaderPasses: [] 18 | m_SavedProperties: 19 | serializedVersion: 3 20 | m_TexEnvs: 21 | - _BumpMap: 22 | m_Texture: {fileID: 0} 23 | m_Scale: {x: 1, y: 1} 24 | m_Offset: {x: 0, y: 0} 25 | - _DetailAlbedoMap: 26 | m_Texture: {fileID: 0} 27 | m_Scale: {x: 1, y: 1} 28 | m_Offset: {x: 0, y: 0} 29 | - _DetailMask: 30 | m_Texture: {fileID: 0} 31 | m_Scale: {x: 1, y: 1} 32 | m_Offset: {x: 0, y: 0} 33 | - _DetailNormalMap: 34 | m_Texture: {fileID: 0} 35 | m_Scale: {x: 1, y: 1} 36 | m_Offset: {x: 0, y: 0} 37 | - _EmissionMap: 38 | m_Texture: {fileID: 0} 39 | m_Scale: {x: 1, y: 1} 40 | m_Offset: {x: 0, y: 0} 41 | - _MainTex: 42 | m_Texture: {fileID: 0} 43 | m_Scale: {x: 1, y: 1} 44 | m_Offset: {x: 0, y: 0} 45 | - _MetallicGlossMap: 46 | m_Texture: {fileID: 0} 47 | m_Scale: {x: 1, y: 1} 48 | m_Offset: {x: 0, y: 0} 49 | - _OcclusionMap: 50 | m_Texture: {fileID: 0} 51 | m_Scale: {x: 1, y: 1} 52 | m_Offset: {x: 0, y: 0} 53 | - _ParallaxMap: 54 | m_Texture: {fileID: 0} 55 | m_Scale: {x: 1, y: 1} 56 | m_Offset: {x: 0, y: 0} 57 | m_Floats: 58 | - _BumpScale: 1 59 | - _Cutoff: 0.5 60 | - _DetailNormalMapScale: 1 61 | - _DstBlend: 0 62 | - _GlossMapScale: 1 63 | - _Glossiness: 0.5 64 | - _GlossyReflections: 1 65 | - _Metallic: 0 66 | - _Mode: 0 67 | - _OcclusionStrength: 1 68 | - _Parallax: 0.02 69 | - _SmoothnessTextureChannel: 0 70 | - _SpecularHighlights: 1 71 | - _SrcBlend: 1 72 | - _UVSec: 0 73 | - _ZWrite: 1 74 | m_Colors: 75 | - _Color: {r: 0.1033731, g: 0.15186034, b: 0.9528302, a: 1} 76 | - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} 77 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Materials/ZMaterial.mat.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 6296326654b2eb8458d58acc5f4f4387 3 | NativeFormatImporter: 4 | externalObjects: {} 5 | mainObjectFileID: 0 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Prefabs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: c8f1d3aa0b4e2ab4bb7305342ecb5be1 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Prefabs/XYZ-Axis.prefab: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!1 &2158344269664875747 4 | GameObject: 5 | m_ObjectHideFlags: 0 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | serializedVersion: 6 10 | m_Component: 11 | - component: {fileID: 2158344269664875748} 12 | m_Layer: 0 13 | m_Name: XYZ-Axis 14 | m_TagString: Untagged 15 | m_Icon: {fileID: 0} 16 | m_NavMeshLayer: 0 17 | m_StaticEditorFlags: 0 18 | m_IsActive: 1 19 | --- !u!4 &2158344269664875748 20 | Transform: 21 | m_ObjectHideFlags: 0 22 | m_CorrespondingSourceObject: {fileID: 0} 23 | m_PrefabInstance: {fileID: 0} 24 | m_PrefabAsset: {fileID: 0} 25 | m_GameObject: {fileID: 2158344269664875747} 26 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 27 | m_LocalPosition: {x: 0, y: 0, z: 0} 28 | m_LocalScale: {x: 1, y: 1, z: 1} 29 | m_Children: 30 | - {fileID: 2158344270279596885} 31 | - {fileID: 2158344270018144819} 32 | - {fileID: 2158344271432798031} 33 | m_Father: {fileID: 0} 34 | m_RootOrder: 0 35 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 36 | --- !u!1 &2158344270018144818 37 | GameObject: 38 | m_ObjectHideFlags: 0 39 | m_CorrespondingSourceObject: {fileID: 0} 40 | m_PrefabInstance: {fileID: 0} 41 | m_PrefabAsset: {fileID: 0} 42 | serializedVersion: 6 43 | m_Component: 44 | - component: {fileID: 2158344270018144819} 45 | - component: {fileID: 2158344270018144822} 46 | - component: {fileID: 2158344270018144821} 47 | - component: {fileID: 2158344270018144820} 48 | m_Layer: 0 49 | m_Name: YAxis 50 | m_TagString: Untagged 51 | m_Icon: {fileID: 0} 52 | m_NavMeshLayer: 0 53 | m_StaticEditorFlags: 0 54 | m_IsActive: 1 55 | --- !u!4 &2158344270018144819 56 | Transform: 57 | m_ObjectHideFlags: 0 58 | m_CorrespondingSourceObject: {fileID: 0} 59 | m_PrefabInstance: {fileID: 0} 60 | m_PrefabAsset: {fileID: 0} 61 | m_GameObject: {fileID: 2158344270018144818} 62 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 63 | m_LocalPosition: {x: 0, y: 0.05, z: 0} 64 | m_LocalScale: {x: 0.01, y: 0.1, z: 0.01} 65 | m_Children: [] 66 | m_Father: {fileID: 2158344269664875748} 67 | m_RootOrder: 1 68 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 69 | --- !u!33 &2158344270018144822 70 | MeshFilter: 71 | m_ObjectHideFlags: 0 72 | m_CorrespondingSourceObject: {fileID: 0} 73 | m_PrefabInstance: {fileID: 0} 74 | m_PrefabAsset: {fileID: 0} 75 | m_GameObject: {fileID: 2158344270018144818} 76 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 77 | --- !u!23 &2158344270018144821 78 | MeshRenderer: 79 | m_ObjectHideFlags: 0 80 | m_CorrespondingSourceObject: {fileID: 0} 81 | m_PrefabInstance: {fileID: 0} 82 | m_PrefabAsset: {fileID: 0} 83 | m_GameObject: {fileID: 2158344270018144818} 84 | m_Enabled: 1 85 | m_CastShadows: 1 86 | m_ReceiveShadows: 1 87 | m_DynamicOccludee: 1 88 | m_MotionVectors: 1 89 | m_LightProbeUsage: 1 90 | m_ReflectionProbeUsage: 1 91 | m_RenderingLayerMask: 1 92 | m_RendererPriority: 0 93 | m_Materials: 94 | - {fileID: 2100000, guid: ef2afdcacafc7da4f9034a996723ad11, type: 2} 95 | m_StaticBatchInfo: 96 | firstSubMesh: 0 97 | subMeshCount: 0 98 | m_StaticBatchRoot: {fileID: 0} 99 | m_ProbeAnchor: {fileID: 0} 100 | m_LightProbeVolumeOverride: {fileID: 0} 101 | m_ScaleInLightmap: 1 102 | m_PreserveUVs: 0 103 | m_IgnoreNormalsForChartDetection: 0 104 | m_ImportantGI: 0 105 | m_StitchLightmapSeams: 0 106 | m_SelectedEditorRenderState: 3 107 | m_MinimumChartSize: 4 108 | m_AutoUVMaxDistance: 0.5 109 | m_AutoUVMaxAngle: 89 110 | m_LightmapParameters: {fileID: 0} 111 | m_SortingLayerID: 0 112 | m_SortingLayer: 0 113 | m_SortingOrder: 0 114 | --- !u!65 &2158344270018144820 115 | BoxCollider: 116 | m_ObjectHideFlags: 0 117 | m_CorrespondingSourceObject: {fileID: 0} 118 | m_PrefabInstance: {fileID: 0} 119 | m_PrefabAsset: {fileID: 0} 120 | m_GameObject: {fileID: 2158344270018144818} 121 | m_Material: {fileID: 0} 122 | m_IsTrigger: 0 123 | m_Enabled: 1 124 | serializedVersion: 2 125 | m_Size: {x: 1, y: 1, z: 1} 126 | m_Center: {x: 0, y: 0, z: 0} 127 | --- !u!1 &2158344270279596884 128 | GameObject: 129 | m_ObjectHideFlags: 0 130 | m_CorrespondingSourceObject: {fileID: 0} 131 | m_PrefabInstance: {fileID: 0} 132 | m_PrefabAsset: {fileID: 0} 133 | serializedVersion: 6 134 | m_Component: 135 | - component: {fileID: 2158344270279596885} 136 | - component: {fileID: 2158344270279596888} 137 | - component: {fileID: 2158344270279596887} 138 | - component: {fileID: 2158344270279596886} 139 | m_Layer: 0 140 | m_Name: XAxis 141 | m_TagString: Untagged 142 | m_Icon: {fileID: 0} 143 | m_NavMeshLayer: 0 144 | m_StaticEditorFlags: 0 145 | m_IsActive: 1 146 | --- !u!4 &2158344270279596885 147 | Transform: 148 | m_ObjectHideFlags: 0 149 | m_CorrespondingSourceObject: {fileID: 0} 150 | m_PrefabInstance: {fileID: 0} 151 | m_PrefabAsset: {fileID: 0} 152 | m_GameObject: {fileID: 2158344270279596884} 153 | m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} 154 | m_LocalPosition: {x: 0.05, y: 0, z: 0} 155 | m_LocalScale: {x: 0.1, y: 0.01, z: 0.01} 156 | m_Children: [] 157 | m_Father: {fileID: 2158344269664875748} 158 | m_RootOrder: 0 159 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 160 | --- !u!33 &2158344270279596888 161 | MeshFilter: 162 | m_ObjectHideFlags: 0 163 | m_CorrespondingSourceObject: {fileID: 0} 164 | m_PrefabInstance: {fileID: 0} 165 | m_PrefabAsset: {fileID: 0} 166 | m_GameObject: {fileID: 2158344270279596884} 167 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 168 | --- !u!23 &2158344270279596887 169 | MeshRenderer: 170 | m_ObjectHideFlags: 0 171 | m_CorrespondingSourceObject: {fileID: 0} 172 | m_PrefabInstance: {fileID: 0} 173 | m_PrefabAsset: {fileID: 0} 174 | m_GameObject: {fileID: 2158344270279596884} 175 | m_Enabled: 1 176 | m_CastShadows: 1 177 | m_ReceiveShadows: 1 178 | m_DynamicOccludee: 1 179 | m_MotionVectors: 1 180 | m_LightProbeUsage: 1 181 | m_ReflectionProbeUsage: 1 182 | m_RenderingLayerMask: 1 183 | m_RendererPriority: 0 184 | m_Materials: 185 | - {fileID: 2100000, guid: 19a78d592f0a58442843aa156428c78d, type: 2} 186 | m_StaticBatchInfo: 187 | firstSubMesh: 0 188 | subMeshCount: 0 189 | m_StaticBatchRoot: {fileID: 0} 190 | m_ProbeAnchor: {fileID: 0} 191 | m_LightProbeVolumeOverride: {fileID: 0} 192 | m_ScaleInLightmap: 1 193 | m_PreserveUVs: 0 194 | m_IgnoreNormalsForChartDetection: 0 195 | m_ImportantGI: 0 196 | m_StitchLightmapSeams: 0 197 | m_SelectedEditorRenderState: 3 198 | m_MinimumChartSize: 4 199 | m_AutoUVMaxDistance: 0.5 200 | m_AutoUVMaxAngle: 89 201 | m_LightmapParameters: {fileID: 0} 202 | m_SortingLayerID: 0 203 | m_SortingLayer: 0 204 | m_SortingOrder: 0 205 | --- !u!65 &2158344270279596886 206 | BoxCollider: 207 | m_ObjectHideFlags: 0 208 | m_CorrespondingSourceObject: {fileID: 0} 209 | m_PrefabInstance: {fileID: 0} 210 | m_PrefabAsset: {fileID: 0} 211 | m_GameObject: {fileID: 2158344270279596884} 212 | m_Material: {fileID: 0} 213 | m_IsTrigger: 0 214 | m_Enabled: 1 215 | serializedVersion: 2 216 | m_Size: {x: 1, y: 1, z: 1} 217 | m_Center: {x: 0, y: 0, z: 0} 218 | --- !u!1 &2158344271432798030 219 | GameObject: 220 | m_ObjectHideFlags: 0 221 | m_CorrespondingSourceObject: {fileID: 0} 222 | m_PrefabInstance: {fileID: 0} 223 | m_PrefabAsset: {fileID: 0} 224 | serializedVersion: 6 225 | m_Component: 226 | - component: {fileID: 2158344271432798031} 227 | - component: {fileID: 2158344271432798034} 228 | - component: {fileID: 2158344271432798033} 229 | - component: {fileID: 2158344271432798032} 230 | m_Layer: 0 231 | m_Name: ZAxis 232 | m_TagString: Untagged 233 | m_Icon: {fileID: 0} 234 | m_NavMeshLayer: 0 235 | m_StaticEditorFlags: 0 236 | m_IsActive: 1 237 | --- !u!4 &2158344271432798031 238 | Transform: 239 | m_ObjectHideFlags: 0 240 | m_CorrespondingSourceObject: {fileID: 0} 241 | m_PrefabInstance: {fileID: 0} 242 | m_PrefabAsset: {fileID: 0} 243 | m_GameObject: {fileID: 2158344271432798030} 244 | m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} 245 | m_LocalPosition: {x: 0, y: 0, z: 0.05} 246 | m_LocalScale: {x: 0.01, y: 0.01, z: 0.1} 247 | m_Children: [] 248 | m_Father: {fileID: 2158344269664875748} 249 | m_RootOrder: 2 250 | m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} 251 | --- !u!33 &2158344271432798034 252 | MeshFilter: 253 | m_ObjectHideFlags: 0 254 | m_CorrespondingSourceObject: {fileID: 0} 255 | m_PrefabInstance: {fileID: 0} 256 | m_PrefabAsset: {fileID: 0} 257 | m_GameObject: {fileID: 2158344271432798030} 258 | m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} 259 | --- !u!23 &2158344271432798033 260 | MeshRenderer: 261 | m_ObjectHideFlags: 0 262 | m_CorrespondingSourceObject: {fileID: 0} 263 | m_PrefabInstance: {fileID: 0} 264 | m_PrefabAsset: {fileID: 0} 265 | m_GameObject: {fileID: 2158344271432798030} 266 | m_Enabled: 1 267 | m_CastShadows: 1 268 | m_ReceiveShadows: 1 269 | m_DynamicOccludee: 1 270 | m_MotionVectors: 1 271 | m_LightProbeUsage: 1 272 | m_ReflectionProbeUsage: 1 273 | m_RenderingLayerMask: 1 274 | m_RendererPriority: 0 275 | m_Materials: 276 | - {fileID: 2100000, guid: 6296326654b2eb8458d58acc5f4f4387, type: 2} 277 | m_StaticBatchInfo: 278 | firstSubMesh: 0 279 | subMeshCount: 0 280 | m_StaticBatchRoot: {fileID: 0} 281 | m_ProbeAnchor: {fileID: 0} 282 | m_LightProbeVolumeOverride: {fileID: 0} 283 | m_ScaleInLightmap: 1 284 | m_PreserveUVs: 0 285 | m_IgnoreNormalsForChartDetection: 0 286 | m_ImportantGI: 0 287 | m_StitchLightmapSeams: 0 288 | m_SelectedEditorRenderState: 3 289 | m_MinimumChartSize: 4 290 | m_AutoUVMaxDistance: 0.5 291 | m_AutoUVMaxAngle: 89 292 | m_LightmapParameters: {fileID: 0} 293 | m_SortingLayerID: 0 294 | m_SortingLayer: 0 295 | m_SortingOrder: 0 296 | --- !u!65 &2158344271432798032 297 | BoxCollider: 298 | m_ObjectHideFlags: 0 299 | m_CorrespondingSourceObject: {fileID: 0} 300 | m_PrefabInstance: {fileID: 0} 301 | m_PrefabAsset: {fileID: 0} 302 | m_GameObject: {fileID: 2158344271432798030} 303 | m_Material: {fileID: 0} 304 | m_IsTrigger: 0 305 | m_Enabled: 1 306 | serializedVersion: 2 307 | m_Size: {x: 1, y: 1, z: 1} 308 | m_Center: {x: 0, y: 0, z: 0} 309 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Prefabs/XYZ-Axis.prefab.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 111f28151da4e814395ac8d7e2f22732 3 | PrefabImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Scripts.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 534e6746d02ad144a8052195be2983c5 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Scripts/CameraController.cs: -------------------------------------------------------------------------------- 1 | // 2 | // This is a modified version of the source code from Es's blog. 3 | // 4 | // The original source code is available in Es's blog. 5 | // http://esprog.hatenablog.com/entry/2016/03/20/033322 6 | // 7 | 8 | using UnityEngine; 9 | 10 | public class CameraController : MonoBehaviour 11 | { 12 | [SerializeField] float _TrackSpeed = 2.0f; 13 | [SerializeField] float _MoveSpeed = 0.5f; 14 | [SerializeField] float _RotateSpeed = 2.0f; 15 | 16 | public enum MouseButtonType 17 | { 18 | Left, 19 | Middle, 20 | Right, 21 | None, 22 | } 23 | 24 | void Update() 25 | { 26 | #if UNITY_EDITOR || UNITY_STANDALONE 27 | Track(); 28 | MouseButtonType buttonType = GetInputMouseButton(); 29 | switch(buttonType) 30 | { 31 | case MouseButtonType.Left: 32 | break; 33 | case MouseButtonType.Right: 34 | Rotate(); 35 | break; 36 | case MouseButtonType.Middle: 37 | Move(); 38 | break; 39 | default: 40 | break; 41 | } 42 | #endif 43 | } 44 | 45 | private void Track() 46 | { 47 | float scroll = Input.GetAxis("Mouse ScrollWheel"); 48 | transform.position += transform.forward * _TrackSpeed * scroll; 49 | } 50 | 51 | private void Rotate() 52 | { 53 | Vector2 angle = Vector2.zero; 54 | angle.x = Input.GetAxis("Mouse X"); 55 | angle.y = Input.GetAxis("Mouse Y"); 56 | transform.RotateAround(transform.position, Vector3.up, _RotateSpeed * angle.x); 57 | transform.RotateAround(transform.position, transform.right, -_RotateSpeed * angle.y); 58 | } 59 | 60 | private void Move() 61 | { 62 | Vector3 horizontal = transform.right * (-Input.GetAxis("Mouse X")) * _MoveSpeed; 63 | Vector3 vertical = transform.up * (-Input.GetAxis("Mouse Y")) * _MoveSpeed; 64 | transform.position += (horizontal + vertical); 65 | } 66 | 67 | private MouseButtonType GetInputMouseButton() 68 | { 69 | if(Input.GetMouseButton(0)) 70 | { 71 | return MouseButtonType.Left; 72 | } 73 | else if(Input.GetMouseButton(1)) 74 | { 75 | return MouseButtonType.Right; 76 | } 77 | else if(Input.GetMouseButton(2)) 78 | { 79 | return MouseButtonType.Middle; 80 | } 81 | else 82 | { 83 | return MouseButtonType.None; 84 | } 85 | } 86 | } -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/Utilities/Scripts/CameraController.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67288c27185a401478829ee535bcc737 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 84f30292c2303404498cdddc40ce20e8 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/LICENSE: -------------------------------------------------------------------------------- 1 | Copyright (c) Microsoft Corporation. All rights reserved. 2 | 3 | MIT License 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED *AS IS*, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/LICENSE.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ae67ce93a611c4e4a9e994c3e1f428d7 3 | DefaultImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/README.md: -------------------------------------------------------------------------------- 1 | # K4A Transformation 2 | 3 | - This is a ported version of a part of Azure Kinect Sensor SDK (K4A). 4 | - The original source code is available on GitHub. 5 | https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/src/ 6 | 7 | ## License 8 | - [MIT License](https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/LICENSE) 9 | 10 | ## Developer 11 | - [Soichiro Sugimoto](https://github.com/sotanmochi) 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 2642c42b2777cd34886afcea0265895c 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 1b744bda50b8874489bf7e59676563ee 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src/ExtrinsicTransformation.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the MIT License. 3 | // 4 | // This code is a ported version of a part of extrinsic_transformation.c in Azure Kinect Sensor SDK (K4A). 5 | // 6 | // The original source code is available on GitHub. 7 | // https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/src/transformation/extrinsic_transformation.c 8 | // 9 | 10 | namespace K4A 11 | { 12 | public static class ExtrinsicTransformation 13 | { 14 | public static bool ApplyExtrinsicTransformation(in CalibrationExtrinsics sourceToTarget, in float[] sourcePoint3d, ref float[] targetPoint3d) 15 | { 16 | ExtrinsicsTransformPoint3(sourceToTarget, sourcePoint3d, ref targetPoint3d); 17 | return true; 18 | } 19 | 20 | public static bool GetExtrinsicTransformation(in CalibrationExtrinsics worldToSource, in CalibrationExtrinsics worldToTarget, ref CalibrationExtrinsics sourceToTarget) 21 | { 22 | CalibrationExtrinsics sourceToWorld = new CalibrationExtrinsics(); 23 | ExtrinsicsInvert(worldToSource, ref sourceToWorld); 24 | ExtrinsicsMult(worldToTarget, sourceToWorld, ref sourceToTarget); 25 | return true; 26 | } 27 | 28 | public static void ExtrinsicsTransformPoint3(in CalibrationExtrinsics sourceToTarget, in float[] x, ref float[] y) 29 | { 30 | float a = x[0], b = x[1], c = x[2]; 31 | float[][] R = sourceToTarget.rotation; 32 | float[] t = sourceToTarget.translation; 33 | 34 | y[0] = R[0][0] * a + R[0][1] * b + R[0][2] * c + t[0]; 35 | y[1] = R[1][0] * a + R[1][1] * b + R[1][2] * c + t[1]; 36 | y[2] = R[2][0] * a + R[2][1] * b + R[2][2] * c + t[2]; 37 | } 38 | 39 | public static void ExtrinsicsInvert(in CalibrationExtrinsics x, ref CalibrationExtrinsics xinv) 40 | { 41 | Math.Transpose3x3(x.rotation, ref xinv.rotation); 42 | Math.MultAx3x3(xinv.rotation, x.translation, ref xinv.translation); 43 | Math.Negate3(xinv.translation, ref xinv.translation); 44 | } 45 | 46 | public static void ExtrinsicsMult(in CalibrationExtrinsics a, in CalibrationExtrinsics b, ref CalibrationExtrinsics ab) 47 | { 48 | float[] Rt = new float[3]; 49 | Math.MultAx3x3(a.rotation, b.translation, ref Rt); 50 | Math.Add3(Rt, a.translation, ref ab.translation); 51 | Math.MultAB3x3x3(a.rotation, b.rotation, ref ab.rotation); 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src/ExtrinsicTransformation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8e8589cff5c9e5640afadf1232472158 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src/IntrinsicTransformation.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the MIT License. 3 | // 4 | // This code is a ported version of a part of intrinsic_transformation.c in Azure Kinect Sensor SDK (K4A). 5 | // 6 | // The original source code is available on GitHub. 7 | // https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/src/transformation/intrinsic_transformation.c 8 | // 9 | 10 | namespace K4A 11 | { 12 | public class IntrinsicTransformation 13 | { 14 | public static bool Project(in CalibrationCamera cameraCalibration, in float[] point3d, ref float[] point2d, ref int valid) 15 | { 16 | if (point3d[2] <= 0.0f) 17 | { 18 | point2d[0] = 0.0f; 19 | point2d[1] = 0.0f; 20 | valid = 0; 21 | return true; 22 | } 23 | 24 | float[] xy = new float[2]; 25 | xy[0] = point3d[0] / point3d[2]; 26 | xy[1] = point3d[1] / point3d[2]; 27 | 28 | float[] J_xy = null; 29 | bool succeeded = ProjectInternal(cameraCalibration, xy, ref point2d, ref valid, ref J_xy); 30 | if (!succeeded) 31 | { 32 | return false; 33 | } 34 | 35 | return true; 36 | } 37 | 38 | public static bool Unproject(in CalibrationCamera cameraCalibration, in float[] point2d, in float depth, ref float[] point3d, ref int valid) 39 | { 40 | if (depth == 0.0f) 41 | { 42 | point3d[0] = 0.0f; 43 | point3d[1] = 0.0f; 44 | point3d[2] = 0.0f; 45 | valid = 0; 46 | return true; 47 | } 48 | 49 | bool succeeded = UnprojectInternal(cameraCalibration, point2d, ref point3d, ref valid); 50 | if (!succeeded) 51 | { 52 | return false; 53 | } 54 | 55 | point3d[0] *= depth; 56 | point3d[1] *= depth; 57 | point3d[2] = depth; 58 | 59 | return true; 60 | } 61 | 62 | public static bool UnprojectInternal(in CalibrationCamera cameraCalibration, in float[] uv, ref float[] xy, ref int valid) 63 | { 64 | CalibrationIntrinsics intrinsics = cameraCalibration.intrinsics; 65 | 66 | float cx = intrinsics.cx; 67 | float cy = intrinsics.cy; 68 | float fx = intrinsics.fx; 69 | float fy = intrinsics.fy; 70 | float k1 = intrinsics.k1; 71 | float k2 = intrinsics.k2; 72 | float k3 = intrinsics.k3; 73 | float k4 = intrinsics.k4; 74 | float k5 = intrinsics.k5; 75 | float k6 = intrinsics.k6; 76 | float codx = intrinsics.codx; 77 | float cody = intrinsics.cody; 78 | float p1 = intrinsics.p1; 79 | float p2 = intrinsics.p2; 80 | 81 | if (!(fx > 0.0f && fy > 0.0f)) 82 | { 83 | return false; 84 | } 85 | 86 | // correction for radial distortion 87 | float xp_d = (uv[0] - cx) / fx - codx; 88 | float yp_d = (uv[1] - cy) / fy - cody; 89 | 90 | float rs = xp_d * xp_d + yp_d * yp_d; 91 | float rss = rs * rs; 92 | float rsc = rss * rs; 93 | float a = 1.0f + k1 * rs + k2 * rss + k3 * rsc; 94 | float b = 1.0f + k4 * rs + k5 * rss + k6 * rsc; 95 | float ai; 96 | if (a != 0.0f) 97 | { 98 | ai = 1.0f / a; 99 | } 100 | else 101 | { 102 | ai = 1.0f; 103 | } 104 | float di = ai * b; 105 | 106 | xy[0] = xp_d * di; 107 | xy[1] = yp_d * di; 108 | 109 | // approximate correction for tangential params 110 | float two_xy = 2.0f * xy[0] * xy[1]; 111 | float xx = xy[0] * xy[0]; 112 | float yy = xy[1] * xy[1]; 113 | 114 | xy[0] -= (yy + 3.0f * xx) * p2 + two_xy * p1; 115 | xy[1] -= (xx + 3.0f * yy) * p1 + two_xy * p2; 116 | 117 | // add on center of distortion 118 | xy[0] += codx; 119 | xy[1] += cody; 120 | 121 | return IterativeUnproject(cameraCalibration, uv, ref xy, ref valid, 20); 122 | } 123 | 124 | public static bool IterativeUnproject(in CalibrationCamera cameraCalibration, in float[] uv, ref float[] xy, ref int valid, int maxPasses) 125 | { 126 | valid = 1; 127 | float[] Jinv = new float[2 * 2]; 128 | float[] best_xy = new float[2] { 0.0f, 0.0f }; 129 | float best_err = float.MaxValue; 130 | 131 | for (int pass = 0; pass < maxPasses; pass++) 132 | { 133 | float[] p = new float[2]; 134 | float[] J = new float[2 * 2]; 135 | 136 | if (!ProjectInternal(cameraCalibration, xy, ref p, ref valid, ref J)) 137 | { 138 | return false; 139 | } 140 | if (valid == 0) 141 | { 142 | return true; 143 | } 144 | 145 | float err_x = uv[0] - p[0]; 146 | float err_y = uv[1] - p[1]; 147 | float err = err_x * err_x + err_y * err_y; 148 | if (err >= best_err) 149 | { 150 | xy[0] = best_xy[0]; 151 | xy[1] = best_xy[1]; 152 | break; 153 | } 154 | 155 | best_err = err; 156 | best_xy[0] = xy[0]; 157 | best_xy[1] = xy[1]; 158 | Invert2x2(J, ref Jinv); 159 | if(pass + 1 == maxPasses || best_err < 1e-22f) 160 | { 161 | break; 162 | } 163 | 164 | float dx = Jinv[0] * err_x + Jinv[1] * err_y; 165 | float dy = Jinv[2] * err_x + Jinv[3] * err_y; 166 | 167 | xy[0] += dx; 168 | xy[1] += dy; 169 | } 170 | 171 | if (best_err > 1e-6f) 172 | { 173 | valid = 0; 174 | } 175 | 176 | return true; 177 | } 178 | 179 | public static bool ProjectInternal(in CalibrationCamera cameraCalibration, in float[] xy, ref float[] uv, ref int valid, ref float[] J_xy) 180 | { 181 | CalibrationIntrinsics intrinsics = cameraCalibration.intrinsics; 182 | 183 | float cx = intrinsics.cx; 184 | float cy = intrinsics.cy; 185 | float fx = intrinsics.fx; 186 | float fy = intrinsics.fy; 187 | float k1 = intrinsics.k1; 188 | float k2 = intrinsics.k2; 189 | float k3 = intrinsics.k3; 190 | float k4 = intrinsics.k4; 191 | float k5 = intrinsics.k5; 192 | float k6 = intrinsics.k6; 193 | float codx = intrinsics.codx; 194 | float cody = intrinsics.cody; 195 | float p1 = intrinsics.p1; 196 | float p2 = intrinsics.p2; 197 | float max_radius_for_projection = cameraCalibration.metricRadius; 198 | 199 | if (!((fx > 0.0f && fy > 0.0f))) 200 | { 201 | return false; 202 | } 203 | 204 | valid = 1; 205 | 206 | float xp = xy[0] - codx; 207 | float yp = xy[1] - cody; 208 | 209 | float xp2 = xp * xp; 210 | float yp2 = yp * yp; 211 | float xyp = xp * yp; 212 | float rs = xp2 + yp2; 213 | if (rs > max_radius_for_projection * max_radius_for_projection) 214 | { 215 | valid = 0; 216 | return true; 217 | } 218 | float rss = rs * rs; 219 | float rsc = rss * rs; 220 | float a = 1.0f + k1 * rs + k2 * rss + k3 * rsc; 221 | float b = 1.0f + k4 * rs + k5 * rss + k6 * rsc; 222 | float bi; 223 | if (b != 0.0f) 224 | { 225 | bi = 1.0f / b; 226 | } 227 | else 228 | { 229 | bi = 1.0f; 230 | } 231 | float d = a * bi; 232 | 233 | float xp_d = xp * d; 234 | float yp_d = yp * d; 235 | 236 | float rs_2xp2 = rs + 2.0f * xp2; 237 | float rs_2yp2 = rs + 2.0f * yp2; 238 | 239 | xp_d += rs_2xp2 * p2 + 2.0f * xyp * p1; 240 | yp_d += rs_2yp2 * p1 + 2.0f * xyp * p2; 241 | 242 | float xp_d_cx = xp_d + codx; 243 | float yp_d_cy = yp_d + cody; 244 | 245 | uv[0] = xp_d_cx * fx + cx; 246 | uv[1] = yp_d_cy * fy + cy; 247 | 248 | if (J_xy == null) 249 | { 250 | return true; 251 | } 252 | 253 | // compute Jacobian matrix 254 | float dudrs = k1 + 2.0f * k2 * rs + 3.0f * k3 * rss; 255 | // compute d(b)/d(r^2) 256 | float dvdrs = k4 + 2.0f * k5 * rs + 3.0f * k6 * rss; 257 | float bis = bi * bi; 258 | float dddrs = (dudrs * b - a * dvdrs) * bis; 259 | 260 | float dddrs_2 = dddrs * 2.0f; 261 | float xp_dddrs_2 = xp * dddrs_2; 262 | float yp_xp_dddrs_2 = yp * xp_dddrs_2; 263 | 264 | J_xy[0] = fx * (d + xp * xp_dddrs_2 + 6.0f * xp * p2 + 2.0f * yp * p1); 265 | J_xy[1] = fx * (yp_xp_dddrs_2 + 2.0f * yp * p2 + 2.0f * xp * p1); 266 | J_xy[2] = fy * (yp_xp_dddrs_2 + 2.0f * xp * p1 + 2.0f * yp * p2); 267 | J_xy[3] = fy * (d + yp * yp * dddrs_2 + 6.0f * yp * p1 + 2.0f * xp * p2); 268 | 269 | return true; 270 | } 271 | 272 | // Size of J and Jinv should be 4. 273 | public static void Invert2x2(in float[] J, ref float[] Jinv) 274 | { 275 | float detJ = J[0] * J[3] - J[1] * J[2]; 276 | float inv_detJ = 1.0f / detJ; 277 | 278 | Jinv[0] = inv_detJ * J[3]; 279 | Jinv[3] = inv_detJ * J[0]; 280 | Jinv[1] = -inv_detJ * J[1]; 281 | Jinv[2] = -inv_detJ * J[2]; 282 | } 283 | } 284 | } 285 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src/IntrinsicTransformation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ffd401b6911f6ea43910b997a9dc7648 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src/K4ATypes.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the MIT License. 3 | // 4 | // This code is a ported version of a part of k4atypes.h in Azure Kinect Sensor SDK (K4A). 5 | // 6 | // The original source code is available on GitHub. 7 | // https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/include/k4a/k4atypes.h 8 | // 9 | 10 | using System; 11 | 12 | namespace K4A 13 | { 14 | public enum CalibrationType 15 | { 16 | Unknown = -1, 17 | Depth = 0, 18 | Color = 1, 19 | Gyro = 2, 20 | Accel = 3, 21 | Num = 4, 22 | } 23 | 24 | [Serializable] 25 | public class Calibration 26 | { 27 | public CalibrationCamera DepthCameraCalibration = new CalibrationCamera(); 28 | public CalibrationCamera ColorCameraCalibration = new CalibrationCamera(); 29 | public CalibrationExtrinsics SourceToTargetExtrinsics = new CalibrationExtrinsics(); 30 | } 31 | 32 | [Serializable] 33 | public class CalibrationCamera 34 | { 35 | public CalibrationExtrinsics extrinsics = new CalibrationExtrinsics(); 36 | public CalibrationIntrinsics intrinsics = new CalibrationIntrinsics(); 37 | public int resolutionWidth; 38 | public int resolutionHeight; 39 | public float metricRadius; 40 | } 41 | 42 | [Serializable] 43 | public class CalibrationIntrinsics 44 | { 45 | public float cx; /**< Principal point in image, x */ 46 | public float cy; /**< Principal point in image, y */ 47 | public float fx; /**< Focal length x */ 48 | public float fy; /**< Focal length y */ 49 | public float k1; /**< k1 radial distortion coefficient */ 50 | public float k2; /**< k2 radial distortion coefficient */ 51 | public float k3; /**< k3 radial distortion coefficient */ 52 | public float k4; /**< k4 radial distortion coefficient */ 53 | public float k5; /**< k5 radial distortion coefficient */ 54 | public float k6; /**< k6 radial distortion coefficient */ 55 | public float codx; /**< Center of distortion in Z=1 plane, x (only used for Rational6KT) */ 56 | public float cody; /**< Center of distortion in Z=1 plane, y (only used for Rational6KT) */ 57 | public float p2; /**< Tangential distortion coefficient 2 */ 58 | public float p1; /**< Tangential distortion coefficient 1 */ 59 | public float metricRadius; /**< Metric radius */ 60 | } 61 | 62 | [Serializable] 63 | public class CalibrationExtrinsics 64 | { 65 | /**< 3x3 Rotation matrix stored in row major order */ 66 | public float[][] rotation = new float[3][]{ new float[3], new float[3], new float[3]}; 67 | 68 | /**< Translation vector, x,y,z (in millimeters) */ 69 | public float[] translation = new float[3]; 70 | } 71 | } 72 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src/K4ATypes.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: f6cb9fcb3d2e2d849a54a0c7c208305b 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src/Math.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the MIT License. 3 | // 4 | // This code is a ported version of a part of transformation.c in Azure Kinect Sensor SDK (K4A). 5 | // 6 | // The original source code is available on GitHub. 7 | // https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/src/math/math.c 8 | // 9 | 10 | namespace K4A 11 | { 12 | public class Math 13 | { 14 | public static void Transpose3x3(in float[][] src, ref float[][] dst) 15 | { 16 | for (int i = 0; i < 3; ++i) 17 | { 18 | dst[i][i] = src[i][i]; 19 | for (int j = i + 1; j < 3; ++j) 20 | { 21 | float tmp = src[i][j]; 22 | dst[i][j] = src[j][i]; 23 | dst[j][i] = tmp; 24 | } 25 | } 26 | } 27 | 28 | public static void Negate3(in float[] src, ref float[] dst) 29 | { 30 | dst[0] = -src[0]; 31 | dst[1] = -src[1]; 32 | dst[2] = -src[2]; 33 | } 34 | 35 | public static void Add3(in float[] a, in float[] b, ref float[] dst) 36 | { 37 | dst[0] = a[0] + b[0]; 38 | dst[1] = a[1] + b[1]; 39 | dst[2] = a[2] + b[2]; 40 | } 41 | 42 | public static void Scale3(in float[] src, float s, ref float[] dst) 43 | { 44 | dst[0] = src[0] * s; 45 | dst[1] = src[1] * s; 46 | dst[2] = src[2] * s; 47 | } 48 | 49 | public static void AddScaled3(in float[] src, float s, ref float[] dst) 50 | { 51 | dst[0] += src[0] * s; 52 | dst[1] += src[1] * s; 53 | dst[2] += src[2] * s; 54 | } 55 | 56 | public static float MathDot3(in float[] a, in float[] b) 57 | { 58 | return a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; 59 | } 60 | 61 | public static void MultAx3x3(in float[][] A, in float[] x, ref float[] dst) 62 | { 63 | float y0 = MathDot3(A[0], x); 64 | float y1 = MathDot3(A[1], x); 65 | float y2 = MathDot3(A[2], x); 66 | dst[0] = y0; 67 | dst[1] = y1; 68 | dst[2] = y2; 69 | } 70 | 71 | public static void MultAtx3x3(in float[][] A, in float[] x, ref float[] dst) 72 | { 73 | float x0 = x[0], x1 = x[1], x2 = x[2]; 74 | Scale3(A[0], x0, ref dst); 75 | AddScaled3(A[1], x1, ref dst); 76 | AddScaled3(A[2], x2, ref dst); 77 | } 78 | 79 | public static void MultAB3x3x3(in float[][] A, in float[][] B, ref float[][] dst) 80 | { 81 | MultAtx3x3(B, A[0], ref dst[0]); 82 | MultAtx3x3(B, A[1], ref dst[1]); 83 | MultAtx3x3(B, A[2], ref dst[2]); 84 | } 85 | } 86 | } 87 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src/Math.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 57de7a41daa3bec4a8eb4e23acbaf9ef 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src/Transformation.cs: -------------------------------------------------------------------------------- 1 | // 2 | // Licensed under the MIT License. 3 | // 4 | // This code is a ported version of a part of transformation.c in Azure Kinect Sensor SDK (K4A). 5 | // 6 | // The original source code is available on GitHub. 7 | // https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/src/transformation/transformation.c 8 | // 9 | 10 | namespace K4A 11 | { 12 | public static class Transformation 13 | { 14 | public static bool InitXyTables(Calibration calibration, CalibrationType camera, out float[] xyTables) 15 | { 16 | int width = 0; 17 | int height = 0; 18 | 19 | switch (camera) 20 | { 21 | case CalibrationType.Depth: 22 | width = calibration.DepthCameraCalibration.resolutionWidth; 23 | height = calibration.DepthCameraCalibration.resolutionHeight; 24 | break; 25 | case CalibrationType.Color: 26 | width = calibration.ColorCameraCalibration.resolutionWidth; 27 | height = calibration.ColorCameraCalibration.resolutionHeight; 28 | break; 29 | default: 30 | xyTables = null; 31 | return false; 32 | } 33 | 34 | xyTables = new float[2 * width * height]; 35 | 36 | float[] point2d = new float[2]; 37 | float[] point3d = new float[3]; 38 | int valid = 0; 39 | 40 | for (int y = 0, idx = 0; y < height; y++) 41 | { 42 | point2d[1] = (float)y; 43 | for (int x = 0; x < width; x++, idx++) 44 | { 45 | point2d[0] = (float)x; 46 | 47 | bool succeeded = Transformation2dTo3d(calibration, point2d, 1.0f, camera, camera, ref point3d, ref valid); 48 | if (!succeeded) 49 | { 50 | return false; 51 | } 52 | 53 | if (valid == 0) 54 | { 55 | xyTables[2 * idx] = 0.0f; 56 | xyTables[2 * idx + 1] = 0.0f; 57 | } 58 | else 59 | { 60 | xyTables[2 * idx] = point3d[0]; 61 | xyTables[2 * idx + 1] = point3d[1]; 62 | } 63 | } 64 | } 65 | 66 | return true; 67 | } 68 | 69 | public static bool Transformation2dTo3d(Calibration calibration, float[] sourcePoint2d, float sourceDepth, 70 | CalibrationType sourceCamera, CalibrationType targetCamera, ref float[] targetPoint3d, ref int valid) 71 | { 72 | bool succeeded = false; 73 | 74 | if (sourceCamera == CalibrationType.Depth) 75 | { 76 | succeeded = IntrinsicTransformation.Unproject(calibration.DepthCameraCalibration, sourcePoint2d, sourceDepth, ref targetPoint3d, ref valid); 77 | } 78 | else if (sourceCamera == CalibrationType.Color) 79 | { 80 | succeeded = IntrinsicTransformation.Unproject(calibration.ColorCameraCalibration, sourcePoint2d, sourceDepth, ref targetPoint3d, ref valid); 81 | } 82 | 83 | if (!succeeded) 84 | { 85 | return false; 86 | } 87 | 88 | if (sourceCamera == targetCamera) 89 | { 90 | return true; 91 | } 92 | else 93 | { 94 | return Transformation3dTo3d(calibration, targetPoint3d, sourceCamera, targetCamera, ref targetPoint3d);; 95 | } 96 | } 97 | 98 | public static bool Transformation3dTo3d(Calibration calibration, float[] sourcePoint3d, 99 | CalibrationType sourceCamera, CalibrationType targetCamera, ref float[] targetPoint3d) 100 | { 101 | if (sourceCamera == targetCamera) 102 | { 103 | targetPoint3d[0] = sourcePoint3d[0]; 104 | targetPoint3d[1] = sourcePoint3d[1]; 105 | targetPoint3d[2] = sourcePoint3d[2]; 106 | return true; 107 | } 108 | 109 | bool succeeded = ExtrinsicTransformation.ApplyExtrinsicTransformation(calibration.SourceToTargetExtrinsics, sourcePoint3d, ref targetPoint3d); 110 | if (!succeeded) 111 | { 112 | return false; 113 | } 114 | 115 | return true; 116 | } 117 | 118 | public static bool Transformation3dTo2d(Calibration calibration, float[] sourcePoint3d, 119 | CalibrationType sourceCamera, CalibrationType targetCamera, ref float[] targetPoint2d, ref int valid) 120 | { 121 | float[] targetPoint3d = new float[3]; 122 | if (sourceCamera == targetCamera) 123 | { 124 | targetPoint3d[0] = sourcePoint3d[0]; 125 | targetPoint3d[1] = sourcePoint3d[1]; 126 | targetPoint3d[2] = sourcePoint3d[2]; 127 | } 128 | else 129 | { 130 | bool succeeded = Transformation3dTo3d(calibration, sourcePoint3d, sourceCamera, targetCamera, ref targetPoint3d); 131 | if (!succeeded) 132 | { 133 | return false; 134 | } 135 | } 136 | 137 | if (targetCamera == CalibrationType.Depth) 138 | { 139 | return IntrinsicTransformation.Project(calibration.DepthCameraCalibration, targetPoint3d, ref targetPoint2d, ref valid); 140 | } 141 | else if (targetCamera == CalibrationType.Color) 142 | { 143 | return IntrinsicTransformation.Project(calibration.ColorCameraCalibration, targetPoint3d, ref targetPoint2d, ref valid); 144 | } 145 | 146 | return true; 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/src/Transformation.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 47fa03da10499f54f822ebd3a854e2b2 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/tests.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e291b8c72fc7b964d95a40dc57041621 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/tests/MathTest.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace K4ATest 3 | { 4 | public class MathTest 5 | { 6 | public static bool TestMultAx3x3(ref float[] Ax) 7 | { 8 | float[][] A = new float[3][]{ new float[3], new float[3], new float[3]}; 9 | float[] x = new float[3]; 10 | float[] y = new float[3]; 11 | 12 | A[0][0] = 1.0f; A[0][1] = 2.0f; A[0][2] = 3.0f; 13 | A[1][0] = 3.0f; A[1][1] = 1.0f; A[1][2] = 2.0f; 14 | A[2][0] = 2.0f; A[2][1] = 3.0f; A[2][2] = 1.0f; 15 | 16 | x[0] = 1.0f; 17 | x[1] = 2.0f; 18 | x[2] = 3.0f; 19 | 20 | // y = A*x 21 | y[0] = 14.0f; 22 | y[1] = 11.0f; 23 | y[2] = 11.0f; 24 | 25 | K4A.Math.MultAx3x3(A, x, ref Ax); 26 | 27 | if (Ax[0].Equals(y[0]) && Ax[1].Equals(y[1]) && Ax[2].Equals(y[2])) 28 | { 29 | return true; 30 | } 31 | 32 | return false; 33 | } 34 | 35 | public static bool TestTranspose3x3(ref float[][] At) 36 | { 37 | float[][] A = new float[3][]{ new float[3], new float[3], new float[3]}; 38 | float[][] B = new float[3][]{ new float[3], new float[3], new float[3]}; 39 | 40 | A[0][0] = 1.0f; A[0][1] = 2.0f; A[0][2] = 3.0f; 41 | A[1][0] = 4.0f; A[1][1] = 5.0f; A[1][2] = 6.0f; 42 | A[2][0] = 7.0f; A[2][1] = 8.0f; A[2][2] = 9.0f; 43 | 44 | // B is the transposed matrix of A 45 | B[0][0] = 1.0f; B[0][1] = 4.0f; B[0][2] = 7.0f; 46 | B[1][0] = 2.0f; B[1][1] = 5.0f; B[1][2] = 8.0f; 47 | B[2][0] = 3.0f; B[2][1] = 6.0f; B[2][2] = 9.0f; 48 | 49 | K4A.Math.Transpose3x3(A, ref At); 50 | 51 | if (At[0][0].Equals(B[0][0]) && At[0][1].Equals(B[0][1]) && At[0][2].Equals(B[0][2]) 52 | && At[1][0].Equals(B[1][0]) && At[1][1].Equals(B[1][1]) && At[1][2].Equals(B[1][2]) 53 | && At[2][0].Equals(B[2][0]) && At[2][1].Equals(B[2][1]) && At[2][2].Equals(B[2][2])) 54 | { 55 | return true; 56 | } 57 | 58 | return false; 59 | } 60 | 61 | public static bool TestMultAB3x3x3(ref float[][] AB) 62 | { 63 | float[][] A = new float[3][]{ new float[3], new float[3], new float[3]}; 64 | float[][] B = new float[3][]{ new float[3], new float[3], new float[3]}; 65 | float[][] C = new float[3][]{ new float[3], new float[3], new float[3]}; 66 | 67 | A[0][0] = 1.0f; A[0][1] = 2.0f; A[0][2] = 3.0f; 68 | A[1][0] = 4.0f; A[1][1] = 5.0f; A[1][2] = 6.0f; 69 | A[2][0] = 7.0f; A[2][1] = 8.0f; A[2][2] = 9.0f; 70 | 71 | B[0][0] = 9.0f; B[0][1] = 8.0f; B[0][2] = 7.0f; 72 | B[1][0] = 6.0f; B[1][1] = 5.0f; B[1][2] = 4.0f; 73 | B[2][0] = 3.0f; B[2][1] = 2.0f; B[2][2] = 1.0f; 74 | 75 | // C = A * B 76 | C[0][0] = 30.0f; C[0][1] = 24.0f; C[0][2] = 18.0f; 77 | C[1][0] = 84.0f; C[1][1] = 69.0f; C[1][2] = 54.0f; 78 | C[2][0] = 138.0f; C[2][1] = 114.0f; C[2][2] = 90.0f; 79 | 80 | K4A.Math.MultAB3x3x3(A, B, ref AB); 81 | 82 | if (AB[0][0].Equals(C[0][0]) && AB[0][1].Equals(C[0][1]) && AB[0][2].Equals(C[0][2]) 83 | && AB[1][0].Equals(C[1][0]) && AB[1][1].Equals(C[1][1]) && AB[1][2].Equals(C[1][2]) 84 | && AB[2][0].Equals(C[2][0]) && AB[2][1].Equals(C[2][1]) && AB[2][2].Equals(C[2][2])) 85 | { 86 | return true; 87 | } 88 | 89 | return false; 90 | } 91 | } 92 | } 93 | -------------------------------------------------------------------------------- /Assets/AzureKinect4Unity/_K4ATransformation/tests/MathTest.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e44a4e622948e1f4682529ca700c6d31 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8266afb16ff73ea4b8c12a891c4fde0c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit/Runtime.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5789983e76143b84b95a8947e41b9830 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit/Runtime/FloorDetection.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9e81d2f240c983f44bf6a76f954d448c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit/Runtime/FloorDetection/FloorDetector.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ad6c4fc8580ff644abf024acf763b3b5 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit/Runtime/FloorDetection/Plane.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) Microsoft Corporation. All rights reserved. 2 | // Licensed under the MIT License. 3 | // 4 | // This code is a ported and modified version of the floor plane detector from Azure Kinect DK Code Samples. 5 | // 6 | // The original source code is available on GitHub. 7 | // https://github.com/microsoft/Azure-Kinect-Samples/blob/master/body-tracking-samples/floor_detector_sample/SampleMathTypes.h 8 | // 9 | 10 | using System; 11 | using System.Numerics; 12 | using System.Runtime.InteropServices; 13 | using Point = System.Numerics.Vector3; 14 | 15 | namespace AzureKinectToolkit 16 | { 17 | [StructLayout(LayoutKind.Sequential)] 18 | public struct Plane 19 | { 20 | public Vector3 Normal { get; set; } 21 | public Point Origin { get; set; } 22 | public float C { get; set; } 23 | 24 | public Plane(Vector3 normal, Point origin, float c) 25 | { 26 | this.Normal = normal; 27 | this.Origin = origin; 28 | this.C = c; 29 | } 30 | 31 | public static Plane Create(Vector3 n, Point p) 32 | { 33 | float c = n.X * p.X + n.Y * p.Y + n.Z * p.Z; 34 | return new Plane(n, p, -c); 35 | } 36 | 37 | public static Plane Create(in Point p1, in Point p2, in Point p3) 38 | { 39 | Vector3 v1 = p2 - p1; 40 | Vector3 v2 = p2 - p3; 41 | Vector3 n = v1 * v2; 42 | return Create(n, p1); 43 | } 44 | 45 | public Vector3 ProjectVector(in Vector3 v) 46 | { 47 | return v - Normal * (Vector3.Dot(v, Normal) / Normal.LengthSquared()); 48 | } 49 | 50 | public Vector3 ProjectPoint(in Point p) 51 | { 52 | return Origin + ProjectVector(p - Origin); 53 | } 54 | 55 | public float AbsDistance(in Point p) 56 | { 57 | return Math.Abs(p.X * Normal.X + p.Y * Normal.Y + p.Z * Normal.Z + C) / Normal.Length(); 58 | } 59 | } 60 | } 61 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit/Runtime/FloorDetection/Plane.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e125fcb199ba07c4cab7ecc3c4f85193 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit/Runtime/FloorDetection/README.md: -------------------------------------------------------------------------------- 1 | # Floor Plane Detection 2 | 3 | This is a ported and modified version of the floor plane detector from Azure Kinect DK Code Samples. 4 | 5 | The original source code is available on GitHub. 6 | https://github.com/microsoft/Azure-Kinect-Samples/blob/master/body-tracking-samples/floor_detector_sample/FloorDetector.cpp 7 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit/Runtime/FloorDetection/README.md.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0d44b6e379a0b8d41b9b409bdb6642d9 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit/Runtime/SensorOrientation.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f045393b22d091499d82b7a66f88009 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit/Runtime/SensorOrientation/SensorOrientationEstimator.cs: -------------------------------------------------------------------------------- 1 | // Copyright (c) 2021 Soichiro Sugimoto. 2 | // Licensed under the MIT License. See LICENSE in the project root for license information. 3 | 4 | using System; 5 | 6 | namespace AzureKinectToolkit 7 | { 8 | public static class SensorOrientationEstimator 9 | { 10 | /// 11 | /// Calculate tilted angles of a sensor for Azure Kinect. 12 | /// 13 | /// 14 | /// 15 | public static System.Numerics.Vector3 EstimateFromAccelerometerForAzureKinect(System.Numerics.Vector3 k4aImuAccSample) 16 | { 17 | // 18 | // Azure Kinect coordinate systems 19 | // https://docs.microsoft.com/ja-jp/azure/Kinect-dk/coordinate-systems 20 | // 21 | // In the accelerometer coordinate system, 22 | // the exact positive direction of axis is the opposite direction figured in the document. 23 | // 24 | // The coordinate system is oriented such that 25 | // the positive X-axis points forward, 26 | // the positive Y-axis points right, 27 | // the positive Z-axis points upward. 28 | // 29 | // The acceleration due to gravity, g, is in a direction toward the ground. 30 | // 31 | return EstimateFromAccelerometer(-k4aImuAccSample); 32 | } 33 | 34 | /// 35 | /// Calculate tilted angles of a sensor in the coordinate system with the positive direction of the Z-axis toward the ground direction. 36 | /// 37 | /// 38 | /// 39 | public static System.Numerics.Vector3 EstimateFromAccelerometer(System.Numerics.Vector3 accelerometer) 40 | { 41 | System.Numerics.Vector3 estimatedAngles = System.Numerics.Vector3.Zero; 42 | 43 | float ayz = (float) Math.Sqrt(accelerometer.Y * accelerometer.Y + accelerometer.Z * accelerometer.Z); 44 | 45 | float roll = (float) Math.Atan2(accelerometer.Y, accelerometer.Z); 46 | float pitch = (float) -Math.Atan2(accelerometer.X, ayz); 47 | 48 | estimatedAngles.X = (float)(roll * 180.0 / Math.PI); 49 | estimatedAngles.Y = (float)(pitch * 180.0 / Math.PI); 50 | 51 | return estimatedAngles; 52 | } 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Assets/AzureKinectToolkit/Runtime/SensorOrientation/SensorOrientationEstimator.cs.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 67a30d09bee7ad2499c99eb87283c9cf 3 | MonoImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | defaultReferences: [] 7 | executionOrder: 0 8 | icon: {instanceID: 0} 9 | userData: 10 | assetBundleName: 11 | assetBundleVariant: 12 | -------------------------------------------------------------------------------- /Assets/Plugins.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a1aabfa20201f4947a5157b9bdc75d42 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/AzureKinectSDK.1.4.0.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 364a3db130cb18441b1ce0872f47d09f 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/AzureKinectSDK.1.4.0/LICENSE.txt.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: caf0654bf67b4264094c87e5cd458fe5 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/AzureKinectSDK.1.4.0/Microsoft.Azure.Kinect.Sensor.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/Plugins/AzureKinectSDK.1.4.0/Microsoft.Azure.Kinect.Sensor.dll -------------------------------------------------------------------------------- /Assets/Plugins/AzureKinectSDK.1.4.0/Microsoft.Azure.Kinect.Sensor.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 58d8451a0db401d4c9f4a92cd66c754c 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Assets/Plugins/AzureKinectSDK.1.4.0/depthengine_2_0.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/Plugins/AzureKinectSDK.1.4.0/depthengine_2_0.dll -------------------------------------------------------------------------------- /Assets/Plugins/AzureKinectSDK.1.4.0/depthengine_2_0.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 9ed098577a642b84094c34ae16d85330 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | userData: 26 | assetBundleName: 27 | assetBundleVariant: 28 | -------------------------------------------------------------------------------- /Assets/Plugins/AzureKinectSDK.1.4.0/k4a.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/Plugins/AzureKinectSDK.1.4.0/k4a.dll -------------------------------------------------------------------------------- /Assets/Plugins/AzureKinectSDK.1.4.0/k4a.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 5ad4510cadaff7040bfb247d8457e713 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | userData: 26 | assetBundleName: 27 | assetBundleVariant: 28 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Buffers.4.4.0.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 82bd484d99fc19248a0134908a15b76a 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Buffers.4.4.0/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Buffers.4.4.0/LICENSE.TXT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e3220ea2be011344191170925c148adf 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Buffers.4.4.0/System.Buffers.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/Plugins/System.Buffers.4.4.0/System.Buffers.dll -------------------------------------------------------------------------------- /Assets/Plugins/System.Buffers.4.4.0/System.Buffers.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 0f8785882102a9c4493494069c9f0958 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Buffers.4.4.0/THIRD-PARTY-NOTICES.TXT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 363b8a525ea675349967d1d4d2b1853b 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Memory.4.5.3.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: e17d98e8bdb81ba4da9a453e6c78714c 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Memory.4.5.3/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Memory.4.5.3/LICENSE.TXT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 3c2e6900e15c6bb4182191546df0ec56 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Memory.4.5.3/System.Memory.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/Plugins/System.Memory.4.5.3/System.Memory.dll -------------------------------------------------------------------------------- /Assets/Plugins/System.Memory.4.5.3/System.Memory.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b628c5eb83b9c5c459fda95eb3e7c880 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Memory.4.5.3/THIRD-PARTY-NOTICES.TXT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: b4b270ce4b05b014eaad0f23db6a0373 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Numerics.Vectors.4.5.0.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 24dd660fd37fba04195c33517ca4d650 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Numerics.Vectors.4.5.0/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Numerics.Vectors.4.5.0/LICENSE.TXT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: ce4f739a57c4d3b49a48cf7417aeccf6 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Numerics.Vectors.4.5.0/System.Numerics.Vectors.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/Plugins/System.Numerics.Vectors.4.5.0/System.Numerics.Vectors.dll -------------------------------------------------------------------------------- /Assets/Plugins/System.Numerics.Vectors.4.5.0/System.Numerics.Vectors.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 8175dbe35da4dff49a2442624b7a59ab 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | '': Any 16 | second: 17 | enabled: 0 18 | settings: 19 | Exclude Android: 0 20 | Exclude Editor: 1 21 | Exclude Linux: 0 22 | Exclude Linux64: 0 23 | Exclude LinuxUniversal: 0 24 | Exclude OSXUniversal: 0 25 | Exclude Win: 0 26 | Exclude Win64: 0 27 | - first: 28 | Android: Android 29 | second: 30 | enabled: 1 31 | settings: 32 | CPU: ARMv7 33 | - first: 34 | Any: 35 | second: 36 | enabled: 0 37 | settings: {} 38 | - first: 39 | Editor: Editor 40 | second: 41 | enabled: 0 42 | settings: 43 | CPU: AnyCPU 44 | DefaultValueInitialized: true 45 | OS: AnyOS 46 | - first: 47 | Facebook: Win 48 | second: 49 | enabled: 0 50 | settings: 51 | CPU: AnyCPU 52 | - first: 53 | Facebook: Win64 54 | second: 55 | enabled: 0 56 | settings: 57 | CPU: AnyCPU 58 | - first: 59 | Standalone: Linux 60 | second: 61 | enabled: 1 62 | settings: 63 | CPU: x86 64 | - first: 65 | Standalone: Linux64 66 | second: 67 | enabled: 1 68 | settings: 69 | CPU: x86_64 70 | - first: 71 | Standalone: LinuxUniversal 72 | second: 73 | enabled: 1 74 | settings: {} 75 | - first: 76 | Standalone: OSXUniversal 77 | second: 78 | enabled: 1 79 | settings: 80 | CPU: AnyCPU 81 | - first: 82 | Standalone: Win 83 | second: 84 | enabled: 1 85 | settings: 86 | CPU: AnyCPU 87 | - first: 88 | Standalone: Win64 89 | second: 90 | enabled: 1 91 | settings: 92 | CPU: AnyCPU 93 | - first: 94 | Windows Store Apps: WindowsStoreApps 95 | second: 96 | enabled: 0 97 | settings: 98 | CPU: AnyCPU 99 | userData: 100 | assetBundleName: 101 | assetBundleVariant: 102 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Numerics.Vectors.4.5.0/THIRD-PARTY-NOTICES.TXT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 38a6a4ab7a07d624babc20c6ddb35c3f 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Runtime.CompilerServices.Unsafe.4.5.2.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 906b535a06b840940adadff0098533ad 3 | folderAsset: yes 4 | DefaultImporter: 5 | externalObjects: {} 6 | userData: 7 | assetBundleName: 8 | assetBundleVariant: 9 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) .NET Foundation and Contributors 4 | 5 | All rights reserved. 6 | 7 | Permission is hereby granted, free of charge, to any person obtaining a copy 8 | of this software and associated documentation files (the "Software"), to deal 9 | in the Software without restriction, including without limitation the rights 10 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 11 | copies of the Software, and to permit persons to whom the Software is 12 | furnished to do so, subject to the following conditions: 13 | 14 | The above copyright notice and this permission notice shall be included in all 15 | copies or substantial portions of the Software. 16 | 17 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 18 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 19 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 20 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 21 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 22 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 23 | SOFTWARE. 24 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Runtime.CompilerServices.Unsafe.4.5.2/LICENSE.TXT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 72f3d4dbda0fe43418c91223cf0ce9e0 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/sotanmochi/AzureKinect4Unity/ce69602bfc183dbb00c7d41566d3cec423f3cce2/Assets/Plugins/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.dll -------------------------------------------------------------------------------- /Assets/Plugins/System.Runtime.CompilerServices.Unsafe.4.5.2/System.Runtime.CompilerServices.Unsafe.dll.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: a5095c9d1220a674bae44691e5cc8443 3 | PluginImporter: 4 | externalObjects: {} 5 | serializedVersion: 2 6 | iconMap: {} 7 | executionOrder: {} 8 | defineConstraints: [] 9 | isPreloaded: 0 10 | isOverridable: 0 11 | isExplicitlyReferenced: 0 12 | validateReferences: 1 13 | platformData: 14 | - first: 15 | Any: 16 | second: 17 | enabled: 1 18 | settings: {} 19 | - first: 20 | Editor: Editor 21 | second: 22 | enabled: 0 23 | settings: 24 | DefaultValueInitialized: true 25 | - first: 26 | Windows Store Apps: WindowsStoreApps 27 | second: 28 | enabled: 0 29 | settings: 30 | CPU: AnyCPU 31 | userData: 32 | assetBundleName: 33 | assetBundleVariant: 34 | -------------------------------------------------------------------------------- /Assets/Plugins/System.Runtime.CompilerServices.Unsafe.4.5.2/THIRD-PARTY-NOTICES.TXT.meta: -------------------------------------------------------------------------------- 1 | fileFormatVersion: 2 2 | guid: 858d4f50f77724d4daabd61f4379332a 3 | TextScriptImporter: 4 | externalObjects: {} 5 | userData: 6 | assetBundleName: 7 | assetBundleVariant: 8 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Soichiro Sugimoto 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Packages/manifest.json: -------------------------------------------------------------------------------- 1 | { 2 | "dependencies": { 3 | "com.unity.2d.sprite": "1.0.0", 4 | "com.unity.2d.tilemap": "1.0.0", 5 | "com.unity.ads": "3.6.1", 6 | "com.unity.analytics": "3.3.5", 7 | "com.unity.collab-proxy": "1.2.16", 8 | "com.unity.ide.rider": "1.2.1", 9 | "com.unity.ide.vscode": "1.2.3", 10 | "com.unity.multiplayer-hlapi": "1.0.8", 11 | "com.unity.purchasing": "3.0.2", 12 | "com.unity.test-framework": "1.1.24", 13 | "com.unity.textmeshpro": "2.1.4", 14 | "com.unity.timeline": "1.2.18", 15 | "com.unity.toolchain.win-x86_64-linux-x86_64": "0.1.19-preview", 16 | "com.unity.ugui": "1.0.0", 17 | "com.unity.xr.legacyinputhelpers": "2.1.7", 18 | "com.unity.modules.ai": "1.0.0", 19 | "com.unity.modules.androidjni": "1.0.0", 20 | "com.unity.modules.animation": "1.0.0", 21 | "com.unity.modules.assetbundle": "1.0.0", 22 | "com.unity.modules.audio": "1.0.0", 23 | "com.unity.modules.cloth": "1.0.0", 24 | "com.unity.modules.director": "1.0.0", 25 | "com.unity.modules.imageconversion": "1.0.0", 26 | "com.unity.modules.imgui": "1.0.0", 27 | "com.unity.modules.jsonserialize": "1.0.0", 28 | "com.unity.modules.particlesystem": "1.0.0", 29 | "com.unity.modules.physics": "1.0.0", 30 | "com.unity.modules.physics2d": "1.0.0", 31 | "com.unity.modules.screencapture": "1.0.0", 32 | "com.unity.modules.terrain": "1.0.0", 33 | "com.unity.modules.terrainphysics": "1.0.0", 34 | "com.unity.modules.tilemap": "1.0.0", 35 | "com.unity.modules.ui": "1.0.0", 36 | "com.unity.modules.uielements": "1.0.0", 37 | "com.unity.modules.umbra": "1.0.0", 38 | "com.unity.modules.unityanalytics": "1.0.0", 39 | "com.unity.modules.unitywebrequest": "1.0.0", 40 | "com.unity.modules.unitywebrequestassetbundle": "1.0.0", 41 | "com.unity.modules.unitywebrequestaudio": "1.0.0", 42 | "com.unity.modules.unitywebrequesttexture": "1.0.0", 43 | "com.unity.modules.unitywebrequestwww": "1.0.0", 44 | "com.unity.modules.vehicles": "1.0.0", 45 | "com.unity.modules.video": "1.0.0", 46 | "com.unity.modules.vr": "1.0.0", 47 | "com.unity.modules.wind": "1.0.0", 48 | "com.unity.modules.xr": "1.0.0" 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /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 | m_Volume: 1 7 | Rolloff Scale: 1 8 | Doppler Factor: 1 9 | Default Speaker Mode: 2 10 | m_SampleRate: 0 11 | m_DSPBufferSize: 1024 12 | m_VirtualVoiceCount: 512 13 | m_RealVoiceCount: 32 14 | m_SpatializerPlugin: 15 | m_AmbisonicDecoderPlugin: 16 | m_DisableAudio: 0 17 | m_VirtualizeEffects: 1 18 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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: 8 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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_SpritePackerMode: 0 12 | m_SpritePackerPaddingPower: 1 13 | m_EtcTextureCompressorBehavior: 1 14 | m_EtcTextureFastCompressor: 1 15 | m_EtcTextureNormalCompressor: 2 16 | m_EtcTextureBestCompressor: 4 17 | m_ProjectGenerationIncludedExtensions: txt;xml;fnt;cd 18 | m_ProjectGenerationRootNamespace: 19 | m_UserGeneratedProjectSuffix: 20 | m_CollabEditorSettings: 21 | inProgressEnabled: 1 22 | -------------------------------------------------------------------------------- /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: 10783, guid: 0000000000000000f000000000000000, type: 0} 39 | - {fileID: 16000, 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 | m_LogWhenShaderIsCompiled: 0 66 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /ProjectSettings/NetworkManager.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!149 &1 4 | NetworkManager: 5 | m_ObjectHideFlags: 0 6 | m_DebugLevel: 0 7 | m_Sendrate: 15 8 | m_AssetToPrefab: {} 9 | -------------------------------------------------------------------------------- /ProjectSettings/PackageManagerSettings.asset: -------------------------------------------------------------------------------- 1 | %YAML 1.1 2 | %TAG !u! tag:unity3d.com,2011: 3 | --- !u!114 &1 4 | MonoBehaviour: 5 | m_ObjectHideFlags: 61 6 | m_CorrespondingSourceObject: {fileID: 0} 7 | m_PrefabInstance: {fileID: 0} 8 | m_PrefabAsset: {fileID: 0} 9 | m_GameObject: {fileID: 0} 10 | m_Enabled: 1 11 | m_EditorHideFlags: 0 12 | m_Script: {fileID: 13964, guid: 0000000000000000e000000000000000, type: 0} 13 | m_Name: 14 | m_EditorClassIdentifier: 15 | m_ScopedRegistriesSettingsExpanded: 1 16 | oneTimeWarningShown: 0 17 | m_Registries: 18 | - m_Id: main 19 | m_Name: 20 | m_Url: https://packages.unity.com 21 | m_Scopes: [] 22 | m_IsDefault: 1 23 | m_UserSelectedRegistryName: 24 | m_UserAddingNewScopedRegistry: 0 25 | m_RegistryInfoDraft: 26 | m_ErrorMessage: 27 | m_Original: 28 | m_Id: 29 | m_Name: 30 | m_Url: 31 | m_Scopes: [] 32 | m_IsDefault: 0 33 | m_Modified: 0 34 | m_Name: 35 | m_Url: 36 | m_Scopes: 37 | - 38 | m_SelectedScopeIndex: 0 39 | -------------------------------------------------------------------------------- /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_AutoSimulation: 1 23 | m_QueriesHitTriggers: 1 24 | m_QueriesStartInColliders: 1 25 | m_ChangeStopsCallbacks: 0 26 | m_CallbacksOnDisable: 1 27 | m_ReuseCollisionCallbacks: 1 28 | m_AutoSyncTransforms: 0 29 | m_AlwaysShowColliders: 0 30 | m_ShowColliderSleep: 1 31 | m_ShowColliderContacts: 0 32 | m_ShowColliderAABB: 0 33 | m_ContactArrowScale: 0.2 34 | m_ColliderAwakeColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.7529412} 35 | m_ColliderAsleepColor: {r: 0.5686275, g: 0.95686275, b: 0.54509807, a: 0.36078432} 36 | m_ColliderContactColor: {r: 1, g: 0, b: 1, a: 0.6862745} 37 | m_ColliderAABBColor: {r: 1, g: 1, b: 0, a: 0.2509804} 38 | m_LayerCollisionMatrix: ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff 39 | -------------------------------------------------------------------------------- /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 | - type: 8 | m_NativeTypeID: 108 9 | m_ManagedTypePPtr: {fileID: 0} 10 | m_ManagedTypeFallback: 11 | defaultPresets: 12 | - m_Preset: {fileID: 2655988077585873504, guid: c1cf8506f04ef2c4a88b64b6c4202eea, 13 | type: 2} 14 | - type: 15 | m_NativeTypeID: 1020 16 | m_ManagedTypePPtr: {fileID: 0} 17 | m_ManagedTypeFallback: 18 | defaultPresets: 19 | - m_Preset: {fileID: 2655988077585873504, guid: 0cd792cc87e492d43b4e95b205fc5cc6, 20 | type: 2} 21 | - type: 22 | m_NativeTypeID: 1006 23 | m_ManagedTypePPtr: {fileID: 0} 24 | m_ManagedTypeFallback: 25 | defaultPresets: 26 | - m_Preset: {fileID: 2655988077585873504, guid: 7a99f8aa944efe94cb9bd74562b7d5f9, 27 | type: 2} 28 | -------------------------------------------------------------------------------- /ProjectSettings/ProjectVersion.txt: -------------------------------------------------------------------------------- 1 | m_EditorVersion: 2019.4.25f1 2 | m_EditorVersionWithRevision: 2019.4.25f1 (01a0494af254) 3 | -------------------------------------------------------------------------------- /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: 4 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 | particleRaycastBudget: 4 33 | asyncUploadTimeSlice: 2 34 | asyncUploadBufferSize: 16 35 | resolutionScalingFixedDPIFactor: 1 36 | excludedTargetPlatforms: [] 37 | - serializedVersion: 2 38 | name: Low 39 | pixelLightCount: 0 40 | shadows: 0 41 | shadowResolution: 0 42 | shadowProjection: 1 43 | shadowCascades: 1 44 | shadowDistance: 20 45 | shadowNearPlaneOffset: 3 46 | shadowCascade2Split: 0.33333334 47 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 48 | shadowmaskMode: 0 49 | blendWeights: 2 50 | textureQuality: 0 51 | anisotropicTextures: 0 52 | antiAliasing: 0 53 | softParticles: 0 54 | softVegetation: 0 55 | realtimeReflectionProbes: 0 56 | billboardsFaceCameraPosition: 0 57 | vSyncCount: 0 58 | lodBias: 0.4 59 | maximumLODLevel: 0 60 | particleRaycastBudget: 16 61 | asyncUploadTimeSlice: 2 62 | asyncUploadBufferSize: 16 63 | resolutionScalingFixedDPIFactor: 1 64 | excludedTargetPlatforms: [] 65 | - serializedVersion: 2 66 | name: Medium 67 | pixelLightCount: 1 68 | shadows: 1 69 | shadowResolution: 0 70 | shadowProjection: 1 71 | shadowCascades: 1 72 | shadowDistance: 20 73 | shadowNearPlaneOffset: 3 74 | shadowCascade2Split: 0.33333334 75 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 76 | shadowmaskMode: 0 77 | blendWeights: 2 78 | textureQuality: 0 79 | anisotropicTextures: 1 80 | antiAliasing: 0 81 | softParticles: 0 82 | softVegetation: 0 83 | realtimeReflectionProbes: 0 84 | billboardsFaceCameraPosition: 0 85 | vSyncCount: 1 86 | lodBias: 0.7 87 | maximumLODLevel: 0 88 | particleRaycastBudget: 64 89 | asyncUploadTimeSlice: 2 90 | asyncUploadBufferSize: 16 91 | resolutionScalingFixedDPIFactor: 1 92 | excludedTargetPlatforms: [] 93 | - serializedVersion: 2 94 | name: High 95 | pixelLightCount: 2 96 | shadows: 2 97 | shadowResolution: 1 98 | shadowProjection: 1 99 | shadowCascades: 2 100 | shadowDistance: 40 101 | shadowNearPlaneOffset: 3 102 | shadowCascade2Split: 0.33333334 103 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 104 | shadowmaskMode: 1 105 | blendWeights: 2 106 | textureQuality: 0 107 | anisotropicTextures: 1 108 | antiAliasing: 2 109 | softParticles: 0 110 | softVegetation: 1 111 | realtimeReflectionProbes: 1 112 | billboardsFaceCameraPosition: 1 113 | vSyncCount: 1 114 | lodBias: 1 115 | maximumLODLevel: 0 116 | particleRaycastBudget: 256 117 | asyncUploadTimeSlice: 2 118 | asyncUploadBufferSize: 16 119 | resolutionScalingFixedDPIFactor: 1 120 | excludedTargetPlatforms: [] 121 | - serializedVersion: 2 122 | name: Very High 123 | pixelLightCount: 3 124 | shadows: 2 125 | shadowResolution: 2 126 | shadowProjection: 1 127 | shadowCascades: 2 128 | shadowDistance: 40 129 | shadowNearPlaneOffset: 3 130 | shadowCascade2Split: 0.33333334 131 | shadowCascade4Split: {x: 0.06666667, y: 0.2, z: 0.46666667} 132 | shadowmaskMode: 1 133 | blendWeights: 4 134 | textureQuality: 0 135 | anisotropicTextures: 1 136 | antiAliasing: 4 137 | softParticles: 1 138 | softVegetation: 1 139 | realtimeReflectionProbes: 1 140 | billboardsFaceCameraPosition: 1 141 | vSyncCount: 1 142 | lodBias: 1.5 143 | maximumLODLevel: 0 144 | particleRaycastBudget: 1024 145 | asyncUploadTimeSlice: 2 146 | asyncUploadBufferSize: 16 147 | resolutionScalingFixedDPIFactor: 1 148 | excludedTargetPlatforms: [] 149 | - serializedVersion: 2 150 | name: Ultra 151 | pixelLightCount: 4 152 | shadows: 2 153 | shadowResolution: 2 154 | shadowProjection: 1 155 | shadowCascades: 4 156 | shadowDistance: 150 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: 1 164 | antiAliasing: 4 165 | softParticles: 1 166 | softVegetation: 1 167 | realtimeReflectionProbes: 1 168 | billboardsFaceCameraPosition: 1 169 | vSyncCount: 1 170 | lodBias: 2 171 | maximumLODLevel: 0 172 | particleRaycastBudget: 4096 173 | asyncUploadTimeSlice: 2 174 | asyncUploadBufferSize: 16 175 | resolutionScalingFixedDPIFactor: 1 176 | excludedTargetPlatforms: [] 177 | m_PerPlatformDefaultQuality: 178 | Android: 2 179 | Nintendo 3DS: 5 180 | Nintendo Switch: 5 181 | PS4: 5 182 | PSP2: 2 183 | Standalone: 5 184 | Tizen: 2 185 | WebGL: 3 186 | WiiU: 5 187 | Windows Store Apps: 5 188 | XboxOne: 5 189 | iPhone: 2 190 | tvOS: 2 191 | -------------------------------------------------------------------------------- /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 | - PostProcessing 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 | -------------------------------------------------------------------------------- /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.1 8 | m_TimeScale: 1 9 | Maximum Particle Timestep: 0.03 10 | -------------------------------------------------------------------------------- /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: 0 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 | -------------------------------------------------------------------------------- /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 | -------------------------------------------------------------------------------- /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 | } -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Azure Kinect for Unity 2 | 3 | ## Examples 4 | SimpleVisualizer 5 | 6 | 7 | 8 | OrientationEstimator 9 | 10 | 11 | 12 | ## Tested environment 13 | - Unity 2018.4.21f1 14 | - Azure Kinect SDK 1.4.0 15 | - Windows 10 16 | 17 | ## Initial setup for a new project 18 | ### 1. Install Azure Kinect SDK 19 | https://github.com/microsoft/Azure-Kinect-Sensor-SDK/blob/develop/docs/usage.md 20 | 21 | ### 2. Setup a Unity project 22 | 2.1. Create a new Unity project 23 | 24 | 2.2. Download and import NuGetForUnity (NuGetForUnity.2.0.0.unitypackage) 25 | https://github.com/GlitchEnzo/NuGetForUnity/releases/tag/v2.0.0 26 | 27 | 2.3. Install Microsoft.Azure.Kinect.Sensor package 28 | 29 | 30 | 31 | 2.4. Copy dll files from the SDK folder 32 | Copy "depthengine_2_0.dll" and "k4a.dll" from the SDK installation folder to Plugins folder. 33 | 34 | SDK installation folder 35 | C:\Program Files\Azure Kinect SDK v1.4.0\sdk\windows-desktop\amd64\release\bin 36 | 37 | Plugins folder 38 | 39 | 40 | 41 | 2.5. Import AzureKinect4Unity 42 | 43 | 44 | 45 | ## Third party assets 46 | このプロジェクトには、以下のアセットが含まれています。 47 | The following assets are included in this project. 48 | 49 | - Microsoft Azure Kinect Sensor SDK 50 | Microsoft Azure Kinect Sensor SDK files (the .dll files contained in the Assets/Plugins/AzureKinectSDK.1.4.0 directory) are distributed under the Microsoft Software License Terms. 51 | 52 | Please see the following license page for complete terms. 53 | https://www.nuget.org/packages/Microsoft.Azure.Kinect.Sensor/1.4.0/License 54 | 55 | - System.Buffers.4.4.0 56 | Licensed under the MIT License. Copyright (c) .NET Foundation and Contributors. 57 | 58 | - System.Memory.4.5.3 59 | Licensed under the MIT License. Copyright (c) .NET Foundation and Contributors. 60 | 61 | - System.Numerics.Vectors.4.5.0 62 | Licensed under the MIT License. Copyright (c) .NET Foundation and Contributors. 63 | 64 | - System.Runtime.CompilerServices.Unsafe.4.5.2 65 | Licensed under the MIT License. Copyright (c) .NET Foundation and Contributors. 66 | 67 | ## License 68 | このプロジェクトは、サードパーティのアセットを除き、MIT Licenseでライセンスされています。 69 | This project is licensed under the MIT License excluding third party assets. 70 | --------------------------------------------------------------------------------