Пример #1
0
        public static ReturnStatus DestroyScene(ref INTERACTION_SCENE scene)
        {
            var rs = LeapIEDestroyScene(ref scene);

            Logger.HandleReturnStatus("Destroy Scene", LogLevel.Info, rs);
            return(rs);
        }
Пример #2
0
        public static ReturnStatus GetShapeInstanceResults(ref INTERACTION_SCENE scene,
                                                           List <INTERACTION_SHAPE_INSTANCE_RESULTS> results)
        {
            UInt32 nResults;
            IntPtr papResultsBuffer;
            var    rs = LeapIEGetShapeInstanceResults(ref scene,
                                                      out nResults,
                                                      out papResultsBuffer);

            results.Clear();
            if (rs == ReturnStatus.Success)
            {
                for (int i = 0; i < nResults; i++)
                {
                    IntPtr resultPtr;
                    StructMarshal <IntPtr> .ArrayElementToStruct(papResultsBuffer, i, out resultPtr);

                    INTERACTION_SHAPE_INSTANCE_RESULTS result;
                    StructMarshal <INTERACTION_SHAPE_INSTANCE_RESULTS> .PtrToStruct(resultPtr, out result);

                    results.Add(result);
                }
            }

            Logger.HandleReturnStatus(scene, "Get Velocities", LogLevel.AllCalls, rs);
            return(rs);
        }
Пример #3
0
        public static void HandleReturnStatus(INTERACTION_SCENE scene, string methodName, LogLevel methodLevel, ReturnStatus rs)
        {
            IntPtr messagePtr;

            InteractionC.GetLastError(ref scene, out messagePtr);
            handleReturnStatusInternal(methodName, methodLevel, rs, messagePtr);
        }
Пример #4
0
        public static ReturnStatus RemoveShapeDescription(ref INTERACTION_SCENE scene,
                                                          ref INTERACTION_SHAPE_DESCRIPTION_HANDLE handle)
        {
            var rs = LeapIERemoveShapeDescription(ref scene, ref handle);

            Logger.HandleReturnStatus(scene, "Remove Shape Description", LogLevel.CreateDestroy, rs);
            return(rs);
        }
Пример #5
0
        public static ReturnStatus UpdateController(ref INTERACTION_SCENE scene,
                                                    ref INTERACTION_TRANSFORM controllerTransform)
        {
            var rs = LeapIEUpdateController(ref scene, ref controllerTransform);

            Logger.HandleReturnStatus(scene, "Update Controller", LogLevel.AllCalls, rs);
            return(rs);
        }
Пример #6
0
        public static ReturnStatus GetLastError(ref INTERACTION_SCENE scene,
                                                out IntPtr messagePtr)
        {
            ReturnStatus rs = GetLastError(ref scene);

            messagePtr = GetLastErrorString();
            return(rs);
        }
Пример #7
0
        public static ReturnStatus UpdateSceneInfo(ref INTERACTION_SCENE scene,
                                                   ref INTERACTION_SCENE_INFO sceneInfo)
        {
            var rs = LeapIEUpdateSceneInfo(ref scene, ref sceneInfo);

            Logger.HandleReturnStatus(scene, "Update Scene Info", LogLevel.Info, rs);
            return(rs);
        }
Пример #8
0
        public static ReturnStatus EnableDebugFlags(ref INTERACTION_SCENE scene,
                                                    UInt32 flags)
        {
            var rs = LeapIEEnableDebugFlags(ref scene, flags);

            Logger.HandleReturnStatus(scene, "Enable Debug Flags", LogLevel.Info, rs);
            return(rs);
        }
Пример #9
0
        public static ReturnStatus DestroyShapeInstance(ref INTERACTION_SCENE scene,
                                                        ref INTERACTION_SHAPE_INSTANCE_HANDLE instance)
        {
            var rs = LeapIEDestroyShapeInstance(ref scene, ref instance);

            Logger.HandleReturnStatus(scene, "Destroy Shape Instance", LogLevel.CreateDestroy, rs);
            return(rs);
        }
Пример #10
0
        public static ReturnStatus UpdateHands(ref INTERACTION_SCENE scene,
                                               UInt32 nHands,
                                               IntPtr pHands)
        {
            var rs = LeapIEUpdateHands(ref scene, nHands, pHands);

            Logger.HandleReturnStatus(scene, "Update Hands", LogLevel.AllCalls, rs);
            return(rs);
        }
Пример #11
0
        public static ReturnStatus AddShapeDescription(ref INTERACTION_SCENE scene,
                                                       IntPtr pDescription,
                                                       out INTERACTION_SHAPE_DESCRIPTION_HANDLE handle)
        {
            var rs = LeapIEAddShapeDescription(ref scene, pDescription, out handle);

            Logger.HandleReturnStatus(scene, "Add Shape Description", LogLevel.CreateDestroy, rs);
            return(rs);
        }
Пример #12
0
        public static ReturnStatus OverrideHandResult(ref INTERACTION_SCENE scene,
                                                      UInt32 handId,
                                                      ref INTERACTION_HAND_RESULT handResult)
        {
            var rs = LeapIEOverrideHandResult(ref scene, handId, ref handResult);

            Logger.HandleReturnStatus(scene, "Override Hand Result", LogLevel.AllCalls, rs);
            return(rs);
        }
Пример #13
0
        public static ReturnStatus UpdateShapeInstance(ref INTERACTION_SCENE scene,
                                                       ref INTERACTION_TRANSFORM transform,
                                                       ref INTERACTION_UPDATE_SHAPE_INFO updateInfo,
                                                       ref INTERACTION_SHAPE_INSTANCE_HANDLE instance)
        {
            var rs = LeapIEUpdateShapeInstance(ref scene, ref transform, ref updateInfo, ref instance);

            Logger.HandleReturnStatus(scene, "Update Shape Instance", LogLevel.AllCalls, rs);
            return(rs);
        }
