update Kinect2Motion with Grpc

master
uc-hoba 8 years ago
parent 77cbfe5661
commit 4aa5fc8af4
  1. BIN
      Build/Kinect2Motion_binary/Kinect2Motion-KinectV2.exe
  2. 171
      Unity_2018_Frozen/Assets/Frozen/Frozen.unity
  3. 2
      Unity_2018_Frozen/Assets/Frozen/Material/Point.mat
  4. 2
      Unity_2018_Frozen/Assets/Frozen/Material/Space.mat
  5. 12
      Unity_2018_Frozen/Assets/Frozen/Script/CharacterBehaviour.cs
  6. 2
      Unity_2018_Frozen/Assets/Frozen/Script/FrozenScreenToWorldSpace.cs.meta
  7. 2
      Unity_2018_Frozen/Assets/Frozen/Script/SceneController.cs
  8. 10
      Unity_2018_Frozen/Assets/Grpc.meta
  9. 10
      Unity_2018_Frozen/Assets/Grpc/Plugins.meta
  10. BIN
      Unity_2018_Frozen/Assets/Grpc/Plugins/Google.Protobuf.dll
  11. 32
      Unity_2018_Frozen/Assets/Grpc/Plugins/Google.Protobuf.dll.meta
  12. BIN
      Unity_2018_Frozen/Assets/Grpc/Plugins/Grpc.Core.dll
  13. 30
      Unity_2018_Frozen/Assets/Grpc/Plugins/Grpc.Core.dll.meta
  14. BIN
      Unity_2018_Frozen/Assets/Grpc/Plugins/System.Interactive.Async.dll
  15. 30
      Unity_2018_Frozen/Assets/Grpc/Plugins/System.Interactive.Async.dll.meta
  16. 10
      Unity_2018_Frozen/Assets/Grpc/Plugins/runtimes.meta
  17. 10
      Unity_2018_Frozen/Assets/Grpc/Plugins/runtimes/win.meta
  18. 10
      Unity_2018_Frozen/Assets/Grpc/Plugins/runtimes/win/native.meta
  19. BIN
      Unity_2018_Frozen/Assets/Grpc/Plugins/runtimes/win/native/grpc_csharp_ext.dll
  20. 88
      Unity_2018_Frozen/Assets/Grpc/Plugins/runtimes/win/native/grpc_csharp_ext.dll.meta
  21. 10
      Unity_2018_Frozen/Assets/Grpc/Script.meta
  22. 10
      Unity_2018_Frozen/Assets/Grpc/Script/Editor.meta
  23. 61
      Unity_2018_Frozen/Assets/Grpc/Script/Editor/GrpcBuildPostProcess.cs
  24. 13
      Unity_2018_Frozen/Assets/Grpc/Script/Editor/GrpcBuildPostProcess.cs.meta
  25. 40
      Unity_2018_Frozen/Assets/Grpc/Script/GrpcNetworkDiscovery.cs
  26. 13
      Unity_2018_Frozen/Assets/Grpc/Script/GrpcNetworkDiscovery.cs.meta
  27. 10
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc.meta
  28. 64
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/Kinect2MotionDebug.shader
  29. 10
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/Kinect2MotionDebug.shader.meta
  30. 19
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/KinectBufferCollect.compute
  31. 10
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/KinectBufferCollect.compute.meta
  32. 83
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/KinectBufferComposite.compute
  33. 10
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/KinectBufferComposite.compute.meta
  34. 362
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/KinectGrpcServer.cs
  35. 18
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/KinectGrpcServer.cs.meta
  36. 97
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/UltraCombos.Kinect2MotionTransmitGrpc.cs
  37. 13
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/UltraCombos.Kinect2MotionTransmitGrpc.cs.meta
  38. 650
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/UltraCombosKinect2MotionTransmit.cs
  39. 13
      Unity_2018_Frozen/Assets/KinectOpticalFlow/Grpc/UltraCombosKinect2MotionTransmit.cs.meta
  40. 65
      Unity_2018_Frozen/Assets/KinectOpticalFlow/KinectOpticalFlow.cs
  41. 25
      Unity_2018_Frozen/Assets/KinectOpticalFlow/KinectUpdateShader.compute

@ -205,7 +205,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_RootOrder: 7
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &145750430
GameObject:
@ -233,7 +233,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 9
m_RootOrder: 10
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &147055504
GameObject:
@ -595,7 +595,7 @@ Transform:
m_Children:
- {fileID: 917676528}
m_Father: {fileID: 0}
m_RootOrder: 15
m_RootOrder: 16
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &350883107
GameObject:
@ -713,7 +713,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 10
m_RootOrder: 11
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &386695295
GameObject:
@ -743,8 +743,9 @@ Transform:
- {fileID: 774429924}
- {fileID: 850228141}
- {fileID: 1848145250}
- {fileID: 887356093}
m_Father: {fileID: 0}
m_RootOrder: 8
m_RootOrder: 9
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &401185750
GameObject:
@ -760,7 +761,7 @@ GameObject:
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
m_IsActive: 0
--- !u!4 &401185751
Transform:
m_ObjectHideFlags: 0
@ -775,7 +776,7 @@ Transform:
- {fileID: 694714222}
- {fileID: 1553193321}
m_Father: {fileID: 0}
m_RootOrder: 7
m_RootOrder: 8
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &411383572
GameObject:
@ -831,7 +832,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 19
m_RootOrder: 20
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &438615021
GameObject:
@ -923,7 +924,7 @@ RectTransform:
- {fileID: 770059767}
- {fileID: 1774693142}
m_Father: {fileID: 0}
m_RootOrder: 18
m_RootOrder: 19
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -1037,7 +1038,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 23
m_RootOrder: 24
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &528715328
GameObject:
@ -1232,7 +1233,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 12
m_RootOrder: 13
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &671544960
GameObject:
@ -1598,7 +1599,7 @@ Transform:
- {fileID: 441718964}
- {fileID: 1167120023}
m_Father: {fileID: 0}
m_RootOrder: 11
m_RootOrder: 12
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &750667758
GameObject:
@ -1609,7 +1610,6 @@ GameObject:
m_Component:
- component: {fileID: 750667763}
- component: {fileID: 750667762}
- component: {fileID: 750667759}
m_Layer: 5
m_Name: Spout Canvas
m_TagString: Untagged
@ -1617,24 +1617,6 @@ GameObject:
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &750667759
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 750667758}
m_Enabled: 0
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0c29cacbda07285449365329adeb3b02, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
MonitorCamera: {fileID: 520040868}
castMouseOnly: 0
--- !u!223 &750667762
Canvas:
m_ObjectHideFlags: 0
@ -1667,7 +1649,7 @@ RectTransform:
m_Children:
- {fileID: 1000268179}
m_Father: {fileID: 0}
m_RootOrder: 21
m_RootOrder: 22
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -1700,7 +1682,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 16
m_RootOrder: 17
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &770059766
GameObject:
@ -2150,6 +2132,53 @@ MonoBehaviour:
m_EditorClassIdentifier:
fluidSimulation: {fileID: 774429923}
uniforms: {fileID: 11400000, guid: 4dcbc9a971de5974da304d60289ebe0f, type: 2}
--- !u!1 &887356092
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 887356093}
- component: {fileID: 887356094}
m_Layer: 0
m_Name: Kinect2MotionGrpc
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!4 &887356093
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 887356092}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 386695297}
m_RootOrder: 3
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &887356094
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 887356092}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d47d55be359a57741a6fecbcc7efaf2b, type: 3}
m_Name:
m_EditorClassIdentifier:
port: 50051
shader: {fileID: 7200000, guid: bd9793649dc30c046875df07338824bb, type: 3}
collectShader: {fileID: 7200000, guid: 7a8ac615a5434b24d83dbec67effb820, type: 3}
connectedDevices: []
debug:
debugDraw: 1
debugShader: {fileID: 4800000, guid: 6ffbbc1e44667e348b62c7f3ea93ae4b, type: 3}
--- !u!1 &917676527
GameObject:
m_ObjectHideFlags: 0
@ -2762,7 +2791,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 17
m_RootOrder: 18
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1390635887
GameObject:
@ -2871,7 +2900,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 13
m_RootOrder: 14
m_LocalEulerAnglesHint: {x: 90, y: 0, z: 0}
--- !u!1 &1553193320
GameObject:
@ -3019,6 +3048,61 @@ CanvasRenderer:
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1621860758}
--- !u!1 &1761700811
GameObject:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
serializedVersion: 5
m_Component:
- component: {fileID: 1761700813}
- component: {fileID: 1761700812}
m_Layer: 0
m_Name: GrpcNetworkDiscovery
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1761700812
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1761700811}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 2bd8ad095eeba3e4faab18e84e7fae76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_BroadcastPort: 47777
m_BroadcastKey: 2222
m_BroadcastVersion: 1
m_BroadcastSubVersion: 1
m_BroadcastInterval: 1000
m_UseNetworkManager: 0
m_BroadcastData: HELLO
m_ShowGUI: 0
m_OffsetX: 0
m_OffsetY: 0
onReceivedBroadcast:
m_PersistentCalls:
m_Calls: []
m_TypeName: UltraCombos.GrpcNetworkDiscovery+MessageEvent, Assembly-CSharp, Version=0.0.0.0,
Culture=neutral, PublicKeyToken=null
--- !u!4 &1761700813
Transform:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 1761700811}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 6
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1765914293
GameObject:
m_ObjectHideFlags: 0
@ -3108,7 +3192,7 @@ RectTransform:
- {fileID: 1227078085}
- {fileID: 2084135710}
m_Father: {fileID: 0}
m_RootOrder: 24
m_RootOrder: 25
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
@ -3227,7 +3311,7 @@ MonoBehaviour:
textureFormat: 28
yFlip: 1
output: {fileID: 0}
m_Shader: {fileID: 0}
m_Shader: {fileID: 4800000, guid: ca95743014f24fd49897e12abbe931fc, type: 3}
--- !u!20 &1817143148
Camera:
m_ObjectHideFlags: 0
@ -3275,7 +3359,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 20
m_RootOrder: 21
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1817143150
MonoBehaviour:
@ -3496,6 +3580,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 639d7a6f2452c7d4cab5ffcb304b1d8c, type: 3}
m_Name:
m_EditorClassIdentifier:
server: {fileID: 887356094}
kinectBuffers:
- {fileID: 810572923}
- {fileID: 563719738}
@ -3505,10 +3590,6 @@ MonoBehaviour:
clipMin: {x: -0.85, y: 0.3, z: 0}
clipMax: {x: 0.71, y: 0.45, z: 1.63}
fluidSimulation: {fileID: 774429923}
kinectAmount: 4
renderTextures:
- {fileID: 8400000, guid: f9c2cef894c9cc54f807a92207bf6eda, type: 2}
- {fileID: 8400000, guid: 1276428e64b9c6444aaa6e9b476ebb1c, type: 2}
debug: 0
colorize: 1
debugMaterial: {fileID: 2100000, guid: 95b4d9b25b7a7e3449627228b10d9009, type: 2}
@ -3732,7 +3813,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 14
m_RootOrder: 15
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &1974547830
GameObject:
@ -3840,7 +3921,7 @@ Transform:
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 22
m_RootOrder: 23
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1 &2084135709
GameObject:
@ -3955,7 +4036,7 @@ MonoBehaviour:
- {fileID: 1906326619}
nightCharacters:
- {fileID: 147055507}
debug: 1
debug: 0
--- !u!4 &2084936104
Transform:
m_ObjectHideFlags: 0

