Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

re-import openni wrapper 0.9.7 and fixed the compilation error

  • Loading branch information...
commit 795a19e6cc01d60d7be2b2c981549d0c5b0bfdbf 1 parent 2c00530
@windhood windhood authored
Showing with 50,060 additions and 0 deletions.
  1. +2 −0  Assets/Editor.meta
  2. +78 −0 Assets/Editor/NIEventLoggerInspector.cs
  3. +7 −0 Assets/Editor/NIEventLoggerInspector.cs.meta
  4. +330 −0 Assets/Editor/NIInputInspector.cs
  5. +7 −0 Assets/Editor/NIInputInspector.cs.meta
  6. +196 −0 Assets/Editor/NIOpenNISettingsManagerInspector.cs
  7. +7 −0 Assets/Editor/NIOpenNISettingsManagerInspector.cs.meta
  8. +63 −0 Assets/Editor/NIPlayerManagerCOMSelectionInspector.cs
  9. +7 −0 Assets/Editor/NIPlayerManagerCOMSelectionInspector.cs.meta
  10. +72 −0 Assets/Editor/NIPlayerManagerInspector.cs
  11. +7 −0 Assets/Editor/NIPlayerManagerInspector.cs.meta
  12. +102 −0 Assets/Editor/NIPlayerManagerPoseSelectionInspector.cs
  13. +7 −0 Assets/Editor/NIPlayerManagerPoseSelectionInspector.cs.meta
  14. +130 −0 Assets/Editor/NIQueryInspector.cs
  15. +7 −0 Assets/Editor/NIQueryInspector.cs.meta
  16. +102 −0 Assets/Editor/NISkeletonControllerInspector.cs
  17. +7 −0 Assets/Editor/NISkeletonControllerInspector.cs.meta
  18. +125 −0 Assets/Editor/NISkeletonTrackerInspector.cs
  19. +7 −0 Assets/Editor/NISkeletonTrackerInspector.cs.meta
  20. +85 −0 Assets/Editor/NIUserPoseDetectorInspector.cs
  21. +7 −0 Assets/Editor/NIUserPoseDetectorInspector.cs.meta
  22. +2 −0  Assets/OpenNI.meta
  23. +2 −0  Assets/OpenNI/Documentation.meta
  24. +2 −0  Assets/OpenNI/Documentation/Additional documentation sources.meta
  25. +34 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIMainPage.cs
  26. +7 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIMainPage.cs.meta
  27. +472 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIOverviewPages.cs
  28. +7 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIOverviewPages.cs.meta
  29. +501 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIPages.cs
  30. +7 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIPages.cs.meta
  31. +151 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNISamplesPages.cs
  32. +7 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNISamplesPages.cs.meta
  33. +1,066 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNITutorials.cs
  34. +7 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNITutorials.cs.meta
  35. +121 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIUtilityPages.cs
  36. +7 −0 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIUtilityPages.cs.meta
  37. +5 −0 Assets/OpenNI/Documentation/ExampleRecord.xml
  38. +2 −0  Assets/OpenNI/Documentation/ExampleRecord.xml.meta
  39. +2 −0  Assets/OpenNI/Documentation/Images.meta
  40. BIN  Assets/OpenNI/Documentation/Images/OpenNILogo.bmp
  41. +33 −0 Assets/OpenNI/Documentation/Images/OpenNILogo.bmp.meta
  42. +1,789 −0 Assets/OpenNI/Documentation/OpenNIDoxyfile
  43. +2 −0  Assets/OpenNI/Documentation/OpenNIDoxyfile.meta
  44. BIN  Assets/OpenNI/Documentation/OpenNIPackageDocumentation.chm
  45. +2 −0  Assets/OpenNI/Documentation/OpenNIPackageDocumentation.chm.meta
  46. +94 −0 Assets/OpenNI/Documentation/SampleXML.xml
  47. +2 −0  Assets/OpenNI/Documentation/SampleXML.xml.meta
  48. +2 −0  Assets/OpenNI/Graphical assets.meta
  49. +2 −0  Assets/OpenNI/Graphical assets/Construction Artwork.meta
  50. +2 −0  Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter.meta
  51. BIN  Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter/Constructor.FBX
  52. +489 −0 Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter/Constructor.FBX.meta
  53. +2 −0  Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter/Materials.meta
  54. BIN  Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter/Materials/constructor_done.mat
  55. +2 −0  Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter/Materials/constructor_done.mat.meta
  56. +2 −0  Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter/Textures.meta
  57. BIN  Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter/Textures/constructor_diffuse.png
  58. +33 −0 Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter/Textures/constructor_diffuse.png.meta
  59. BIN  Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter/Textures/constructor_normals.png
  60. +33 −0 Assets/OpenNI/Graphical assets/Construction Artwork/PrototypeCharacter/Textures/constructor_normals.png.meta
  61. +2 −0  Assets/OpenNI/Graphical assets/Floor assets.meta
  62. +2 −0  Assets/OpenNI/Graphical assets/Floor assets/Materials.meta
  63. BIN  Assets/OpenNI/Graphical assets/Floor assets/Materials/floor.mat
  64. +2 −0  Assets/OpenNI/Graphical assets/Floor assets/Materials/floor.mat.meta
  65. +2 −0  Assets/OpenNI/Graphical assets/Floor assets/textures.meta
  66. BIN  Assets/OpenNI/Graphical assets/Floor assets/textures/bridgegroundstones_layers.psd
  67. +33 −0 Assets/OpenNI/Graphical assets/Floor assets/textures/bridgegroundstones_layers.psd.meta
  68. +2 −0  Assets/OpenNI/Graphical assets/Images.meta
  69. BIN  Assets/OpenNI/Graphical assets/Images/Click.png
  70. +33 −0 Assets/OpenNI/Graphical assets/Images/Click.png.meta
  71. BIN  Assets/OpenNI/Graphical assets/Images/WaveGesture.jpg
  72. +33 −0 Assets/OpenNI/Graphical assets/Images/WaveGesture.jpg.meta
  73. BIN  Assets/OpenNI/Graphical assets/Images/calibrate_sample.png
  74. +33 −0 Assets/OpenNI/Graphical assets/Images/calibrate_sample.png.meta
  75. BIN  Assets/OpenNI/Graphical assets/Images/exit_sample.png
  76. +33 −0 Assets/OpenNI/Graphical assets/Images/exit_sample.png.meta
  77. +2 −0  Assets/OpenNI/Graphical assets/Logo.meta
  78. BIN  Assets/OpenNI/Graphical assets/Logo/OpenNI-on-transparent.png
  79. +33 −0 Assets/OpenNI/Graphical assets/Logo/OpenNI-on-transparent.png.meta
  80. BIN  Assets/OpenNI/Graphical assets/Logo/OpenNI-on-white.png
  81. +33 −0 Assets/OpenNI/Graphical assets/Logo/OpenNI-on-white.png.meta
  82. +2 −0  Assets/OpenNI/Graphical assets/Soldier Artwork.meta
  83. +2 −0  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX.meta
  84. +2 −0  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Materials.meta
  85. BIN  ...ets/Soldier Artwork/FBX/Materials/soldier@idle-soldiermesh1_soldiermesh_soldier_normalmap_test_lambert8.mat
  86. +2 −0  ...oldier Artwork/FBX/Materials/soldier@idle-soldiermesh1_soldiermesh_soldier_normalmap_test_lambert8.mat.meta
  87. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Materials/soldier@leanleft-aw_man_01mesh_lambert2.mat
  88. +2 −0  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Materials/soldier@leanleft-aw_man_01mesh_lambert2.mat.meta
  89. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Materials/soldier@leanright-aw_man_01mesh_lambert2.mat
  90. +2 −0  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Materials/soldier@leanright-aw_man_01mesh_lambert2.mat.meta
  91. BIN  .../Soldier Artwork/FBX/Materials/soldier@runfast-soldiermesh1_soldiermesh_soldier_normalmap_test_lambert8.mat
  92. +2 −0  ...ier Artwork/FBX/Materials/soldier@runfast-soldiermesh1_soldiermesh_soldier_normalmap_test_lambert8.mat.meta
  93. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Materials/soldier@runslow-aw_man_01mesh_lambert2.mat
  94. +2 −0  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Materials/soldier@runslow-aw_man_01mesh_lambert2.mat.meta
  95. BIN  ...ets/Soldier Artwork/FBX/Materials/soldier@walk-soldiermesh1_soldiermesh_soldier_normalmap_test_lambert8.mat
  96. +2 −0  ...oldier Artwork/FBX/Materials/soldier@walk-soldiermesh1_soldiermesh_soldier_normalmap_test_lambert8.mat.meta
  97. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier.fbx
  98. +383 −0 Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier.fbx.meta
  99. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@idle.fbx
  100. +376 −0 Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@idle.fbx.meta
  101. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@leanLeft.fbx
  102. +467 −0 Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@leanLeft.fbx.meta
  103. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@leanRight.fbx
  104. +467 −0 Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@leanRight.fbx.meta
  105. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@runFast.fbx
  106. +376 −0 Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@runFast.fbx.meta
  107. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@runSlow.fbx
  108. +467 −0 Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@runSlow.fbx.meta
  109. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@walk.fbx
  110. +376 −0 Assets/OpenNI/Graphical assets/Soldier Artwork/FBX/Soldier@walk.fbx.meta
  111. +2 −0  Assets/OpenNI/Graphical assets/Soldier Artwork/Materials.meta
  112. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/Materials/soldier_blue.mat
  113. +2 −0  Assets/OpenNI/Graphical assets/Soldier Artwork/Materials/soldier_blue.mat.meta
  114. +2 −0  Assets/OpenNI/Graphical assets/Soldier Artwork/Textures.meta
  115. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/Textures/bridgeground1_normals.tga
  116. +33 −0 Assets/OpenNI/Graphical assets/Soldier Artwork/Textures/bridgeground1_normals.tga.meta
  117. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/Textures/soldier_blue.psd
  118. +33 −0 Assets/OpenNI/Graphical assets/Soldier Artwork/Textures/soldier_blue.psd.meta
  119. BIN  Assets/OpenNI/Graphical assets/Soldier Artwork/Textures/soldier_normalmap_test.tga
  120. +33 −0 Assets/OpenNI/Graphical assets/Soldier Artwork/Textures/soldier_normalmap_test.tga.meta
  121. +2 −0  Assets/OpenNI/Interface library.meta
  122. +2 −0  Assets/OpenNI/Interface library/Installer.meta
  123. +2 −0  Assets/OpenNI/Interface library/OpenNI engine.meta
  124. +6 −0 Assets/OpenNI/Interface library/OpenNI engine/OpenNI.Net.dll.meta
  125. +2 −0  Assets/OpenNI/Prefabs.meta
  126. +2 −0  Assets/OpenNI/Prefabs/Main OpenNI Prefabs.meta
  127. BIN  Assets/OpenNI/Prefabs/Main OpenNI Prefabs/InputController.prefab
  128. +2 −0  Assets/OpenNI/Prefabs/Main OpenNI Prefabs/InputController.prefab.meta
  129. BIN  Assets/OpenNI/Prefabs/Main OpenNI Prefabs/OpenNISettings.prefab
  130. +2 −0  Assets/OpenNI/Prefabs/Main OpenNI Prefabs/OpenNISettings.prefab.meta
  131. +2 −0  Assets/OpenNI/Prefabs/Samples Prefabs.meta
  132. BIN  Assets/OpenNI/Prefabs/Samples Prefabs/BallPrefab.prefab
  133. +2 −0  Assets/OpenNI/Prefabs/Samples Prefabs/BallPrefab.prefab.meta
  134. BIN  Assets/OpenNI/Prefabs/Samples Prefabs/ConstructionWorkerPrefab.prefab
  135. +2 −0  Assets/OpenNI/Prefabs/Samples Prefabs/ConstructionWorkerPrefab.prefab.meta
  136. BIN  Assets/OpenNI/Prefabs/Samples Prefabs/FullBodySkeletonCubes.prefab
  137. +2 −0  Assets/OpenNI/Prefabs/Samples Prefabs/FullBodySkeletonCubes.prefab.meta
  138. BIN  Assets/OpenNI/Prefabs/Samples Prefabs/MoveableSoldier.prefab
  139. +2 −0  Assets/OpenNI/Prefabs/Samples Prefabs/MoveableSoldier.prefab.meta
  140. BIN  Assets/OpenNI/Prefabs/Samples Prefabs/OpenNILogo.prefab
  141. +2 −0  Assets/OpenNI/Prefabs/Samples Prefabs/OpenNILogo.prefab.meta
  142. BIN  Assets/OpenNI/Prefabs/Samples Prefabs/SkeletonLineDebugger.prefab
  143. +2 −0  Assets/OpenNI/Prefabs/Samples Prefabs/SkeletonLineDebugger.prefab.meta
  144. BIN  Assets/OpenNI/Prefabs/Samples Prefabs/SkeletonLineRenderer.prefab
  145. +2 −0  Assets/OpenNI/Prefabs/Samples Prefabs/SkeletonLineRenderer.prefab.meta
  146. BIN  Assets/OpenNI/Prefabs/Samples Prefabs/UpperBodySkeletonCubes.prefab
  147. +2 −0  Assets/OpenNI/Prefabs/Samples Prefabs/UpperBodySkeletonCubes.prefab.meta
  148. +2 −0  Assets/OpenNI/Prefabs/Utility Prefabs.meta
  149. BIN  Assets/OpenNI/Prefabs/Utility Prefabs/CalibrationMessage.prefab
  150. +2 −0  Assets/OpenNI/Prefabs/Utility Prefabs/CalibrationMessage.prefab.meta
  151. BIN  Assets/OpenNI/Prefabs/Utility Prefabs/NIDepthViewer.prefab
  152. +2 −0  Assets/OpenNI/Prefabs/Utility Prefabs/NIDepthViewer.prefab.meta
  153. BIN  Assets/OpenNI/Prefabs/Utility Prefabs/NIGUI.prefab
  154. +2 −0  Assets/OpenNI/Prefabs/Utility Prefabs/NIGUI.prefab.meta
  155. BIN  Assets/OpenNI/Prefabs/Utility Prefabs/NIImageViewer.prefab
  156. +2 −0  Assets/OpenNI/Prefabs/Utility Prefabs/NIImageViewer.prefab.meta
  157. BIN  Assets/OpenNI/Prefabs/Utility Prefabs/NIRadarViewer.prefab
  158. +2 −0  Assets/OpenNI/Prefabs/Utility Prefabs/NIRadarViewer.prefab.meta
  159. BIN  Assets/OpenNI/Prefabs/Utility Prefabs/NIUserViewer.prefab
  160. +2 −0  Assets/OpenNI/Prefabs/Utility Prefabs/NIUserViewer.prefab.meta
  161. +32,200 −0 Assets/OpenNI/Readme.rtf
  162. +5 −0 Assets/OpenNI/Readme.rtf.meta
  163. +30 −0 Assets/OpenNI/ReleaseNotes.txt
  164. +2 −0  Assets/OpenNI/ReleaseNotes.txt.meta
  165. +2 −0  Assets/OpenNI/Sample Scenes.meta
  166. BIN  Assets/OpenNI/Sample Scenes/MultipleSkeletons.unity
  167. +2 −0  Assets/OpenNI/Sample Scenes/MultipleSkeletons.unity.meta
  168. BIN  Assets/OpenNI/Sample Scenes/NIGUIControl.unity
  169. +2 −0  Assets/OpenNI/Sample Scenes/NIGUIControl.unity.meta
  170. BIN  Assets/OpenNI/Sample Scenes/NIInputControl.unity
  171. +2 −0  Assets/OpenNI/Sample Scenes/NIInputControl.unity.meta
  172. BIN  Assets/OpenNI/Sample Scenes/SimpleGame.unity
  173. +2 −0  Assets/OpenNI/Sample Scenes/SimpleGame.unity.meta
  174. BIN  Assets/OpenNI/Sample Scenes/SingleSkeleton.unity
  175. +2 −0  Assets/OpenNI/Sample Scenes/SingleSkeleton.unity.meta
  176. +2 −0  Assets/OpenNI/Scripts.meta
  177. +2 −0  Assets/OpenNI/Scripts/Main OpenNI.meta
  178. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Basic objects.meta
  179. +164 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/NIEventLogger.cs
  180. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/NIEventLogger.cs.meta
  181. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine.meta
  182. +137 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NICheckVersion.cs
  183. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NICheckVersion.cs.meta
  184. +341 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NIContext.cs
  185. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NIContext.cs.meta
  186. +91 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NIConvertCoordinates.cs
  187. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NIConvertCoordinates.cs.meta
  188. +108 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NIImage.cs
  189. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NIImage.cs.meta
  190. +80 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NIOpenNICheckVersion.cs
  191. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NIOpenNICheckVersion.cs.meta
  192. +436 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NIUserAndSkeleton.cs
  193. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/NIUserAndSkeleton.cs.meta
  194. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/WrapperBaseObjects.meta
  195. +84 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/WrapperBaseObjects/NIWrapperContextDependant.cs
  196. +7 −0 ...OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/WrapperBaseObjects/NIWrapperContextDependant.cs.meta
  197. +84 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/WrapperBaseObjects/NIWrapperObject.cs
  198. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNI engine/WrapperBaseObjects/NIWrapperObject.cs.meta
  199. +338 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNISettingsManager.cs
  200. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/OpenNISettingsManager.cs.meta
  201. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Basic objects/Queries.meta
  202. +145 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/Queries/NIQuery.cs
  203. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/Queries/NIQuery.cs.meta
  204. +234 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/Queries/NIQueryDescription.cs
  205. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Basic objects/Queries/NIQueryDescription.cs.meta
  206. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Input.meta
  207. +151 −0 Assets/OpenNI/Scripts/Main OpenNI/Input/NIAxis.cs
  208. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Input/NIAxis.cs.meta
  209. +538 −0 Assets/OpenNI/Scripts/Main OpenNI/Input/NIInput.cs
  210. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Input/NIInput.cs.meta
  211. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Skeleton base objects.meta
  212. +364 −0 Assets/OpenNI/Scripts/Main OpenNI/Skeleton base objects/NISkeletonController.cs
  213. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Skeleton base objects/NISkeletonController.cs.meta
  214. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Trackers.meta
  215. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Trackers/Base tracker and manager classes.meta
  216. +201 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Base tracker and manager classes/NIPointTracker.cs
  217. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Base tracker and manager classes/NIPointTracker.cs.meta
  218. +157 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Base tracker and manager classes/NIPointTrackerManager.cs
  219. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Base tracker and manager classes/NIPointTrackerManager.cs.meta
  220. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Trackers/Common gesture classes.meta
  221. +94 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Common gesture classes/NIGestureFactory.cs
  222. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Common gesture classes/NIGestureFactory.cs.meta
  223. +29 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Common gesture classes/NIGestureManager.cs
  224. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Common gesture classes/NIGestureManager.cs.meta
  225. +119 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Common gesture classes/NIGestureTracker.cs
  226. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Common gesture classes/NIGestureTracker.cs.meta
  227. +83 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/NIPositionTrackerFrameManager.cs
  228. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/NIPositionTrackerFrameManager.cs.meta
  229. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Trackers/Skeleton based trackers.meta
  230. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Trackers/Skeleton based trackers/gestures.meta
  231. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Trackers/Skeleton based trackers/gestures/Gesture detectors.meta
  232. +185 −0 ...pts/Main OpenNI/Trackers/Skeleton based trackers/gestures/Gesture detectors/NISteadySkeletonHandDetector.cs
  233. +7 −0 ...ain OpenNI/Trackers/Skeleton based trackers/gestures/Gesture detectors/NISteadySkeletonHandDetector.cs.meta
  234. +185 −0 ...penNI/Scripts/Main OpenNI/Trackers/Skeleton based trackers/gestures/Gesture detectors/NIUserPoseDetector.cs
  235. +7 −0 .../Scripts/Main OpenNI/Trackers/Skeleton based trackers/gestures/Gesture detectors/NIUserPoseDetector.cs.meta
  236. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Trackers/Skeleton based trackers/gestures/factories.meta
  237. +74 −0 ...I/Scripts/Main OpenNI/Trackers/Skeleton based trackers/gestures/factories/NISteadySkeletonGestureFactory.cs
  238. +7 −0 ...ipts/Main OpenNI/Trackers/Skeleton based trackers/gestures/factories/NISteadySkeletonGestureFactory.cs.meta
  239. +57 −0 .../OpenNI/Scripts/Main OpenNI/Trackers/Skeleton based trackers/gestures/factories/NIUserPoseGestureFactory.cs
  240. +7 −0 ...NI/Scripts/Main OpenNI/Trackers/Skeleton based trackers/gestures/factories/NIUserPoseGestureFactory.cs.meta
  241. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/Trackers/Skeleton based trackers/point trackers.meta
  242. +338 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Skeleton based trackers/point trackers/NISkeletonTracker.cs
  243. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/Trackers/Skeleton based trackers/point trackers/NISkeletonTracker.cs.meta
  244. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/User selector.meta
  245. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/User selector/Base objects.meta
  246. +274 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Base objects/NIPlayerCandidateObject.cs
  247. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Base objects/NIPlayerCandidateObject.cs.meta
  248. +322 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Base objects/NIPlayerManager.cs
  249. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Base objects/NIPlayerManager.cs.meta
  250. +193 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Base objects/NISelectedPlayer.cs
  251. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Base objects/NISelectedPlayer.cs.meta
  252. +2 −0  Assets/OpenNI/Scripts/Main OpenNI/User selector/Selectors.meta
  253. +39 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Selectors/NIPlayerCOMCandidateObject.cs
  254. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Selectors/NIPlayerCOMCandidateObject.cs.meta
  255. +120 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Selectors/NIPlayerManagerCOMSelection.cs
  256. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Selectors/NIPlayerManagerCOMSelection.cs.meta
  257. +216 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Selectors/NIPlayerManagerPoseSelection.cs
  258. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Selectors/NIPlayerManagerPoseSelection.cs.meta
  259. +58 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Selectors/NIPlayerPoseCandidateObject.cs
  260. +7 −0 Assets/OpenNI/Scripts/Main OpenNI/User selector/Selectors/NIPlayerPoseCandidateObject.cs.meta
  261. +2 −0  Assets/OpenNI/Scripts/Samples.meta
  262. +2 −0  Assets/OpenNI/Scripts/Samples/Ball Hitting Sample.meta
  263. +110 −0 Assets/OpenNI/Scripts/Samples/Ball Hitting Sample/BallCreator.cs
  264. +7 −0 Assets/OpenNI/Scripts/Samples/Ball Hitting Sample/BallCreator.cs.meta
  265. +53 −0 Assets/OpenNI/Scripts/Samples/Ball Hitting Sample/JointSpeeder.cs
  266. +7 −0 Assets/OpenNI/Scripts/Samples/Ball Hitting Sample/JointSpeeder.cs.meta
  267. +85 −0 Assets/OpenNI/Scripts/Samples/Ball Hitting Sample/NICollider.cs
  268. +7 −0 Assets/OpenNI/Scripts/Samples/Ball Hitting Sample/NICollider.cs.meta
  269. +2 −0  Assets/OpenNI/Scripts/Samples/Cursor examples.meta
  270. +55 −0 Assets/OpenNI/Scripts/Samples/Cursor examples/NIHandPositionInputPositionOnly.cs
  271. +7 −0 Assets/OpenNI/Scripts/Samples/Cursor examples/NIHandPositionInputPositionOnly.cs.meta
  272. +2 −0  Assets/OpenNI/Scripts/Samples/GUI examples.meta
  273. +216 −0 Assets/OpenNI/Scripts/Samples/GUI examples/GUIExample.cs
  274. +7 −0 Assets/OpenNI/Scripts/Samples/GUI examples/GUIExample.cs.meta
  275. +154 −0 Assets/OpenNI/Scripts/Samples/GUI examples/SkeletonGuiControl.cs
  276. +7 −0 Assets/OpenNI/Scripts/Samples/GUI examples/SkeletonGuiControl.cs.meta
  277. +2 −0  Assets/OpenNI/Scripts/Samples/Javascript assets.meta
  278. +56 −0 Assets/OpenNI/Scripts/Samples/Javascript assets/SmoothFollow.js
  279. +7 −0 Assets/OpenNI/Scripts/Samples/Javascript assets/SmoothFollow.js.meta
  280. +54 −0 Assets/OpenNI/Scripts/Samples/LogoShower.cs
  281. +7 −0 Assets/OpenNI/Scripts/Samples/LogoShower.cs.meta
  282. +2 −0  Assets/OpenNI/Scripts/Samples/Trackers.meta
  283. +2 −0  Assets/OpenNI/Scripts/Samples/Trackers/Exit pose.meta
  284. +289 −0 Assets/OpenNI/Scripts/Samples/Trackers/Exit pose/NIExitPoseDetector.cs
  285. +7 −0 Assets/OpenNI/Scripts/Samples/Trackers/Exit pose/NIExitPoseDetector.cs.meta
  286. +56 −0 Assets/OpenNI/Scripts/Samples/Trackers/Exit pose/NIExitPoseGestureFactory.cs
  287. +7 −0 Assets/OpenNI/Scripts/Samples/Trackers/Exit pose/NIExitPoseGestureFactory.cs.meta
  288. +2 −0  Assets/OpenNI/Scripts/Utilities.meta
  289. +2 −0  Assets/OpenNI/Scripts/Utilities/Debug utilities.meta
  290. +172 −0 Assets/OpenNI/Scripts/Utilities/Debug utilities/NISkeletonControllerLineDebugger.cs
  291. +7 −0 Assets/OpenNI/Scripts/Utilities/Debug utilities/NISkeletonControllerLineDebugger.cs.meta
  292. +64 −0 Assets/OpenNI/Scripts/Utilities/Debug utilities/NISkeletonControllerLineRenderer.cs
  293. +7 −0 Assets/OpenNI/Scripts/Utilities/Debug utilities/NISkeletonControllerLineRenderer.cs.meta
  294. +2 −0  Assets/OpenNI/Scripts/Utilities/Debug utilities/Viewers.meta
  295. +166 −0 Assets/OpenNI/Scripts/Utilities/Debug utilities/Viewers/NIDepthmapViewerUtility.cs
  296. +7 −0 Assets/OpenNI/Scripts/Utilities/Debug utilities/Viewers/NIDepthmapViewerUtility.cs.meta
  297. +112 −0 Assets/OpenNI/Scripts/Utilities/Debug utilities/Viewers/NIImagemapViewerUtility.cs
  298. +7 −0 Assets/OpenNI/Scripts/Utilities/Debug utilities/Viewers/NIImagemapViewerUtility.cs.meta
  299. +160 −0 Assets/OpenNI/Scripts/Utilities/Debug utilities/Viewers/NIMapViewerBaseUtility.cs
  300. +7 −0 Assets/OpenNI/Scripts/Utilities/Debug utilities/Viewers/NIMapViewerBaseUtility.cs.meta
Sorry, we could not display the entire diff because too many files (320) changed.
View
2  Assets/Editor.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: c933ccd6c46e7cb498af1bc5374abab6
View
78 Assets/Editor/NIEventLoggerInspector.cs
@@ -0,0 +1,78 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+
+using UnityEditor;
+using UnityEngine;
+using System.Collections.Generic;
+using System;
+using OpenNI;
+
+
+/// @brief A class to define the inspector of NIEventLogger
+///
+/// This class is responsible for adding various inspector capabilities to the NIEventLogger tool
+/// @ingroup OpenNIBasicObjects
+[CustomEditor(typeof(NIEventLogger))]
+public class NIEventLoggerInspector : Editor
+{
+ /// editor OnInspectorGUI to control the NIEventLogger properties
+ override public void OnInspectorGUI()
+ {
+ EditorGUI.indentLevel = 0;
+ EditorGUIUtility.LookLikeInspector();
+ NIEventLogger logger = target as NIEventLogger;
+ EditorGUILayout.LabelField("Categories to show","");
+ EditorGUI.indentLevel += 2;
+
+ if (Initialized == false)
+ {
+ // this is aimed to make sure the categories and sources list will be updated when
+ // the enums change. Therefore we use the static variable to make sure the test is done
+ // only once and not every frame.
+ if (logger.InitCategoriesList() || logger.InitSourcesList())
+ {
+ EditorUtility.SetDirty(target);
+ }
+ Initialized = true;
+ }
+ for (int i = 0; i < logger.m_categoriesToShow.Length; i++)
+ {
+ logger.m_categoriesToShow[i] = EditorGUILayout.Toggle("" + (NIEventLogger.Categories)i,logger.m_categoriesToShow[i]);
+ }
+ EditorGUI.indentLevel -= 2;
+ EditorGUILayout.Space();
+
+ EditorGUILayout.LabelField("Sources to show", "");
+ EditorGUI.indentLevel += 2;
+ for (int i = 0; i < logger.m_sourcesToShow.Length; i++)
+ {
+ logger.m_sourcesToShow[i] = EditorGUILayout.Toggle("" + (NIEventLogger.Sources)i, logger.m_sourcesToShow[i]);
+ }
+ logger.m_minLevelToShow = (NIEventLogger.VerboseLevel)EditorGUILayout.EnumPopup("Minimum log level", (System.Enum)logger.m_minLevelToShow);
+ EditorGUI.indentLevel -= 2;
+ EditorGUILayout.Space();
+
+ if (GUI.changed)
+ EditorUtility.SetDirty(target);
+ }
+
+ private bool Initialized = false; ///< @brief Used to make sure we initialize the sources and categories list of the logger.
+}
View
7 Assets/Editor/NIEventLoggerInspector.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 037de391cc4847a489d81c9b0dc9f6a1
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
330 Assets/Editor/NIInputInspector.cs
@@ -0,0 +1,330 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+using UnityEditor;
+using UnityEngine;
+using System.Collections.Generic;
+using OpenNI;
+
+
+/// @brief A class to define the inspector of NIInput
+///
+/// This class is responsible for adding various inspector capabilities to @ref NIInput.
+/// It provides the following information to configure:
+/// - Hands tracker manager: a link to the hands tracker manager which tells us which points (or
+/// hands) to track using the axis (this is similar to having a list of available joysticks).
+/// - Gestures manager: a link to the gestures manager which tells us which gestures could be used
+/// for the axes (this is similar to having a list of buttons on a joystick).
+/// - An axis array: This array serves the exact same purpose as the (<A HREF="http://unity3d.com/support/documentation/Components/class-InputManager.html">
+/// InputManager </A> provided by Unity.
+/// - The axes themselves are based on the @ref NIAxis class and are designed to be as similar to
+/// InputManager axes as possible. The axes definitions include the following:
+/// - @b Name: The name used for the axis (same as InputManager Name field, used as the identifier
+/// for GetAxis or GetAxisRaw). @note if multiple axes (between InputManager and NIInput) have
+/// the same name, the definition which returns the greatest absolute value will be used!.
+/// - @b NIInputAxis?: This checkbox tells us if we need to check the regular input for the axis.
+/// If this is checked (true) then %NIInput will not try to get axis information for that axis
+/// from the regular Input class.
+/// - <b>Descriptive name</b>: A short description of the axis(same as InputManager Descriptive
+/// Name field)
+/// - @b Gesture: The gesture used to push the axis in the positive direction. The list of available
+/// gestures is derived from the GestureManager. This comes instead of the key choice in
+/// InputManager. @note the gesture chosen must be a legal gesture for the hand tracker (
+/// otherwise a runtime error would occure)!
+/// - @b Dead: Size of the analog dead zone. All analog device values within this range result
+/// map to neutral (same as InputManager)
+/// - @b Sensitivity: for gestures: Speed in units per second that the the axis will move toward the target value.
+/// for movement this is a scaling factor
+/// - @b Invert: If true, all values are inverted (negative)
+/// - @b Type: The type of input used. For a list of types (and their meaning)
+/// see @ref NIAxis::NIInputTypes
+/// - @b Normalization: Defines a transformation of the tracked point's in the axis to [-1,1]
+/// range (clipped). -1 is anything smaller than the center minus m_maxMovement, +1 is anything
+/// larger than the center plus m_maxMovement and the values in between are a linear change.
+/// The center is defined based on the type (0 for HandMovement, focus point for
+/// HandMovementFromFocusPoint etc.). If the normalization value is 0 or negative then there
+/// will be no transformation (i.e. the axis value will be the position).
+/// @note the actual value is still multiplied by the sensitivity, changed to 0 in the dead
+/// zone and can be inverted.
+/// - @b Axis: Which axes the type relates to (x,y,z).
+/// - <b>Tracker to use</b>: This tells us which tracker to use (very similar to the joystick
+/// number defined in InputManager. Unlike InputManager there is no "all joystick". The
+/// available values are extracted from the Hands tracker manager.
+/// @note It is possible to have a value of None (which is the default and will occur if the
+/// relevant tracker is removed from the hand tracker). This will result in a runtime error!
+/// the developer must make sure a valid value exits!
+/// <br><br>
+/// @see @ref NIInputConcept for more information.
+/// @ingroup OpenNIInput
+[CustomEditor(typeof(NIInput))]
+[System.Serializable]
+public class NIInputInspector : Editor
+{
+ /// used to save the array size before we press "enter" to actually do the change.
+ protected int arraySize=-1;
+ /// internal GUIContent, this is used to easily add tool tips.
+ protected GUIContent m_myContent = new GUIContent("label", "tooltip");
+
+ /// the list of gestures we can choose
+ protected string[] m_gestureStrings = null;
+
+ /// the list of hand trackers we can choose
+ protected string[] m_pointTrackerStrings = null;
+
+ /// initializes the list of gestures to use.
+ protected void InitGestureStrings()
+ {
+ NIInput inp = target as NIInput;
+ if(inp.m_gestureManager==null || inp.m_gestureManager.m_gestures==null)
+ {
+ if(m_gestureStrings==null || m_gestureStrings.Length!=1)
+ {
+ m_gestureStrings=new string[1];
+ m_gestureStrings[0]="No gesture";
+ return;
+ }
+ else
+ {
+ // we already have the gesture strings
+ return;
+ }
+ }
+ if (m_gestureStrings != null && m_gestureStrings.Length == inp.m_gestureManager.m_gestures.Length)
+ return; // it is already initialized properly.
+ m_gestureStrings = new string[inp.m_gestureManager.m_gestures.Length + 1];
+ for (int i = 0; i < inp.m_gestureManager.m_gestures.Length; i++)
+ m_gestureStrings[i] = inp.m_gestureManager.m_gestures[i].GetGestureType();
+ m_gestureStrings[inp.m_gestureManager.m_gestures.Length] = "None";
+ }
+
+ /// initializes the list of point trackers to use.
+ protected void InitPointTrackerStrings()
+ {
+ NIInput inp = target as NIInput;
+ if (inp.m_pointsTrackingManager == null || inp.m_pointsTrackingManager.m_trackers == null)
+ {
+ if (m_pointTrackerStrings == null || m_pointTrackerStrings.Length != 1)
+ {
+ m_pointTrackerStrings = new string[1];
+ m_pointTrackerStrings[0] = "No point trackers";
+ return;
+ }
+ else
+ {
+ // we already have the gesture strings
+ return;
+ }
+ }
+ if (m_pointTrackerStrings != null && m_pointTrackerStrings.Length == inp.m_pointsTrackingManager.m_trackers.Length)
+ return; // it is already initialized properly.
+ m_pointTrackerStrings = new string[inp.m_pointsTrackingManager.m_trackers.Length + 1];
+ for (int i = 0; i < inp.m_pointsTrackingManager.m_trackers.Length; i++)
+ m_pointTrackerStrings[i] = inp.m_pointsTrackingManager.m_trackers[i].GetTrackerType();
+ m_pointTrackerStrings[inp.m_pointsTrackingManager.m_trackers.Length] = "None";
+ }
+
+ /// utility method to fix the index of gestures after changes (assuming the string is always
+ /// fine while the index might change because of changes done to the GestureManager).
+ /// @param axis the axis to fix.
+ protected void fixGestureIndex(NIAxis axis)
+ {
+ if(axis.m_gestureIndex<m_gestureStrings.Length && m_gestureStrings[axis.m_gestureIndex].CompareTo(axis.m_gestureString)==0)
+ return; // we match
+ // if we are not a "gesture" type, lets just make it the "none" gesture
+ if(axis.m_Type != NIAxis.NIInputTypes.Gesture)
+ {
+ axis.m_gestureIndex=m_gestureStrings.Length-1;
+ axis.m_gestureString=m_gestureStrings[axis.m_gestureIndex];
+ return;
+ }
+ // we now know we are a gesture type so lets look for a match
+ for (int i = 0; i < m_gestureStrings.Length; i++)
+ {
+ if (m_gestureStrings[i].CompareTo(axis.m_gestureString) == 0)
+ {
+ axis.m_gestureIndex = i;
+ return; // we found a match
+ }
+ }
+ // if we are here, the gesture no longer exist. We therefore will set ourselves to not be a gesture
+ // anymore but instead a hand movement type.
+ axis.m_gestureIndex = m_gestureStrings.Length - 1;
+ axis.m_Type = NIAxis.NIInputTypes.HandMovementFromStartingPoint;
+ axis.m_gestureString = m_gestureStrings[axis.m_gestureIndex];
+ }
+
+
+ /// utility method to fix the index of point trackers after changes (assuming the string is always
+ /// fine while the index might change because of changes done to the pointsTrackingManager).
+ /// @param axis the axis to fix.
+ protected void fixTrackerIndex(NIAxis axis)
+ {
+ if (axis.m_sourceTrackerIndex < m_pointTrackerStrings.Length && m_pointTrackerStrings[axis.m_sourceTrackerIndex].CompareTo(axis.m_sourceTrackerString) == 0)
+ return; // we match
+ for (int i = 0; i < m_pointTrackerStrings.Length; i++)
+ {
+ if (m_pointTrackerStrings[i].CompareTo(axis.m_sourceTrackerString) == 0)
+ {
+ axis.m_sourceTrackerIndex = i;
+ return; // we found a match
+ }
+ }
+ // if we are here, the tracker no longer exist. We therefore will set ourselves
+ // the "none" tracker
+ axis.m_sourceTrackerIndex = m_pointTrackerStrings.Length - 1;
+ axis.m_sourceTrackerString = m_pointTrackerStrings[axis.m_sourceTrackerIndex];
+ }
+
+
+ /// implementation of the Editor inspector GUI (this is what is called to see the inspector).
+ override public void OnInspectorGUI()
+ {
+ if(EditorApplication.isPlaying)
+ return;
+ InitGestureStrings();
+ InitPointTrackerStrings();
+ EditorGUIUtility.LookLikeInspector();
+ NIInput inp = target as NIInput;
+ EditorGUI.indentLevel = 0;
+ m_myContent.text = "Hand trackers manager";
+ m_myContent.tooltip = "The hands tracker manager which holds which hand tracking source we have";
+ inp.m_pointsTrackingManager = EditorGUILayout.ObjectField(m_myContent, inp.m_pointsTrackingManager, typeof(NIPointTrackerManager), true) as NIPointTrackerManager;
+ m_myContent.text = "Gestures manager";
+ m_myContent.tooltip = "The gestures manager which holds which gestures we can use";
+ inp.m_gestureManager = EditorGUILayout.ObjectField(m_myContent, inp.m_gestureManager, typeof(NIGestureManager), true) as NIGestureManager;
+
+ m_myContent.text = "Axes";
+ m_myContent.tooltip = "All the axes to use for Natural Interactions";
+ inp.m_foldAllAxes = EditorGUILayout.Foldout(inp.m_foldAllAxes, m_myContent);
+ if (inp.m_foldAllAxes == false)
+ return;
+ EditorGUI.indentLevel += 2;
+ if (arraySize < 0)
+ arraySize = inp.m_axisList.Count;
+ m_myContent.text = "Size";
+ m_myContent.tooltip = "The number of axes used";
+ int numElements = EditorGUILayout.IntField(m_myContent, arraySize);
+ arraySize = numElements;
+ Event e = Event.current;
+ if (e.keyCode == KeyCode.Return)
+ {
+ if (numElements == 0)
+ {
+ numElements = inp.m_axisList.Count; // don't allow to make it into 0 to avoid "deleting" to change something.
+ arraySize = numElements;
+ }
+ if (numElements != inp.m_axisList.Count)
+ {
+ if (numElements < inp.m_axisList.Count)
+ {
+ while (numElements < inp.m_axisList.Count)
+ {
+ inp.m_axisList.RemoveAt(inp.m_axisList.Count - 1);
+ }
+ }
+ else
+ {
+ for (int i = inp.m_axisList.Count; i < numElements; i++)
+ {
+ NIAxis newAxis = new NIAxis();
+ newAxis.m_gestureIndex = m_gestureStrings.Length - 1; // initialize to none
+ inp.m_axisList.Add(newAxis);
+ }
+ }
+ List<bool> newFoldout = new List<bool>();
+ int size = inp.m_foldAxisElement.Count;
+ if (size > inp.m_axisList.Count)
+ size = inp.m_axisList.Count;
+ for (int i = 0; i < size; i++)
+ {
+ newFoldout.Add(inp.m_foldAxisElement[i]);
+ }
+ for (int i = size; i < inp.m_axisList.Count; i++)
+ newFoldout.Add(false);
+ inp.m_foldAxisElement = newFoldout;
+ }
+ }
+
+ for (int i = 0; i < inp.m_foldAxisElement.Count; i++)
+ {
+ inp.m_foldAxisElement[i] = EditorGUILayout.Foldout(inp.m_foldAxisElement[i], inp.m_axisList[i].m_axisName);
+ if(inp.m_foldAxisElement[i]==false)
+ continue;
+ EditorGUI.indentLevel += 2;
+ m_myContent.text = "Name";
+ m_myContent.tooltip = "Change the name of the current axis";
+ inp.m_axisList[i].m_axisName = EditorGUILayout.TextField(m_myContent, inp.m_axisList[i].m_axisName);
+ m_myContent.text = "NIInput axis?";
+ m_myContent.tooltip = "if checked, the axis is used only by NIInput, if not, it is also used by the input manager";
+ inp.m_axisList[i].m_NIInputAxisOnly = EditorGUILayout.Toggle(m_myContent, inp.m_axisList[i].m_NIInputAxisOnly);
+ m_myContent.text = "Descriptive Name";
+ m_myContent.tooltip = "Name presented to the user if relevant";
+ inp.m_axisList[i].m_descriptiveName = EditorGUILayout.TextField(m_myContent, inp.m_axisList[i].m_descriptiveName);
+ fixGestureIndex(inp.m_axisList[i]);
+ inp.m_axisList[i].m_gestureIndex = EditorGUILayout.Popup("Gesture", inp.m_axisList[i].m_gestureIndex,m_gestureStrings);
+ inp.m_axisList[i].m_gestureString = m_gestureStrings[inp.m_axisList[i].m_gestureIndex];
+ if (inp.m_axisList[i].m_gestureIndex != m_gestureStrings.Length - 1)
+ inp.m_axisList[i].m_Type = NIAxis.NIInputTypes.Gesture; // to make sure we use either
+ m_myContent.text = "Dead";
+ m_myContent.tooltip = "Movement of less than this value (when changes are used) will be ignored and considered 0";
+ float deadZone=EditorGUILayout.FloatField(m_myContent,inp.m_axisList[i].m_deadZone);
+ inp.m_axisList[i].m_deadZone = deadZone < NIAxis.m_minDeadZone ? NIAxis.m_minDeadZone : deadZone;
+ m_myContent.text = "Sensitivity";
+ m_myContent.tooltip = "A scaling factor";
+ float sensitivity = EditorGUILayout.FloatField(m_myContent, inp.m_axisList[i].m_sensitivity);
+ inp.m_axisList[i].m_sensitivity = sensitivity < NIAxis.m_minSensitivity ? NIAxis.m_minSensitivity : sensitivity;
+ m_myContent.text = "Invert";
+ m_myContent.tooltip = "Flip the values between positive and negative";
+ inp.m_axisList[i].m_invert = EditorGUILayout.Toggle(m_myContent, inp.m_axisList[i].m_invert);
+ m_myContent.text = "Type";
+ m_myContent.tooltip = "The type of movement to do";
+ inp.m_axisList[i].m_Type = (NIAxis.NIInputTypes)EditorGUILayout.EnumPopup(m_myContent, (System.Enum)inp.m_axisList[i].m_Type);
+ if (inp.m_axisList[i].m_Type != NIAxis.NIInputTypes.Gesture)
+ {
+ inp.m_axisList[i].m_gestureIndex = m_gestureStrings.Length - 1; // make it a "none" gesture
+ }
+ m_myContent.text = "Normalization";
+ m_myContent.tooltip = "Defines a transformation of the hand's axis to [-1,1] range (clipped).";
+ m_myContent.tooltip += " -1 is anything smaller than the center minus m_maxMovement,";
+ m_myContent.tooltip += " +1 is anything larger than the center plus m_maxMovement";
+ m_myContent.tooltip += " and the values in between are a linear change.";
+ m_myContent.tooltip += " The center is defined based on the type (0 for HandMovement, focus point";
+ m_myContent.tooltip += " for HandMovementFromFocusPoint etc.). If m_maxMovement is 0 or negative";
+ m_myContent.tooltip += " then there will be no transformation. \n";
+ m_myContent.tooltip += "Note the actual value is still multiplied by the sensitivity, ";
+ m_myContent.tooltip += " changed to 0 in the dead zone and can base inverted. ";
+ inp.m_axisList[i].m_maxMovement = EditorGUILayout.FloatField(m_myContent, inp.m_axisList[i].m_maxMovement);
+
+ m_myContent.text = "Axis";
+ m_myContent.tooltip = "Axis to use";
+ inp.m_axisList[i].m_axisUsed = (NIAxis.AxesList)EditorGUILayout.EnumPopup(m_myContent, (System.Enum)inp.m_axisList[i].m_axisUsed);
+ fixTrackerIndex(inp.m_axisList[i]);
+ inp.m_axisList[i].m_sourceTrackerIndex = EditorGUILayout.Popup("Tracker to use", inp.m_axisList[i].m_sourceTrackerIndex, m_pointTrackerStrings);
+ inp.m_axisList[i].m_sourceTrackerString = m_pointTrackerStrings[inp.m_axisList[i].m_sourceTrackerIndex];
+ EditorGUILayout.Space();
+ EditorGUI.indentLevel -= 2;
+ }
+ EditorGUI.indentLevel -= 2;
+ EditorGUI.indentLevel = 0;
+ EditorGUILayout.Space();
+ if(GUI.changed)
+ EditorUtility.SetDirty(target);
+ }
+}
View
7 Assets/Editor/NIInputInspector.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 3eb5907c4930c8e48bc3c6aae4f33ad5
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
196 Assets/Editor/NIOpenNISettingsManagerInspector.cs
@@ -0,0 +1,196 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+using UnityEditor;
+using UnityEngine;
+using System.Collections.Generic;
+using OpenNI;
+
+
+/// @brief A class to define the inspector of NIConfigurableContext
+/// This class is responsible for adding various inspector capabilities to the NIConfigurableContext tool
+/// @ingroup OpenNIBasicObjects
+[CustomEditor(typeof(OpenNISettingsManager))]
+public class NIOpenNISettingsManagerInspector : Editor
+{
+ /// holds the foldout of the user and skeleton control
+ protected bool m_userAndSkeletonControlFoldout = true;
+
+ /// internal GUIContent, this is used to easily add tool tips.
+ protected GUIContent m_myContent = new GUIContent("string label", "tooltip");
+
+
+ /// This method creates the inspector when the program is running. In this mode we
+ /// only show information on what is initialized, valid etc. but allow no changes.
+ protected void RunInspector()
+ {
+ // for easy access to the object
+ OpenNISettingsManager OpenNISettings = target as OpenNISettingsManager;
+
+ // basic test. If the object is invalid, nothing else matters.
+ if(OpenNISettings.Valid==false)
+ {
+ EditorGUILayout.LabelField("NI was not initialized and therefore everything is invalid!", "");
+ return;
+ }
+ // show the mirror capability (global one from the context). Note, we can change the mirroring (To
+ // allow showing mirrored/unmirrored viewers in realtime) but this should NOT be used except for that
+ // purpose
+ OpenNISettings.Mirror = EditorGUILayout.Toggle("Mirror behavior ", OpenNISettings.Mirror);
+
+ // show image generator status
+ string str = "Not used";
+ if (OpenNISettings.m_useImageGenerator)
+ {
+ str = OpenNISettings.ImageValid ? "Valid" : "Invalid";
+ }
+ EditorGUILayout.LabelField("Image Generator:", str);
+
+ EditorGUILayout.Space();
+
+ // show user and skeleton control status
+ if (OpenNISettings.m_useSkeleton)
+ {
+ str = OpenNISettings.UserSkeletonValid ? "user and skeleton control is Valid" : "user and skeleton control is Invalid";
+ m_userAndSkeletonControlFoldout = EditorGUILayout.Foldout(m_userAndSkeletonControlFoldout, str);
+ if (m_userAndSkeletonControlFoldout && OpenNISettings.UserSkeletonValid)
+ {
+ EditorGUI.indentLevel += 2;
+ int[] users = OpenNISettings.UserGenrator.GetUserIds();
+ EditorGUILayout.LabelField("Identified " + users.Length + " users", "");
+ for(int i=0; i<users.Length; i++)
+ {
+ int userID = users[i];
+ Vector3 center = OpenNISettings.UserGenrator.GetUserCenterOfMass(userID);
+ EditorGUILayout.LabelField("User:", ""+i);
+ EditorGUI.indentLevel += 2;
+ EditorGUILayout.LabelField("user id:", ""+userID);
+ string state="Not yet calibrated";
+ if(OpenNISettings.UserGenrator.IsTracking(userID))
+ {
+ state="Tracking";
+ }
+ else if(OpenNISettings.UserGenrator.IsCalibrated(userID))
+ {
+ state="Calibrated";
+ }
+ else if(OpenNISettings.UserGenrator.IsCalibrating(userID))
+ {
+ state="Calibrating";
+ }
+ EditorGUILayout.LabelField("state:", "" + state);
+ EditorGUILayout.LabelField("center of mass:", "" + center);
+ EditorGUI.indentLevel -= 2;
+ }
+ EditorGUILayout.Space();
+ OpenNISettings.SmoothFactor = EditorGUILayout.FloatField("Smoothing factor:", OpenNISettings.SmoothFactor);
+ EditorGUI.indentLevel -= 2;
+ }
+ }
+ else
+ {
+ EditorGUILayout.LabelField("user and skeleton control:", "Not used");
+ }
+ EditorGUILayout.Space();
+
+ }
+
+ /// This method creates the inspector when the program is NOT running. In this mode we
+ /// allow initialization but do not show any running information
+ protected void InitInspector()
+ {
+ // for easy access to the object
+ OpenNISettingsManager OpenNISettings = target as OpenNISettingsManager;
+
+ // set the default mirroring.
+ OpenNISettings.m_initMirroring = EditorGUILayout.Toggle("Mirror behavior ", OpenNISettings.m_initMirroring);
+ // chooses the xml file. In most implementations this should be empty!
+
+ OpenNISettings.m_XMLFileName = EditorGUILayout.TextField("XML file", OpenNISettings.m_XMLFileName);
+ // set image generator use.
+ OpenNISettings.m_useImageGenerator = EditorGUILayout.Toggle("Use image generator?", OpenNISettings.m_useImageGenerator);
+
+ // set skeleton generator use.
+ // show user and skeleton control status
+ OpenNISettings.m_useSkeleton = EditorGUILayout.Toggle("Use user and skeleton?", OpenNISettings.m_useSkeleton);
+ if (OpenNISettings.m_useSkeleton && OpenNISettings.m_useSkeleton)
+ {
+ EditorGUI.indentLevel += 2;
+ OpenNISettings.m_smoothingFactor = EditorGUILayout.FloatField("Smoothing factor:", OpenNISettings.m_smoothingFactor);
+ EditorGUI.indentLevel -= 2;
+ }
+
+ // initialize the logger and query objects
+ OpenNISettings.m_Logger = EditorGUILayout.ObjectField("Logger object", OpenNISettings.m_Logger, typeof(NIEventLogger), true) as NIEventLogger;
+ OpenNISettings.m_query = EditorGUILayout.ObjectField("Query object", OpenNISettings.m_query, typeof(NIQuery), true) as NIQuery;
+ m_myContent.text = "Playback filename";
+ m_myContent.tooltip = "If this is not empty, it will hold the filename of a recording. NOTE: if XML is defined, this is ignored. See the documentation for more info";
+ OpenNISettings.m_recordingFilename = EditorGUILayout.TextField(m_myContent, OpenNISettings.m_recordingFilename);
+ m_myContent.text = "Reset floor normal";
+ m_myContent.tooltip = "If floor normal is updated in the game, it remains between games. If a new normal should be calculated, reset it between games. Note: this is only relevant while playing again and again in the editor as the normal will automatically be reset whenever the program is started again";
+ if (GUILayout.Button(m_myContent))
+ {
+ NIConvertCoordinates.ResetFloorNormal();
+ }
+ if (GUI.changed)
+ EditorUtility.SetDirty(target);
+ }
+
+ /// implementation of the Editor inspector GUI (this is what is called to see the inspector).
+ override public void OnInspectorGUI()
+ {
+ EditorGUI.indentLevel = 0;
+ EditorGUIUtility.LookLikeInspector();
+ if(EditorApplication.isPlaying)
+ {
+ // we are running so we can only get some feedback
+ RunInspector();
+ }
+ else
+ {
+ // we are not running so we can initialize stuff
+ InitInspector();
+ }
+ EditorGUI.indentLevel = 0;
+
+ // this is part of making sure we update during running. This adds the update function
+ // to the editor application update which is called 100 times per second.
+ if (m_initialized == false)
+ {
+ EditorApplication.update += Update;
+ m_initialized = true;
+ }
+ }
+
+ /// if true we initialized and need to do nothing
+ private bool m_initialized = false;
+
+
+ /// used in order to make sure we update during running even if no movement occurs as long as
+ /// the object is chosen.
+ void Update()
+ {
+ // to make sure this updates when we are not in focus too..
+ if (EditorApplication.isPlaying)
+ {
+ Repaint();
+ }
+ }
+}
View
7 Assets/Editor/NIOpenNISettingsManagerInspector.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 007ca6578f9b9c54b9f98e6fb3c7547f
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
63 Assets/Editor/NIPlayerManagerCOMSelectionInspector.cs
@@ -0,0 +1,63 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+
+using UnityEditor;
+using UnityEngine;
+using System.Collections.Generic;
+using OpenNI;
+
+
+/// @brief A class to define the inspector of NIPlayerManager
+///
+/// This class is responsible for adding various inspector capabilities to the player manager
+/// @ingroup UserSelectionModule
+[CustomEditor(typeof(NIPlayerManagerCOMSelection))]
+public class NIPlayerManagerCOMSelectionInspector : NIPlayerManagerInspector
+{
+
+ /// editor OnInspectorGUI to control the NIEventLogger properties
+ override public void OnInspectorGUI()
+ {
+ DrawPlayerManager();
+ if (GUI.changed)
+ EditorUtility.SetDirty(target);
+ }
+
+ protected override void DrawPlayerManager()
+ {
+ base.DrawPlayerManager();
+ NIPlayerManagerCOMSelection manager = target as NIPlayerManagerCOMSelection;
+ manager.m_maxAllowedDistance = EditorGUILayout.FloatField("Max distance", manager.m_maxAllowedDistance);
+ if (manager.m_maxAllowedDistance < 0)
+ manager.m_maxAllowedDistance = 0;
+ manager.m_failurePenalty = EditorGUILayout.FloatField("Failure penalty", manager.m_failurePenalty);
+ if (manager.m_failurePenalty < 0)
+ manager.m_failurePenalty = 0;
+ manager.m_minCOMChangeForFailure = EditorGUILayout.FloatField("Min change to retry", manager.m_minCOMChangeForFailure);
+ if (manager.m_minCOMChangeForFailure < 0)
+ manager.m_minCOMChangeForFailure = 0;
+ manager.m_hysteresis = EditorGUILayout.FloatField("Hysteresis", manager.m_hysteresis);
+ if (manager.m_hysteresis < 0)
+ manager.m_hysteresis = 0;
+
+ }
+
+}
View
7 Assets/Editor/NIPlayerManagerCOMSelectionInspector.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4c6ae797b24cffd4eb58fe8964e7f557
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
72 Assets/Editor/NIPlayerManagerInspector.cs
@@ -0,0 +1,72 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+
+using UnityEditor;
+using UnityEngine;
+using System.Collections.Generic;
+using OpenNI;
+
+
+/// @brief A class to define the inspector of NIPlayerManager
+///
+/// This class is responsible for adding various inspector capabilities to the player manager
+/// @ingroup UserSelectionModule
+[CustomEditor(typeof(NIPlayerManager))]
+public class NIPlayerManagerInspector : Editor
+{
+ /// editor OnInspectorGUI to control the NIEventLogger properties
+ override public void OnInspectorGUI()
+ {
+ DrawPlayerManager();
+ if (GUI.changed)
+ EditorUtility.SetDirty(target);
+ }
+
+ /// @brief Internal method to do the actual drawing.
+ ///
+ /// Inspectors for users selectors inheriting NIPlayerManager should inherit NIPlayerManagerInspector
+ /// and override this method.
+ /// @note for best performance, call base.DrawPlayerManager() and only then add the new behavior.
+ protected virtual void DrawPlayerManager()
+ {
+ EditorGUIUtility.LookLikeInspector();
+ NIPlayerManager manager = target as NIPlayerManager;
+ GUILayout.Label(manager.GetSelectionString());
+ EditorGUILayout.Space();
+ manager.m_contextManager = EditorGUILayout.ObjectField("Context", manager.m_contextManager, typeof(OpenNISettingsManager), true) as OpenNISettingsManager;
+ int maxPlayers = EditorGUILayout.IntField("Max allowed players", manager.m_MaxNumberOfPlayers);
+ if(maxPlayers>0)
+ {
+ if (EditorApplication.isPlaying)
+ {
+ // we are running so we need to change manually
+ manager.ChangeNumberOfPlayers(maxPlayers);
+ }
+ else
+ {
+ manager.m_MaxNumberOfPlayers = maxPlayers;
+ }
+ }
+ int numRetries = EditorGUILayout.IntField("Num retries", manager.m_numRetries);
+ if (numRetries > 0)
+ manager.m_numRetries = numRetries;
+ }
+}
View
7 Assets/Editor/NIPlayerManagerInspector.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4b377c8e20089e0419be25e904ace87d
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
102 Assets/Editor/NIPlayerManagerPoseSelectionInspector.cs
@@ -0,0 +1,102 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+
+using UnityEditor;
+using UnityEngine;
+using System.Collections.Generic;
+using OpenNI;
+
+
+/// @brief A class to define the inspector of NIPlayerManager
+///
+/// This class is responsible for adding various inspector capabilities to the player manager
+/// @ingroup UserSelectionModule
+[CustomEditor(typeof(NIPlayerManagerPoseSelection))]
+public class NIPlayerManagerPoseSelectionInspector : NIPlayerManagerInspector
+{
+ protected override void DrawPlayerManager()
+ {
+ base.DrawPlayerManager();
+ NIPlayerManagerPoseSelection manager = target as NIPlayerManagerPoseSelection;
+ string[] legalPoses = NIUserAndSkeleton.GetLegalPoses();
+
+ if (legalPoses != null)
+ {
+ int selectedIndex;
+ if (manager.m_PoseToSelect == null)
+ {
+ selectedIndex = 0;
+ }
+ else for (selectedIndex = 0; selectedIndex < legalPoses.Length; selectedIndex++)
+ {
+ if (manager.m_PoseToSelect.CompareTo(legalPoses[selectedIndex])==0)
+ break;
+ }
+ if (selectedIndex >= legalPoses.Length)
+ selectedIndex = 0;
+ selectedIndex = EditorGUILayout.Popup("pose to select", selectedIndex, legalPoses);
+ manager.m_PoseToSelect = legalPoses[selectedIndex];
+
+ bool useUnselectionPose = manager.m_PoseToUnselect != null && manager.m_PoseToUnselect.CompareTo("")!=0;
+ useUnselectionPose = EditorGUILayout.Toggle("Use unselection pose", useUnselectionPose);
+ if (useUnselectionPose == false)
+ {
+ manager.m_PoseToUnselect = "";
+ }
+ else
+ {
+ if (manager.m_PoseToUnselect == null)
+ {
+ selectedIndex = 0;
+ }
+ else for (selectedIndex = 0; selectedIndex < legalPoses.Length; selectedIndex++)
+ {
+ if (manager.m_PoseToUnselect.CompareTo(legalPoses[selectedIndex])==0)
+ break;
+ }
+ if (selectedIndex >= legalPoses.Length)
+ selectedIndex = 0;
+ selectedIndex = EditorGUILayout.Popup("Pose to unselect", selectedIndex, legalPoses);
+ manager.m_PoseToUnselect = legalPoses[selectedIndex];
+ }
+ }
+ else
+ {
+ EditorGUILayout.LabelField("Pose to Select", manager.m_PoseToSelect);
+ EditorGUILayout.LabelField("Pose to Unselect", manager.m_PoseToUnselect);
+ }
+
+ manager.m_timeToSwitch = EditorGUILayout.FloatField("Time between switching", manager.m_timeToSwitch);
+ if (manager.m_timeToSwitch < 0.0f)
+ manager.m_timeToSwitch = 0;
+
+ if (EditorApplication.isPlaying == false)
+ {
+ if (GUILayout.Button("Update legal poses (might take some time)"))
+ {
+ OpenNISettingsManager.InspectorReloadAnInstance();
+ }
+ }
+
+ }
+}
+
+
View
7 Assets/Editor/NIPlayerManagerPoseSelectionInspector.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: aa80931bd7ab78e4a8fe6d86c85f83aa
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
130 Assets/Editor/NIQueryInspector.cs
@@ -0,0 +1,130 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+
+using UnityEditor;
+using UnityEngine;
+using System.Collections.Generic;
+using OpenNI;
+
+
+/// @brief A class to define the inspector of NIEventLogger
+///
+/// This class is responsible for adding various inspector capabilities to the NIEventLogger tool
+/// @ingroup OpenNIBasicObjects
+[CustomEditor(typeof(NIQuery))]
+public class NIQueryInspector : Editor
+{
+ /// editor OnInspectorGUI to control the NIEventLogger properties
+ override public void OnInspectorGUI()
+ {
+ EditorGUI.indentLevel = 0;
+ EditorGUIUtility.LookLikeInspector();
+ NIQuery query = target as NIQuery;
+
+ if(query.Valid==false)
+ {
+ query.ForceInit();
+ }
+ if (query.m_queryDescriptions != null)
+ {
+ if (m_queryFoldout == null || m_queryFoldout.Length != query.m_queryDescriptions.Length)
+ {
+ m_queryFoldout = new bool[query.m_queryDescriptions.Length];
+ for (int i = 0; i < m_queryFoldout.Length; i++)
+ {
+ m_queryFoldout[i] = false;
+ }
+ }
+
+ GUILayout.Label("Queries supported for " + query.m_queryDescriptions.Length + " nodes ");
+ for (int i = 0; i < query.m_queryDescriptions.Length; i++)
+ {
+ m_queryFoldout[i] = EditorGUILayout.Foldout(m_queryFoldout[i], "" + query.m_queryDescriptions[i].m_nodeType + " nodes query");
+ if (m_queryFoldout[i])
+ {
+ EditorGUI.indentLevel += 2;
+ QueryDescription desc = query.m_queryDescriptions[i];
+ if (EditorApplication.isPlaying == false)
+ {
+ desc.m_nodeName = EditorGUILayout.TextField("Node name", desc.m_nodeName);
+ desc.m_vendorName = EditorGUILayout.TextField("Vendor name", desc.m_vendorName);
+ EditorGUILayout.LabelField("Min version: ", desc.RequiresMinVersion() ? "Limited" : "no limitation");
+ desc.GetMinVersionArr(ref m_Version);
+ EditorGUILayout.BeginHorizontal();
+ EditorGUILayout.Space();
+ for (int j = 0; j < m_Version.Length; j++)
+ {
+ if (j != 0)
+ {
+ GUILayout.Label(".", GUILayout.MaxWidth(5));
+ }
+ m_Version[j] = EditorGUILayout.IntField(m_Version[j], GUILayout.MaxWidth(25));
+ }
+ EditorGUILayout.EndHorizontal();
+ desc.SetMinVersion(m_Version);
+
+ EditorGUILayout.LabelField("Max version: ", desc.RequiresMaxVersion() ? "Limited" : "no limitation");
+ desc.GetMaxVersionArr(ref m_Version);
+ EditorGUILayout.BeginHorizontal();
+ EditorGUILayout.Space();
+ for (int j = 0; j < m_Version.Length; j++)
+ {
+ if (j != 0)
+ {
+ GUILayout.Label(".", GUILayout.MaxWidth(5));
+ }
+ m_Version[j] = EditorGUILayout.IntField(m_Version[j], GUILayout.MaxWidth(25));
+ }
+ EditorGUILayout.EndHorizontal();
+ desc.SetMaxVersion(m_Version);
+ }
+ ProductionNodeDescription curNodeDesc;
+ if (OpenNISettingsManager.GetProductionNodeInformation(desc.m_nodeType, out curNodeDesc))
+ {
+ EditorGUILayout.LabelField("Last node loaded was:", "");
+ EditorGUI.indentLevel += 2;
+ EditorGUILayout.LabelField("Node name", curNodeDesc.Name);
+ EditorGUILayout.LabelField("Vendor name", curNodeDesc.Vendor);
+ EditorGUILayout.LabelField("Version:", "" + curNodeDesc.Version.Major + "." + curNodeDesc.Version.Minor + "." + curNodeDesc.Version.Maintenance + "." + curNodeDesc.Version.Build);
+ EditorGUI.indentLevel -= 2;
+ }
+ else
+ {
+ GUILayout.Label(" Load node to see its info");
+ }
+
+ EditorGUI.indentLevel -= 2;
+ query.m_queryDescriptions[i] = desc;
+ }
+ }
+ }
+
+ if (GUI.changed)
+ EditorUtility.SetDirty(target);
+ }
+
+
+ /// @brief Holds the current foldout of the open inspector
+ static protected bool[] m_queryFoldout;
+
+ /// @brief utility version to be filled on the fly
+ protected static int[] m_Version = new int[4];
+}
View
7 Assets/Editor/NIQueryInspector.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: e973263360315ef49953143c6bd5d536
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
102 Assets/Editor/NISkeletonControllerInspector.cs
@@ -0,0 +1,102 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+
+using UnityEditor;
+using UnityEngine;
+using System.Collections.Generic;
+using OpenNI;
+using System;
+
+
+/// @brief A class to define the inspector of NISkeletonController
+///
+/// This class is responsible for adding various inspector capabilities to the NISkeletonController object
+/// @ingroup SkeletonBaseObjects
+[CustomEditor(typeof(NISkeletonController))]
+public class NISkeletonControllerInspector : Editor
+{
+ /// editor OnInspectorGUI to control the NIEventLogger properties
+ override public void OnInspectorGUI()
+ {
+ EditorGUI.indentLevel = 0;
+ EditorGUIUtility.LookLikeInspector();
+ NISkeletonController controller = target as NISkeletonController;
+ EditorGUILayout.LabelField("Controlling player", "");
+ EditorGUI.indentLevel += 2;
+ controller.m_playerManager = EditorGUILayout.ObjectField("Player manager", controller.m_playerManager, typeof(NIPlayerManager), true) as NIPlayerManager;
+ controller.m_playerNumber = EditorGUILayout.IntField("Player Number", controller.m_playerNumber);
+ EditorGUI.indentLevel -= 2;
+ EditorGUILayout.Space();
+
+ EditorGUILayout.LabelField("Joints to control","");
+ EditorGUI.indentLevel += 2;
+ // make sure the joint transforms are initialized.
+ if(controller.m_jointTransforms==null)
+ {
+ controller.m_jointTransforms=new Transform[Enum.GetNames(typeof(SkeletonJoint)).Length + 1];
+ for(int i=0; i<controller.m_jointTransforms.Length; i++)
+ controller.m_jointTransforms[i]=null;
+ }
+ else if(controller.m_jointTransforms.Length!=Enum.GetNames(typeof(SkeletonJoint)).Length + 1)
+ {
+ // the skeleton joints enum changed since last time...
+ Transform[] newVal=new Transform[Enum.GetNames(typeof(SkeletonJoint)).Length + 1];
+ for(int i=0; i<newVal.Length; i++)
+ {
+ if(i<controller.m_jointTransforms.Length)
+ newVal[i]=controller.m_jointTransforms[i];
+ else
+ newVal[i]=null;
+ }
+ controller.m_jointTransforms=newVal;
+ }
+ foreach(SkeletonJoint joint in Enum.GetValues(typeof(SkeletonJoint)))
+ {
+ controller.m_jointTransforms[(int)joint] = EditorGUILayout.ObjectField(""+joint, controller.m_jointTransforms[(int)joint], typeof(Transform), true) as Transform;
+ }
+ EditorGUI.indentLevel -= 2;
+ EditorGUILayout.Space();
+
+ EditorGUILayout.LabelField("What to update", "");
+ EditorGUI.indentLevel += 2;
+ controller.m_updateRootPosition = EditorGUILayout.Toggle("Update Root Positions?", controller.m_updateRootPosition);
+ controller.m_updateJointPositions = EditorGUILayout.Toggle("Update Joint Positions?",controller.m_updateJointPositions);
+ controller.m_updateOrientation = EditorGUILayout.Toggle("Update joint Orientation?",controller.m_updateOrientation);
+ EditorGUI.indentLevel -= 2;
+ EditorGUILayout.Space();
+
+ EditorGUILayout.LabelField("Scaling & limitations", "");
+ EditorGUI.indentLevel += 2;
+ controller.m_rotationDampening = EditorGUILayout.FloatField("Rotation Dampening", controller.m_rotationDampening);
+ controller.m_scale = EditorGUILayout.FloatField("Scale", controller.m_scale);
+ controller.m_speed = EditorGUILayout.FloatField("Torso speed scale", controller.m_speed);
+ EditorGUI.indentLevel -= 2;
+
+ EditorGUILayout.Space();
+ controller.m_linesDebugger = EditorGUILayout.ObjectField("Lines debugger", controller.m_linesDebugger, typeof(NISkeletonControllerLineDebugger), true) as NISkeletonControllerLineDebugger;
+
+ EditorGUILayout.Space();
+
+ EditorGUI.indentLevel -= 2;
+ if (GUI.changed)
+ EditorUtility.SetDirty(target);
+ }
+}
View
7 Assets/Editor/NISkeletonControllerInspector.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 39df7b1080e85d8468c4dfd402bd878f
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
125 Assets/Editor/NISkeletonTrackerInspector.cs
@@ -0,0 +1,125 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+
+using UnityEditor;
+using UnityEngine;
+using System.Collections.Generic;
+using OpenNI;
+
+
+/// @brief A class to define the inspector of NIEventLogger
+///
+/// This class is responsible for adding various inspector capabilities to the NIEventLogger tool
+/// @ingroup OpenNIPointTrackers
+[CustomEditor(typeof(NISkeletonTracker))]
+public class NISkeletonTrackerInspector : Editor
+{
+ /// @brief Called when the inspector is initialized
+ public void OnEnable()
+ {
+ NISkeletonTracker tracker = target as NISkeletonTracker;
+ if (tracker == null)
+ {
+ m_lastDescription = "Error";
+ }
+ else
+ {
+ m_lastDescription = tracker.GetTrackerType();
+ }
+ m_style = new GUIStyle();
+ m_style.wordWrap = true;
+ m_style.fontStyle = FontStyle.Normal;
+ m_content = new GUIContent();
+
+ }
+
+ /// editor OnInspectorGUI to control the NIEventLogger properties
+ override public void OnInspectorGUI()
+ {
+ EditorGUI.indentLevel = 0;
+ EditorGUIUtility.LookLikeInspector();
+ NISkeletonTracker tracker = target as NISkeletonTracker;
+
+ GUILayout.Label("Tracker description: ");
+ GUILayout.BeginHorizontal();
+ GUILayout.Space(20);
+ GUILayout.Label(m_lastDescription,m_style);
+ GUILayout.EndHorizontal();
+
+ if (m_lastDescription.CompareTo(tracker.GetTrackerType()) != 0)
+ {
+ EditorGUILayout.Space();
+ Color tmpColor = m_style.normal.textColor;
+ m_style.normal.textColor = Color.red;
+ m_content.text="Tracker description changed! Please relink all references";
+ m_content.tooltip="When objects reference the tracker (such as NIInput), they use the description to choose between the various options. When the description changes, the linking is lost. You need to relink all references unless you return the description to the previous definition by changing the player and joint";
+ GUILayout.BeginHorizontal();
+ GUILayout.Space(20);
+ GUILayout.Label(m_content,m_style);
+ GUILayout.EndHorizontal();
+ m_style.normal.textColor = tmpColor;
+
+ }
+ EditorGUILayout.Space();
+ EditorGUILayout.LabelField("Who to track","");
+ EditorGUI.indentLevel += 2;
+ tracker.m_playerNum = EditorGUILayout.IntField("Player Num", tracker.m_playerNum);
+ if (tracker.m_playerNum < 0)
+ tracker.m_playerNum = 0;
+ tracker.m_jointToUse = (SkeletonJoint)EditorGUILayout.EnumPopup("Joint to track", (System.Enum)tracker.m_jointToUse);
+ EditorGUI.indentLevel -= 2;
+ tracker.m_context = EditorGUILayout.ObjectField("context", tracker.m_context, typeof(OpenNISettingsManager), true) as OpenNISettingsManager;
+ tracker.m_playerManager = EditorGUILayout.ObjectField("Player manager", tracker.m_playerManager, typeof(NIPlayerManager), true) as NIPlayerManager;
+ tracker.m_startingPoseReferenceType = (NISkeletonTracker.StartingPosReferenceType)EditorGUILayout.EnumPopup("StartPos type", (System.Enum)tracker.m_startingPoseReferenceType);
+ EditorGUI.indentLevel += 2;
+ switch (tracker.m_startingPoseReferenceType)
+ {
+ case NISkeletonTracker.StartingPosReferenceType.SetPointReference:
+ tracker.m_StartPosModifier = EditorGUILayout.Vector3Field("StartPos", tracker.m_StartPosModifier);
+ break;
+ case NISkeletonTracker.StartingPosReferenceType.TrackedJointReference:
+ EditorGUILayout.LabelField("StartPos=ref of", "" + tracker.m_jointToUse);
+ break;
+ case NISkeletonTracker.StartingPosReferenceType.StaticModifierToOtherJoint:
+ tracker.m_referenceJoint = (SkeletonJoint)EditorGUILayout.EnumPopup("cur position of", (System.Enum)tracker.m_referenceJoint);
+ tracker.m_StartPosModifier = EditorGUILayout.Vector3Field("Modified by", tracker.m_StartPosModifier);
+ break;
+ case NISkeletonTracker.StartingPosReferenceType.ScaledModifierToOtherJoint:
+ tracker.m_referenceJoint = (SkeletonJoint)EditorGUILayout.EnumPopup("cur position of", (System.Enum)tracker.m_referenceJoint);
+ tracker.m_StartPosModifier = EditorGUILayout.Vector3Field("Modified by", tracker.m_StartPosModifier);
+ EditorGUILayout.LabelField("scaled by distance", "between");
+ EditorGUI.indentLevel += 2;
+ tracker.m_referenceJointScale1 = (SkeletonJoint)EditorGUILayout.EnumPopup("joint1", (System.Enum)tracker.m_referenceJointScale1);
+ tracker.m_referenceJointScale2 = (SkeletonJoint)EditorGUILayout.EnumPopup("joint2", (System.Enum)tracker.m_referenceJointScale2);
+ EditorGUI.indentLevel -= 2;
+ break;
+
+ }
+ EditorGUI.indentLevel -= 2;
+ EditorGUILayout.Space();
+ if (GUI.changed)
+ EditorUtility.SetDirty(target);
+ }
+
+ private string m_lastDescription; ///< @brief Holds the last description since initialization (used to check when to give a relink warning)
+ private GUIStyle m_style = null; ///< @brief internal GUIStyle to use
+ private GUIContent m_content = null; ///< @brief internal GUIContent to use
+}
View
7 Assets/Editor/NISkeletonTrackerInspector.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 14d49c5c73da4d54c827bd7ed3f7dcf1
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
85 Assets/Editor/NIUserPoseDetectorInspector.cs
@@ -0,0 +1,85 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+
+using UnityEditor;
+using UnityEngine;
+using System.Collections.Generic;
+using System;
+using OpenNI;
+
+
+/// @brief A class to define the inspector of NIEventLogger
+///
+/// This class is responsible for adding various inspector capabilities to the NIEventLogger tool
+/// @ingroup OpenNIGestureTrackers
+[CustomEditor(typeof(NIUserPoseGestureFactory))]
+public class NIUserPoseDetectorInspector : Editor
+{
+ /// editor OnInspectorGUI to control the NIEventLogger properties
+ override public void OnInspectorGUI()
+ {
+ EditorGUI.indentLevel = 0;
+ EditorGUIUtility.LookLikeInspector();
+ NIUserPoseGestureFactory detector = target as NIUserPoseGestureFactory;
+
+ string[] legalPoses = NIUserAndSkeleton.GetLegalPoses();
+
+ if (legalPoses != null)
+ {
+ int selectedIndex;
+ if (detector.m_poseName == null)
+ {
+ selectedIndex = 0;
+ }
+ else for (selectedIndex = 0; selectedIndex < legalPoses.Length; selectedIndex++)
+ {
+ if (detector.m_poseName.CompareTo(legalPoses[selectedIndex])==0)
+ break;
+ }
+ if (selectedIndex >= legalPoses.Length)
+ selectedIndex = 0;
+ selectedIndex = EditorGUILayout.Popup("pose to detect", selectedIndex, legalPoses);
+ detector.m_poseName = legalPoses[selectedIndex];
+ }
+ else
+ {
+ EditorGUILayout.LabelField("Pose to detect", detector.m_poseName);
+ }
+
+ detector.m_timeToHoldPose = EditorGUILayout.FloatField("Time to hold pose", detector.m_timeToHoldPose);
+ if (detector.m_timeToHoldPose < 0)
+ detector.m_timeToHoldPose = 0;
+
+ detector.m_Context = EditorGUILayout.ObjectField("Context", detector.m_Context, typeof(OpenNISettingsManager), true) as OpenNISettingsManager;
+
+
+ if (EditorApplication.isPlaying == false)
+ {
+ if (GUILayout.Button("Update legal poses (might take some time)"))
+ {
+ OpenNISettingsManager.InspectorReloadAnInstance();
+ }
+ }
+
+ if (GUI.changed)
+ EditorUtility.SetDirty(target);
+ }
+}
View
7 Assets/Editor/NIUserPoseDetectorInspector.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 5d2722c9d42a63a478c4c0f89932154b
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
2  Assets/OpenNI.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 5cd3f7dabea0d2f4da4bec833b6af307
View
2  Assets/OpenNI/Documentation.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: 823888871948c6440b74b7b9c36e530a
View
2  Assets/OpenNI/Documentation/Additional documentation sources.meta
@@ -0,0 +1,2 @@
+fileFormatVersion: 2
+guid: b73102ed4edeb6541b22bbe0ac38ab8b
View
34 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIMainPage.cs
@@ -0,0 +1,34 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+// This file is used for documentation rather than code.
+// This holds pages which are unique to the OPENNI documentation (including the main page)
+
+/**
+
+@mainpage Unity OpenNI Unity Toolkit Overview
+
+@copydoc Introduction
+
+See the @subpage OpenNIPackageOverview to get started.
+
+@copydoc OpenNILicense
+*/
+
View
7 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIMainPage.cs.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 4067472e52e8cc94ab56612fcdf4e018
+MonoImporter:
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
View
472 Assets/OpenNI/Documentation/Additional documentation sources/OpenNIOverviewPages.cs
@@ -0,0 +1,472 @@
+/****************************************************************************
+* *
+* OpenNI Unity Toolkit *
+* Copyright (C) 2011 PrimeSense Ltd. *
+* *
+* *
+* OpenNI is free software: you can redistribute it and/or modify *
+* it under the terms of the GNU Lesser General Public License as published *
+* by the Free Software Foundation, either version 3 of the License, or *
+* (at your option) any later version. *
+* *
+* OpenNI is distributed in the hope that it will be useful, *
+* but WITHOUT ANY WARRANTY; without even the implied warranty of *
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
+* GNU Lesser General Public License for more details. *
+* *
+* You should have received a copy of the GNU Lesser General Public License *
+* along with OpenNI. If not, see <http://www.gnu.org/licenses/>. *
+* *
+****************************************************************************/
+// This file is used for documentation rather than code.
+// This holds the general pages for the product (overview, additional topics etc).
+
+
+/**
+@page Introduction Introduction
+<H1>Introduction</H1>
+The purpose of this document is to provide an overview of the structure and usage of the OpenNI Unity Toolkit.
+The target audience for this document are game developers who wish to create motion control games in Unity that
+take advantage of Natural Interaction&reg; capabilities.<br><br>
+
+The Unity assets for the toolkit provide all a game developer needs to create motion controlled games in Unity,
+with OpenNI compliant sensors, such as the ASUS Xtion Pro Live which can be purchased at www.openni.org/hardware.<br><br>
+
+In fact, creating motion controlled games on top of @subpage OpenNIFramework is already broadly done by OpenNI vibrant
+developers' community, using the various API wrappers that are provided with OpenNI Framework. However, this requires
+learning the entire framework. The OpenNI Unity Toolkit builds upon this existing framework and provides tools that are
+easy to use inside Unity, and that act in accordance with the Unity spirit. <br><br>
+
+For this purpose, the toolkit provides a new framework inside Unity that packages everything in a Unity friendly
+fashion. This hides a lot of the internals of OpenNI (and its implementations) behind easy-to-use prefabs and
+mono-behavior objects, and provides drag & drop functionality, easy-to-configure inspectors, ready-made objects
+full of functionality, and extensions to existing Unity tools, such as Input and GUI. In addition, documentation
+and samples are provided to make it as easy as possible for the Unity game developer to simply dive in and create
+amazing motioned controlled games.<br><br>
+The product is packaged as assets that can be downloaded from the Unity Asset store.<br><br>
+
+*/
+
+/**
+@page OpenNIPackageOverview OpenNI Package Overview
+The idea behind the OpenNI package is to build upon the @ref OpenNIFramework to provide tools that
+are easy to use inside Unity and to work with them in the Unity spirit.<br><br>
+
+In order to better understand the package, you should read the following chapters first:
+- @subpage OpenNIMainCapabilities
+- @subpage OpenNIFileOrganization
+- @subpage OpenNIBeforeYouStart
+- @subpage OpenNISamplesOverview
+- @subpage OpenNIAdditionalTopics
+
+@see @ref OpenNIPackage
+<br><br><br>
+
+
+In addition, full documentation is provided for all files, classes and constructs.
+<H1>Further Information</H1>
+ Feedback and discussion on the toolkit is available at: OpenNI-dev google group: http://groups.google.com/group/openni-dev?hl=en
+<br><br>
+*/
+
+/**
+@page OpenNICentralizedInitializationAndConfigurationCapability Centralized Initialization and Configuration
+One of the main goals of this package is to enable developers to easily use OpenNI to create games.
+To enable this, all the internals of how to initialize and build an OpenNI applications are wrapped in
+a single prefab that is used to initialize and configure OpenNI. This means that most developers will
+never need to learn the internals of the @ref OpenNIFramework and instead can just add the prefab to their
+scene and configure it using the inspector. More advanced users who need to get into the internals can
+always use the programmatic accessors provided. This basic capability is the base for all other
+capabilities provided by this package.<br><br>
+
+The entire wrapper is implemented in the @ref OpenNIBasicObjects module, while the prefab itself is
+described in @subpage OpenNISettingsPrefab.
+*/
+
+/**
+@page OpenNISkeletonControlCapability Skeleton Control
+The package is designed to make it extremely easy to gather skeleton information and to use it to control
+3D models. As such, one of the main capabilities provided is this control, which includes three main
+elements:
+- The ability to connect a 3D model to the skeleton controller so that the human player can control the
+ movements of that character using his own movement. This includes tracking various joints (hands,
+ legs, torso, head etc.).
+- Managing several players and providing user selection capabilities.
+- Tracking any joint on the skeleton and specifically tracking the position of the
+ skeleton hand. This also includes detecting gestures (currently a limited selection mainly to show how
+ it is done) that can be used to trigger actions.
+
+@see @subpage UserSelectionCapabilities and @ref NISkeletonController
+*/
+
+
+
+/**
+@page OpenNIInputManagementCapability Input Management
+The package provides a new Input class (@ref NIInput) that can be used instead of the regular Input class.
+This enables adding Natural Interactions sensitive axes, as well as adding Natural Interactions to regular
+Input Manager-defined axes.<br>
+The Input can work seamlessly with skeleton hand tracking (similar to mouse movements) and use gestures,
+or more complex movement, to simulate clicks. It can work with any tracker.<br><br>
+@see @subpage NIInputConcept, which is implemented in the @ref OpenNIInput module.
+*/
+
+/**
+@page OpenNIUtilitiesCapability Utilities
+The package includes various utilities included in the @ref OpenNIUtilities module. These utilities are
+aimed at debugging tools, and tools that aim to show what things SHOULD look like but are
+not polished enough to be considered a product.<br>
+Two main groups of utilities are worth noting:
+- Viewer utilities (see @ref OpenNIViewerUtilities)
+- NIGUI utilities (see @subpage NIGUIConcepts and @ref OpenNIGUIUtiliites)
+*/
+
+
+/**
+@page OpenNIMainCapabilities OpenNI Module Main Capabilities
+
+The @ref OpenNIPackage provides the following main capabilities:
+
+- @subpage OpenNICentralizedInitializationAndConfigurationCapability
+- @subpage OpenNISkeletonControlCapability
+- @subpage OpenNIInputManagementCapability
+- @subpage OpenNIUtilitiesCapability
+
+In addition, various useful prefabs and scripts are provided in the OpenNISamples module.
+
+
+*/
+
+/**
+@page OpenNIFileOrganization File Organization for the OpenNI Module
+
+The resources and assets of the @ref OpenNIPackage are organized into a folder tree under the
+Assets/OpenNI directory. In addition, custom inspectors are provided in the Editor directory.
+<br>
+The OpenNI directory contains the following:
+- <b>Documentation</b> - This directory holds the main documentation for the package. This includes:
+ - <b>OpenNIPackageDocumentation.chm file</b>: This is the main documentation file, that holds
+ everything needed in order to use this package.
+ - <b>OpenNIDoxyfile</b>: This is a doxygen configuration file aimed at creating the documentation.
+ @note It will create html files on a Documentation/OpenNI/ directory on the same level as the
+ Assets directory for those who prefer HTML to chm.
+ - The <b>"Additional Documentation Sources"</b> directory: This directory includes files used for creating the
+ documentation. It includes .cs files for each module, as well as additional ones, such as the
+ Overview. The OpenNIMainpage contains the main page. @note The documentation for the actual code is inside the code.
+ - The <b>Images</b> directory: This holds images used in the documentation (such as the OpenNI
+ logo)
+ - <b>ExampleRecord.xml</b>: This is an example for playing a recording. See
+ @ref OpenNIRecordAndPlayback "Recording and playing back sensor data"
+ for more information.
+ - <b>SampleXML.xml</b>: This is an example xml for limiting the nodes to the supplied
+ NITE implementation and to show how to set the log to a file. For
+ more information see @ref OpenNIAdditionalTopics and the internal
+ documentation of the xml file.
+- <b>Graphical assets</b> - This directory contains the various graphical assets which are used in the
+ samples and include 3D models, textures, materials etc.
+- <b>Interface library</b> - This directory is divided into two sub-directories.
+ - <b>Installer</b>: This holds the installer for the OpenNI framework, an OpenNI
+ implementation (NITE) and the sensor's driver.<br>
+ This is required both for development (see @ref OpenNIBeforeYouStart) and for deployment (see
+ @ref OpenNIAdditionalTopics) as an updated version of OpenNI, an implementation of it
+ (such as NITE) and the sensor drivers @b MUST be installed before any development begins and
+ before playing any game using this package.
+ - <b>OpenNI engine</b> - this includes a C# .Net dll containing the OpenNI interface.
+- <b>Prefabs</b>: This directory is divided into three sub directories, one for each sub module of
+ the @ref OpenNIPackage and includes:
+ - <b>Main OpenNI prefabs</b>: Contains the main prefabs, i.e. those useful to anyone who uses the
+ package.
+ - <b>Samples prefabs</b>: Includes prefabs used in the samples.
+ - <b>Utility prefabs</b>: Includes prefabs used as utility (aimed at debugging or being extended
+ by the developer)
+- <b>Sample scenes</b>: This directory holds the end product of all samples, i.e what they should
+ look like after the tutorials are finished.
+- <b>Scripts</b>: This is where all the code is located. The code is divided into sub-directories based on
+ the sub-module they belong to.
+ - <b>Main OpenNI</b>: Contains the main scripts. This is the basis for the entire package.
+ - <b>Samples</b>: Contains scripts specific for the samples. They are needed to make the samples
+ work and may be used by the developer as implementation examples.
+ - <b>Utilities</b>: Contains scripts that supply debugging tools and provide a basis for the
+ developer to extend capabilities (@ref NIGUIConcepts).
+*/
+
+/**
+@page OpenNIBeforeYouStart Before you Start
+
+Before you start developing using the @ref OpenNIPackage, you should first:<br><br>
+<H1>Download the Package</H1>
+Download and import the OpenNI Unity Toolkit. The easiest way to do this is to download it from the Unity Asset store.
+
+<H1>Install OpenNI Framework, Implementation and the Sensor Driver</H1>
+The OpenNI Unity Toolkit assumes updated versions of the following 3 components are already installed on the system.
+Without these, you cannot use this package:
+- OpenNI framework
+- An OpenNI compliant middleware (a middleware component that implements OpenNI API and provides motion tracking capabilities)
+- Sensor driver
+There are two ways to install them:
+- This is based on the Primesense&trade; implementation and drivers. For sensors which use other drivers,
+ please refer to the installation media that came with the sensor or to the sensor developer's site
+ @note Two versions of the installer are supplied. They can both be used for the purpose of development
+ (and deployment). The difference is that while the "PrimeSense-Win32-FullInstaller-Redist.exe" version has
+ just the required binaries, the "PrimeSense-Win32-FullInstaller-Dev.exe" version contains samples, headers and
+ documentation. If you wish to do any development with the original framework from the .net dll or wishes to use
+ recording of sensor data (see @ref OpenNIRecordAndPlayback "Recording and playing back sensor data") then the second
+ ("Dev") version should be used. Otherwise the "Redist" version is enough.
+
+ @note The installer installs the Primesense&trade; driver, for sensors from other providers, please refer to the
+ installation media that came with the sensor or to the sensor developer's site.
+- Download an updated version from the Internet:
+ - From the download page of <a href="http://www.openni.org/">OpenNI.org</a>
+
+
+@note <b> You MUST install the updated version before starting to develop. </b>
+
+<br>
+
+@note This package is aimed at development in Windows only. It was not tested on any other environment.
+
+
+<H1>Documentation</H1>
+Documentation is available under Assets/Documentation/PackageDocumentation.chm<br>
+In addition to the documentation, a doxyfile is provided, in the same directory. It can be used to
+recreate the chm file AND create html (in a Documentation directory parallel to Assets).<br><br>
+The best way to learn how to use this package is to read the sample tutorials
+*/
+
+/**
+@page OpenNIAdditionalTopics Additional Topics
+
+<H1>Deployment</H1>
+
+<H2>Creating an Installer</H2>
+As stated in the @ref OpenNIBeforeYouStart section, one needs to install the OpenNI framework, an OpenNI
+compliant middleware and the sensor drivers before starting to develop. This is also true for deployment.<br>
+It is the responsibility of the developer to create an installer that installs an updated version of
+the OpenNI framework, an OpenNI compliant middleware and the sensor drivers before running the game.
+For simplicity, a Windows installer is provided under
+Assets/Interface library/Installer/PrimeSense-Win32-FullInstaller-Redist.exe.<br>
+
+The creation of the installer for the deployment target is the responsibility of the developer.
+
+@note The installer installs the Primesense&trade; driver, for sensors from other providers, please refer to the
+installation media that came with the sensor or to the sensor developer's site.
+
+<H2>Supported Environments</H2>
+This package was tested for creating Windows standalone deployment only, and the editor was tested
+on windows only.
+While in theory, any environment for which OpenNI is supported should work, no other environment was tested and no
+installer is supplied.
+
+@note This package was tested on Unity 3.4 only.
+
+<H2>Setting queries</H2>
+OpenNI can load different implementations of the basic nodes. This provides the advantage of easy bug
+fixes (the end user can install a new version of their nodes and everything is fixed) as well as easy
+access to improvements and support for a wide range of middleware implementations. The downside of
+this is that the game was not necessarily tested under those different implementations and those
+implementations might not support all required capabilities. For example, if the user selection
+process requires support for a "wave" pose but the specific implementation has no support for the
+"wave" pose then the game might behave differently from expected.<br>
+To mitigate this two options are available to the developer:
+- <b>Use queries inside the NIQuery script</b>. The basic idea here is to set the vendor and a minimum
+ and maximum version corresponding to the supplied versions in the installer. For example, lets assume
+ we use NITE then the vendor name would be PrimeSense and the minimum version might be 1.5.1.2 while
+ the maximum version would be 1.5.X.X.
+- <b>Use an XML file</b>. The same queries can be added in an XML file and that file used. An example
+ file is supplied under the OpenNI/documentation directory.
+
+
+<H1>Loading levels</H1>
+When loading a level in Unity, all game objects are destroyed and new ones are created. This means
+that when loading a level, the OpenNI engine will close everything and reopen them. Typically this does
+not pose any problem. However, it does mean that user detection starts from scratch. This may mean that
+the player will be required to calibrate again and that the player's mapping to skeletons might change.<br>
+
+A possible solution for this is to use DontDestroyOnLoad. From the Unity script reference:<br>
+"When loading a new level all objects in the scene are destroyed, then the objects in the new level are
+loaded. In order to preserve an object during level loading call DontDestroyOnLoad on it. If the
+object is a component or game object then its entire transform hierarchy will not be destroyed either."
+<br>
+This should be handled with care as ALL relevant game objects must not be destroyed. If some are
+destroyed and some are not, unexpected results may occur. The developer, therefore, should make sure
+that any objects no longer needed are destroyed in an orderly fashion and that all important objects
+are saved. For example, in order to save calibration data, it is enough to save the OpenNISettings
+prefab (although if the objects were created separately, all of them must be saved). If you wishe to
+save the user to player mapping, then the object containing the NIPlayerManager should also
+be preserved and so on.<br>
+
+Another important thing to note is that static classes are not destroyed. This means that NIGUI
+is not recreated and if the load was handled in the middle of a BeginGroup block, the ResetGroups
+method should be called on it.
+
+<H1>Positioning the Sensor</H1>
+Correct positioning of the sensor is important for good performance. The following are general tips
+for positioning the sensor correctly. These tips should probably be provided to the user as well. <br>
+- The sensor should be positioned parallel to the floor on a flat surface. It should also be parallel to
+ the wall.
+- Position the sensor on a stable surface so it cannot move @note Speakers are not stable because of
+ their vibrations so you should not position the sensor near speakers.
+- Position the sensor near the end of the surface (otherwise the surface may obstruct the view).
+- Position the sensor so that it points to the center of the body mass (not too low, not too high).
+- Make sure the area in front of the sensor (where you will stand) is free of obstructions.
+
+@note The positioning has a substantial effect on performance. An example of these effects can be seen
+in @subpage PinningToTheFloor
+
+@anchor AddingNewSkeletonModels
+<H1>Adding New Skeleton Models</H1>
+When creating a model to be controlled by the skeleton, it is important to rig it correctly.
+The best way for the skeleton to control the model is to control its joints. Therefore, the rigging
+should be done so that the controlled joints control the movement. A good example for this is the
+soldier model in the sample. <br>
+The following joints are best used for control:
+- Torso: This is a must as the controller uses the center of the torso as a positioning tool
+- Head: The head generally turns only with the body but is important for calculations to see if
+ the skeleton is erect or if the user is bowing to any side (a commonly used gesture).
+- Hands (left and right): These are generally used for tracking and as the arm's end point.
+- Elbows (left and right): Used to control the lower arm's direction
+- Shoulders (left and right): Used to control the upper arm's direction
+- Hips (left and right): Used to control the upper leg's direction
+- Knees (left and right): Used to control the lower leg's direction
+- Feet (left and right): Used for tracking and are the leg's end point.
+
+@note The model itself must be in a T pose (standing straight with the arms extended to both sides). Any
+change in orientation from this will cause the movement to be skewed.
+
+@see @ref OpenNICreatingASkeletonModelPrefabTutorial for more information.
+
+@anchor OpenNIRecordAndPlayback
+<H1>Recording and playing back sensor data</H1>
+<H2>Overview</H2>
+While most of the time developers want to work with the sensor directly, it is very useful for debugging purposes to
+be able to record and load the recording data. This is useful for two things:
+-# It makes it much easier to reproduce problems
+-# It allows the developer to work without a sensor (for example when on the move or when working with
+ other people).
+
+In general, OpenNI provides the capability to record and load. In order to simplify it as much as possible,
+following are simple instructions on how to use the recording.
+@note the current version of OpenNI records only basic nodes (depth, image). This means that any
+implementation which uses these nodes as the basis for everything is supported. For example,
+the NITE implementation (used in the installer) creates the user and skeleton data from the depth and
+therefore works.
+
+<H2>Creating a recording</H2>
+OpenNI provides API for recording. However, creating a program which uses this API inside Unity would
+require writing code, which unfortunately, didn't make it to this version.<br>
+For developers who installed the "dev" version of OpenNI (see @ref OpenNIBeforeYouStart) there are two
+ways to create a new recording:
+-# <b>Write the code</b>: Writing the code to record is not very complicated. The samples and
+ docummentation of OpenNI show how to do it.
+-# <b>Use the samples</b>:
+ - <b>niBackRecorder</b> is a command line tool, which stores frames in memory in a
+ cyclic buffer. Clicking "D" sends a request to dump this cyclic buffer to an ONI file.
+ In effect, it saves the last certain number of seconds, according to how it has been configured.
+ This means that a developer can run the recorder in the background, run the Unity program and then save the
+ result.
+ - <b>NIViewer</b> Using the NIViewer sample. For this do the following
+ - Run the NIViewer sample (this is by default in "C:\Program Files\OpenNI\Samples\Bin\Release"
+ on a 32 bit machine and in "C:\Program Files (x86)\OpenNI\Samples\Bin\Release" on a
+ 64 bit machine).
+ - Press 'f' to toggle between full screen view and windowed view.
+ - Press 'd' and choose a filename for the recording.
+ - The recording will start in 5 seconds (to avoid the wait use 's' instead of 'd').
+ - Move quickly to the Unity game and start it.
+ - After the 5 seconds have passed, play the game and record everything you wish.
+ - when you are ready to finish, return to the sample and press x.
+ - You now have a recording of everything you did.
+ - @note you can always use '?' in the sample to get help.
+ - <b>Other samples</b> are available for recording such as NiRecordRaw.
+<br><br>
+
+<H2>Playing a recording</H2>
+Now that we have a recording, we want to play it. There are two ways to do this:
+- The OpenNI Settings manager has an option <b>Playerback filename</b> which can hold the filename
+ for a recording. If this is used then the recording will be loaded for all nodes recorded in it.
+ @note this does @b NOT work properly if an XML file is used!
+- Use an xml file. For simplicity, a sample XML file is provided (ExampleRecord.xml in the
+ documentation directory). <br> The main change which needs to be done in the XML file is to change
+ the filename which holds the recorded data (if one uses extensions then more production nodes
+ might be required).<br>To use the xml file, In the OpenNI configuration object of the
+ @ref OpenNISettingsPrefab (or directly from the @ref OpenNISettingsManager script) the XML file
+ name needs to be set.