Пример #14
0
        public static ReturnStatus CreateShapeInstance(ref INTERACTION_SCENE scene,
                                                       ref INTERACTION_SHAPE_DESCRIPTION_HANDLE handle,
                                                       ref INTERACTION_TRANSFORM transform,
                                                       ref INTERACTION_CREATE_SHAPE_INFO shapeInfo,
                                                       out INTERACTION_SHAPE_INSTANCE_HANDLE instance)
        {
            var rs = LeapIECreateShapeInstance(ref scene, ref handle, ref transform, ref shapeInfo, out instance);

            Logger.HandleReturnStatus(scene, "Create Shap eInstance", LogLevel.CreateDestroy, rs);
            return(rs);
        }
Пример #15
0
        public static ReturnStatus GetDebugLines(ref INTERACTION_SCENE scene,
                                                 List <INTERACTION_DEBUG_LINE> lines)
        {
            UInt32 lineCount;
            IntPtr arrayPtr;
            var    rs = LeapIEGetDebugLines(ref scene, out lineCount, out arrayPtr);

            lines.Clear();
            for (int i = 0; i < lineCount; i++)
            {
                INTERACTION_DEBUG_LINE line;
                StructMarshal <INTERACTION_DEBUG_LINE> .ArrayElementToStruct(arrayPtr, i, out line);

                lines.Add(line);
            }

            return(rs);
        }
Пример #16
0
        public static ReturnStatus GetDebugStrings(ref INTERACTION_SCENE scene,
                                                   List <string> strings)
        {
            UInt32 nStrings;
            IntPtr pppStrings;
            var    rs = LeapIEGetDebugStrings(ref scene, out nStrings, out pppStrings);

            strings.Clear();
            if (rs == ReturnStatus.Success)
            {
                for (int i = 0; i < nStrings; i++)
                {
                    IntPtr charPtr;
                    StructMarshal <IntPtr> .ArrayElementToStruct(pppStrings, i, out charPtr);

                    string str = Marshal.PtrToStringAnsi(charPtr);
                    strings.Add(str);
                }
            }

            Logger.HandleReturnStatus(scene, "Get Debug Strings", LogLevel.AllCalls, rs);
            return(rs);
        }
Пример #17
0
 private static extern ReturnStatus LeapIEGetDebugLines(ref INTERACTION_SCENE scene,
                                                        out UInt32 nLines,
                                                        out IntPtr ppLineBuffer);
Пример #18
0
 private static extern ReturnStatus LeapIEUpdateSceneInfo(ref INTERACTION_SCENE scene,
                                                          ref INTERACTION_SCENE_INFO sceneInfo);
Пример #19
0
 private static extern ReturnStatus LeapIEEnableDebugFlags(ref INTERACTION_SCENE scene,
                                                           UInt32 flags);
Пример #20
0
 public static extern ReturnStatus GetLastError(ref INTERACTION_SCENE scene);
Пример #21
0
 private static extern ReturnStatus LeapIEGetShapeInstanceResults(ref INTERACTION_SCENE scene,
                                                                  out UInt32 nResults,
                                                                  out IntPtr papResultsBuffer);
Пример #22
0
 private static extern ReturnStatus LeapIEUpdateShapeInstance(ref INTERACTION_SCENE scene,
                                                              ref INTERACTION_TRANSFORM transform,
                                                              ref INTERACTION_UPDATE_SHAPE_INFO updateInfo,
                                                              ref INTERACTION_SHAPE_INSTANCE_HANDLE instance);
Пример #23
0
 private static extern ReturnStatus LeapIEOverrideHandResult(ref INTERACTION_SCENE scene,
                                                             UInt32 handId,
                                                             ref INTERACTION_HAND_RESULT handResult);
Пример #24
0
 private static extern ReturnStatus LeapIERemoveShapeDescription(ref INTERACTION_SCENE scene,
                                                                 ref INTERACTION_SHAPE_DESCRIPTION_HANDLE handle);
Пример #25
0
 private static extern ReturnStatus LeapIEUpdateController(ref INTERACTION_SCENE scene,
                                                           ref INTERACTION_TRANSFORM controllerTransform);
Пример #26
0
 private static extern ReturnStatus LeapIECreateShapeInstance(ref INTERACTION_SCENE scene,
                                                              ref INTERACTION_SHAPE_DESCRIPTION_HANDLE handle,
                                                              ref INTERACTION_TRANSFORM transform,
                                                              ref INTERACTION_CREATE_SHAPE_INFO shapeInfo,
                                                              out INTERACTION_SHAPE_INSTANCE_HANDLE instance);
Пример #27
0
 private static extern ReturnStatus LeapIEUpdateHands(ref INTERACTION_SCENE scene,
                                                      UInt32 nHands,
                                                      IntPtr pHands);
Пример #28
0
 private static extern ReturnStatus LeapIEGetDebugStrings(ref INTERACTION_SCENE scene,
                                                          out UInt32 nStrings,
                                                          out IntPtr pppStrings);
Пример #29
0
 private static extern ReturnStatus LeapIEAddShapeDescription(ref INTERACTION_SCENE scene,
                                                              IntPtr pDescription,
                                                              out INTERACTION_SHAPE_DESCRIPTION_HANDLE handle);
Пример #30
0
 private static extern ReturnStatus LeapIEDestroyShapeInstance(ref INTERACTION_SCENE scene,
                                                               ref INTERACTION_SHAPE_INSTANCE_HANDLE instance);