Commit 33793d76 authored by 16도재형's avatar 16도재형

Update Kinect part

parent a022ecd1
fileFormatVersion: 2 fileFormatVersion: 2
guid: 370ceeb4338949c458d2c4831721adcc guid: 370ceeb4338949c458d2c4831721adcc
folderAsset: yes folderAsset: yes
timeCreated: 1502957664 timeCreated: 1503553766
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 8563af7e17548df4db018f658370cf05 guid: 423f09712356a4342a8bb35165660d8d
folderAsset: yes folderAsset: yes
timeCreated: 1502957664 timeCreated: 1503553766
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 85bafbe9b14b18b45b445b304b1f3efc guid: 85bafbe9b14b18b45b445b304b1f3efc
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
PluginImporter: DefaultImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 1
settings:
CPU: x86
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
fileFormatVersion: 2
guid: b51ad12a45add75438b0b8494a1b5bc0
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 0
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
DefaultValueInitialized: true
data:
first:
Windows Store Apps: WindowsStoreApps
second:
enabled: 1
settings:
CPU: x86
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2 fileFormatVersion: 2
guid: 82be2ecc1ba65e94f8d03335c7969a8d guid: 8c803e04f1df4064ab87cb9920569ef3
folderAsset: yes folderAsset: yes
timeCreated: 1502957664 timeCreated: 1503553766
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:
......
fileFormatVersion: 2
guid: 1db2dc2b011493340af3c486814773b6
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
data:
first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2 fileFormatVersion: 2
guid: b65facb0c9c68b647b8ca7435b5f35c4 guid: b65facb0c9c68b647b8ca7435b5f35c4
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
PluginImporter: DefaultImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
data:
first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
fileFormatVersion: 2
guid: 1c16b6c4f21217940a45b0a7980bbaa4
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
data:
first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3404b8810d8d9bd40a69b6ddb8d40ec0
folderAsset: yes
timeCreated: 1502958445
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: e64ddea403d2dab41a0b9e06194e24a8
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
data:
first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 3b9258fe0bd5fa44fbb9b84edddc8a80
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Facebook: Win64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: Linux64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86
data:
first:
Standalone: OSXIntel
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXIntel64
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86
data:
first:
Standalone: Win
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Win64
second:
enabled: 0
settings:
CPU: None
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2 fileFormatVersion: 2
guid: dc48a865720f47745baa454faadba922 guid: 40e0d3de9df769b42b6ae91ec22df21e
folderAsset: yes folderAsset: yes
timeCreated: 1502957664 timeCreated: 1503553766
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:
......
fileFormatVersion: 2
guid: 56fe3b4f6cf934645b95af4f873f5dae
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86_64
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86_64
data:
first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2 fileFormatVersion: 2
guid: 82e143d16729051459ae6a54b37e9eab guid: 82e143d16729051459ae6a54b37e9eab
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
PluginImporter: DefaultImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86_64
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86_64
data:
first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
userData: userData:
assetBundleName: assetBundleName:
assetBundleVariant: assetBundleVariant:
fileFormatVersion: 2
guid: bd1efe6facd8abe48967be99b7e8bb6e
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86_64
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86_64
data:
first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: dc8b7a4f52179304abb4308e1f5dc486
folderAsset: yes
timeCreated: 1502958445
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 92bd007400232df44a5145238b2ee5f7
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86_64
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86_64
data:
first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: b23429c6264008d44b3e037dfa9712c4
timeCreated: 18446744011573954816
PluginImporter:
serializedVersion: 2
iconMap: {}
executionOrder: {}
isPreloaded: 0
isOverridable: 0
platformData:
data:
first:
Any:
second:
enabled: 1
settings: {}
data:
first:
Editor: Editor
second:
enabled: 0
settings:
CPU: x86_64
DefaultValueInitialized: true
data:
first:
Facebook: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Facebook: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: Linux
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Linux64
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: LinuxUniversal
second:
enabled: 1
settings:
CPU: x86_64
data:
first:
Standalone: OSXIntel
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: OSXIntel64
second:
enabled: 1
settings:
CPU: AnyCPU
data:
first:
Standalone: OSXUniversal
second:
enabled: 0
settings:
CPU: x86_64
data:
first:
Standalone: Win
second:
enabled: 0
settings:
CPU: None
data:
first:
Standalone: Win64
second:
enabled: 1
settings:
CPU: AnyCPU
userData:
assetBundleName:
assetBundleVariant:
using UnityEngine; using UnityEngine;
using System.Collections; using System.Collections;
using Windows.Kinect; using Windows.Kinect;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
...@@ -13,8 +13,8 @@ public class CoordinateMapperManager : MonoBehaviour ...@@ -13,8 +13,8 @@ public class CoordinateMapperManager : MonoBehaviour
private byte[] pColorBuffer; private byte[] pColorBuffer;
private byte[] pBodyIndexBuffer; private byte[] pBodyIndexBuffer;
private ushort[] pDepthBuffer; private ushort[] pDepthBuffer;
private Body[] pBodyBuffer;
const int cDepthWidth = 512; const int cDepthWidth = 512;
const int cDepthHeight = 424; const int cDepthHeight = 424;
...@@ -71,27 +71,36 @@ public class CoordinateMapperManager : MonoBehaviour ...@@ -71,27 +71,36 @@ public class CoordinateMapperManager : MonoBehaviour
return m_pDepthCoordinates; return m_pDepthCoordinates;
} }
public Body[] GetBodyBuffer()
{
return pBodyBuffer;
}
void InitializeDefaultSensor() void InitializeDefaultSensor()
{ {
m_pKinectSensor = KinectSensor.GetDefault(); m_pKinectSensor = KinectSensor.GetDefault();
if (m_pKinectSensor != null)
{
// Initialize the Kinect and get coordinate mapper and the frame reader
m_pCoordinateMapper = m_pKinectSensor.CoordinateMapper;
m_pKinectSensor.Open();
if (m_pKinectSensor.IsOpen)
{
m_pMultiSourceFrameReader = m_pKinectSensor.OpenMultiSourceFrameReader(
FrameSourceTypes.Color | FrameSourceTypes.Depth | FrameSourceTypes.BodyIndex);
}
}
if (m_pKinectSensor == null) if (m_pKinectSensor == null)
{ {
UnityEngine.Debug.LogError("No ready Kinect found!"); UnityEngine.Debug.LogError("No ready Kinect found!");
return;
} }
// Initialize the Kinect and get coordinate mapper and the frame reader
m_pCoordinateMapper = m_pKinectSensor.CoordinateMapper;
m_pKinectSensor.Open();
if (!m_pKinectSensor.IsOpen)
{
UnityEngine.Debug.LogError("Kinect sensor has problem!");
return;
}
m_pMultiSourceFrameReader = m_pKinectSensor.OpenMultiSourceFrameReader(
FrameSourceTypes.Color |
FrameSourceTypes.Depth |
FrameSourceTypes.BodyIndex |
FrameSourceTypes.Body);
pBodyBuffer = new Body[m_pKinectSensor.BodyFrameSource.BodyCount];
} }
void ProcessFrame() void ProcessFrame()
...@@ -112,7 +121,6 @@ public class CoordinateMapperManager : MonoBehaviour ...@@ -112,7 +121,6 @@ public class CoordinateMapperManager : MonoBehaviour
m_pColorRGBX.Apply (); m_pColorRGBX.Apply ();
} }
void Update() void Update()
{ {
// Get FPS // Get FPS
...@@ -124,56 +132,52 @@ public class CoordinateMapperManager : MonoBehaviour ...@@ -124,56 +132,52 @@ public class CoordinateMapperManager : MonoBehaviour
elapsedCounter = 0.0; elapsedCounter = 0.0;
} }
if (m_pMultiSourceFrameReader == null) if (m_pMultiSourceFrameReader == null)
{
return; return;
}
var pMultiSourceFrame = m_pMultiSourceFrameReader.AcquireLatestFrame(); var pMultiSourceFrame = m_pMultiSourceFrameReader.AcquireLatestFrame();
if (pMultiSourceFrame != null) if (pMultiSourceFrame == null)
{ {
frameCount++; nullFrame = true;
nullFrame = false; return;
}
frameCount++;
nullFrame = false;
using(var pDepthFrame = pMultiSourceFrame.DepthFrameReference.AcquireFrame()) // Get Depth Frame Data.
using(var pDepthFrame = pMultiSourceFrame.DepthFrameReference.AcquireFrame())
if (pDepthFrame != null)
{ {
using(var pColorFrame = pMultiSourceFrame.ColorFrameReference.AcquireFrame()) var pDepthData = GCHandle.Alloc (pDepthBuffer, GCHandleType.Pinned);
{ pDepthFrame.CopyFrameDataToIntPtr(pDepthData.AddrOfPinnedObject(), (uint)pDepthBuffer.Length * sizeof(ushort));
using(var pBodyIndexFrame = pMultiSourceFrame.BodyIndexFrameReference.AcquireFrame()) pDepthData.Free();
{
// Get Depth Frame Data.
if (pDepthFrame != null)
{
var pDepthData = GCHandle.Alloc (pDepthBuffer, GCHandleType.Pinned);
pDepthFrame.CopyFrameDataToIntPtr(pDepthData.AddrOfPinnedObject(), (uint)pDepthBuffer.Length * sizeof(ushort));
pDepthData.Free();
}
// Get Color Frame Data
if (pColorFrame != null)
{
var pColorData = GCHandle.Alloc (pColorBuffer, GCHandleType.Pinned);
pColorFrame.CopyConvertedFrameDataToIntPtr(pColorData.AddrOfPinnedObject(), (uint)pColorBuffer.Length, ColorImageFormat.Rgba);
pColorData.Free();
}
// Get BodyIndex Frame Data.
if (pBodyIndexFrame != null)
{
var pBodyIndexData = GCHandle.Alloc (pBodyIndexBuffer, GCHandleType.Pinned);
pBodyIndexFrame.CopyFrameDataToIntPtr(pBodyIndexData.AddrOfPinnedObject(), (uint)pBodyIndexBuffer.Length);
pBodyIndexData.Free();
}
}
}
} }
ProcessFrame(); // Get Color Frame Data
} using(var pColorFrame = pMultiSourceFrame.ColorFrameReference.AcquireFrame())
else if (pColorFrame != null)
{ {
nullFrame = true; var pColorData = GCHandle.Alloc (pColorBuffer, GCHandleType.Pinned);
} pColorFrame.CopyConvertedFrameDataToIntPtr(pColorData.AddrOfPinnedObject(), (uint)pColorBuffer.Length, ColorImageFormat.Rgba);
pColorData.Free();
}
// Get BodyIndex Frame Data.
using(var pBodyIndexFrame = pMultiSourceFrame.BodyIndexFrameReference.AcquireFrame())
if (pBodyIndexFrame != null)
{
var pBodyIndexData = GCHandle.Alloc (pBodyIndexBuffer, GCHandleType.Pinned);
pBodyIndexFrame.CopyFrameDataToIntPtr(pBodyIndexData.AddrOfPinnedObject(), (uint)pBodyIndexBuffer.Length);
pBodyIndexData.Free();
}
// Get Body Frame Data.
using(var pBodyFrame = pMultiSourceFrame.BodyFrameReference.AcquireFrame())
if (pBodyFrame != null)
pBodyFrame.GetAndRefreshBodyData(pBodyBuffer);
ProcessFrame();
} }
void OnApplicationQuit() void OnApplicationQuit()
...@@ -181,11 +185,10 @@ public class CoordinateMapperManager : MonoBehaviour ...@@ -181,11 +185,10 @@ public class CoordinateMapperManager : MonoBehaviour
pDepthBuffer = null; pDepthBuffer = null;
pColorBuffer = null; pColorBuffer = null;
pBodyIndexBuffer = null; pBodyIndexBuffer = null;
pBodyBuffer = null;
if (m_pDepthCoordinates != null) if (m_pDepthCoordinates != null)
{
m_pDepthCoordinates = null; m_pDepthCoordinates = null;
}
if (m_pMultiSourceFrameReader != null) if (m_pMultiSourceFrameReader != null)
{ {
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7a5e5e01ba9a7b742a012d7255c03a48 guid: 397b5aecede4d754abd2fba781e08f97
timeCreated: 1503487044 timeCreated: 1503474049
licenseType: Free licenseType: Free
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
...@@ -18,17 +18,13 @@ public class CoordinateMapperView : MonoBehaviour ...@@ -18,17 +18,13 @@ public class CoordinateMapperView : MonoBehaviour
ReleaseBuffers (); ReleaseBuffers ();
if (CoordinateMapperManager == null) if (CoordinateMapperManager == null)
{
return; return;
}
_CoordinateMapperManager = CoordinateMapperManager.GetComponent<CoordinateMapperManager>(); _CoordinateMapperManager = CoordinateMapperManager.GetComponent<CoordinateMapperManager>();
Texture2D renderTexture = _CoordinateMapperManager.GetColorTexture(); Texture2D renderTexture = _CoordinateMapperManager.GetColorTexture();
if (renderTexture != null) if (renderTexture != null)
{
GetComponent<Renderer>().material.SetTexture("_MainTex", renderTexture); GetComponent<Renderer>().material.SetTexture("_MainTex", renderTexture);
}
depthPoints = _CoordinateMapperManager.GetDepthCoordinates (); depthPoints = _CoordinateMapperManager.GetDepthCoordinates ();
if (depthPoints != null) if (depthPoints != null)
...@@ -53,19 +49,19 @@ public class CoordinateMapperView : MonoBehaviour ...@@ -53,19 +49,19 @@ public class CoordinateMapperView : MonoBehaviour
// ComputeBuffers do not accept bytes, so we need to convert to float. // ComputeBuffers do not accept bytes, so we need to convert to float.
float[] buffer = new float[512 * 424]; float[] buffer = new float[512 * 424];
for (int i = 0; i < bodyIndexPoints.Length; i++) for (int i = 0; i < bodyIndexPoints.Length; i++)
{
buffer[i] = (float)bodyIndexPoints[i]; buffer[i] = (float)bodyIndexPoints[i];
}
bodyIndexBuffer.SetData(buffer); bodyIndexBuffer.SetData(buffer);
buffer = null; buffer = null;
} }
private void ReleaseBuffers() private void ReleaseBuffers()
{ {
if (depthBuffer != null) depthBuffer.Release(); if (depthBuffer != null)
depthBuffer.Release();
depthBuffer = null; depthBuffer = null;
if (bodyIndexBuffer != null) bodyIndexBuffer.Release(); if (bodyIndexBuffer != null)
bodyIndexBuffer.Release();
bodyIndexBuffer = null; bodyIndexBuffer = null;
depthPoints = null; depthPoints = null;
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: e443859d15e7c3944bb46042a9ef0a73 guid: 8503e604fd3a9d44ba58c6fcc10a96ba
timeCreated: 1503487115 timeCreated: 1503474201
licenseType: Free licenseType: Free
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
...@@ -7,9 +7,6 @@ using UnityEngine.UI; ...@@ -7,9 +7,6 @@ using UnityEngine.UI;
public class InputManager : MonoBehaviour { public class InputManager : MonoBehaviour {
private static InputManager instance; private static InputManager instance;
KinectScript ks;
bool isUpdating = false;
public Text txt;
public static InputManager Instance public static InputManager Instance
{ {
...@@ -27,7 +24,7 @@ public class InputManager : MonoBehaviour { ...@@ -27,7 +24,7 @@ public class InputManager : MonoBehaviour {
private bool IsButtonDown { get; set; } private bool IsButtonDown { get; set; }
public Pair<float, MotionState> CurrentMotionState { get; set; } public MotionState CurrentMotionState { get; set; }
public bool IsButtonPressed public bool IsButtonPressed
{ {
...@@ -56,25 +53,11 @@ public class InputManager : MonoBehaviour { ...@@ -56,25 +53,11 @@ public class InputManager : MonoBehaviour {
// Use this for initialization // Use this for initialization
void Start() void Start()
{ {
ks = GameObject.Find("Managers").GetComponent<KinectScript>();
} }
// Update is called once per frame // Update is called once per frame
void Update() void Update()
{ {
IsButtonDown = Input.anyKey; IsButtonDown = Input.anyKey;
if(!isUpdating)
{
isUpdating = true;
ks.StartUpdating();
}
CurrentMotionState = ks.GetState();
if(CurrentMotionState!=null)
Debug.Log(CurrentMotionState.second.ToString());
GameObject.Find("Wall").GetComponent<Renderer>().material.mainTexture = ks.GetImage();
} }
} }
\ No newline at end of file
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Windows.Kinect;
using System.IO;
public class KinectScript : MonoBehaviour
{
KinectSensor sensor;
MultiSourceFrameReader msfReader;
KinectImage image;
KinectMotion motion = new KinectMotion();
bool isUpdating = false;
// Use this for initialization
void Start()
{
sensor = KinectSensor.GetDefault();
if (sensor == null)
return;
msfReader = sensor.OpenMultiSourceFrameReader(FrameSourceTypes.Color |
FrameSourceTypes.Depth |
FrameSourceTypes.Body);
image = new KinectImage(
sensor.ColorFrameSource.CreateFrameDescription(
ColorImageFormat.Rgba));
if (!sensor.IsOpen)
sensor.Open();
}
// Update is called once per frame
void Update()
{
if (isUpdating)
Update(image);
}
void AccurateUpdate()
{
if (isUpdating)
Update(motion);
}
void Update(KinectData data)
{
if (msfReader == null)
return;
var frame = msfReader.AcquireLatestFrame();
if (frame == null)
return;
data.Update(frame);
}
public void StartUpdating()
{
isUpdating = true;
InvokeRepeating("AccurateUpdate", 0, 0.001f);
}
public void StopUpdating()
{
isUpdating = false;
CancelInvoke("AccurateUpdate");
}
private void OnApplicationQuit()
{
StopUpdating();
if (msfReader == null)
return;
msfReader.Dispose();
msfReader = null;
if (sensor == null)
return;
if (sensor.IsOpen)
sensor.Close();
sensor = null;
}
public Texture2D GetImage()
{
return image.GetImage();
}
public Pair<float, MotionState> GetState()
{
return motion.GetState();
}
}
public abstract class KinectSource
{
public abstract void Update(MultiSourceFrame frame);
}
public class KinectBody : KinectSource
{
Body[] body = null;
public Dictionary<JointType, Windows.Kinect.Joint> joints
{
get;
private set;
}
public KinectBody()
{
joints = null;
}
public override void Update(MultiSourceFrame frame)
{
BodyFrame bFrame = frame.BodyFrameReference.AcquireFrame();
if (body == null)
body = new Body[bFrame.BodyCount];
bFrame.GetAndRefreshBodyData(body);
bFrame.Dispose();
bFrame = null;
UpdateBodyData();
}
private void UpdateBodyData()
{
int idx;
for (idx = 0; idx < body.Length; ++idx)
if (body[idx].IsTracked)
break;
if (idx >= body.Length)
return;
joints = body[idx].Joints;
}
}
public class KinectColor : KinectSource
{
public byte[] texel
{ get; private set; }
public KinectColor(FrameDescription frameDesc)
{
texel = new byte[frameDesc.BytesPerPixel * frameDesc.LengthInPixels];
}
public override void Update(MultiSourceFrame frame)
{
ColorFrame cFrame = frame.ColorFrameReference.AcquireFrame();
cFrame.CopyConvertedFrameDataToArray(texel, ColorImageFormat.Rgba);
cFrame.Dispose();
cFrame = null;
}
}
[System.Flags]
public enum MotionState : uint
{
UNKNOWN = 0,
CLAP_PREPARE = 1,
CLAP_DONE = 2,
HURRAY = 4
}
public abstract class KinectData
{
public abstract void Update(MultiSourceFrame frame);
}
public class KinectImage : KinectData
{
Texture2D image;
KinectColor color;
public KinectImage(FrameDescription frameDesc)
{
image = new Texture2D(frameDesc.Width,
frameDesc.Height,
TextureFormat.RGBA32,
false);
color = new KinectColor(frameDesc);
}
public override void Update(MultiSourceFrame frame)
{
color.Update(frame);
image.LoadRawTextureData(color.texel);
image.Apply();
}
public Texture2D GetImage()
{
return image;
}
}
public class Pair<T1, T2>
{
public T1 first;
public T2 second;
}
public class KinectMotion : KinectData
{
Queue<Pair<float, MotionState>> motions
= new Queue<Pair<float, MotionState>>();
KinectBody body = new KinectBody();
float timeRecent = 0;
public override void Update(MultiSourceFrame frame)
{
body.Update(frame);
const float UNIT_TIME = 0.001f;
timeRecent += UNIT_TIME;
motions.Enqueue(new Pair<float, MotionState>
{
first = timeRecent,
second = DetermineState()
});
}
MotionState DetermineState()
{
MotionState s = MotionState.UNKNOWN;
if (body.joints == null || body.joints.Count == 0)
return s;
CameraSpacePoint head = body.joints[JointType.Head].Position,
leftHand = body.joints[JointType.HandLeft].Position,
rightHand = body.joints[JointType.HandRight].Position;
if (head.Y < leftHand.Y && head.Y < rightHand.Y)
s |= MotionState.HURRAY;
if (Distance(leftHand, rightHand) > 0.3f)
s |= MotionState.CLAP_PREPARE;
if (Distance(leftHand, rightHand) < 0.1f)
s |= MotionState.CLAP_DONE;
return s;
}
float Distance(CameraSpacePoint a, CameraSpacePoint b)
{
return Mathf.Sqrt(Mathf.Pow(a.X - b.X, 2.0f) +
Mathf.Pow(a.Y - b.Y, 2.0f) +
Mathf.Pow(a.Z - b.Z, 2.0f));
}
public Pair<float, MotionState> GetState()
{
return motions.Count > 0 ? motions.Dequeue() :
new Pair<float, MotionState>
{ first = 0, second = MotionState.UNKNOWN };
}
}
...@@ -10,7 +10,7 @@ public class ClapNote : MotionNote ...@@ -10,7 +10,7 @@ public class ClapNote : MotionNote
public override IEnumerable<bool> Checkpoint() public override IEnumerable<bool> Checkpoint()
{ {
var motionState = InputManager.Instance.CurrentMotionState; var motionState = InputManager.Instance.CurrentMotionState;
var motion = motionState.second; var motion = motionState;
while (motion != MotionState.CLAP_PREPARE) while (motion != MotionState.CLAP_PREPARE)
yield return false; yield return false;
......
using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using Windows.Kinect;
public class MotionView : MonoBehaviour {
Pair<float, MotionState> recent;
public GameObject CoordinateMapperManager;
CoordinateMapperManager _coordinateMapperManager;
Body[] body;
// Use this for initialization
void Start () {
recent = new Pair<float, MotionState>
{
first = 0,
second = MotionState.UNKNOWN
};
if(CoordinateMapperManager == null)
return;
_coordinateMapperManager
= CoordinateMapperManager.GetComponent<CoordinateMapperManager>();
body = _coordinateMapperManager.GetBodyBuffer();
}
// Update is called once per frame
void Update () {
recent.first += Time.deltaTime;
recent.second = DetermineState();
InputManager.Instance.CurrentMotionState = recent.second;
}
MotionState DetermineState()
{
int idx;
for(idx = 0; idx < body.Length; ++idx)
if (body[idx] != null && body[idx].IsTracked)
break;
if(idx == body.Length || body[idx].Joints == null)
return MotionState.UNKNOWN;
CameraSpacePoint head = body[idx].Joints[JointType.Head ]
.Position,
leftHand = body[idx].Joints[JointType.HandLeft ]
.Position,
rightHand = body[idx].Joints[JointType.HandRight]
.Position;
MotionState s = MotionState.UNKNOWN;
if (head.Y < leftHand.Y && head.Y < rightHand.Y)
s |= MotionState.HURRAY;
if (Distance(leftHand, rightHand) > 0.3f)
s |= MotionState.CLAP_PREPARE;
if (Distance(leftHand, rightHand) < 0.1f)
s |= MotionState.CLAP_DONE;
return s;
}
float Distance(CameraSpacePoint a, CameraSpacePoint b)
{
return Mathf.Sqrt(Mathf.Pow(a.X - b.X, 2.0f) +
Mathf.Pow(a.Y - b.Y, 2.0f) +
Mathf.Pow(a.Z - b.Z, 2.0f));
}
public Pair<float, MotionState> GetState()
{
return recent;
}
}
[System.Flags]
public enum MotionState : uint
{
UNKNOWN = 0,
CLAP_PREPARE = 1,
CLAP_DONE = 2,
HURRAY = 4
}
public class Pair<T1, T2>
{
public T1 first;
public T2 second;
}
\ No newline at end of file
fileFormatVersion: 2 fileFormatVersion: 2
guid: c957a7b7e1e0a87438d12097932a611d guid: 510da3d4303d77441a0367665b5a4ae3
timeCreated: 1502957708 timeCreated: 1503527098
licenseType: Free licenseType: Free
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2
guid: 97b13591a96f8174d980197f404dcf8d
folderAsset: yes
timeCreated: 1502088321
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2 fileFormatVersion: 2
guid: 5cf2eeaeb5141e545923973c7d827d6f guid: 5cf2eeaeb5141e545923973c7d827d6f
folderAsset: yes folderAsset: yes
timeCreated: 1502957664 timeCreated: 1503553766
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 1d7502d8680f38344a822b04f6589097 guid: bc11ab9581163ba44b721acb44ce8763
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 5af24ef31b79af248965e672735626a3 guid: b404867256ddca245871a9152fd54294
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: e11228902f41cb242bd8b1f16b364e24 guid: a4997bd0bad10ad46a9793a4055c7fcd
folderAsset: yes folderAsset: yes
timeCreated: 1502957664 timeCreated: 1503553766
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 992490f149d571a4bb003838d2ac33c5 guid: a103df75c03c9c54096627354fdb1398
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
using UnityEditor;
using UnityEditor.Callbacks;
using System;
public static class KinectVisualGestureBuilderPostBuildCopyPluginData
{
[PostProcessBuild]
public static void OnPostProcessBuild(BuildTarget target, string path)
{
KinectCopyPluginDataHelper.CopyPluginData (target, path, "vgbtechs");
}
}
fileFormatVersion: 2
guid: b57003b3c57eec84685a31008f2876e4
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2 fileFormatVersion: 2
guid: eb47e8e15bc900141b610bf206931fd3 guid: debd3e6b79ccfa7439ef3bc59b8d30e6
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2c60ec64b7307604bba5b0cae3bfbdb7 guid: 86085617855511d45b0648e6b62e1584
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 3c63fb408f75ea84a914dde0bedf5db6 guid: 010db25b57d940546a60549c96171b70
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 041b09b5123e8c04d82d9fadf4e38ea9 guid: a27f97f1b27134f4bbee290cf18c791c
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
using RootSystem = System;
using System;
using System.Collections.Generic;
using System.Runtime.InteropServices;
namespace Microsoft.Kinect.VisualGestureBuilder
{
public sealed partial class VisualGestureBuilderDatabase
{
[RootSystem.Runtime.InteropServices.DllImport(
"KinectVisualGestureBuilderUnityAddin",
EntryPoint = "Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ctor",
CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ctor([MarshalAs(UnmanagedType.LPWStr)]string path);
public static VisualGestureBuilderDatabase Create(string path)
{
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ctor(path);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderDatabase>(
objectPointer, n => new Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderDatabase(n));
}
}
public sealed partial class VisualGestureBuilderFrameSource
{
[RootSystem.Runtime.InteropServices.DllImport(
"KinectVisualGestureBuilderUnityAddin",
EntryPoint = "Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_ctor",
CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_ctor(RootSystem.IntPtr sensorPtr, ulong initialTrackingId);
public static VisualGestureBuilderFrameSource Create(Windows.Kinect.KinectSensor sensor, ulong initialTrackingId)
{
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_ctor(Helper.NativeWrapper.GetNativePtr(sensor), initialTrackingId);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameSource>(
objectPointer, n => new Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameSource(n));
}
[RootSystem.Runtime.InteropServices.DllImport(
"KinectVisualGestureBuilderUnityAddin",
EntryPoint = "Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_GetIsEnabled",
CallingConvention = RootSystem.Runtime.InteropServices.CallingConvention.Cdecl)]
private static extern bool Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_GetIsEnabled(RootSystem.IntPtr pNative, RootSystem.IntPtr gesturePtr);
public bool GetIsEnabled(Microsoft.Kinect.VisualGestureBuilder.Gesture gesture)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("VisualGestureBuilderFrameSource");
}
var result = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameSource_GetIsEnabled(_pNative, Helper.NativeWrapper.GetNativePtr(gesture));
Helper.ExceptionHelper.CheckLastError();
return result;
}
}
}
\ No newline at end of file
fileFormatVersion: 2
guid: 485600beef8b3194a94d471e24181020
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 1205289338cc2a04785ba3d26477b300
folderAsset: yes
timeCreated: 1502958445
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 46e2a41736f788a478d357ee5e6ec601
folderAsset: yes
timeCreated: 1502958445
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 0ef9aefeeafdaac429ef13524278f572
folderAsset: yes
timeCreated: 1502958445
licenseType: Free
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.ContinuousGestureResult
//
public sealed partial class ContinuousGestureResult : Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal ContinuousGestureResult(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_AddRefObject(ref _pNative);
}
~ContinuousGestureResult()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<ContinuousGestureResult>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern float Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_get_Progress(RootSystem.IntPtr pNative);
public float Progress
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("ContinuousGestureResult");
}
return Microsoft_Kinect_VisualGestureBuilder_ContinuousGestureResult_get_Progress(_pNative);
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: 39ba8f678e5073b44804c65fbbaf302c
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.DiscreteGestureResult
//
public sealed partial class DiscreteGestureResult : Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal DiscreteGestureResult(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_AddRefObject(ref _pNative);
}
~DiscreteGestureResult()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<DiscreteGestureResult>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern float Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_Confidence(RootSystem.IntPtr pNative);
public float Confidence
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("DiscreteGestureResult");
}
return Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_Confidence(_pNative);
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern bool Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_Detected(RootSystem.IntPtr pNative);
public bool Detected
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("DiscreteGestureResult");
}
return Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_Detected(_pNative);
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern bool Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_FirstFrameDetected(RootSystem.IntPtr pNative);
public bool FirstFrameDetected
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("DiscreteGestureResult");
}
return Microsoft_Kinect_VisualGestureBuilder_DiscreteGestureResult_get_FirstFrameDetected(_pNative);
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: 348b878afc4a938499c34b47772438f3
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.Gesture
//
public sealed partial class Gesture : Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal Gesture(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_Gesture_AddRefObject(ref _pNative);
}
~Gesture()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_Gesture_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_Gesture_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<Gesture>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_Gesture_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern Microsoft.Kinect.VisualGestureBuilder.GestureType Microsoft_Kinect_VisualGestureBuilder_Gesture_get_GestureType(RootSystem.IntPtr pNative);
public Microsoft.Kinect.VisualGestureBuilder.GestureType GestureType
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("Gesture");
}
return Microsoft_Kinect_VisualGestureBuilder_Gesture_get_GestureType(_pNative);
}
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_Gesture_get_Name(RootSystem.IntPtr pNative);
public string Name
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("Gesture");
}
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_Gesture_get_Name(_pNative);
Helper.ExceptionHelper.CheckLastError();
var managedString = RootSystem.Runtime.InteropServices.Marshal.PtrToStringUni(objectPointer);
RootSystem.Runtime.InteropServices.Marshal.FreeCoTaskMem(objectPointer);
return managedString;
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: a84b2c069de62a14c94940154ec6f7da
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.GestureType
//
public enum GestureType : int
{
None =0,
Discrete =1,
Continuous =2,
}
}
fileFormatVersion: 2
guid: 75c13895e20797f4fadf7ce99a885eb9
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.KinectVisualGestureBuilderUnityAddinUtils
//
public sealed partial class KinectVisualGestureBuilderUnityAddinUtils
{
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void KinectVisualGestureBuilderUnityAddin_FreeMemory(RootSystem.IntPtr pToDealloc);
public static void FreeMemory(RootSystem.IntPtr pToDealloc)
{
KinectVisualGestureBuilderUnityAddin_FreeMemory(pToDealloc);
}
}
}
fileFormatVersion: 2
guid: 2d5a0b5ff72c39a4e95865b317bd147d
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.TrackingIdLostEventArgs
//
public sealed partial class TrackingIdLostEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal TrackingIdLostEventArgs(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_AddRefObject(ref _pNative);
}
~TrackingIdLostEventArgs()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<TrackingIdLostEventArgs>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern ulong Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_get_TrackingId(RootSystem.IntPtr pNative);
public ulong TrackingId
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("TrackingIdLostEventArgs");
}
return Microsoft_Kinect_VisualGestureBuilder_TrackingIdLostEventArgs_get_TrackingId(_pNative);
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: fa8002d3a67f41f48bfaa702a83320ae
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderDatabase
//
public sealed partial class VisualGestureBuilderDatabase : RootSystem.IDisposable, Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal VisualGestureBuilderDatabase(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_AddRefObject(ref _pNative);
}
~VisualGestureBuilderDatabase()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<VisualGestureBuilderDatabase>(_pNative);
if (disposing)
{
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_Dispose(_pNative);
}
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern int Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_get_AvailableGestures(RootSystem.IntPtr pNative, [RootSystem.Runtime.InteropServices.Out] RootSystem.IntPtr[] outCollection, int outCollectionSize);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern int Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_get_AvailableGestures_Length(RootSystem.IntPtr pNative);
public RootSystem.Collections.Generic.IList<Microsoft.Kinect.VisualGestureBuilder.Gesture> AvailableGestures
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("VisualGestureBuilderDatabase");
}
int outCollectionSize = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_get_AvailableGestures_Length(_pNative);
var outCollection = new RootSystem.IntPtr[outCollectionSize];
var managedCollection = new Microsoft.Kinect.VisualGestureBuilder.Gesture[outCollectionSize];
outCollectionSize = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_get_AvailableGestures(_pNative, outCollection, outCollectionSize);
Helper.ExceptionHelper.CheckLastError();
for(int i=0;i<outCollectionSize;i++)
{
if(outCollection[i] == RootSystem.IntPtr.Zero)
{
continue;
}
var obj = Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.Gesture>(outCollection[i], n => new Microsoft.Kinect.VisualGestureBuilder.Gesture(n));
managedCollection[i] = obj;
}
return managedCollection;
}
}
// Public Methods
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderDatabase_Dispose(RootSystem.IntPtr pNative);
public void Dispose()
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
Dispose(true);
RootSystem.GC.SuppressFinalize(this);
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: 9f131b0b4bd823f408e9f36fa0f4b620
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 47c323266c46b964493ab406ea288659
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameArrivedEventArgs
//
public sealed partial class VisualGestureBuilderFrameArrivedEventArgs : RootSystem.EventArgs, Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal VisualGestureBuilderFrameArrivedEventArgs(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_AddRefObject(ref _pNative);
}
~VisualGestureBuilderFrameArrivedEventArgs()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<VisualGestureBuilderFrameArrivedEventArgs>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_get_FrameReference(RootSystem.IntPtr pNative);
public Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameReference FrameReference
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("VisualGestureBuilderFrameArrivedEventArgs");
}
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameArrivedEventArgs_get_FrameReference(_pNative);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameReference>(objectPointer, n => new Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameReference(n));
}
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: 487a1dbae6735f34695213eaf0e7486b
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 92b159bf1aed2df4986d0398eda39fe7
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
using RootSystem = System;
using System.Linq;
using System.Collections.Generic;
namespace Microsoft.Kinect.VisualGestureBuilder
{
//
// Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrameReference
//
public sealed partial class VisualGestureBuilderFrameReference : Helper.INativeWrapper
{
internal RootSystem.IntPtr _pNative;
RootSystem.IntPtr Helper.INativeWrapper.nativePtr { get { return _pNative; } }
// Constructors and Finalizers
internal VisualGestureBuilderFrameReference(RootSystem.IntPtr pNative)
{
_pNative = pNative;
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_AddRefObject(ref _pNative);
}
~VisualGestureBuilderFrameReference()
{
Dispose(false);
}
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_ReleaseObject(ref RootSystem.IntPtr pNative);
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern void Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_AddRefObject(ref RootSystem.IntPtr pNative);
private void Dispose(bool disposing)
{
if (_pNative == RootSystem.IntPtr.Zero)
{
return;
}
__EventCleanup();
Helper.NativeObjectCache.RemoveObject<VisualGestureBuilderFrameReference>(_pNative);
Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_ReleaseObject(ref _pNative);
_pNative = RootSystem.IntPtr.Zero;
}
// Public Properties
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern long Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_get_RelativeTime(RootSystem.IntPtr pNative);
public RootSystem.TimeSpan RelativeTime
{
get
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("VisualGestureBuilderFrameReference");
}
return RootSystem.TimeSpan.FromMilliseconds(Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_get_RelativeTime(_pNative));
}
}
// Public Methods
[RootSystem.Runtime.InteropServices.DllImport("KinectVisualGestureBuilderUnityAddin", CallingConvention=RootSystem.Runtime.InteropServices.CallingConvention.Cdecl, SetLastError=true)]
private static extern RootSystem.IntPtr Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_AcquireFrame(RootSystem.IntPtr pNative);
public Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrame AcquireFrame()
{
if (_pNative == RootSystem.IntPtr.Zero)
{
throw new RootSystem.ObjectDisposedException("VisualGestureBuilderFrameReference");
}
RootSystem.IntPtr objectPointer = Microsoft_Kinect_VisualGestureBuilder_VisualGestureBuilderFrameReference_AcquireFrame(_pNative);
Helper.ExceptionHelper.CheckLastError();
if (objectPointer == RootSystem.IntPtr.Zero)
{
return null;
}
return Helper.NativeObjectCache.CreateOrGetObject<Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrame>(objectPointer, n => new Microsoft.Kinect.VisualGestureBuilder.VisualGestureBuilderFrame(n));
}
private void __EventCleanup()
{
}
}
}
fileFormatVersion: 2
guid: ba8bac3cd7bf2b841ad9dd3acb0b34e1
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2
guid: 641d13669aad591478663a1e1aecf37d
timeCreated: 18446744011573954816
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
fileFormatVersion: 2 fileFormatVersion: 2
guid: d03d0f1305bee2541b8bf6b6aad5ae66 guid: 96cf7d466b0b0bb4d92fb09d817ad613
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 6a5563074073a2746adeab572f9254f2 guid: 0eb32acf7ae62044194131ae0f7e4516
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: b8692c711ef8ca04b8cbc62b7aea656c guid: adc912eeb5de2014f9ca670eca6ac808
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 9e4d8029771f44e45ac2b95f1172e12b guid: b31ad795626855f41842734c10d2a41f
timeCreated: 18446744011573954816 timeCreated: 18446744011573954816
MonoImporter: MonoImporter:
serializedVersion: 2 serializedVersion: 2
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 2723e673de8807e43ad17c3ba3135b72 guid: 52bd9bdade9838840b80797ddd320e17
folderAsset: yes folderAsset: yes
timeCreated: 1502957664 timeCreated: 1503553766
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 04e90123037305243906258ff07b4736 guid: 4fccb6c96acbf444bb0e7fcab0da3b38
folderAsset: yes folderAsset: yes
timeCreated: 1502957664 timeCreated: 1503553766
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:
......
fileFormatVersion: 2 fileFormatVersion: 2
guid: 7eaeb51706298234982d58b7d8469461 guid: 05a950b0c830aca40b627845ce306e0f
folderAsset: yes folderAsset: yes
timeCreated: 1502957664 timeCreated: 1503553766
licenseType: Free licenseType: Free
DefaultImporter: DefaultImporter:
userData: userData:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment