Project

General

Profile

SO3Engine
SCOLVirtualPointer.cpp
Go to the documentation of this file.
1/*
2-----------------------------------------------------------------------------
3This source file is part of OpenSpace3D
4For the latest info, see http://www.openspace3d.com
5
6Copyright (c) 2018 I-maginer
7
8This program is free software; you can redistribute it and/or modify it under
9the terms of the GNU Lesser General Public License as published by the Free Software
10Foundation; either version 2 of the License, or (at your option) any later
11version.
12
13This program is distributed in the hope that it will be useful, but WITHOUT
14ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
15FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
16
17You should have received a copy of the GNU Lesser General Public License along with
18this program; if not, write to the Free Software Foundation, Inc., 59 Temple
19Place - Suite 330, Boston, MA 02111-1307, USA, or go to
20http://www.gnu.org/copyleft/lesser.txt
21
22-----------------------------------------------------------------------------
23*/
24
25
34#include "SCOLPack/SO3SCOL.h"
35
36// Scene Graph includes
41
52{
53#ifdef SO3_DEBUG
54 MMechostr(MSKDEBUG, "SO3VirtualPointerCreate\n");
55#endif
56 int name = MMpull(m);
57 int s = MMget(m, 0);
58 if (s == NIL)
59 {
60 MMset(m, 0, NIL);
61 return 0;
62 }
63
64 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
65 if (scene == NULL)
66 {
67 MMset(m, 0, NIL);
68 return 0;
69 }
70
71 // Create Node
72 std::string tmpBaseName(MMstartstr(m, MTOP(name)));
73 SVirtualPointer* virtualPointer = 0;
74 try
75 {
76 virtualPointer = scene->CreateVirtualPointer(tmpBaseName);
77 }
78 catch (Ogre::Exception &e)
79 {
80 MMechostr(MSKDEBUG, "An exception has occurred : %s\n", e.what());
81 MMset(m, 0, NIL);
82 return 0;
83 }
84
85 // remove last param
86 MMpull(m);
87 return createObject(m, virtualPointer, scene);
88}
89
90
101{
102#ifdef SO3_DEBUG
103 MMechostr(MSKDEBUG, "SO3VirtualPointerSetMaxLength\n");
104#endif
105
106 int f = MMpull(m);
107 int obj = MMget(m, 0);
108
109 if ((obj == NIL) || (f == NIL))
110 {
111 MMset(m, 0, NIL);
112 return 0;
113 }
114
115 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
116 if (node == 0)
117 {
118 MMset(m, 0, NIL);
119 return 0;
120 }
121
122 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
123 {
124 MMset(m, 0, NIL);
125 return 0;
126 }
127
128 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
129 if (MTOF(f) == 0.0)
130 {
131 MMset(m, 0, NIL);
132 return 0;
133 }
134
135 virtualPointer->SetMaxLength(MTOF(f));
136 MMset(m, 0, ITOM(1));
137 return 0;
138}
139
140
150{
151#ifdef SO3_DEBUG
152 MMechostr(MSKDEBUG, "SO3VirtualPointerGetMaxLength\n");
153#endif
154
155 int obj = MMget(m, 0);
156 if (obj == NIL)
157 {
158 MMset(m, 0, NIL);
159 return 0;
160 }
161
162 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
163 if (node == 0)
164 {
165 MMset(m, 0, NIL);
166 return 0;
167 }
168
169 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
170 {
171 MMset(m, 0, NIL);
172 return 0;
173 }
174
175 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
176 float f = virtualPointer->GetMaxLength();
177 MMset(m, 0, FTOM(f));
178 return 0;
179}
180
181
192{
193#ifdef SO3_DEBUG
194 MMechostr(MSKDEBUG, "SO3VirtualPointerSetEnable\n");
195#endif
196
197 int state = MMpull(m);
198 int obj = MMget(m, 0);
199
200 if (obj == NIL)
201 {
202 MMset(m, 0, NIL);
203 return 0;
204 }
205
206 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
207 if (node == 0)
208 {
209 MMset(m, 0, NIL);
210 return 0;
211 }
212
213 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
214 {
215 MMset(m, 0, NIL);
216 return 0;
217 }
218
219 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
220 virtualPointer->SetEnable((MTOI(state) > 0) ? true : false);
221 MMset(m, 0, ITOM(1));
222 return 0;
223}
224
225
235{
236#ifdef SO3_DEBUG
237 MMechostr(MSKDEBUG, "SO3VirtualPointerGetEnable\n");
238#endif
239
240 int obj = MMget(m, 0);
241 if (obj == NIL)
242 {
243 MMset(m, 0, NIL);
244 return 0;
245 }
246
247 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
248 if (node == 0)
249 {
250 MMset(m, 0, NIL);
251 return 0;
252 }
253
254 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
255 {
256 MMset(m, 0, NIL);
257 return 0;
258 }
259
260 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
261 MMset(m, 0, ITOM((virtualPointer->GetEnable()) ? 1 : 0));
262 return 0;
263}
264
265
276{
277#ifdef SO3_DEBUG
278 MMechostr(MSKDEBUG, "SO3VirtualPointerSetRayCastMode\n");
279#endif
280
281 int imode = MMpull(m);
282 int obj = MMget(m, 0);
283
284 if (obj == NIL)
285 {
286 MMset(m, 0, NIL);
287 return 0;
288 }
289
290 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
291 if (node == 0)
292 {
293 MMset(m, 0, NIL);
294 return 0;
295 }
296
297 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
298 {
299 MMset(m, 0, NIL);
300 return 0;
301 }
302
303 SWindow::SelectorMode mode = SWindow::SO3_SELECTOR_FAST;
304 if ((imode != NIL) && (MTOI(imode) >= 0) && (MTOI(imode) < 3))
305 mode = static_cast<SWindow::SelectorMode>(MTOI(imode));
306
307 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
308 virtualPointer->SetSelectorMode(mode);
309
310 return 0;
311}
312
313
323{
324#ifdef SO3_DEBUG
325 MMechostr(MSKDEBUG, "SO3VirtualPointerUpdate\n");
326#endif
327
328 int obj = MMget(m, 0);
329 if (obj == NIL)
330 {
331 MMset(m, 0, NIL);
332 return 0;
333 }
334
335 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
336 if (node == 0)
337 {
338 MMset(m, 0, NIL);
339 return 0;
340 }
341
342 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
343 {
344 MMset(m, 0, NIL);
345 return 0;
346 }
347
348 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
349 if (!virtualPointer->GetEnable())
350 {
351 MMset(m, 0, NIL);
352 return 0;
353 }
354
355 virtualPointer->Update();
356 MMset(m, 0, ITOM(1));
357 return 0;
358}
359
360
371{
372#ifdef SO3_DEBUG
373 MMechostr(MSKDEBUG, "SO3VirtualPointerSendClick\n");
374#endif
375
376 int btn = MTOI(MMpull(m));
377 int obj = MMget(m, 0);
378 if ((obj == NIL) || (btn == NIL))
379 {
380 MMset(m, 0, NIL);
381 return 0;
382 }
383
384 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
385 if (node == 0)
386 {
387 MMset(m, 0, NIL);
388 return 0;
389 }
390
391 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
392 {
393 MMset(m, 0, NIL);
394 return 0;
395 }
396
397 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
398 if (!virtualPointer->GetEnable())
399 {
400 MMset(m, 0, NIL);
401 return 0;
402 }
403
404 virtualPointer->Click((MouseButtonId)btn);
405 MMset(m, 0, ITOM(1));
406
407 return 0;
408}
409
410
421{
422#ifdef SO3_DEBUG
423 MMechostr(MSKDEBUG, "SO3VirtualPointerSendUnClick\n");
424#endif
425
426 int btn = MTOI(MMpull(m));
427 int obj = MMget(m, 0);
428 if ((obj == NIL) || (btn == NIL))
429 {
430 MMset(m, 0, NIL);
431 return 0;
432 }
433
434 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
435 if (node == 0)
436 {
437 MMset(m, 0, NIL);
438 return 0;
439 }
440
441 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
442 {
443 MMset(m, 0, NIL);
444 return 0;
445 }
446
447 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
448 if (!virtualPointer->GetEnable())
449 {
450 MMset(m, 0, NIL);
451 return 0;
452 }
453
454 virtualPointer->UnClick((MouseButtonId)btn);
455 MMset(m, 0, ITOM(1));
456
457 return 0;
458}
459
460
471{
472#ifdef SO3_DEBUG
473 MMechostr(MSKDEBUG, "SO3VirtualPointerSendWheel\n");
474#endif
475
476 int delta = MTOI(MMpull(m));
477 int obj = MMget(m, 0);
478 if ((obj == NIL) || (delta == NIL))
479 {
480 MMset(m, 0, NIL);
481 return 0;
482 }
483
484 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
485 if (node == 0)
486 {
487 MMset(m, 0, NIL);
488 return 0;
489 }
490
491 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
492 {
493 MMset(m, 0, NIL);
494 return 0;
495 }
496
497 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
498 if (!virtualPointer->GetEnable())
499 {
500 MMset(m, 0, NIL);
501 return 0;
502 }
503
504 virtualPointer->Wheel(delta);
505 MMset(m, 0, ITOM(1));
506
507 return 0;
508}
509
510
521{
522#ifdef SO3_DEBUG
523 MMechostr(MSKDEBUG, "SO3VirtualPointerSendMove\n");
524#endif
525
526 int btn = MTOI(MMpull(m));
527 int obj = MMget(m, 0);
528 if ((obj == NIL) || (btn == NIL))
529 {
530 MMset(m, 0, NIL);
531 return 0;
532 }
533
534 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
535 if (node == 0)
536 {
537 MMset(m, 0, NIL);
538 return 0;
539 }
540
541 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
542 {
543 MMset(m, 0, NIL);
544 return 0;
545 }
546
547 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
548 if (!virtualPointer->GetEnable())
549 {
550 MMset(m, 0, NIL);
551 return 0;
552 }
553
554 virtualPointer->MoveCursor((MouseButtonId)btn);
555 MMset(m, 0, ITOM(1));
556
557 return 0;
558}
559
560
570{
571#ifdef SO3_DEBUG
572 MMechostr(MSKDEBUG, "SO3VirtualPointerHasWidgetUnder\n");
573#endif
574
575 int obj = MMget(m, 0);
576 if (obj == NIL)
577 {
578 MMset(m, 0, NIL);
579 return 0;
580 }
581
582 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
583 if (node == 0)
584 {
585 MMset(m, 0, NIL);
586 return 0;
587 }
588
589 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
590 {
591 MMset(m, 0, NIL);
592 return 0;
593 }
594
595 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
596 if (!virtualPointer->GetEnable())
597 {
598 MMset(m, 0, NIL);
599 return 0;
600 }
601
602 MMset(m, 0, ITOM(virtualPointer->HasWidgetUnder() ? 1 : 0));
603
604 return 0;
605}
606
607
617{
618#ifdef SO3_DEBUG
619 MMechostr(MSKDEBUG, "SO3VirtualPointerGetId\n");
620#endif
621
622 int obj = MMget(m, 0);
623 if (obj == NIL)
624 {
625 MMset(m, 0, NIL);
626 return 0;
627 }
628
629 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
630 if (node == 0)
631 {
632 MMset(m, 0, NIL);
633 return 0;
634 }
635
636 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
637 {
638 MMset(m, 0, NIL);
639 return 0;
640 }
641
642 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
643 if (!virtualPointer->GetEnable())
644 {
645 MMset(m, 0, NIL);
646 return 0;
647 }
648
649 MMset(m, 0, ITOM(virtualPointer->GetID()));
650
651 return 0;
652}
653
654
664{
665#ifdef SO3_DEBUG
666 MMechostr(MSKDEBUG, "SO3VirtualPointerGetlength\n");
667#endif
668
669 int obj = MMget(m, 0);
670 if (obj == NIL)
671 {
672 MMset(m, 0, NIL);
673 return 0;
674 }
675
676 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
677 if (node == 0)
678 {
679 MMset(m, 0, NIL);
680 return 0;
681 }
682
683 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
684 {
685 MMset(m, 0, NIL);
686 return 0;
687 }
688
689 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
690 if (!virtualPointer->GetEnable())
691 {
692 MMset(m, 0, NIL);
693 return 0;
694 }
695
696 MMset(m, 0, FTOM(virtualPointer->GetLength()));
697
698 return 0;
699}
700
701
711{
712#ifdef SO3_DEBUG
713 MMechostr(MSKDEBUG, "SO3VirtualPointerGetTargetPosition\n");
714#endif
715
716 int obj = MMget(m, 0);
717 if (obj == NIL)
718 {
719 MMset(m, 0, NIL);
720 return 0;
721 }
722
723 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
724 if (node == 0)
725 {
726 MMset(m, 0, NIL);
727 return 0;
728 }
729
730 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
731 {
732 MMset(m, 0, NIL);
733 return 0;
734 }
735
736 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
737 if (!virtualPointer->GetEnable())
738 {
739 MMset(m, 0, NIL);
740 return 0;
741 }
742
743 Ogre::Vector3 pos = virtualPointer->GetTargetPosition();
744 int tuple = MMmalloc(m, 3, TYPETAB);
745 if (tuple == NIL)
746 {
747 MMset(m, 0, NIL);
748 return MERRMEM;
749 }
750
751 MMstore(m, tuple, 0, FTOM((pos.x)));
752 MMstore(m, tuple, 1, FTOM((pos.y)));
753 MMstore(m, tuple, 2, FTOM((pos.z)));
754 MMset(m, 0, PTOM(tuple));
755
756 return 0;
757}
758
759
769{
770#ifdef SO3_DEBUG
771 MMechostr(MSKDEBUG, "SO3VirtualPointerGetSelectedEntityName\n");
772#endif
773
774 int obj = MMget(m, 0);
775 if (obj == NIL)
776 {
777 MMset(m, 0, NIL);
778 return 0;
779 }
780
781 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
782 if (node == 0)
783 {
784 MMset(m, 0, NIL);
785 return 0;
786 }
787
788 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
789 {
790 MMset(m, 0, NIL);
791 return 0;
792 }
793
794 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
795 if (!virtualPointer->GetEnable())
796 {
797 MMset(m, 0, NIL);
798 return 0;
799 }
800
801 SEntity* entity = virtualPointer->GetSelectedObject();
802 if (entity == 0)
803 {
804 MMset(m, 0, NIL);
805 return 0;
806 }
807
808 MMpull(m);
809 Mpushstrbloc(m, entity->GetName().c_str());
810
811 return 0;
812}
813
814
824{
825#ifdef SO3_DEBUG
826 MMechostr(MSKDEBUG, "SO3VirtualPointerGetSelectedMaterialName\n");
827#endif
828
829 int obj = MMget(m, 0);
830 if (obj == NIL)
831 {
832 MMset(m, 0, NIL);
833 return 0;
834 }
835
836 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
837 if (node == 0)
838 {
839 MMset(m, 0, NIL);
840 return 0;
841 }
842
843 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
844 {
845 MMset(m, 0, NIL);
846 return 0;
847 }
848
849 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
850 if (!virtualPointer->GetEnable())
851 {
852 MMset(m, 0, NIL);
853 return 0;
854 }
855
856 SMaterial* mat = virtualPointer->GetSelectedMaterial();
857 if (mat == 0)
858 {
859 MMset(m, 0, NIL);
860 return 0;
861 }
862
863 MMpull(m);
864 Mpushstrbloc(m, mat->GetName().c_str());
865
866 return 0;
867}
868
869
886{
887#ifdef SO3_DEBUG
888 MMechostr(MSKDEBUG, "SO3VirtualPointerGetRayInfos\n");
889#endif
890
891 int obj = MMget(m, 0);
892 if (obj == NIL)
893 {
894 MMset(m, 0, NIL);
895 return 0;
896 }
897
898 SNode* node = MMgetPointer<SNode*>(m, MTOP(obj));
899 if (node == 0)
900 {
901 MMset(m, 0, NIL);
902 return 0;
903 }
904
905 if (node->GetNodeType() != SNode::VIRTUAL_POINTER_TYPE_ID)
906 {
907 MMset(m, 0, NIL);
908 return 0;
909 }
910
911 SVirtualPointer* virtualPointer = static_cast<SVirtualPointer*>(node);
912 if (!virtualPointer->GetEnable())
913 {
914 MMset(m, 0, NIL);
915 return 0;
916 }
917
918 const SRaycastResult& lastRaycast = virtualPointer->GetRaycastResult();
919 if (lastRaycast.entity == 0)
920 {
921 MMset(m, 0, NIL);
922 return 0;
923 }
924
925 // push Scene
926 int s = OBJfindTH(m, SO3SCENETYPE, SCOL_PTR(lastRaycast.entity->GetParentScene()));
927 if (s != NIL)
928 s = MMfetch(m, s, OFFOBJMAG);
929 if (MMpush(m, s))
930 return MERRMEM;
931
932 //push entity
933 int n = OBJfindTH(m, SO3OBJTYPE, SCOL_PTR(lastRaycast.entity));
934 if (n != NIL)
935 n = MMfetch(m, n, OFFOBJMAG);
936 if (MMpush(m, n))
937 return MERRMEM;
938
939 //push material
940 createOrRetrieveScolMaterialAndSendToVM(m, lastRaycast.scene, lastRaycast.material);
941
942 // push sub entity index
943 if (MMpush(m, ITOM(lastRaycast.indexSubEntity)))
944 return MERRMEM;
945
946 // Coordinate of the intersection point
947 int inter = MMmalloc(m, 3, TYPETAB);
948 if (inter == NIL)
949 {
950 SEDROP(m, 4);
951 MMset(m, 0, NIL);
952 return MERRMEM;
953 }
954 MMstore(m, inter, 0, FTOM(lastRaycast.point.x));
955 MMstore(m, inter, 1, FTOM(lastRaycast.point.y));
956 MMstore(m, inter, 2, FTOM(lastRaycast.point.z));
957
958 if (MMpush(m, PTOM(inter)))
959 return MERRMEM;
960
961 // UV coordinates of the intersection point
962 int uvf = MMmalloc(m, 2, TYPETAB);
963 if (uvf == NIL)
964 {
965 SEDROP(m, 5);
966 MMset(m, 0, NIL);
967 return MERRMEM;
968 }
969 MMstore(m, uvf, 0, FTOM(lastRaycast.uvResult.x));
970 MMstore(m, uvf, 1, FTOM(lastRaycast.uvResult.y));
971 if (MMpush(m, PTOM(uvf)))
972 return MERRMEM;
973
974 // distance
975 if (MMpush(m, FTOM(lastRaycast.closestDistance)))
976 return MERRMEM;
977
978 int finaltuple = MMmalloc(m, 7, TYPETAB);
979 if (finaltuple == NIL)
980 {
981 SEDROP(m, 6);
982 MMset(m, 0, NIL);
983 return MERRMEM;
984 }
985
986 MMstore(m, finaltuple, 6, MMpull(m));
987 MMstore(m, finaltuple, 5, MMpull(m));
988 MMstore(m, finaltuple, 4, MMpull(m));
989 MMstore(m, finaltuple, 3, MMpull(m));
990 MMstore(m, finaltuple, 2, MMpull(m));
991 MMstore(m, finaltuple, 1, MMpull(m));
992 MMstore(m, finaltuple, 0, MMpull(m));
993 MMset(m, 0, PTOM(finaltuple));
994
995 return 0;
996}
997
998
999NativeDefinition natSO3Vpointer[] = {
1000 { "SO3VirtualPointerCreate", 2, "fun [SO3_SCENE S] SO3_OBJECT", SO3VirtualPointerCreate },
1001 { "SO3VirtualPointerSetMaxLength", 2, "fun [SO3_OBJECT F] I", SO3VirtualPointerSetMaxLength },
1002 { "SO3VirtualPointerGetMaxLength", 1, "fun [SO3_OBJECT] F", SO3VirtualPointerGetMaxLength },
1003 { "SO3VirtualPointerSetEnable", 2, "fun [SO3_OBJECT I] I", SO3VirtualPointerSetEnable },
1004 { "SO3VirtualPointerGetEnable", 1, "fun [SO3_OBJECT] I", SO3VirtualPointerGetEnable },
1005 { "SO3VirtualPointerSetRayCastMode", 2, "fun [SO3_OBJECT I] SO3_OBJECT", SO3VirtualPointerSetRayCastMode },
1006 { "SO3VirtualPointerUpdate", 1, "fun [SO3_OBJECT] I", SO3VirtualPointerUpdate },
1007 { "SO3VirtualPointerSendClick", 2, "fun [SO3_OBJECT I] I", SO3VirtualPointerSendClick },
1008 { "SO3VirtualPointerSendUnClick", 2, "fun [SO3_OBJECT I] I", SO3VirtualPointerSendUnClick },
1009 { "SO3VirtualPointerSendMove", 2, "fun [SO3_OBJECT I] I", SO3VirtualPointerSendMove },
1010 { "SO3VirtualPointerSendWheel", 2, "fun [SO3_OBJECT I] I", SO3VirtualPointerSendWheel },
1011 { "SO3VirtualPointerHasWidgetUnder", 1, "fun [SO3_OBJECT] I", SO3VirtualPointerHasWidgetUnder },
1012 { "SO3VirtualPointerGetId", 1, "fun [SO3_OBJECT] I", SO3VirtualPointerGetId },
1013 { "SO3VirtualPointerGetlength", 1, "fun [SO3_OBJECT] F", SO3VirtualPointerGetlength },
1014 { "SO3VirtualPointerGetTargetPosition", 1, "fun [SO3_OBJECT] [F F F]", SO3VirtualPointerGetTargetPosition },
1015 { "SO3VirtualPointerGetSelectedEntityName", 1, "fun [SO3_OBJECT] S", SO3VirtualPointerGetSelectedEntityName },
1016 { "SO3VirtualPointerGetSelectedMaterialName", 1, "fun [SO3_OBJECT] S", SO3VirtualPointerGetSelectedMaterialName },
1017 { "SO3VirtualPointerGetRayInfos", 1, "fun [SO3_OBJECT] [SO3_SCENE SO3_OBJECT SO3_MATERIAL I [F F F] [F F] F]", SO3VirtualPointerGetRayInfos }
1018};
1019
1020
1021
1027int SCOLloadVirtualPointer(mmachine m, cbmachine w)
1028{
1029 return PKhardpak2(m, "SO3Vpointer.pkg", sizeof(natSO3Vpointer) / sizeof(natSO3Vpointer[0]), natSO3Vpointer);
1030}
1031
1032
1038{
1039 return 0;
1040}
NativeDefinition natSO3Vpointer[]
int SCOLfreeVirtualPointer()
free the SO3Engine Viewport function
int SCOLloadVirtualPointer(mmachine m, cbmachine w)
Load the SO3Engine Viewport function.
MMechostr(MSKDEBUG, " > Start loading Plugin SO3Engine dll\n")
SCOL_EXPORT int cbmachine w
Definition SO3SCOL.cpp:5150
int SO3SCENETYPE
Definition SO3SCOL.cpp:88
int SO3OBJTYPE
Definition SO3SCOL.cpp:90
int createOrRetrieveScolMaterialAndSendToVM(mmachine m, SScene *scene, SMaterial *mat)
int createObject(mmachine m, SNode *curNode, SScene *curScene)
int SO3VirtualPointerSendMove(mmachine m)
SO3VirtualPointerSendMove : Send a virtual pointer move.
int SO3VirtualPointerHasWidgetUnder(mmachine m)
SO3VirtualPointerHasWidgetUnder : Return if a widget have been hit by the raycast.
int SO3VirtualPointerGetSelectedEntityName(mmachine m)
SO3VirtualPointerGetSelectedEntityName : Return the last entity name found in ray.
int SO3VirtualPointerSetEnable(mmachine m)
SO3VirtualPointerSetEnable : Enable or disable the virtual pointer.
int SO3VirtualPointerSendUnClick(mmachine m)
SO3VirtualPointerSendUnClick : Send a virtual pointer unclick.
int SO3VirtualPointerCreate(mmachine m)
main include
int SO3VirtualPointerGetSelectedMaterialName(mmachine m)
SO3VirtualPointerGetSelectedMaterialName : Return the last material name found in ray.
int SO3VirtualPointerGetTargetPosition(mmachine m)
SO3VirtualPointerGetTargetPosition : Return the last ray length.
int SO3VirtualPointerGetMaxLength(mmachine m)
SO3VirtualPointerGetMaxLength : Get the virtual pointer max length.
int SO3VirtualPointerGetId(mmachine m)
SO3VirtualPointerGetId : Return the virtual pointer id.
int SO3VirtualPointerSendClick(mmachine m)
SO3VirtualPointerSendClick : Send a virtual pointer click.
int SO3VirtualPointerGetEnable(mmachine m)
SO3VirtualPointerGetEnable : Get the virtual pointer active state.
int SO3VirtualPointerUpdate(mmachine m)
SO3VirtualPointerUpdate : Update virtual pointer raycast.
int SO3VirtualPointerSetMaxLength(mmachine m)
SO3VirtualPointerSetMaxLength : defines the max raycast length.
int SO3VirtualPointerGetlength(mmachine m)
SO3VirtualPointerGetlength : Return the last ray length.
int SO3VirtualPointerSetRayCastMode(mmachine m)
SO3VirtualPointerSetRayCastMode : Set the virtual pointer raycast mode.
int SO3VirtualPointerGetRayInfos(mmachine m)
SO3VirtualPointerGetRayInfos : Return the last ray infos.
int SO3VirtualPointerSendWheel(mmachine m)
SO3VirtualPointerSendWheel : Send a virtual pointer wheel.