示例#1
0
        public void Init(GestureConfigParams Param)
        {
            m_NativeParam = new NativeGestureConfigParam();

            m_NativeParam.IsUsingSubThread = Convert.ToInt32(Param.IsUsingSubThread);

            m_NativeParam.ReturnInfoType = (int)Param.GestureReturnInfoType;

            m_NativeParam.PlayerNum = Param.PlayerNum;

            m_NativeParam.SkeletonVelocityFrames = Param.SkeletonVelocityFrames;

            m_NativeParam.SkeletonVelocityMulType = (int)Param.SkeletonVelocityMulType;

            m_NativeParam.SkeletonNum = OrbbecWrapper.availableJoints.Length;

            SkeletonIndexs = new int[m_NativeParam.SkeletonNum];
            for (int i = 0; i < SkeletonIndexs.Length; ++i)
            {
                SkeletonIndexs[i] = (int)OrbbecWrapper.availableJoints[i];
            }

            m_NativeParam.SkeletonTypeArray = Marshal.UnsafeAddrOfPinnedArrayElement(SkeletonIndexs, 0);

            m_NativeParam.IsGetVelocityData = Convert.ToInt32(Param.IsGetVelocityData);

            GestureNativeMethods.InitGestureNative(m_NativeParam);
        }
示例#2
0
        public string GetGestureName(int PlayerIndex, uint GestureIndex)
        {
            IntPtr namePtr = GestureNativeMethods.GetGestureName(PlayerIndex, GestureIndex);

            string Name = Marshal.PtrToStringAnsi(namePtr);

            return(Name);
        }
示例#3
0
 public void SetPlayer(int PlayerIndex, bool IsUpdate)
 {
     if (m_NativeParam.IsUsingSubThread == 0)
     {
         GestureNativeMethods.SetPlayerImmediate(PlayerIndex, IsUpdate);
     }
     else
     {
         GestureNativeMethods.SetPlayer(PlayerIndex, IsUpdate);
     }
 }
示例#4
0
 public void ResetPlayerGestureFromName(int PlayerIndex, string GestureName)
 {
     if (m_NativeParam.IsUsingSubThread == 0)
     {
         GestureNativeMethods.ResetPlayerGestureImmediateFromName(PlayerIndex, GestureName);
     }
     else
     {
         GestureNativeMethods.ResetPlayerGestureFromName(PlayerIndex, GestureName);
     }
 }
示例#5
0
 public int GetFPS()
 {
     if (m_NativeParam.IsUsingSubThread != 0)
     {
         return(GestureNativeMethods.SubThreadFPS());
     }
     else
     {
         return((int)(1.0f / Time.unscaledDeltaTime));
     }
 }
示例#6
0
 public void ResetPlayerGesture(int PlayerIndex, uint GestureIndex)
 {
     if (m_NativeParam.IsUsingSubThread == 0)
     {
         GestureNativeMethods.ResetPlayerGestureImmediate(PlayerIndex, GestureIndex);
     }
     else
     {
         GestureNativeMethods.ResetPlayerGesture(PlayerIndex, GestureIndex);
     }
 }
示例#7
0
 public bool GetPlayerGestureState(int PlayerIndex, IntPtr pGestureInfo, ref int InfoNum)
 {
     return(GestureNativeMethods.GetPlayerGestureState(PlayerIndex, pGestureInfo, ref InfoNum));
 }
示例#8
0
        public bool UpdateSkeletonImmediate(int PlayerIndex, Point3D[] SkeletonData, IntPtr pGestureInfo, ref int InfoNum)
        {
            IntPtr SkeletonPtr = Marshal.UnsafeAddrOfPinnedArrayElement(SkeletonData, 0);

            return(GestureNativeMethods.UpdateSketonDataImmediate(PlayerIndex, SkeletonPtr, SkeletonData.Length, pGestureInfo, ref InfoNum));
        }
示例#9
0
        public void UpdateSkeleton(int PlayerIndex, Point3D[] SkeletonData)
        {
            IntPtr SkeletonPtr = Marshal.UnsafeAddrOfPinnedArrayElement(SkeletonData, 0);

            GestureNativeMethods.UpdateSketonData(PlayerIndex, SkeletonPtr, SkeletonData.Length);
        }
示例#10
0
 public void OnIdle()
 {
     GestureNativeMethods.OnIdle();
 }
示例#11
0
 public int GetGestureNum(int PlayerIndex)
 {
     return(GestureNativeMethods.GetGestureNum(PlayerIndex));
 }
示例#12
0
 public uint GetGestureIndex(int PlayerIndex, string GestureName)
 {
     return(GestureNativeMethods.GetGestureIndex(PlayerIndex, GestureName));
 }
示例#13
0
 public bool StartGestureWork()
 {
     return(GestureNativeMethods.StartGestureWork());
 }
示例#14
0
 public bool LoadConfigData(string XmlFileData)
 {
     return(GestureNativeMethods.LoadConfigData(XmlFileData));
 }
示例#15
0
 public bool LoadConfigFile(string XmlFilePath)
 {
     return(GestureNativeMethods.LoadConfigFile(XmlFilePath));
 }
示例#16
0
        public bool GetPlayerVelocityData(int PlayerIndex, Point3D[] SkeletonVelocityInfo)
        {
            IntPtr SkeletonPtr = Marshal.UnsafeAddrOfPinnedArrayElement(SkeletonVelocityInfo, 0);

            return(GestureNativeMethods.GetPlayerVelocityData(PlayerIndex, SkeletonPtr, SkeletonVelocityInfo.Length));
        }
示例#17
0
 public void ShutDown()
 {
     GestureNativeMethods.CloseGestureNative();
 }
示例#18
0
 public void SetDebugInfo(bool bFlag)
 {
     GestureNativeMethods.SetDebugInfo(bFlag);
 }