@ -81,7 +81,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Size: 0
- _Size: 0.0051771435
- _SmoothnessTextureChannel: 0
- _SoftParticlesEnabled: 0
- _SoftParticlesFarFadeDistance: 1

@ -70,7 +70,7 @@ Material:
- _Mode: 0
- _OcclusionStrength: 1
- _Parallax: 0.02
- _Rate: 0
- _Rate: 0.3156795
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1

@ -96,13 +96,13 @@ public class CharacterBehaviour : MonoBehaviour
private void Start()
{
standby = true;
isSleep = false;
//standby = true;
//isSleep = false;
mat.mainTextureScale = new Vector2(1, -1);
mat.mainTextureOffset = new Vector2(0, -1);
StartCoroutine(PlayOnStart());
InitialTouchButton();
StartCoroutine(RandomPosNoTriggerOther());
//StartCoroutine(PlayOnStart());
//InitialTouchButton();
//StartCoroutine(RandomPosNoTriggerOther());
}
private void OnEnable()
@ -110,7 +110,9 @@ public class CharacterBehaviour : MonoBehaviour
standby = true;
isSleep = false;
StartCoroutine(PlayOnStart());
InitialTouchButton();
StartCoroutine(RandomPosNoTriggerOther());
color = Color.white;
}
IEnumerator PlayOnStart()

@ -6,7 +6,7 @@ MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
executionOrder: -10
icon: {instanceID: 0}
userData:
assetBundleName:

