31 #include "sLeapMotion.h" 32 #include <scolPlugin.h> 33 #include <scolMemoryHelper.hpp> 44 int OBJ_LEAPMOTION_SCOL;
46 int LEAPMOTION_CONNECTED_CB;
47 int SCOL_LEAPMOTION_CONNECTED_CB = 0;
49 int LEAPMOTION_DISCONNECTED_CB;
50 int SCOL_LEAPMOTION_DISCONNECTED_CB = 1;
52 int LEAPMOTION_CIRCLE_CB;
53 int SCOL_LEAPMOTION_CIRCLE_CB = 2;
55 int LEAPMOTION_SWIPE_CB;
56 int SCOL_LEAPMOTION_SWIPEB_CB = 3;
58 int LEAPMOTION_KEYTAP_CB;
59 int SCOL_LEAPMOTION_KEYTAP_CB = 4;
61 int LEAPMOTION_SCREENTAP_CB;
62 int SCOL_LEAPMOTION_SCREENTAP_CB = 5;
85 int destroyLEAPMOTIONObj(mmachine m, SCOL_PTR_TYPE handsys,
int handscol)
88 sLeapMotion* leapObj = MMgetPointer<sLeapMotion*>(m, MTOP(handscol));
91 MMsetPointer(m, MTOP(handscol), NULL);
94 MMechostr(MSKDEBUG,
"ObjLeapMotion destroyed.\n");
114 MMechostr(0,
"_CRleapMotionDevice\n");
119 int pUserd = MMpull(m);
120 int pCbkd = MMpull(m);
121 int pUserc = MMpull(m);
122 int pCbkc = MMpull(m);
125 int channel = MMget(m, 0);
130 MMechostr(MSKDEBUG,
"_CRleapMotionDevice : Channel NIL\n");
137 MMechostr(MSKDEBUG,
"_CRleapMotionDevice : leapObj failed\n");
143 if ((MMpushPointer(m, leapObj) != 0))
145 SAFE_DELETE(leapObj);
151 k = OBJcreate(m, OBJ_LEAPMOTION_SCOL, SCOL_PTR leapObj, NIL, NULL);
153 if ((k = MMpush(m, pCbkc)))
return k;
154 if ((k = MMpush(m, pUserc)))
return k;
155 if ((k = OBJaddreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_LEAPMOTION_CONNECTED_CB)))
return k;
157 if ((k = MMpush(m, pCbkd)))
return k;
158 if ((k = MMpush(m, pUserd)))
return k;
159 if ((k = OBJaddreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_LEAPMOTION_DISCONNECTED_CB)))
return k;
180 MMechostr(MSKDEBUG,
"_DSleapMotionDevice\n");
183 int leapMotionTab = MMget(m, 0);
184 if (leapMotionTab == NIL)
190 OBJdelTM(m, OBJ_LEAPMOTION_SCOL, leapMotionTab);
191 MMset(m, 0, ITOM(0));
194 MMechostr(MSKDEBUG,
"ok\n");
211 MMechostr(MSKDEBUG,
"_GetLeapMotionHand\n");
215 int index = MMpull(m);
216 int leapMotionTab = MMget(m, 0);
217 if (leapMotionTab == NIL)
223 sLeapMotion* leapObj = MMgetPointer<sLeapMotion*>(m, MTOP(leapMotionTab));
240 if (!leapObj->GetHand(index, hand))
250 leapObj->GetHandPosition(hand, optim, pos);
251 leapObj->GetHandOrientation(hand, pyr);
252 leapObj->GetHandVelocity(hand, vel);
254 int ptuple = MMmalloc(m, 3, TYPETAB);
260 MMstore(m, ptuple, 0, FTOM(pos.x / 1000.0f));
261 MMstore(m, ptuple, 1, FTOM(pos.y / 1000.0f));
262 MMstore(m, ptuple, 2, FTOM(pos.z / 1000.0f));
264 int otuple = MMmalloc(m, 3, TYPETAB);
270 MMstore(m, otuple, 0, FTOM(pyr.x));
271 MMstore(m, otuple, 1, FTOM(pyr.y));
272 MMstore(m, otuple, 2, FTOM(pyr.z));
274 int vtuple = MMmalloc(m, 3, TYPETAB);
280 MMstore(m, vtuple, 0, FTOM(vel.x / 1000.0f));
281 MMstore(m, vtuple, 1, FTOM(vel.y / 1000.0f));
282 MMstore(m, vtuple, 2, FTOM(vel.z / 1000.0f));
284 int ftuple = MMmalloc(m, 3, TYPETAB);
290 MMstore(m, ftuple, 0, PTOM(ptuple));
291 MMstore(m, ftuple, 1, PTOM(otuple));
292 MMstore(m, ftuple, 2, PTOM(vtuple));
294 MMset(m, 0, PTOM(ftuple));
297 MMechostr(MSKDEBUG,
"ok\n");
314 MMechostr(MSKDEBUG,
"_GetLeapMotionHandExt\n");
318 int index = MMpull(m);
319 int leapMotionTab = MMget(m, 0);
320 if (leapMotionTab == NIL)
326 sLeapMotion* leapObj = MMgetPointer<sLeapMotion*>(m, MTOP(leapMotionTab));
345 if (!leapObj->GetHand(index, hand))
355 leapObj->GetHandPosition(hand, optim, pos);
356 leapObj->GetHandOrientation(hand, pyr);
357 leapObj->GetHandVelocity(hand, vel);
358 leapObj->GetHandDirection(hand, dir);
359 leapObj->GetHandPalmNormal(hand, norm);
360 float confidence = hand.confidence();
362 int ptuple = MMmalloc(m, 3, TYPETAB);
368 MMstore(m, ptuple, 0, FTOM(pos.x / 1000.0f));
369 MMstore(m, ptuple, 1, FTOM(pos.y / 1000.0f));
370 MMstore(m, ptuple, 2, FTOM(pos.z / 1000.0f));
372 int otuple = MMmalloc(m, 3, TYPETAB);
378 MMstore(m, otuple, 0, FTOM(pyr.x));
379 MMstore(m, otuple, 1, FTOM(pyr.y));
380 MMstore(m, otuple, 2, FTOM(pyr.z));
382 int vtuple = MMmalloc(m, 3, TYPETAB);
388 MMstore(m, vtuple, 0, FTOM(vel.x / 1000.0f));
389 MMstore(m, vtuple, 1, FTOM(vel.y / 1000.0f));
390 MMstore(m, vtuple, 2, FTOM(vel.z / 1000.0f));
392 int dtuple = MMmalloc(m, 3, TYPETAB);
398 MMstore(m, dtuple, 0, FTOM(dir.x));
399 MMstore(m, dtuple, 1, FTOM(dir.y));
400 MMstore(m, dtuple, 2, FTOM(dir.z));
402 int ntuple = MMmalloc(m, 3, TYPETAB);
408 MMstore(m, ntuple, 0, FTOM(norm.x));
409 MMstore(m, ntuple, 1, FTOM(norm.y));
410 MMstore(m, ntuple, 2, FTOM(norm.z));
412 int ftuple = MMmalloc(m, 6, TYPETAB);
418 MMstore(m, ftuple, 0, PTOM(ptuple));
419 MMstore(m, ftuple, 1, PTOM(otuple));
420 MMstore(m, ftuple, 2, PTOM(vtuple));
421 MMstore(m, ftuple, 3, PTOM(dtuple));
422 MMstore(m, ftuple, 4, PTOM(ntuple));
423 MMstore(m, ftuple, 5, FTOM(confidence));
425 MMset(m, 0, PTOM(ftuple));
428 MMechostr(MSKDEBUG,
"ok\n");
445 MMechostr(MSKDEBUG,
"_GetLeapMotionTool\n");
449 int index = MMpull(m);
450 int leapMotionTab = MMget(m, 0);
451 if (leapMotionTab == NIL)
457 sLeapMotion* leapObj = MMgetPointer<sLeapMotion*>(m, MTOP(leapMotionTab));
474 if (!leapObj->GetTool(index, tool))
484 leapObj->GetToolPosition(tool, optim, pos);
485 leapObj->GetToolOrientation(tool, pyr);
487 int ptuple = MMmalloc(m, 3, TYPETAB);
493 MMstore(m, ptuple, 0, FTOM(pos.x / 1000.0f));
494 MMstore(m, ptuple, 1, FTOM(pos.y / 1000.0f));
495 MMstore(m, ptuple, 2, FTOM(pos.z / 1000.0f));
497 int otuple = MMmalloc(m, 3, TYPETAB);
503 MMstore(m, otuple, 0, FTOM(pyr.x));
504 MMstore(m, otuple, 1, FTOM(pyr.y));
505 MMstore(m, otuple, 2, FTOM(pyr.z));
507 int vtuple = MMmalloc(m, 3, TYPETAB);
513 MMstore(m, vtuple, 0, FTOM(vel.x / 1000.0f));
514 MMstore(m, vtuple, 1, FTOM(vel.y / 1000.0f));
515 MMstore(m, vtuple, 2, FTOM(vel.z / 1000.0f));
517 int ftuple = MMmalloc(m, 3, TYPETAB);
523 MMstore(m, ftuple, 0, PTOM(ptuple));
524 MMstore(m, ftuple, 1, PTOM(otuple));
525 MMstore(m, ftuple, 2, PTOM(vtuple));
527 MMset(m, 0, PTOM(ftuple));
530 MMechostr(MSKDEBUG,
"ok\n");
547 MMechostr(MSKDEBUG,
"_GetLeapMotionHandFingers\n");
551 int index = MMpull(m);
552 int leapMotionTab = MMget(m, 0);
553 if (leapMotionTab == NIL)
559 sLeapMotion* leapObj = MMgetPointer<sLeapMotion*>(m, MTOP(leapMotionTab));
572 if (!leapObj->GetHand(index, hand))
585 std::vector<SCbData> lfingers = leapObj->GetHandFingers(hand, optim);
586 for (
unsigned int i = 0; i < lfingers.size(); i++)
590 int ptuple = MMmalloc(m, 3, TYPETAB);
595 MMstore(m, ptuple, 0, FTOM(data.svec.x / 1000.0f));
596 MMstore(m, ptuple, 1, FTOM(data.svec.y / 1000.0f));
597 MMstore(m, ptuple, 2, FTOM(data.svec.z / 1000.0f));
599 int otuple = MMmalloc(m, 3, TYPETAB);
604 MMstore(m, otuple, 0, FTOM(data.pyr.x));
605 MMstore(m, otuple, 1, FTOM(data.pyr.y));
606 MMstore(m, otuple, 2, FTOM(data.pyr.z));
608 int stuple = MMmalloc(m, 2, TYPETAB);
613 MMstore(m, stuple, 0, FTOM(data.screenPos.x));
614 MMstore(m, stuple, 1, FTOM(data.screenPos.y));
616 int ftuple = MMmalloc(m, 4, TYPETAB);
622 MMstore(m, ftuple, 0, PTOM(ptuple));
623 MMstore(m, ftuple, 1, PTOM(otuple));
624 MMstore(m, ftuple, 2, PTOM(stuple));
625 MMstore(m, ftuple, 3, ITOM(data.id));
627 MMpush(m, PTOM(ftuple));
633 for (
unsigned int i = 0; i < lfingers.size(); i++)
638 if (
int k=MBdeftab(m))
643 MMechostr(MSKDEBUG,
"ok\n");
660 MMechostr(MSKDEBUG,
"_GetLeapMotionHandFingersWithJoints\n");
664 int index = MMpull(m);
665 int leapMotionTab = MMget(m, 0);
666 if (leapMotionTab == NIL)
672 sLeapMotion* leapObj = MMgetPointer<sLeapMotion*>(m, MTOP(leapMotionTab));
685 if (!leapObj->GetHand(index, hand))
698 std::vector<SCbData> lfingers = leapObj->GetHandFingers(hand, optim);
699 for (
unsigned int i = 0; i < lfingers.size(); i++)
703 int ptuple = MMmalloc(m, 3, TYPETAB);
708 MMstore(m, ptuple, 0, FTOM(data.svec.x / 1000.0f));
709 MMstore(m, ptuple, 1, FTOM(data.svec.y / 1000.0f));
710 MMstore(m, ptuple, 2, FTOM(data.svec.z / 1000.0f));
712 int otuple = MMmalloc(m, 3, TYPETAB);
717 MMstore(m, otuple, 0, FTOM(data.pyr.x));
718 MMstore(m, otuple, 1, FTOM(data.pyr.y));
719 MMstore(m, otuple, 2, FTOM(data.pyr.z));
721 int stuple = MMmalloc(m, 2, TYPETAB);
726 MMstore(m, stuple, 0, FTOM(data.screenPos.x));
727 MMstore(m, stuple, 1, FTOM(data.screenPos.y));
730 for (
unsigned int j = 0; j < data.subVecs.size(); j++)
732 Vector jvec = data.subVecs[j];
733 int jtuple = MMmalloc(m, 3, TYPETAB);
739 MMstore(m, jtuple, 0, FTOM(jvec.x / 1000.0f));
740 MMstore(m, jtuple, 1, FTOM(jvec.y / 1000.0f));
741 MMstore(m, jtuple, 2, FTOM(jvec.z / 1000.0f));
743 MMpush(m, PTOM(jtuple));
749 for (
unsigned int j = 0; j < data.subVecs.size(); j++)
754 if (
int k=MBdeftab(m))
759 int ftuple = MMmalloc(m, 5, TYPETAB);
766 MMstore(m, ftuple, 0, PTOM(ptuple));
767 MMstore(m, ftuple, 1, PTOM(otuple));
768 MMstore(m, ftuple, 2, PTOM(stuple));
769 MMstore(m, ftuple, 3, MMpull(m));
770 MMstore(m, ftuple, 4, ITOM(data.id));
772 MMpush(m, PTOM(ftuple));
778 for (
unsigned int i = 0; i < lfingers.size(); i++)
783 if (
int k=MBdeftab(m))
788 MMechostr(MSKDEBUG,
"ok\n");
810 return OBJaddreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_LEAPMOTION_CIRCLE_CB);
813 int getLeapMotionCircleCb(mmachine m, SCOL_PTR_TYPE
id, LONG param)
827 if (OBJbeginreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_PTR leapObj, SCOL_LEAPMOTION_CIRCLE_CB))
833 MMpush(m, ITOM(data->state));
834 MMpush(m, ITOM(data->handId));
835 MMpush(m, ITOM(data->id));
836 MMpush(m, FTOM(data->dir));
837 MMpush(m, FTOM(data->fparam));
838 MMpush(m, FTOM(data->progress));
840 k=OBJcallreflex(m, 6);
863 return OBJaddreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_LEAPMOTION_SWIPEB_CB);
866 int getLeapMotionSwipeCb(mmachine m, SCOL_PTR_TYPE
id, LONG param)
880 if (OBJbeginreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_PTR leapObj, SCOL_LEAPMOTION_SWIPEB_CB))
886 int ftuple = MMmalloc(m, 3, TYPETAB);
892 MMstore(m, ftuple, 0, FTOM(data->vDir.x));
893 MMstore(m, ftuple, 1, FTOM(data->vDir.y));
894 MMstore(m, ftuple, 2, FTOM(data->vDir.z));
896 MMpush(m, ITOM(data->state));
897 MMpush(m, ITOM(data->handId));
898 MMpush(m, ITOM(data->id));
900 MMpush(m, PTOM(ftuple));
902 MMpush(m, FTOM(data->fparam));
903 MMpush(m, FTOM(data->progress));
905 k=OBJcallreflex(m, 6);
926 return OBJaddreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_LEAPMOTION_KEYTAP_CB);
929 int getLeapMotionKeyTapCb(mmachine m, SCOL_PTR_TYPE
id, LONG param)
943 if (OBJbeginreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_PTR leapObj, SCOL_LEAPMOTION_KEYTAP_CB))
949 int ftuple = MMmalloc(m, 3, TYPETAB);
955 MMstore(m, ftuple, 0, FTOM(data->vDir.x));
956 MMstore(m, ftuple, 1, FTOM(data->vDir.y));
957 MMstore(m, ftuple, 2, FTOM(data->vDir.z));
959 int vtuple = MMmalloc(m, 3, TYPETAB);
965 MMstore(m, vtuple, 0, FTOM(data->svec.x));
966 MMstore(m, vtuple, 1, FTOM(data->svec.y));
967 MMstore(m, vtuple, 2, FTOM(data->svec.z));
969 MMpush(m, ITOM(data->handId));
970 MMpush(m, ITOM(data->id));
971 MMpush(m, PTOM(ftuple));
972 MMpush(m, PTOM(vtuple));
974 k=OBJcallreflex(m, 4);
995 return OBJaddreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_LEAPMOTION_SCREENTAP_CB);
998 int getLeapMotionScreenTapCb(mmachine m, SCOL_PTR_TYPE
id, LONG param)
1012 if (OBJbeginreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_PTR leapObj, SCOL_LEAPMOTION_SCREENTAP_CB))
1018 int ftuple = MMmalloc(m, 3, TYPETAB);
1024 MMstore(m, ftuple, 0, FTOM(data->vDir.x));
1025 MMstore(m, ftuple, 1, FTOM(data->vDir.y));
1026 MMstore(m, ftuple, 2, FTOM(data->vDir.z));
1028 int vtuple = MMmalloc(m, 3, TYPETAB);
1034 MMstore(m, vtuple, 0, FTOM(data->svec.x));
1035 MMstore(m, vtuple, 1, FTOM(data->svec.y));
1036 MMstore(m, vtuple, 2, FTOM(data->svec.z));
1038 MMpush(m, ITOM(data->handId));
1039 MMpush(m, ITOM(data->id));
1040 MMpush(m, PTOM(ftuple));
1041 MMpush(m, PTOM(vtuple));
1043 k=OBJcallreflex(m, 4);
1060 MMechostr(MSKDEBUG,
"_GetLeapMotionGrabStrength\n");
1063 int index = MMpull(m);
1064 int leapMotionTab = MMget(m, 0);
1065 if (leapMotionTab == NIL)
1071 sLeapMotion* leapObj = MMgetPointer<sLeapMotion*>(m, MTOP(leapMotionTab));
1081 index = MTOI(index);
1084 if (!leapObj->GetHand(index, hand))
1090 MMset(m, 0, FTOM(hand.grabStrength()));
1093 MMechostr(MSKDEBUG,
"ok\n");
1109 MMechostr(MSKDEBUG,
"_GetLeapMotionPinchStrength\n");
1112 int index = MMpull(m);
1113 int leapMotionTab = MMget(m, 0);
1114 if (leapMotionTab == NIL)
1120 sLeapMotion* leapObj = MMgetPointer<sLeapMotion*>(m, MTOP(leapMotionTab));
1130 index = MTOI(index);
1133 if (!leapObj->GetHand(index, hand))
1139 MMset(m, 0, FTOM(hand.pinchStrength()));
1142 MMechostr(MSKDEBUG,
"ok\n");
1159 MMechostr(MSKDEBUG,
"_SetleapMotionHmdOptimization\n");
1162 int state = MMpull(m);
1163 int leapMotionTab = MMget(m, 0);
1164 if (leapMotionTab == NIL)
1170 sLeapMotion* leapObj = MMgetPointer<sLeapMotion*>(m, MTOP(leapMotionTab));
1177 bool bstate =
false;
1178 if (state != NIL && MTOI(state) > 0)
1181 leapObj->SetTopTrackingEnable(bstate);
1183 MMset(m, 0, ITOM(0));
1186 MMechostr(MSKDEBUG,
"ok\n");
1193 int getLeapMotionConnectedCb(mmachine m, SCOL_PTR_TYPE
id, LONG param)
1202 if (OBJbeginreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_PTR leapObj, SCOL_LEAPMOTION_CONNECTED_CB))
1205 k=OBJcallreflex(m, 0);
1209 int getLeapMotionDisconnectedCb(mmachine m, SCOL_PTR_TYPE
id, LONG param)
1218 if (OBJbeginreflex(m, OBJ_LEAPMOTION_SCOL, SCOL_PTR leapObj, SCOL_LEAPMOTION_DISCONNECTED_CB))
1221 k=OBJcallreflex(m, 0);
1230 char* mLEAPMOTIONname[]=
1234 "_CRleapMotionDevice",
1235 "_DSleapMotionDevice",
1236 "_SetleapMotionHmdOptimization",
1237 "_GetLeapMotionHand",
1238 "_GetLeapMotionHandExt",
1239 "_GetLeapMotionTool",
1240 "_GetLeapMotionHandFingers",
1241 "_GetLeapMotionHandFingersWithJoints",
1242 "_GetLeapMotionGrabStrength",
1243 "_GetLeapMotionPinchStrength",
1244 "_CBLeapMotionCircleGesture",
1245 "_CBLeapMotionSwipeGesture",
1246 "_CBLeapMotionKeyTapGesture",
1247 "_CBLeapMotionScreenTapGesture" 1253 #define NLEAPMOTIONPKG (sizeof(mLEAPMOTIONname)/sizeof(char*)) 1258 int (*mLEAPMOTIONfun[NLEAPMOTIONPKG])(mmachine m)=
1281 int mLEAPMOTIONnarg[NLEAPMOTIONPKG]=
1304 char* mLEAPMOTIONtype[NLEAPMOTIONPKG]=
1308 "fun [Chn fun [ObjLeapMotion u0] u1 u0 fun [ObjLeapMotion u2] u3 u2] ObjLeapMotion",
1309 "fun [ObjLeapMotion] I",
1310 "fun [ObjLeapMotion I] I",
1311 "fun [ObjLeapMotion I I] [[F F F] [F F F] [F F F]]",
1312 "fun [ObjLeapMotion I I] [[F F F] [F F F] [F F F] [F F F] [F F F] F]",
1313 "fun [ObjLeapMotion I I] [[F F F] [F F F] [F F F]]",
1314 "fun [ObjLeapMotion I I] [[[F F F] [F F F] [F F] I] r1]",
1315 "fun [ObjLeapMotion I I] [[[F F F] [F F F] [F F] [[F F F] r1] I] r1]",
1316 "fun [ObjLeapMotion I] F",
1317 "fun [ObjLeapMotion I] F",
1318 "fun [ObjLeapMotion fun [ObjLeapMotion u0 I I I F F F] u1 u0] ObjLeapMotion",
1319 "fun [ObjLeapMotion fun [ObjLeapMotion u0 I I I [F F F] F F] u1 u0] ObjLeapMotion",
1320 "fun [ObjLeapMotion fun [ObjLeapMotion u0 I I [F F F] [F F F]] u1 u0] ObjLeapMotion",
1321 "fun [ObjLeapMotion fun [ObjLeapMotion u0 I I [F F F] [F F F]] u1 u0] ObjLeapMotion" 1332 int LoadLEAPMOTION(mmachine m)
1336 MMechostr(MSKDEBUG,
"\n" );
1337 MMechostr(MSKDEBUG,
" > Loading LEAPMOTION Support\n");
1340 OBJ_LEAPMOTION_SCOL = OBJregister(6 , 0, destroyLEAPMOTIONObj,
"OBJ_LEAPMOTION_SCOL");
1341 k = PKhardpak(m,
"mLEAPMOTION.pkg-1.0", NLEAPMOTIONPKG, mLEAPMOTIONname, mLEAPMOTIONfun, mLEAPMOTIONnarg, mLEAPMOTIONtype);
1343 LEAPMOTION_CONNECTED_CB = OBJgetUserEvent();
1344 OBJdefEvent(LEAPMOTION_CONNECTED_CB, (
int (__cdecl *)(
struct Mmachine*, SCOL_PTR_TYPE, LONG))getLeapMotionConnectedCb);
1346 LEAPMOTION_DISCONNECTED_CB = OBJgetUserEvent();
1347 OBJdefEvent(LEAPMOTION_DISCONNECTED_CB, (
int (__cdecl *)(
struct Mmachine*, SCOL_PTR_TYPE, LONG))getLeapMotionDisconnectedCb);
1349 LEAPMOTION_CIRCLE_CB = OBJgetUserEvent();
1350 OBJdefEvent(LEAPMOTION_CIRCLE_CB, (
int (__cdecl *)(
struct Mmachine*, SCOL_PTR_TYPE, LONG))getLeapMotionCircleCb);
1352 LEAPMOTION_SWIPE_CB = OBJgetUserEvent();
1353 OBJdefEvent(LEAPMOTION_SWIPE_CB, (
int (__cdecl *)(
struct Mmachine*, SCOL_PTR_TYPE, LONG))getLeapMotionSwipeCb);
1355 LEAPMOTION_KEYTAP_CB = OBJgetUserEvent();
1356 OBJdefEvent(LEAPMOTION_KEYTAP_CB, (
int (__cdecl *)(
struct Mmachine*, SCOL_PTR_TYPE, LONG))getLeapMotionKeyTapCb);
1358 LEAPMOTION_SCREENTAP_CB = OBJgetUserEvent();
1359 OBJdefEvent(LEAPMOTION_SCREENTAP_CB, (
int (__cdecl *)(
struct Mmachine*, SCOL_PTR_TYPE, LONG))getLeapMotionScreenTapCb);
1361 MMechostr(MSKDEBUG,
" > Successfully Loaded\n\n");
1365 int CloseLEAPMOTION()
1367 MMechostr(MSKDEBUG,
"\n" );
1368 MMechostr(MSKDEBUG,
" > Unloading LEAPMOTION Support\n");
1370 MMechostr(MSKDEBUG,
" > Successfully unloaded\n\n");
1381 extern "C" SCOL_EXPORT
int ScolLoadPlugin(mmachine m, cbmachine w)
1386 return LoadLEAPMOTION(m);
1393 extern "C" SCOL_EXPORT
int ScolUnloadPlugin()
1395 return CloseLEAPMOTION();
1402 extern "C" SCOL_EXPORT
int ScolLeapMotionLoadPlugin(mmachine m, cbmachine w)
1407 return LoadLEAPMOTION(m);
1414 extern "C" SCOL_EXPORT
int ScolLeapMotionUnloadPlugin()
1416 return CloseLEAPMOTION();
int _GetLeapMotionPinchStrength(mmachine m)
_GetLeapMotionPinchStrength : Get a LEAPMOTION hand Pinch strengh
int _SetleapMotionHmdOptimization(mmachine m)
_SetleapMotionHmdOptimization : Set the LEAPMOTION Hmd optimization enable or disable ...
int _CBLeapMotionCircleGesture(mmachine m)
_CBLeapMotionCircleGesture : Called on a Circle gesture
int _GetLeapMotionTool(mmachine m)
_GetLeapMotionTool : Get a LEAPMOTION tool position, orientation and velocity
int _GetLeapMotionHandFingers(mmachine m)
_GetLeapMotionHandFingers : Get the LEAPMOTION sensor fingers data from a hand
int _CBLeapMotionScreenTapGesture(mmachine m)
_CBLeapMotionScreenTapGesture : Called on a ScreenTap gesture
int _GetLeapMotionGrabStrength(mmachine m)
_GetLeapMotionGrabStrength : Get a LEAPMOTION hand Grab strengh
int _GetLeapMotionHandFingersWithJoints(mmachine m)
_GetLeapMotionHandFingersWithJoints : Get the LEAPMOTION sensor fingers data from a hand with finger ...
int _GetLeapMotionHandExt(mmachine m)
_GetLeapMotionHandExt : Get a LEAPMOTION hand position, orientation, direction and normal ...
int _CBLeapMotionSwipeGesture(mmachine m)
_CBLeapMotionSwipeGesture : Called on a Swipe gesture
int _CRleapMotionDevice(mmachine m)
_CRleapMotionDevice : This function create a LEAPMOTION object
int _DSleapMotionDevice(mmachine m)
_DSleapMotionDevice : Destroy LEAPMOTION object
int _CBLeapMotionKeyTapGesture(mmachine m)
_CBLeapMotionKeyTapGesture : Called on a KeyTap gesture
int _GetLeapMotionHand(mmachine m)
_GetLeapMotionHand : Get a LEAPMOTION hand position and orientation