コード例 #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
ファイル: Logger.cs プロジェクト: BioTronFYDP/SpaceRockaway
        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);