@ -34,7 +34,7 @@ namespace UltraCombos.Frozen
private void Start()
{
debug = false;
//debug = false;
}
private void Update()

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 6f6b5b47aa125be4aa9abe68fcf892ac
folderAsset: yes
timeCreated: 1525257095
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: d0bdbcbef356b804d884dd930d38ae8b
folderAsset: yes
timeCreated: 1518015320
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,32 @@
fileFormatVersion: 2
guid: 9504153c153a2624e9da519e92cf5542
timeCreated: 1518015297
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,30 @@
fileFormatVersion: 2
guid: dbf1aea72c6b57649b8bfb462b093c00
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,30 @@
fileFormatVersion: 2
guid: 495e81e1d71d1314bb494527410dccb0
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
- first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 0
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 1152917cc2daa11438d537680ad5f9d4
folderAsset: yes
timeCreated: 1518001842
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: dfc7c55cf51ee0b489c4b8f996fa221a
folderAsset: yes
timeCreated: 1517972283
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 9d801733b0f4ed842a4226da283a9575
folderAsset: yes
timeCreated: 1518001790
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,88 @@
fileFormatVersion: 2
guid: c45a46b26d79cea4bbe365f12000d367
timeCreated: 1518001685
licenseType: Free
PluginImporter:
externalObjects: {}
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
- first:
'': Any
second:
enabled: 0
settings:
Exclude Editor: 0
Exclude Linux: 0
Exclude Linux64: 0
Exclude LinuxUniversal: 0
Exclude OSXUniversal: 0
Exclude Win: 1
Exclude Win64: 0
- first:
Any:
second:
enabled: 1
settings: {}
- first:
Editor: Editor
second:
enabled: 1
settings:
CPU: x86_64
DefaultValueInitialized: true
OS: Windows
- first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
- first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: AnyCPU
- first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
- first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
- first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: OSXUniversal
second:
enabled: 1
settings:
CPU: AnyCPU
- first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
- first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: e61dbedb9243085418be7e788fc4b7d7
folderAsset: yes
timeCreated: 1518408269
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 069493b6cf88a674b8ea05d8ce5ede27
folderAsset: yes
timeCreated: 1518162534
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,61 @@
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.IO;
using System.Collections;
#if UNITY_EDITOR_OSX
using UnityEditor.iOS.Xcode;
public class GrpcBuildPostProcess
{
[PostProcessBuild]
public static void OnPostprocessBuild(BuildTarget buildTarget, string path)
{
if (buildTarget == BuildTarget.iOS)
{
/* .xcodeproj/project.pbxproj */
//Get path to the PBX project
string projPath = path + "/Unity-iPhone.xcodeproj/project.pbxproj";
//Read the pbx project
PBXProject proj = new PBXProject();
proj.ReadFromString(File.ReadAllText(projPath));
//Get the build target
string target = proj.TargetGuidByName("Unity-iPhone");
//set ENABLE_BITCODE to false (this shouldn't be required in Unity 5.2+)
proj.SetBuildProperty(target, "ENABLE_BITCODE", "No");
//Add libz.dylib
string name = proj.AddFile("/usr/lib/libz.dylib", "Frameworks/libz.dylib", PBXSourceTree.Source);
proj.AddFileToBuild(target, name);
//proj.AddFrameworkToProject(target, "/usr/lib/libz.dylib", false);
//Write back out the PBX project
File.WriteAllText(projPath, proj.WriteToString());
/* Info.plist */
// Read the Info.plist file
string plistPath = path + "/Info.plist";
PlistDocument plist = new PlistDocument();
plist.ReadFromString(File.ReadAllText(plistPath));
// Get root of plist
PlistElementDict rootDict = plist.root;
//Set Requires full screen = true. This was needed only with Xcode 9.
rootDict.SetBoolean("UIRequiresFullScreen", true);
//Adding background modes for remote notification (For Push notifications - OneSignal)
var bgModes = rootDict.CreateArray("UIBackgroundModes");
bgModes.AddString("remote-notification");
//Write out the Info.plist file
plist.WriteToFile(plistPath);
}
}
}
#endif

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 2c2dc5ab2aeed034fa54b99ce7684e86
timeCreated: 1518162353
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,40 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.Networking;
namespace UltraCombos
{
public class GrpcNetworkDiscovery : NetworkDiscovery
{
public class Config
{
public string serviceName;
public string host;
public int port;
}
[System.Serializable]
public class MessageEvent : UnityEvent<Config>
{
}
public MessageEvent onReceivedBroadcast = new MessageEvent();
private void Start()
{
Initialize();
StartAsServer();
}
public override void OnReceivedBroadcast(string fromAddress, string data)
{
var config = JsonUtility.FromJson<Config>(data);
//config.host = System.Net.IPAddress.Parse(fromAddress).MapToIPv4().ToString();
onReceivedBroadcast.Invoke(config);
}
}
}

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 2bd8ad095eeba3e4faab18e84e7fae76
timeCreated: 1518487708
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 56032ca3ec67ba3449b295b605a3b7be
folderAsset: yes
timeCreated: 1524647267
licenseType: Free
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,64 @@
Shader "Hidden/Kinect2MotionDebug"
{
Properties
{
_Color("Color", Color) = (1,1,1,1)
}
SubShader
{
Tags{ "RenderType" = "Opaque" }
LOD 100
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma geometry geom
#pragma fragment frag
#include "UnityCG.cginc"
struct v2g
{
float4 vertex : SV_POSITION;
};
struct g2f
{
float4 vertex : SV_POSITION;
};
fixed4 _Color;
#ifdef SHADER_API_D3D11
StructuredBuffer<float4> ssbo;
#endif
v2g vert(appdata_base v, uint vid : SV_VertexID)
{
v2g o = (v2g)0;
#ifdef SHADER_API_D3D11
o.vertex = float4(ssbo[vid].xyz, 1);
#endif
return o;
}
[maxvertexcount(1)]
void geom(point v2g input[1], inout PointStream<g2f> OutputStream)
{
g2f o = (g2f)0;
o.vertex = UnityObjectToClipPos(input[0].vertex.xyz);
OutputStream.Append(o);
}
fixed4 frag(g2f i) : SV_Target
{
fixed4 col = fixed4(1, 1, 1, 1);
return col;
}
ENDCG
}
}
}

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 6ffbbc1e44667e348b62c7f3ea93ae4b
timeCreated: 1525233718
licenseType: Free
ShaderImporter:
externalObjects: {}
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,19 @@
#pragma kernel CSMain
#include "UnityCG.cginc"
StructuredBuffer<float4> position_buffer;
StructuredBuffer<float4> velocity_buffer;
RWStructuredBuffer<float4> FinalPositionBuffer;
RWStructuredBuffer<float4> FinalVelocityBuffer;
int count;
[numthreads(512, 1, 1)]
void CSMain(uint3 id : SV_DispatchThreadID)
{
int final_index = 512 * 424 * count + id.x;
FinalPositionBuffer[final_index] = position_buffer[id.x];
FinalVelocityBuffer[final_index] = velocity_buffer[id.x];
}

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 7a8ac615a5434b24d83dbec67effb820
timeCreated: 1524801314
licenseType: Free
ComputeShaderImporter:
externalObjects: {}
currentAPIMask: 4
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,83 @@
#define WIDTH 512
#define HEIGHT 424
#pragma kernel CSMain
#include "UnityCG.cginc"
RWStructuredBuffer<float4> kinect_motion_buffer;
RWStructuredBuffer<float4> position_buffer;
RWStructuredBuffer<float4> velocity_buffer;
Texture2D<float> depth_high_texture;
Texture2D<float> depth_low_texture;
Texture2D<float2> velocity_texture;
float4x4 kinect_matrix;
float3 clip_box;
[numthreads(32, 32, 1)]
void CSMain(uint3 id : SV_DispatchThreadID)
{
int index = id.y * WIDTH + id.x;
int high = (int)(depth_high_texture[id.xy].x * 255.0);
int low = (int)(depth_low_texture[id.xy].x * 255.0);
float depth = (float)((high << 8) + low) * 0.001;
float2 vel = velocity_texture[id.xy].xy * 255.0 - 128.0;
float pre_depth = kinect_motion_buffer[index].z;
kinect_motion_buffer[index] = float4(vel, depth, pre_depth);
///////////////////////////////////
float2 img_size = float2(512.0, 424.0);
float fovy = 60.0;
float PI = UNITY_PI;
float focal = img_size.y / 2.0 / tan(fovy / 2.0 * PI / 180.0);
float2 vel2d = vel;
float2 f_pos = float2(id.xy) + 0.5;
float2 t_pos = f_pos + vel2d;
float f_depth = pre_depth;
float t_depth = depth;
float3 flip = float3(1.0, -1.0, -1.0);
float3 f_vec = float3((f_pos - 0.5 * img_size) / focal, -1.0) * flip;
float3 t_vec = float3((t_pos - 0.5 * img_size) / focal, -1.0) * flip;
float3 f_p3d = float3(f_vec * f_depth);
float3 t_p3d = float3(t_vec * t_depth);
float3 vel3d = t_p3d - f_p3d;
float depth_diff_threshold = 0.14;
float cam_dot_threshold = 0.955;
if (f_depth == 0.0 || t_depth == 0.0 || abs(f_depth - t_depth) > depth_diff_threshold)
{
f_p3d = float3(0, 0, 0);
vel3d = float3(0, 0, 0);
}
else if (abs(dot(normalize(vel3d), normalize(f_vec))) > cam_dot_threshold)
{
f_p3d = float3(0, 0, 0);
vel3d = float3(0, 0, 0);
}
float3 kpos = mul(kinect_matrix, float4(t_p3d, 1.0)).xyz;
float3 kvel = mul(kinect_matrix, float4(vel3d, 0.0)).xyz;
if (kpos.x < -clip_box.x * 0.5 || kpos.x > clip_box.x * 0.5 ||
kpos.z < -clip_box.z * 0.5 || kpos.z > clip_box.z * 0.5 ||
kpos.y < 0.0 || kpos.y > clip_box.y)
{
kpos = float3(0, 0, 0);
kvel = float3(0, 0, 0);
}
position_buffer[index] = float4(kpos, 1.0);
velocity_buffer[index] = float4(kvel, 0.0);
}

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: bd9793649dc30c046875df07338824bb
timeCreated: 1524801314
licenseType: Free
ComputeShaderImporter:
externalObjects: {}
currentAPIMask: 4
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,362 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Grpc.Core;
using System.Threading.Tasks;
namespace UltraCombos.Kinect2MotionTransmit
{
public class KinectGrpcServer : MonoBehaviour
{
public int port = 50051;
Server server;
[SerializeField]
ComputeShader shader;
public ComputeBuffer buffer;
[SerializeField]
ComputeShader collectShader;
class KinectBuffer
{
~KinectBuffer()
{
Release();
}
public void Release()
{
if (position != null)
{
position.Release();
position = null;
}
if (velocity != null)
{
velocity.Release();
velocity = null;
}
}
public ComputeBuffer position;
public ComputeBuffer velocity;
public object mutex = new object();
public DataRequest[] data_pool = new DataRequest[3];
public bool has_new_data = false;
public int READY = 0;
public int FRONT = 1;
public int BACK = 2;
public float fps = 30.0f;
public float stamp = 0.0f;
public Matrix4x4 matrix;
public Vector3 ClipBox;
}
List<KeyValuePair<string, KinectBuffer>> kinect_buffers = new List<KeyValuePair<string, KinectBuffer>>();
int final_count = 1;
ComputeBuffer final_position_buffer;
public ComputeBuffer FinalPositionBuffer { get { return final_position_buffer; } }
ComputeBuffer final_velocity_buffer;
public ComputeBuffer FinalVelocityBuffer { get { return final_velocity_buffer; } }
Texture2D depth_high_texture;
byte[] depth_high_data;
Texture2D depth_low_texture;
byte[] depth_low_data;
Texture2D velocity_texture;
byte[] velocity_data;
const int width = 512;
const int height = 424;
[SerializeField]
List<string> connectedDevices = new List<string>();
[SerializeField]
string debug;
[SerializeField]
bool debugDraw = false;
[SerializeField]
Shader debugShader = null;
private void Start()
{
buffer = new ComputeBuffer(width * height, sizeof(float) * 4);
Debug.LogFormat("Buffer is created by count {0} and stride {1}", buffer.count, buffer.stride);
depth_high_data = new byte[buffer.count / 2];
depth_low_data = new byte[buffer.count / 2];
velocity_data = new byte[buffer.count];
depth_high_texture = new Texture2D(width, height, TextureFormat.BC4, false);
depth_low_texture = new Texture2D(width, height, TextureFormat.BC4, false);
velocity_texture = new Texture2D(width, height, TextureFormat.BC5, false);
final_position_buffer = new ComputeBuffer(width * height, sizeof(float) * 4);
final_velocity_buffer = new ComputeBuffer(width * height, sizeof(float) * 4);
StartServer();
}
private void Update()
{
uint x, y, z;
shader.GetKernelThreadGroupSizes(0, out x, out y, out z);
int[] args = new int[3]
{
(int)Mathf.CeilToInt((float)width / x),
(int)Mathf.CeilToInt((float)height / y),
(int)Mathf.CeilToInt((float)1 / z)
};
connectedDevices.Clear();
debug = "";
foreach (var buf in kinect_buffers)
{
connectedDevices.Add(buf.Key);
debug += string.Format("{0} ", buf.Value.fps);
var kinect = buf.Value;
if (kinect.position == null)
kinect.position = new ComputeBuffer(width * height, sizeof(float) * 4);
if (kinect.velocity == null)
kinect.velocity = new ComputeBuffer(width * height, sizeof(float) * 4);
if (kinect.has_new_data)
{
lock (kinect.mutex)
{
Swap(ref kinect.FRONT, ref kinect.READY);
kinect.has_new_data = false;
}
DataRequest data = kinect.data_pool[kinect.READY];
Vector3 pos = new Vector3(data.PositionX, data.PositionY, -data.PositionZ);
#if false
Quaternion q = Quaternion.Euler(-data.RotationX, -data.RotationY, data.RotationZ);
#else
Quaternion q = Quaternion.Euler(0, 0, data.RotationZ);
q *= Quaternion.Euler(0, -data.RotationY, 0);
q *= Quaternion.Euler(-data.RotationX, 0, 0);
#endif
kinect.matrix = Matrix4x4.TRS(pos, q, Vector3.one);
kinect.ClipBox = new Vector3(data.ClipSizeX, data.ClipSizeY, data.ClipSizeZ);
data.DepthHighData.CopyTo(depth_high_data, 0);
data.DepthLowData.CopyTo(depth_low_data, 0);
data.VelocityData.CopyTo(velocity_data, 0);
depth_high_texture.LoadRawTextureData(depth_high_data);
depth_high_texture.Apply();
depth_low_texture.LoadRawTextureData(depth_low_data);
depth_low_texture.Apply();
velocity_texture.LoadRawTextureData(velocity_data);
velocity_texture.Apply();
shader.SetTexture(0, "depth_high_texture", depth_high_texture);
shader.SetTexture(0, "depth_low_texture", depth_low_texture);
shader.SetTexture(0, "velocity_texture", velocity_texture);
shader.SetBuffer(0, "kinect_motion_buffer", buffer);
shader.SetBuffer(0, "position_buffer", kinect.position);
shader.SetBuffer(0, "velocity_buffer", kinect.velocity);
shader.SetMatrix("kinect_matrix", kinect.matrix);
shader.SetVector("clip_box", kinect.ClipBox);
shader.Dispatch(0, args[0], args[1], args[2]);
kinect.fps = Mathf.Lerp(kinect.fps, 1.0f / (Time.time - kinect.stamp), 0.02f);
kinect.stamp = Time.time;
}
}
}
private void FixedUpdate()
{
uint x, y, z;
collectShader.GetKernelThreadGroupSizes(0, out x, out y, out z);
int[] args = new int[3]
{
(int)Mathf.CeilToInt((float)(width * height) / x),
(int)Mathf.CeilToInt((float)1 / y),
(int)Mathf.CeilToInt((float)1 / z)
};
if (final_count < kinect_buffers.Count)
{
final_count = kinect_buffers.Count;
int buf_count = final_count * width * height;
final_position_buffer.Release();
final_position_buffer = new ComputeBuffer(buf_count, sizeof(float) * 4);
final_velocity_buffer.Release();
final_velocity_buffer = new ComputeBuffer(buf_count, sizeof(float) * 4);
}
int count = 0;
foreach (var buf in kinect_buffers)
{
if (buf.Value.position == null || buf.Value.velocity == null)
continue;
collectShader.SetInt("count", count++);
collectShader.SetBuffer(0, "position_buffer", buf.Value.position);
collectShader.SetBuffer(0, "velocity_buffer", buf.Value.velocity);
collectShader.SetBuffer(0, "FinalPositionBuffer", final_position_buffer);
collectShader.SetBuffer(0, "FinalVelocityBuffer", final_velocity_buffer);
collectShader.Dispatch(0, args[0], args[1], args[2]);
}
}
private void OnDestroy()
{
server.ShutdownAsync().Wait();
if (buffer != null)
{
buffer.Release();
buffer = null;
}
if (final_position_buffer != null)
{
final_position_buffer.Release();
final_position_buffer = null;
}
if (final_velocity_buffer != null)
{
final_velocity_buffer.Release();
final_velocity_buffer = null;
}
foreach (var buf in kinect_buffers)
{
buf.Value.Release();
}
}
private void StartServer()
{
try
{
var options = new List<ChannelOption> { new ChannelOption(ChannelOptions.MaxReceiveMessageLength, int.MaxValue) };
server = new Server(options)
{
Services = { Resource.BindService(new ResourceImpl(OnMessageReceived)) },
Ports = { new ServerPort("0.0.0.0", port, ServerCredentials.Insecure) }
};
server.Start();
Debug.Log("Start Server");
}
catch (System.Exception e)
{
Debug.LogError(e.Message);
}
}
private void OnMessageReceived(DataRequest data)
{
//Debug.Log(data.Name);
//Debug.LogFormat("message.Length: {0}", data.Content.Length);
KinectBuffer kinect = null;
foreach (var buf in kinect_buffers)
{
if (data.Name.Equals(buf.Key))
{
kinect = buf.Value;
}
}
if (kinect == null)
{
kinect = new KinectBuffer();
for (int i = 0; i < 3; i++)
kinect.data_pool[i] = new DataRequest();
kinect_buffers.Add(new KeyValuePair<string, KinectBuffer>(data.Name, kinect));
}
kinect.data_pool[kinect.BACK].MergeFrom(data);
lock (kinect.mutex)
{
Swap(ref kinect.BACK, ref kinect.FRONT);
kinect.has_new_data = true;
}
}
private static void Swap<T>(ref T a, ref T b)
{
T tmp = a;
a = b;
b = tmp;
}
private void OnDrawGizmosSelected()
{
var col = Gizmos.color;
int count = 0;
foreach (var buf in kinect_buffers)
{
var kinect = buf.Value;
Gizmos.color = Color.HSVToRGB(count++ / 5.0f, 0.8f, 0.8f);
var mat = Gizmos.matrix;
Gizmos.matrix = transform.localToWorldMatrix;
Gizmos.matrix = Matrix4x4.identity;
Gizmos.DrawWireCube(new Vector3(0, kinect.ClipBox.y * 0.5f, 0), kinect.ClipBox);
Gizmos.matrix *= kinect.matrix;
Gizmos.DrawFrustum(Vector3.zero, 60.0f, 20.0f, 0.6f, 512.0f / 424.0f);
Gizmos.matrix = mat;
}
Gizmos.color = col;
}
Material material = null;
private void OnRenderObject()
{
if (debugShader == null)
return;
if (debugDraw == false)
return;
if (material == null)
material = new Material(debugShader);
material.SetPass(0);
material.SetBuffer("ssbo", final_position_buffer);
Graphics.DrawProcedural(MeshTopology.Points, final_position_buffer.count, 1);
}
}
internal class ResourceImpl : Resource.ResourceBase
{
public ResourceImpl(MessageDelegate func = null)
{
if (func != null)
onMessageReceived += func;
}
public override Task<DataReply> SendData(DataRequest request, ServerCallContext context)
{
onMessageReceived.Invoke(request);
string res = string.Format("OK: DH({0}), DL({1}), V({2})", request.DepthHighData.Length, request.DepthLowData.Length, request.VelocityData.Length);
//Debug.Log(res);
return Task.FromResult(new DataReply { Result = res });
}
public delegate void MessageDelegate(DataRequest data);
public MessageDelegate onMessageReceived;
}
}

@ -0,0 +1,18 @@
fileFormatVersion: 2
guid: d47d55be359a57741a6fecbcc7efaf2b
timeCreated: 1524646292
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences:
- shader: {fileID: 7200000, guid: bd9793649dc30c046875df07338824bb, type: 3}
- collectShader: {fileID: 7200000, guid: 7a8ac615a5434b24d83dbec67effb820, type: 3}
- FinalPositionBuffer: {instanceID: 0}
- FinalVelocityBuffer: {instanceID: 0}
- debugShader: {fileID: 4800000, guid: 6ffbbc1e44667e348b62c7f3ea93ae4b, type: 3}
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,97 @@
// <auto-generated>
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: UltraCombos.Kinect2MotionTransmit.proto
// </auto-generated>
#pragma warning disable 1591
#region Designer generated code
using grpc = global::Grpc.Core;
namespace UltraCombos.Kinect2MotionTransmit {
public static partial class Resource
{
static readonly string __ServiceName = "UltraCombos.Kinect2MotionTransmit.Resource";
static readonly grpc::Marshaller<global::UltraCombos.Kinect2MotionTransmit.DataRequest> __Marshaller_DataRequest = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::UltraCombos.Kinect2MotionTransmit.DataRequest.Parser.ParseFrom);
static readonly grpc::Marshaller<global::UltraCombos.Kinect2MotionTransmit.DataReply> __Marshaller_DataReply = grpc::Marshallers.Create((arg) => global::Google.Protobuf.MessageExtensions.ToByteArray(arg), global::UltraCombos.Kinect2MotionTransmit.DataReply.Parser.ParseFrom);
static readonly grpc::Method<global::UltraCombos.Kinect2MotionTransmit.DataRequest, global::UltraCombos.Kinect2MotionTransmit.DataReply> __Method_SendData = new grpc::Method<global::UltraCombos.Kinect2MotionTransmit.DataRequest, global::UltraCombos.Kinect2MotionTransmit.DataReply>(
grpc::MethodType.Unary,
__ServiceName,
"SendData",
__Marshaller_DataRequest,
__Marshaller_DataReply);
/// <summary>Service descriptor</summary>
public static global::Google.Protobuf.Reflection.ServiceDescriptor Descriptor
{
get { return global::UltraCombos.Kinect2MotionTransmit.UltraCombosKinect2MotionTransmitReflection.Descriptor.Services[0]; }
}
/// <summary>Base class for server-side implementations of Resource</summary>
public abstract partial class ResourceBase
{
public virtual global::System.Threading.Tasks.Task<global::UltraCombos.Kinect2MotionTransmit.DataReply> SendData(global::UltraCombos.Kinect2MotionTransmit.DataRequest request, grpc::ServerCallContext context)
{
throw new grpc::RpcException(new grpc::Status(grpc::StatusCode.Unimplemented, ""));
}
}
/// <summary>Client for Resource</summary>
public partial class ResourceClient : grpc::ClientBase<ResourceClient>
{
/// <summary>Creates a new client for Resource</summary>
/// <param name="channel">The channel to use to make remote calls.</param>
public ResourceClient(grpc::Channel channel) : base(channel)
{
}
/// <summary>Creates a new client for Resource that uses a custom <c>CallInvoker</c>.</summary>
/// <param name="callInvoker">The callInvoker to use to make remote calls.</param>
public ResourceClient(grpc::CallInvoker callInvoker) : base(callInvoker)
{
}
/// <summary>Protected parameterless constructor to allow creation of test doubles.</summary>
protected ResourceClient() : base()
{
}
/// <summary>Protected constructor to allow creation of configured clients.</summary>
/// <param name="configuration">The client configuration.</param>
protected ResourceClient(ClientBaseConfiguration configuration) : base(configuration)
{
}
public virtual global::UltraCombos.Kinect2MotionTransmit.DataReply SendData(global::UltraCombos.Kinect2MotionTransmit.DataRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return SendData(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual global::UltraCombos.Kinect2MotionTransmit.DataReply SendData(global::UltraCombos.Kinect2MotionTransmit.DataRequest request, grpc::CallOptions options)
{
return CallInvoker.BlockingUnaryCall(__Method_SendData, null, options, request);
}
public virtual grpc::AsyncUnaryCall<global::UltraCombos.Kinect2MotionTransmit.DataReply> SendDataAsync(global::UltraCombos.Kinect2MotionTransmit.DataRequest request, grpc::Metadata headers = null, global::System.DateTime? deadline = null, global::System.Threading.CancellationToken cancellationToken = default(global::System.Threading.CancellationToken))
{
return SendDataAsync(request, new grpc::CallOptions(headers, deadline, cancellationToken));
}
public virtual grpc::AsyncUnaryCall<global::UltraCombos.Kinect2MotionTransmit.DataReply> SendDataAsync(global::UltraCombos.Kinect2MotionTransmit.DataRequest request, grpc::CallOptions options)
{
return CallInvoker.AsyncUnaryCall(__Method_SendData, null, options, request);
}
/// <summary>Creates a new instance of client from given <c>ClientBaseConfiguration</c>.</summary>
protected override ResourceClient NewInstance(ClientBaseConfiguration configuration)
{
return new ResourceClient(configuration);
}
}
/// <summary>Creates service definition that can be registered with a server</summary>
/// <param name="serviceImpl">An object implementing the server-side handling logic.</param>
public static grpc::ServerServiceDefinition BindService(ResourceBase serviceImpl)
{
return grpc::ServerServiceDefinition.CreateBuilder()
.AddMethod(__Method_SendData, serviceImpl.SendData).Build();
}
}
}
#endregion

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: 6aaa626a29978c944b18c4334a0b06dc
timeCreated: 1524800781
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -0,0 +1,650 @@
// Generated by the protocol buffer compiler. DO NOT EDIT!
// source: UltraCombos.Kinect2MotionTransmit.proto
#pragma warning disable 1591, 0612, 3021
#region Designer generated code
using pb = global::Google.Protobuf;
using pbc = global::Google.Protobuf.Collections;
using pbr = global::Google.Protobuf.Reflection;
using scg = global::System.Collections.Generic;
namespace UltraCombos.Kinect2MotionTransmit {
/// <summary>Holder for reflection information generated from UltraCombos.Kinect2MotionTransmit.proto</summary>
public static partial class UltraCombosKinect2MotionTransmitReflection {
#region Descriptor
/// <summary>File descriptor for UltraCombos.Kinect2MotionTransmit.proto</summary>
public static pbr::FileDescriptor Descriptor {
get { return descriptor; }
}
private static pbr::FileDescriptor descriptor;
static UltraCombosKinect2MotionTransmitReflection() {
byte[] descriptorData = global::System.Convert.FromBase64String(
string.Concat(
"CidVbHRyYUNvbWJvcy5LaW5lY3QyTW90aW9uVHJhbnNtaXQucHJvdG8SIVVs",
"dHJhQ29tYm9zLktpbmVjdDJNb3Rpb25UcmFuc21pdCKeAgoLRGF0YVJlcXVl",
"c3QSDAoEbmFtZRgBIAEoCRIVCg1kZXB0aEhpZ2hEYXRhGAIgASgMEhQKDGRl",
"cHRoTG93RGF0YRgDIAEoDBIUCgx2ZWxvY2l0eURhdGEYBCABKAwSEQoJcG9z",
"aXRpb25YGAUgASgCEhEKCXBvc2l0aW9uWRgGIAEoAhIRCglwb3NpdGlvbloY",
"ByABKAISEQoJcm90YXRpb25YGAggASgCEhEKCXJvdGF0aW9uWRgJIAEoAhIR",
"Cglyb3RhdGlvbloYCiABKAISEQoJY2xpcFNpemVYGAsgASgCEhEKCWNsaXBT",
"aXplWRgMIAEoAhIRCgljbGlwU2l6ZVoYDSABKAISEwoLaW5mb3JtYXRpb24Y",
"DiABKAkiGwoJRGF0YVJlcGx5Eg4KBnJlc3VsdBgBIAEoCTJ2CghSZXNvdXJj",
"ZRJqCghTZW5kRGF0YRIuLlVsdHJhQ29tYm9zLktpbmVjdDJNb3Rpb25UcmFu",
"c21pdC5EYXRhUmVxdWVzdBosLlVsdHJhQ29tYm9zLktpbmVjdDJNb3Rpb25U",
"cmFuc21pdC5EYXRhUmVwbHkiAGIGcHJvdG8z"));
descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData,
new pbr::FileDescriptor[] { },
new pbr::GeneratedClrTypeInfo(null, new pbr::GeneratedClrTypeInfo[] {
new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Kinect2MotionTransmit.DataRequest), global::UltraCombos.Kinect2MotionTransmit.DataRequest.Parser, new[]{ "Name", "DepthHighData", "DepthLowData", "VelocityData", "PositionX", "PositionY", "PositionZ", "RotationX", "RotationY", "RotationZ", "ClipSizeX", "ClipSizeY", "ClipSizeZ", "Information" }, null, null, null),
new pbr::GeneratedClrTypeInfo(typeof(global::UltraCombos.Kinect2MotionTransmit.DataReply), global::UltraCombos.Kinect2MotionTransmit.DataReply.Parser, new[]{ "Result" }, null, null, null)
}));
}
#endregion
}
#region Messages
public sealed partial class DataRequest : pb::IMessage<DataRequest> {
private static readonly pb::MessageParser<DataRequest> _parser = new pb::MessageParser<DataRequest>(() => new DataRequest());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DataRequest> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::UltraCombos.Kinect2MotionTransmit.UltraCombosKinect2MotionTransmitReflection.Descriptor.MessageTypes[0]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataRequest() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataRequest(DataRequest other) : this() {
name_ = other.name_;
depthHighData_ = other.depthHighData_;
depthLowData_ = other.depthLowData_;
velocityData_ = other.velocityData_;
positionX_ = other.positionX_;
positionY_ = other.positionY_;
positionZ_ = other.positionZ_;
rotationX_ = other.rotationX_;
rotationY_ = other.rotationY_;
rotationZ_ = other.rotationZ_;
clipSizeX_ = other.clipSizeX_;
clipSizeY_ = other.clipSizeY_;
clipSizeZ_ = other.clipSizeZ_;
information_ = other.information_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataRequest Clone() {
return new DataRequest(this);
}
/// <summary>Field number for the "name" field.</summary>
public const int NameFieldNumber = 1;
private string name_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Name {
get { return name_; }
set {
name_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "depthHighData" field.</summary>
public const int DepthHighDataFieldNumber = 2;
private pb::ByteString depthHighData_ = pb::ByteString.Empty;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString DepthHighData {
get { return depthHighData_; }
set {
depthHighData_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "depthLowData" field.</summary>
public const int DepthLowDataFieldNumber = 3;
private pb::ByteString depthLowData_ = pb::ByteString.Empty;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString DepthLowData {
get { return depthLowData_; }
set {
depthLowData_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "velocityData" field.</summary>
public const int VelocityDataFieldNumber = 4;
private pb::ByteString velocityData_ = pb::ByteString.Empty;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public pb::ByteString VelocityData {
get { return velocityData_; }
set {
velocityData_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
/// <summary>Field number for the "positionX" field.</summary>
public const int PositionXFieldNumber = 5;
private float positionX_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float PositionX {
get { return positionX_; }
set {
positionX_ = value;
}
}
/// <summary>Field number for the "positionY" field.</summary>
public const int PositionYFieldNumber = 6;
private float positionY_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float PositionY {
get { return positionY_; }
set {
positionY_ = value;
}
}
/// <summary>Field number for the "positionZ" field.</summary>
public const int PositionZFieldNumber = 7;
private float positionZ_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float PositionZ {
get { return positionZ_; }
set {
positionZ_ = value;
}
}
/// <summary>Field number for the "rotationX" field.</summary>
public const int RotationXFieldNumber = 8;
private float rotationX_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float RotationX {
get { return rotationX_; }
set {
rotationX_ = value;
}
}
/// <summary>Field number for the "rotationY" field.</summary>
public const int RotationYFieldNumber = 9;
private float rotationY_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float RotationY {
get { return rotationY_; }
set {
rotationY_ = value;
}
}
/// <summary>Field number for the "rotationZ" field.</summary>
public const int RotationZFieldNumber = 10;
private float rotationZ_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float RotationZ {
get { return rotationZ_; }
set {
rotationZ_ = value;
}
}
/// <summary>Field number for the "clipSizeX" field.</summary>
public const int ClipSizeXFieldNumber = 11;
private float clipSizeX_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float ClipSizeX {
get { return clipSizeX_; }
set {
clipSizeX_ = value;
}
}
/// <summary>Field number for the "clipSizeY" field.</summary>
public const int ClipSizeYFieldNumber = 12;
private float clipSizeY_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float ClipSizeY {
get { return clipSizeY_; }
set {
clipSizeY_ = value;
}
}
/// <summary>Field number for the "clipSizeZ" field.</summary>
public const int ClipSizeZFieldNumber = 13;
private float clipSizeZ_;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public float ClipSizeZ {
get { return clipSizeZ_; }
set {
clipSizeZ_ = value;
}
}
/// <summary>Field number for the "information" field.</summary>
public const int InformationFieldNumber = 14;
private string information_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Information {
get { return information_; }
set {
information_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DataRequest);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DataRequest other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Name != other.Name) return false;
if (DepthHighData != other.DepthHighData) return false;
if (DepthLowData != other.DepthLowData) return false;
if (VelocityData != other.VelocityData) return false;
if (PositionX != other.PositionX) return false;
if (PositionY != other.PositionY) return false;
if (PositionZ != other.PositionZ) return false;
if (RotationX != other.RotationX) return false;
if (RotationY != other.RotationY) return false;
if (RotationZ != other.RotationZ) return false;
if (ClipSizeX != other.ClipSizeX) return false;
if (ClipSizeY != other.ClipSizeY) return false;
if (ClipSizeZ != other.ClipSizeZ) return false;
if (Information != other.Information) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Name.Length != 0) hash ^= Name.GetHashCode();
if (DepthHighData.Length != 0) hash ^= DepthHighData.GetHashCode();
if (DepthLowData.Length != 0) hash ^= DepthLowData.GetHashCode();
if (VelocityData.Length != 0) hash ^= VelocityData.GetHashCode();
if (PositionX != 0F) hash ^= PositionX.GetHashCode();
if (PositionY != 0F) hash ^= PositionY.GetHashCode();
if (PositionZ != 0F) hash ^= PositionZ.GetHashCode();
if (RotationX != 0F) hash ^= RotationX.GetHashCode();
if (RotationY != 0F) hash ^= RotationY.GetHashCode();
if (RotationZ != 0F) hash ^= RotationZ.GetHashCode();
if (ClipSizeX != 0F) hash ^= ClipSizeX.GetHashCode();
if (ClipSizeY != 0F) hash ^= ClipSizeY.GetHashCode();
if (ClipSizeZ != 0F) hash ^= ClipSizeZ.GetHashCode();
if (Information.Length != 0) hash ^= Information.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (DepthHighData.Length != 0) {
output.WriteRawTag(18);
output.WriteBytes(DepthHighData);
}
if (DepthLowData.Length != 0) {
output.WriteRawTag(26);
output.WriteBytes(DepthLowData);
}
if (VelocityData.Length != 0) {
output.WriteRawTag(34);
output.WriteBytes(VelocityData);
}
if (PositionX != 0F) {
output.WriteRawTag(45);
output.WriteFloat(PositionX);
}
if (PositionY != 0F) {
output.WriteRawTag(53);
output.WriteFloat(PositionY);
}
if (PositionZ != 0F) {
output.WriteRawTag(61);
output.WriteFloat(PositionZ);
}
if (RotationX != 0F) {
output.WriteRawTag(69);
output.WriteFloat(RotationX);
}
if (RotationY != 0F) {
output.WriteRawTag(77);
output.WriteFloat(RotationY);
}
if (RotationZ != 0F) {
output.WriteRawTag(85);
output.WriteFloat(RotationZ);
}
if (ClipSizeX != 0F) {
output.WriteRawTag(93);
output.WriteFloat(ClipSizeX);
}
if (ClipSizeY != 0F) {
output.WriteRawTag(101);
output.WriteFloat(ClipSizeY);
}
if (ClipSizeZ != 0F) {
output.WriteRawTag(109);
output.WriteFloat(ClipSizeZ);
}
if (Information.Length != 0) {
output.WriteRawTag(114);
output.WriteString(Information);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Name.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Name);
}
if (DepthHighData.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(DepthHighData);
}
if (DepthLowData.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(DepthLowData);
}
if (VelocityData.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeBytesSize(VelocityData);
}
if (PositionX != 0F) {
size += 1 + 4;
}
if (PositionY != 0F) {
size += 1 + 4;
}
if (PositionZ != 0F) {
size += 1 + 4;
}
if (RotationX != 0F) {
size += 1 + 4;
}
if (RotationY != 0F) {
size += 1 + 4;
}
if (RotationZ != 0F) {
size += 1 + 4;
}
if (ClipSizeX != 0F) {
size += 1 + 4;
}
if (ClipSizeY != 0F) {
size += 1 + 4;
}
if (ClipSizeZ != 0F) {
size += 1 + 4;
}
if (Information.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Information);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DataRequest other) {
if (other == null) {
return;
}
if (other.Name.Length != 0) {
Name = other.Name;
}
if (other.DepthHighData.Length != 0) {
DepthHighData = other.DepthHighData;
}
if (other.DepthLowData.Length != 0) {
DepthLowData = other.DepthLowData;
}
if (other.VelocityData.Length != 0) {
VelocityData = other.VelocityData;
}
if (other.PositionX != 0F) {
PositionX = other.PositionX;
}
if (other.PositionY != 0F) {
PositionY = other.PositionY;
}
if (other.PositionZ != 0F) {
PositionZ = other.PositionZ;
}
if (other.RotationX != 0F) {
RotationX = other.RotationX;
}
if (other.RotationY != 0F) {
RotationY = other.RotationY;
}
if (other.RotationZ != 0F) {
RotationZ = other.RotationZ;
}
if (other.ClipSizeX != 0F) {
ClipSizeX = other.ClipSizeX;
}
if (other.ClipSizeY != 0F) {
ClipSizeY = other.ClipSizeY;
}
if (other.ClipSizeZ != 0F) {
ClipSizeZ = other.ClipSizeZ;
}
if (other.Information.Length != 0) {
Information = other.Information;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
DepthHighData = input.ReadBytes();
break;
}
case 26: {
DepthLowData = input.ReadBytes();
break;
}
case 34: {
VelocityData = input.ReadBytes();
break;
}
case 45: {
PositionX = input.ReadFloat();
break;
}
case 53: {
PositionY = input.ReadFloat();
break;
}
case 61: {
PositionZ = input.ReadFloat();
break;
}
case 69: {
RotationX = input.ReadFloat();
break;
}
case 77: {
RotationY = input.ReadFloat();
break;
}
case 85: {
RotationZ = input.ReadFloat();
break;
}
case 93: {
ClipSizeX = input.ReadFloat();
break;
}
case 101: {
ClipSizeY = input.ReadFloat();
break;
}
case 109: {
ClipSizeZ = input.ReadFloat();
break;
}
case 114: {
Information = input.ReadString();
break;
}
}
}
}
}
public sealed partial class DataReply : pb::IMessage<DataReply> {
private static readonly pb::MessageParser<DataReply> _parser = new pb::MessageParser<DataReply>(() => new DataReply());
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pb::MessageParser<DataReply> Parser { get { return _parser; } }
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public static pbr::MessageDescriptor Descriptor {
get { return global::UltraCombos.Kinect2MotionTransmit.UltraCombosKinect2MotionTransmitReflection.Descriptor.MessageTypes[1]; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
pbr::MessageDescriptor pb::IMessage.Descriptor {
get { return Descriptor; }
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataReply() {
OnConstruction();
}
partial void OnConstruction();
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataReply(DataReply other) : this() {
result_ = other.result_;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public DataReply Clone() {
return new DataReply(this);
}
/// <summary>Field number for the "result" field.</summary>
public const int ResultFieldNumber = 1;
private string result_ = "";
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public string Result {
get { return result_; }
set {
result_ = pb::ProtoPreconditions.CheckNotNull(value, "value");
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override bool Equals(object other) {
return Equals(other as DataReply);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public bool Equals(DataReply other) {
if (ReferenceEquals(other, null)) {
return false;
}
if (ReferenceEquals(other, this)) {
return true;
}
if (Result != other.Result) return false;
return true;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override int GetHashCode() {
int hash = 1;
if (Result.Length != 0) hash ^= Result.GetHashCode();
return hash;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public override string ToString() {
return pb::JsonFormatter.ToDiagnosticString(this);
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) {
if (Result.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Result);
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() {
int size = 0;
if (Result.Length != 0) {
size += 1 + pb::CodedOutputStream.ComputeStringSize(Result);
}
return size;
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(DataReply other) {
if (other == null) {
return;
}
if (other.Result.Length != 0) {
Result = other.Result;
}
}
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
input.SkipLastField();
break;
case 10: {
Result = input.ReadString();
break;
}
}
}
}
}
#endregion
}
#endregion Designer generated code

@ -0,0 +1,13 @@
fileFormatVersion: 2
guid: fd3f3cb7e4054474fbb709ccad276dc6
timeCreated: 1524800781
licenseType: Free
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

@ -11,6 +11,8 @@ namespace UltraCombos
const int POSITION = 0;
const int VELOCITY = 1;
public Kinect2MotionTransmit.KinectGrpcServer server;
[SerializeField]
List<StructuredBuffer> kinectBuffers = new List<StructuredBuffer>();
public ComputeBuffer PositionBuffer { get { return kinectBuffers[POSITION].obj; } }
@ -33,10 +35,8 @@ namespace UltraCombos
ComputeBuffer kinect_grid_buffer;
public ComputeBuffer KinectGridBuffer { get { return kinect_grid_buffer; } }
int grid_width, grid_height, grid_depth;
[Range(0, 5)]
public float kinectAmount = 0;
public List<RenderTexture> renderTextures;
Texture2DArray kinectTextureArray;
[SerializeField, Header("Debug")]
bool debug = false;
@ -53,8 +53,8 @@ namespace UltraCombos
public ComputeBuffer HomeVelocityBuffer { get { return home_velocity_buffer; } }
ComputeBuffer home_count_buffer;
public ComputeBuffer HomeCountBuffer { get { return home_count_buffer; } }
int home_count = 0;
public int HomeCount { get { return home_count; } }
private void Start()
@ -71,14 +71,12 @@ namespace UltraCombos
}
{
home_position_buffer = new ComputeBuffer(512 * 424 * renderTextures.Count, sizeof(float) * 4, ComputeBufferType.Append);
home_velocity_buffer = new ComputeBuffer(512 * 424 * renderTextures.Count, sizeof(float) * 4, ComputeBufferType.Append);
home_position_buffer = new ComputeBuffer(512 * 424, sizeof(float) * 4, ComputeBufferType.Append);
home_velocity_buffer = new ComputeBuffer(512 * 424, sizeof(float) * 4, ComputeBufferType.Append);
home_count_buffer = new ComputeBuffer(1, sizeof(int), ComputeBufferType.Raw);
}
{
kinectTextureArray = new Texture2DArray(512 * 2, 424, 8, TextureFormat.RGBAFloat, false);
}
}
private void FixedUpdate()
@ -88,14 +86,31 @@ namespace UltraCombos
args_buffer = updateShader.CreateIndirectComputeArgsBuffer(width * height, 1, 1);
}
if (server != null)
{
for (int i = 0; i < renderTextures.Count; i++)
if (home_position_buffer.count != server.FinalPositionBuffer.count)
{
if (renderTextures[i].IsCreated())
Graphics.CopyTexture(renderTextures[i], 0, kinectTextureArray, i);
home_position_buffer.Release();
home_position_buffer = new ComputeBuffer(server.FinalPositionBuffer.count,
server.FinalPositionBuffer.stride, ComputeBufferType.Append);
}
if (home_velocity_buffer.count != server.FinalVelocityBuffer.count)
{
home_velocity_buffer.Release();
home_velocity_buffer = new ComputeBuffer(server.FinalVelocityBuffer.count,
server.FinalVelocityBuffer.stride, ComputeBufferType.Append);
}
foreach (var buf in kinectBuffers)
{
if (buf.count != server.FinalPositionBuffer.count)
{
buf.Release();
buf.Allocate(server.FinalVelocityBuffer.count, server.FinalVelocityBuffer.stride);
}
}
}
// update
{
@ -113,23 +128,34 @@ namespace UltraCombos
updateShader.SetVector("FluidRoot", fluidSimulation.GridRoot);
updateShader.SetVector("FluidDim", fluidSimulation.GridDim);
updateShader.SetInt("flipX", flipX ? 1 : 0);
updateShader.SetInt("NumKinects", renderTextures.Count);
//updateShader.SetTexture(0, "PositionTexture", renderTextures[POSITION]);
//updateShader.SetTexture(0, "VelocityTexture", renderTextures[VELOCITY]);
updateShader.SetTexture(0, "MotionTextureArray", kinectTextureArray);
updateShader.SetTexture(0, "MotionTexture", renderTextures[0]);
foreach (var buf in kinectBuffers)
updateShader.SetBuffer(0, buf.bufferName, buf.obj);
updateShader.SetBuffer(0, "KinectGridBuffer", kinect_grid_buffer);
updateShader.SetBuffer(0, "HomePositionBuffer", home_position_buffer);
updateShader.SetBuffer(0, "HomeVelocityBuffer", home_velocity_buffer);
if (server != null)
{
updateShader.SetBuffer(0, "FinalPositionBuffer", server.FinalPositionBuffer);
updateShader.SetBuffer(0, "FinalVelocityBuffer", server.FinalVelocityBuffer);
uint x, y, z;
updateShader.GetKernelThreadGroupSizes(0, out x, out y, out z);
int tgx = Mathf.CeilToInt((float)server.FinalPositionBuffer.count / x);
updateShader.Dispatch(0, tgx, 1, 1);
}
else
{
updateShader.DispatchIndirect(0, args_buffer);
}
}
{
ComputeBuffer.CopyCount(home_position_buffer, home_count_buffer, 0);
int home_count;
#if false
var data = new int[home_count_buffer.count];
home_count_buffer.GetData(data);
@ -157,7 +183,6 @@ namespace UltraCombos
applyShader.SetFloat("timeStep", Time.fixedDeltaTime);
applyShader.SetFloat("temperatureAmount", fluidSimulation.m_temperatureAmount);
applyShader.SetFloat("densityAmount", fluidSimulation.m_densityAmount);
applyShader.SetFloat("kinectAmount", kinectAmount);
applyShader.SetBuffer(0, "KinectGridBuffer", kinect_grid_buffer);
applyShader.DispatchIndirect(0, clear_grid_buffer_args_buffer);
}

@ -8,14 +8,17 @@
RWStructuredBuffer<float4> KinectPositionBuffer;
RWStructuredBuffer<float4> KinectVelocityBuffer;
RWStructuredBuffer<float4> KinectGridBuffer;
//RWStructuredBuffer<float4> KinectOpticalBuffer;
RWStructuredBuffer<float4> FinalPositionBuffer;
RWStructuredBuffer<float4> FinalVelocityBuffer;
AppendStructuredBuffer<float4> HomePositionBuffer;
AppendStructuredBuffer<float4> HomeVelocityBuffer;
//Texture2D<float4> PositionTexture;
//Texture2D<float4> VelocityTexture;
Texture2D<float4> MotionTexture;
Texture2DArray<float4> MotionTextureArray;
//Texture2D<float4> MotionTexture;
//Texture2DArray<float4> MotionTextureArray;
float4 ClipMin;
float4 ClipMax;
@ -26,17 +29,14 @@ float4 FluidDim;
int flipX;
int NumKinects;
[numthreads(512,1,1)]
[numthreads(512, 1, 1)]
void CSMain (uint3 id : SV_DispatchThreadID)
{
uint2 tex_coord = uint2(id.x % HEIGHT, id.x / HEIGHT);
//uint2 tex_coord = uint2(id.x % WIDTH, id.x / WIDTH);
for (int i = 0; i < NumKinects; i++)
{
float4 pos = float4(MotionTexture[tex_coord].xyz, 1);
pos = float4(MotionTextureArray[uint3(tex_coord, i)].xyz, 1);
float4 pos = FinalPositionBuffer[id.x];
//pos.y *= -1;
pos.z *= -1;
//pos.z *= -1;
pos.x = lerp(pos.x, -pos.x, flipX);
float pos_mag = length(pos.xyz);
@ -44,10 +44,10 @@ void CSMain (uint3 id : SV_DispatchThreadID)
{
pos = mul(pos, ModelMatrix);
float4 vel = MotionTexture[tex_coord + uint2(WIDTH, 0)];
vel = MotionTextureArray[uint3(tex_coord, i) + uint3(WIDTH, 0, 0)];
float4 vel = FinalVelocityBuffer[id.x];
//vel = float4(0, 0, 0.01, 0);
//vel.y *= -1;
vel.z *= -1;
//vel.z *= -1;
vel.x = lerp(vel.x, -vel.x, flipX);
float3 grid_pos = (pos.xyz - FluidRoot.xyz) / FluidSize.xyz;
@ -76,6 +76,5 @@ void CSMain (uint3 id : SV_DispatchThreadID)
KinectVelocityBuffer[id.x] = float4((pos_mag == 0.0f) ? float3(0, 0, 0) : vel.xyz, 0);
}
}
}

Loading…
Cancel
Save