Project

General

Profile

SO3Engine
SCOLCamera.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) 2012 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// Material includes
38
39// Renderer includes
41
42// Scene Graph includes
46
56int SO3CameraCreate(mmachine m)
57{
58#ifdef SO3_DEBUG
59 MMechostr(MSKDEBUG, "SO3CameraCreate\n");
60#endif
61 int name = MMpull(m);
62 int s = MMget(m, 0);
63 if (s==NIL)
64 {
65 MMset(m, 0, NIL);
66 return 0;
67 }
68
69 SScene* scene = MMgetPointer<SScene*>(m, MTOP(s));
70 if (scene==NULL)
71 {
72 MMset(m, 0, NIL);
73 return 0;
74 }
75
76 // Create Node
77 std::string tmpCameraName(MMstartstr(m, MTOP(name)));
78 SCamera* cam = 0;
79 try
80 {
81 cam = scene->CreateCamera(tmpCameraName);
82 }
83 catch(Ogre::Exception &e)
84 {
85 MMechostr(MSKDEBUG,"An exception has occurred : %s\n",e.what());
86 MMset(m, 0, NIL);
87 return 0;
88 }
89
90 // remove last param
91 MMpull(m);
92 return createObject(m, cam, scene);
93}
94
95
105int SO3CameraLookAt(mmachine m)
106{
107#ifdef SO3_DEBUG
108 MMechostr(MSKDEBUG, "SO3CameraLookAt\n");
109#endif
110
111 int vec = MMpull(m);
112 int cam = MMget(m, 0);
113 if((cam==NIL)||(vec==NIL))
114 {
115 MMset(m, 0, NIL);
116 return 0;
117 }
118
119 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
120 if(node == 0)
121 {
122 MMset(m, 0, NIL);
123 return 0;
124 }
125
126 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
127 {
128 MMset(m, 0, NIL);
129 return 0;
130 }
131
132 SCamera* camera = static_cast<SCamera*>(node);
133
134 if((MMfetch(m,MTOP(vec),0)==NIL) || (MMfetch(m,MTOP(vec),1)==NIL) || (MMfetch(m,MTOP(vec),2)==NIL))
135 {
136 MMset(m, 0, NIL);
137 return 0;
138 }
139
140 Ogre::Vector3 vecteur(MTOF(MMfetch(m, MTOP(vec), 0)),
141 MTOF(MMfetch(m, MTOP(vec), 1)),
142 MTOF(MMfetch(m, MTOP(vec), 2)));
143
144 camera->LookAt(vecteur, SNode::SO3_WORLD_TS, Ogre::Vector3::NEGATIVE_UNIT_Z);
145
146 MMset(m, 0, ITOM(1));
147
148 return 0;
149}
150
151
161{
162#ifdef SO3_DEBUG
163 MMechostr(MSKDEBUG, "SO3CameraGetDirection\n");
164#endif
165
166 int cam = MMget(m, 0);
167 if(cam==NIL)
168 {
169 MMset(m, 0, NIL);
170 return 0;
171 }
172
173 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
174 if(node == 0)
175 {
176 MMset(m, 0, NIL);
177 return 0;
178 }
179
180 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
181 {
182 MMset(m, 0, NIL);
183 return 0;
184 }
185
186 SCamera* camera = static_cast<SCamera*>(node);
187
188 // TODO: GetDirection in SNode or SCamera
189 Ogre::Vector3 dirvec(camera->GetDirection());
190 int tuple = MMmalloc(m, 3, TYPETAB);
191 if(tuple==NIL)
192 {
193 MMset(m, 0, NIL);
194 return MERRMEM;
195 }
196
197 MMstore(m, tuple, 0, FTOM((dirvec.x)));
198 MMstore(m, tuple, 1, FTOM((dirvec.y)));
199 MMstore(m, tuple, 2, FTOM((dirvec.z)));
200 MMset(m, 0, PTOM(tuple));
201
202 return 0;
203}
204
205
215{
216#ifdef SO3_DEBUG
217 MMechostr(MSKDEBUG, "SO3CameraGetDerivedDirection\n");
218#endif
219
220 int cam = MMget(m, 0);
221 if(cam==NIL)
222 {
223 MMset(m, 0, NIL);
224 return 0;
225 }
226
227 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
228 if(node == 0)
229 {
230 MMset(m, 0, NIL);
231 return 0;
232 }
233
234 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
235 {
236 MMset(m, 0, NIL);
237 return 0;
238 }
239
240 SCamera* camera = static_cast<SCamera*>(node);
241
242 Ogre::Vector3 vecteur(camera->GetDirection(true));
243 int tuple = MMmalloc(m, 3, TYPETAB);
244 if(tuple==NIL)
245 {
246 MMset(m, 0, NIL);
247 return MERRMEM;
248 }
249
250 MMstore(m, tuple, 0, FTOM((vecteur.x)));
251 MMstore(m, tuple, 1, FTOM((vecteur.y)));
252 MMstore(m, tuple, 2, FTOM((vecteur.z)));
253 MMset(m, 0, PTOM(tuple));
254
255 return 0;
256}
257
258
268{
269#ifdef SO3_DEBUG
270 MMechostr(MSKDEBUG, "SO3CameraGetDerivedUp\n");
271#endif
272
273 int cam = MMget(m, 0);
274 if(cam==NIL)
275 {
276 MMset(m, 0, NIL);
277 return 0;
278 }
279
280 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
281 if(node == 0)
282 {
283 MMset(m, 0, NIL);
284 return 0;
285 }
286
287 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
288 {
289 MMset(m, 0, NIL);
290 return 0;
291 }
292
293 SCamera* camera = static_cast<SCamera*>(node);
294
295 // TODO function in SNode or SCamera
296 Ogre::Vector3 vecteur(camera->GetOgreCameraPointer()->getDerivedUp());
297 int tuple = MMmalloc(m, 3, TYPETAB);
298 if(tuple==NIL)
299 {
300 MMset(m, 0, NIL);
301 return MERRMEM;
302 }
303
304 MMstore(m, tuple, 0, FTOM((vecteur.x)));
305 MMstore(m, tuple, 1, FTOM((vecteur.y)));
306 MMstore(m, tuple, 2, FTOM((vecteur.z)));
307 MMset(m, 0, PTOM(tuple));
308
309 return 0;
310}
311
321{
322#ifdef SO3_DEBUG
323 MMechostr(MSKDEBUG, "SO3CameraGetTriangleCount\n");
324#endif
325
326 int cam = MMget(m, 0);
327 if (cam == NIL)
328 {
329 MMset(m, 0, NIL);
330 return 0;
331 }
332
333 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
334 if (node == 0)
335 {
336 MMset(m, 0, NIL);
337 return 0;
338 }
339
340 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
341 {
342 MMset(m, 0, NIL);
343 return 0;
344 }
345
346 SCamera* camera = static_cast<SCamera*>(node);
347 MMset(m, 0, ITOM(camera->GetNumRenderedFaces()));
348
349 return 0;
350}
351
361{
362#ifdef SO3_DEBUG
363 MMechostr(MSKDEBUG, "SO3CameraGetBatchCount\n");
364#endif
365
366 int cam = MMget(m, 0);
367 if (cam == NIL)
368 {
369 MMset(m, 0, NIL);
370 return 0;
371 }
372
373 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
374 if (node == 0)
375 {
376 MMset(m, 0, NIL);
377 return 0;
378 }
379
380 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
381 {
382 MMset(m, 0, NIL);
383 return 0;
384 }
385
386 SCamera* camera = static_cast<SCamera*>(node);
387 MMset(m, 0, ITOM(camera->GetNumRenderedBatches()));
388
389 return 0;
390}
391
401int SO3CameraSetViewport(mmachine m)
402{
403#ifdef SO3_DEBUG
404 MMechostr(MSKDEBUG, "SO3CameraSetViewport\n");
405#endif
406
407 // secure method to get the scol object since the ptr can be valid in the scol var but no more in scol tape
408 //int cam = OBJfindTM(m, MMpull(m), SO3OBJTYPE);
409 int cam = MMpull(m);
410 int vp = MMget(m, 0);
411
412 if((vp==NIL)||(cam==NIL))
413 {
414 MMset(m, 0, NIL);
415 return 0;
416 }
417
418 SViewPort* viewport = MMgetPointer<SViewPort*>(m, MTOP(vp));
419 if(viewport==NULL)
420 {
421 MMechostr(MSKDEBUG,"vp is NULL \n");
422 MMset(m, 0, NIL);
423 return 0;
424 }
425
426 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
427 if(node == 0)
428 {
429 MMset(m, 0, NIL);
430 return 0;
431 }
432
433 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
434 {
435 MMset(m, 0, NIL);
436 return 0;
437 }
438
439 SCamera* camera = static_cast<SCamera*>(node);
440 viewport->SetCamera(camera);
441
442 MMset(m, 0, ITOM(1));
443 return 0;
444}
445
446
457{
458#ifdef SO3_DEBUG
459 MMechostr(MSKDEBUG, "SO3CameraSetFocalLength\n");
460#endif
461
462 int f = MMpull(m);
463 int cam = MMget(m, 0);
464
465 if((cam==NIL)||(f==NIL))
466 {
467 MMset(m, 0, NIL);
468 return 0;
469 }
470
471 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
472 if(node == 0)
473 {
474 MMset(m, 0, NIL);
475 return 0;
476 }
477
478 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
479 {
480 MMset(m, 0, NIL);
481 return 0;
482 }
483
484 SCamera* camera = static_cast<SCamera*>(node);
485 if(MTOF(f)==0.0)
486 {
487 MMset(m, 0, NIL);
488 return 0;
489 }
490
491 camera->SetFocalLength(MTOF(f));
492 MMset(m, 0, ITOM(1));
493 return 0;
494}
495
496
506{
507#ifdef SO3_DEBUG
508 MMechostr(MSKDEBUG, "SO3CameraGetFocalLength\n");
509#endif
510
511 int cam = MMget(m, 0);
512 if(cam==NIL)
513 {
514 MMset(m, 0, NIL);
515 return 0;
516 }
517
518 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
519 if(node == 0)
520 {
521 MMset(m, 0, NIL);
522 return 0;
523 }
524
525 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
526 {
527 MMset(m, 0, NIL);
528 return 0;
529 }
530
531 SCamera* camera = static_cast<SCamera*>(node);
532 float f = camera->GetFocalLength();
533 MMset(m, 0, FTOM(f));
534 return 0;
535}
536
537
547int SO3CameraSetFOVy(mmachine m)
548{
549#ifdef SO3_DEBUG
550 MMechostr(MSKDEBUG, "SO3CameraSetFOVy\n");
551#endif
552
553 int fovy = MMpull(m);
554 int cam = MMget(m, 0);
555 if((cam==NIL)||(fovy==NIL))
556 {
557 MMset(m, 0, NIL);
558 return 0;
559 }
560
561 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
562 if(node == 0)
563 {
564 MMset(m, 0, NIL);
565 return 0;
566 }
567
568 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
569 {
570 MMset(m, 0, NIL);
571 return 0;
572 }
573
574 SCamera* camera = static_cast<SCamera*>(node);
575 camera->SetFOVy(MTOF(fovy));
576 MMset(m, 0, ITOM(1));
577 return 0;
578}
579
580
590int SO3CameraSetLODbias(mmachine m)
591{
592#ifdef SO3_DEBUG
593 MMechostr(MSKDEBUG, "SO3CameraSetLODbias\n");
594#endif
595
596 int ibias = MMpull(m);
597 int cam = MMget(m, 0);
598 if (cam == NIL)
599 {
600 MMset(m, 0, NIL);
601 return 0;
602 }
603
604 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
605 if (node == 0)
606 {
607 MMset(m, 0, NIL);
608 return 0;
609 }
610
611 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
612 {
613 MMset(m, 0, NIL);
614 return 0;
615 }
616
617 SCamera* camera = static_cast<SCamera*>(node);
618
619 float bias = 1.0f;
620 if (ibias != NIL)
621 bias = MTOF(ibias);
622
623 if (bias <= 0.0f)
624 {
625 MMset(m, 0, NIL);
626 return 0;
627 }
628
629 camera->SetLODbias(bias);
630
631 MMset(m, 0, ITOM(1));
632 return 0;
633}
634
645{
646#ifdef SO3_DEBUG
647 MMechostr(MSKDEBUG, "SO3CameraSetAspectRatio\n");
648#endif
649
650 int ratio = MMpull(m);
651 int cam = MMget(m, 0);
652 if((cam==NIL)||(ratio==NIL))
653 {
654 MMset(m, 0, NIL);
655 return 0;
656 }
657
658 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
659 if(node == 0)
660 {
661 MMset(m, 0, NIL);
662 return 0;
663 }
664
665 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
666 {
667 MMset(m, 0, NIL);
668 return 0;
669 }
670
671 SCamera* camera = static_cast<SCamera*>(node);
672 camera->SetAspectRatio(MTOF(ratio));
673 MMset(m, 0, ITOM(1));
674 return 0;
675}
676
686{
687#ifdef SO3_DEBUG
688 MMechostr(MSKDEBUG, "SO3CameraGetAspectRatio\n");
689#endif
690
691 int cam = MMget(m, 0);
692 if (cam==NIL)
693 {
694 MMset(m, 0, NIL);
695 return 0;
696 }
697
698 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
699 if(node == 0)
700 {
701 MMset(m, 0, NIL);
702 return 0;
703 }
704
705 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
706 {
707 MMset(m, 0, NIL);
708 return 0;
709 }
710
711 SCamera* camera = static_cast<SCamera*>(node);
712 MMset(m, 0, FTOM(camera->GetAspectRatio()));
713 return 0;
714}
715
726{
727#ifdef SO3_DEBUG
728 MMechostr(MSKDEBUG, "SO3CameraSetAutoAspectRatio\n");
729#endif
730
731 int istate = MMpull(m);
732 int cam = MMget(m, 0);
733 if (cam==NIL)
734 {
735 MMset(m, 0, NIL);
736 return 0;
737 }
738
739 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
740 if(node == 0)
741 {
742 MMset(m, 0, NIL);
743 return 0;
744 }
745
746 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
747 {
748 MMset(m, 0, NIL);
749 return 0;
750 }
751
752 bool state = false;
753 if (istate != NIL && ITOM(istate) >= 0)
754 state = true;
755
756 SCamera* camera = static_cast<SCamera*>(node);
757 camera->SetAutoAspectRatio(state);
758
759 MMset(m, 0, ITOM(1));
760 return 0;
761}
762
763
775{
776#ifdef SO3_DEBUG
777 MMechostr(MSKDEBUG, "SO3CameraSetFrustumOffset\n");
778#endif
779
780 int yoffest = MMpull(m);
781 int xoffest = MMpull(m);
782 int cam = MMget(m, 0);
783 if (cam==NIL)
784 {
785 MMset(m, 0, NIL);
786 return 0;
787 }
788
789 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
790 if(node == 0)
791 {
792 MMset(m, 0, NIL);
793 return 0;
794 }
795
796 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
797 {
798 MMset(m, 0, NIL);
799 return 0;
800 }
801
802 SCamera* camera = static_cast<SCamera*>(node);
803
804 float x = 0.0f;
805 if (xoffest != NIL)
806 x = MTOF(xoffest);
807 float y = 0.0f;
808 if (yoffest != NIL)
809 y = MTOF(yoffest);
810
811 camera->SetFrustumOffset(x, y);
812 MMset(m, 0, ITOM(1));
813 return 0;
814}
815
825{
826#ifdef SO3_DEBUG
827 MMechostr(MSKDEBUG, "SO3CameraGetFrustumOffset\n");
828#endif
829
830 int cam = MMget(m, 0);
831 if (cam==NIL)
832 {
833 MMset(m, 0, NIL);
834 return 0;
835 }
836
837 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
838 if(node == 0)
839 {
840 MMset(m, 0, NIL);
841 return 0;
842 }
843
844 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
845 {
846 MMset(m, 0, NIL);
847 return 0;
848 }
849
850 SCamera* camera = static_cast<SCamera*>(node);
851 Ogre::Vector2 offset = camera->GetFrustumOffset();
852
853 int tuple = MMmalloc(m, 2, TYPETAB);
854 if(tuple==NIL)
855 {
856 MMset(m, 0, NIL);
857 return MERRMEM;
858 }
859
860 MMstore(m, tuple, 0, FTOM(offset.x));
861 MMstore(m, tuple, 1, FTOM(offset.y));
862 MMset(m, 0, PTOM(tuple));
863
864 return 0;
865}
866
875int SO3CameraGetFOVy(mmachine m)
876{
877#ifdef SO3_DEBUG
878 MMechostr(MSKDEBUG, "SO3CameraGetFOVy\n");
879#endif
880
881 int cam = MMget(m, 0);
882 if(cam==NIL)
883 {
884 MMset(m, 0, NIL);
885 return 0;
886 }
887
888 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
889 if(node == 0)
890 {
891 MMset(m, 0, NIL);
892 return 0;
893 }
894
895 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
896 {
897 MMset(m, 0, NIL);
898 return 0;
899 }
900
901 SCamera* camera = static_cast<SCamera*>(node);
902 float fovy = camera->GetFOVy();
903 MMset(m, 0, FTOM(fovy));
904 return 0;
905}
906
907
916int SO3CameraGetLODbias(mmachine m)
917{
918#ifdef SO3_DEBUG
919 MMechostr(MSKDEBUG, "SO3CameraGetLODbias\n");
920#endif
921
922 int cam = MMget(m, 0);
923 if (cam == NIL)
924 {
925 MMset(m, 0, NIL);
926 return 0;
927 }
928
929 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
930 if (node == 0)
931 {
932 MMset(m, 0, NIL);
933 return 0;
934 }
935
936 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
937 {
938 MMset(m, 0, NIL);
939 return 0;
940 }
941
942 SCamera* camera = static_cast<SCamera*>(node);
943 float bias = camera->GetLODbias();
944
945 MMset(m, 0, FTOM(bias));
946 return 0;
947}
948
949
965{
966#ifdef SO3_DEBUG
967 MMechostr(MSKDEBUG, "SO3CameraSetPolygonMode\n");
968#endif
969
970 int b = MTOI(MMpull(m));
971 int cam = MMget(m, 0);
972 if((cam==NIL) || (b==NIL))
973 {
974 MMset(m, 0, NIL);
975 return 0;
976 }
977
978 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
979 if(node == 0)
980 {
981 MMset(m, 0, NIL);
982 return 0;
983 }
984
985 if(node->GetNodeType() != SNode::CAMERA_TYPE_ID)
986 {
987 MMset(m, 0, NIL);
988 return 0;
989 }
990
991 SCamera* camera = static_cast<SCamera*>(node);
992
993 // TODO in SCamera
994 if(b==SO3_POLY_POINTS)
995 camera->GetOgreCameraPointer()->setPolygonMode(Ogre::PM_POINTS);
996 else if(b==SO3_POLY_SOLID)
997 camera->GetOgreCameraPointer()->setPolygonMode(Ogre::PM_SOLID);
998 if(b==SO3_POLY_WIREFRAME)
999 camera->GetOgreCameraPointer()->setPolygonMode(Ogre::PM_WIREFRAME);
1000
1001 MMset(m, 0, ITOM(1));
1002 return 0;
1003}
1004
1005
1020{
1021#ifdef SO3_DEBUG
1022 MMechostr(MSKDEBUG, "SO3CameraGetPolygonMode\n");
1023#endif
1024
1025 int cam = MMget(m, 0);
1026 if(cam==NIL)
1027 {
1028 MMset(m, 0, NIL);
1029 return 0;
1030 }
1031
1032 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1033 if(node == 0)
1034 {
1035 MMset(m, 0, NIL);
1036 return 0;
1037 }
1038
1039 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1040 {
1041 MMset(m, 0, NIL);
1042 return 0;
1043 }
1044
1045 SCamera* camera = static_cast<SCamera*>(node);
1046
1047 // TODO in SCamera
1048 if(camera->GetOgreCameraPointer()->getPolygonMode() == Ogre::PM_POINTS)
1049 MMset(m, 0, ITOM(SO3_POLY_POINTS));
1050 else if(camera->GetOgreCameraPointer()->getPolygonMode() == Ogre::PM_SOLID)
1051 MMset(m, 0, ITOM(SO3_POLY_SOLID));
1052 else if(camera->GetOgreCameraPointer()->getPolygonMode() == Ogre::PM_WIREFRAME)
1053 MMset(m, 0, ITOM(SO3_POLY_WIREFRAME));
1054 else
1055 MMset(m, 0, NIL);
1056
1057 return 0;
1058}
1059
1060
1075{
1076#ifdef SO3_DEBUG
1077 MMechostr(MSKDEBUG, "SO3CameraSetProjectionType\n");
1078#endif
1079
1080 int b = MTOI(MMpull(m));
1081 int cam = MMget(m, 0);
1082 if((cam==NIL) || (b==NIL))
1083 {
1084 MMset(m, 0, NIL);
1085 return 0;
1086 }
1087
1088 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1089 if(node == 0)
1090 {
1091 MMset(m, 0, NIL);
1092 return 0;
1093 }
1094
1095 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1096 {
1097 MMset(m, 0, NIL);
1098 return 0;
1099 }
1100
1101 SCamera* camera = static_cast<SCamera*>(node);
1102
1103 // TODO in SCamera
1104 if(b==SO3_PROJECTION_PERSPECTIVE)
1105 camera->SetProjectionType(Ogre::PT_PERSPECTIVE);
1106 else if(b==SO3_PROJECTION_ORTHOGRAPHIC)
1107 camera->SetProjectionType(Ogre::PT_ORTHOGRAPHIC);
1108
1109 MMset(m, 0, ITOM(1));
1110 return 0;
1111}
1112
1113
1127{
1128#ifdef SO3_DEBUG
1129 MMechostr(MSKDEBUG, "SO3CameraGetProjectionType\n");
1130#endif
1131
1132 int cam = MMget(m, 0);
1133 if(cam==NIL)
1134 {
1135 MMset(m, 0, NIL);
1136 return 0;
1137 }
1138
1139 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1140 if(node == 0)
1141 {
1142 MMset(m, 0, NIL);
1143 return 0;
1144 }
1145
1146 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1147 {
1148 MMset(m, 0, NIL);
1149 return 0;
1150 }
1151
1152 SCamera* camera = static_cast<SCamera*>(node);
1153
1154 // TODO in SCamera
1155 if(camera->GetProjectionType() == Ogre::PT_PERSPECTIVE)
1156 MMset(m, 0, ITOM(SO3_PROJECTION_PERSPECTIVE));
1157 else if(camera->GetProjectionType() == Ogre::PT_ORTHOGRAPHIC)
1158 MMset(m, 0, ITOM(SO3_PROJECTION_ORTHOGRAPHIC));
1159 else
1160 MMset(m, 0, NIL);
1161
1162 return 0;
1163}
1164
1165
1177{
1178#ifdef SO3_DEBUG
1179 MMechostr(MSKDEBUG, "SO3CameraSetOrthoWindow\n");
1180#endif
1181
1182 int height = MMpull(m);
1183 int width = MMpull(m);
1184 int cam = MMget(m, 0);
1185 if((cam==NIL)||(width==NIL)||(height==NIL))
1186 {
1187 MMset(m, 0, NIL);
1188 return 0;
1189 }
1190
1191 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1192 if(node == 0)
1193 {
1194 MMset(m, 0, NIL);
1195 return 0;
1196 }
1197
1198 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1199 {
1200 MMset(m, 0, NIL);
1201 return 0;
1202 }
1203
1204 SCamera* camera = static_cast<SCamera*>(node);
1205 camera->SetOrthoWindow(SPoint<float>(MTOF(width), MTOF(height)));
1206
1207 MMset(m, 0, ITOM(1));
1208
1209 return 0;
1210}
1211
1212
1222{
1223#ifdef SO3_DEBUG
1224 MMechostr(MSKDEBUG, "SO3CameraGetOrthoWindow\n");
1225#endif
1226
1227 int cam = MMget(m, 0);
1228 if(cam==NIL)
1229 {
1230 MMset(m, 0, NIL);
1231 return 0;
1232 }
1233
1234 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1235 if(node == 0)
1236 {
1237 MMset(m, 0, NIL);
1238 return 0;
1239 }
1240
1241 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1242 {
1243 MMset(m, 0, NIL);
1244 return 0;
1245 }
1246
1247 SCamera* camera = static_cast<SCamera*>(node);
1248
1249 SPoint<float> size = camera->GetOrthoWindow();
1250 int tuple = MMmalloc(m, 2, TYPETAB);
1251 if(tuple==NIL)
1252 {
1253 MMset(m, 0, NIL);
1254 return MERRMEM;
1255 }
1256
1257 MMstore(m, tuple, 0, FTOM(size.x));
1258 MMstore(m, tuple, 1, FTOM(size.y));
1259 MMset(m, 0, PTOM(tuple));
1260
1261 return 0;
1262}
1263
1264
1275{
1276#ifdef SO3_DEBUG
1277 MMechostr(MSKDEBUG, "SO3CameraSetNearClipDistance\n");
1278#endif
1279
1280 int n = MMpull(m);
1281 int cam = MMget(m, 0);
1282 if((cam==NIL)||(n==NIL))
1283 {
1284 MMset(m, 0, NIL);
1285 return 0;
1286 }
1287
1288 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1289 if(node == 0)
1290 {
1291 MMset(m, 0, NIL);
1292 return 0;
1293 }
1294
1295 if(node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1296 {
1297 MMset(m, 0, NIL);
1298 return 0;
1299 }
1300
1301 SCamera* camera = static_cast<SCamera*>(node);
1302
1303 if(MTOF(n)==0.0f)
1304 {
1305 MMset(m, 0, NIL);
1306 return 0;
1307 }
1308
1309 camera->SetNearClipDistance(MTOF(n));
1310
1311 MMset(m, 0, ITOM(1));
1312 return 0;
1313}
1314
1315
1325{
1326#ifdef SO3_DEBUG
1327 MMechostr(MSKDEBUG, "SO3CameraGetNearClipDistance\n");
1328#endif
1329
1330 int cam = MMget(m, 0);
1331 if(cam==NIL)
1332 {
1333 MMset(m, 0, NIL);
1334 return 0;
1335 }
1336
1337 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1338 if(node == 0)
1339 {
1340 MMset(m, 0, NIL);
1341 return 0;
1342 }
1343
1344 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1345 {
1346 MMset(m, 0, NIL);
1347 return 0;
1348 }
1349
1350 SCamera* camera = static_cast<SCamera*>(node);
1351
1352 MMset(m, 0, FTOM(camera->GetNearClipDistance()));
1353
1354 return 0;
1355}
1356
1357
1368{
1369#ifdef SO3_DEBUG
1370 MMechostr(MSKDEBUG, "SO3CameraSetFarClipDistance\n");
1371#endif
1372
1373 int val = MMpull(m);
1374 int cam = MMget(m, 0);
1375 if((cam==NIL)||(val==NIL))
1376 {
1377 MMset(m, 0, NIL);
1378 return 0;
1379 }
1380
1381 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1382 if(node == 0)
1383 {
1384 MMset(m, 0, NIL);
1385 return 0;
1386 }
1387
1388 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1389 {
1390 MMset(m, 0, NIL);
1391 return 0;
1392 }
1393
1394 SCamera* camera = static_cast<SCamera*>(node);
1395
1396 camera->SetFarClipDistance(MTOF(val));
1397 MMset(m, 0, ITOM(1));
1398 return 0;
1399}
1400
1401
1411{
1412#ifdef SO3_DEBUG
1413 MMechostr(MSKDEBUG, "SO3CameraGetFarClipDistance\n");
1414#endif
1415
1416 int cam = MMget(m, 0);
1417 if(cam==NIL)
1418 {
1419 MMset(m, 0, NIL);
1420 return 0;
1421 }
1422
1423 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1424 if(node == 0)
1425 {
1426 MMset(m, 0, NIL);
1427 return 0;
1428 }
1429
1430 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1431 {
1432 MMset(m, 0, NIL);
1433 return 0;
1434 }
1435
1436 SCamera* camera = static_cast<SCamera*>(node);
1437
1438 MMset(m, 0, FTOM(camera->GetFarClipDistance()));
1439
1440 return 0;
1441}
1442
1443
1453{
1454 #ifdef SO3_DEBUG
1455 MMechostr(MSKDEBUG,"SO3CameraGetViewport\n");
1456 #endif
1457
1458 int cam = MMget(m, 0);
1459 if(cam==NIL)
1460 {
1461 MMset(m, 0, NIL);
1462 return 0;
1463 }
1464
1465 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1466 if(node == 0)
1467 {
1468 MMset(m, 0, NIL);
1469 return 0;
1470 }
1471
1472 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1473 {
1474 MMset(m, 0, NIL);
1475 return 0;
1476 }
1477
1478 SCamera* camera = static_cast<SCamera*>(node);
1479
1480 SViewPort* viewport = camera->getCurrentViewPort();
1481 if(viewport==NULL)
1482 {
1483 MMset(m, 0, NIL);
1484 return 0;
1485 }
1486
1487 int vp = OBJfindTH(m, SO3VPTYPE, SCOL_PTR (viewport));
1488 if(vp!=NIL)
1489 vp = MMfetch(m, vp, OFFOBJMAG);
1490
1491 MMset(m, 0, vp);
1492 return 0;
1493}
1494
1495
1505{
1506#ifdef SO3_DEBUG
1507 MMechostr(MSKDEBUG, "SO3CameraGetNumRenderedFaces\n");
1508#endif
1509
1510 int cam = MMget(m, 0);
1511 if(cam==NIL)
1512 {
1513 MMset(m, 0, NIL);
1514 return 0;
1515 }
1516
1517 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1518 if(node == 0)
1519 {
1520 MMset(m, 0, NIL);
1521 return 0;
1522 }
1523
1524 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1525 {
1526 MMset(m, 0, NIL);
1527 return 0;
1528 }
1529
1530 SCamera* camera = static_cast<SCamera*>(node);
1531
1532 // TODO in SCamera
1533 int nb = camera->GetOgreCameraPointer()->_getNumRenderedFaces();
1534 MMset(m, 0, ITOM(nb));
1535
1536 return 0;
1537}
1538
1539
1549{
1550#ifdef SO3_DEBUG
1551 MMechostr(MSKDEBUG, "SO3CameraSetProjectionMatrix\n");
1552#endif
1553
1554 int imat = MMpull(m);
1555 int cam = MMget(m, 0);
1556 if(cam==NIL)
1557 {
1558 MMset(m, 0, NIL);
1559 return 0;
1560 }
1561
1562 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1563 if(node == 0)
1564 {
1565 MMset(m, 0, NIL);
1566 return 0;
1567 }
1568
1569 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1570 {
1571 MMset(m, 0, NIL);
1572 return 0;
1573 }
1574
1575 SCamera* camera = static_cast<SCamera*>(node);
1576 if (camera == 0)
1577 {
1578 MMset(m, 0, NIL);
1579 return 0;
1580 }
1581
1582 if (imat != NIL)
1583 {
1584 int imat0 = MMfetch(m, MTOP(imat), 0);
1585 int imat1 = MMfetch(m, MTOP(imat), 1);
1586 int imat2 = MMfetch(m, MTOP(imat), 2);
1587 int imat3 = MMfetch(m, MTOP(imat), 3);
1588
1589 Ogre::Matrix4 projmat(MTOF(MMfetch(m, MTOP(imat0), 0)), MTOF(MMfetch(m, MTOP(imat0), 1)), MTOF(MMfetch(m, MTOP(imat0), 2)), MTOF(MMfetch(m, MTOP(imat0), 3)),
1590 MTOF(MMfetch(m, MTOP(imat1), 0)), MTOF(MMfetch(m, MTOP(imat1), 1)), MTOF(MMfetch(m, MTOP(imat1), 2)), MTOF(MMfetch(m, MTOP(imat1), 3)),
1591 MTOF(MMfetch(m, MTOP(imat2), 0)), MTOF(MMfetch(m, MTOP(imat2), 1)), MTOF(MMfetch(m, MTOP(imat2), 2)), MTOF(MMfetch(m, MTOP(imat2), 3)),
1592 MTOF(MMfetch(m, MTOP(imat3), 0)), MTOF(MMfetch(m, MTOP(imat3), 1)), MTOF(MMfetch(m, MTOP(imat3), 2)), MTOF(MMfetch(m, MTOP(imat3), 3)));
1593
1594 try
1595 {
1596 camera->SetCustomProjectionMatrix(true, projmat);
1597 }
1598 catch(Ogre::Exception &e)
1599 {
1600 MMechostr(MSKDEBUG, "SO3CameraSetProjectionMatrix matrix error : %s\n", e.what());
1601 }
1602 }
1603 else
1604 {
1605 try
1606 {
1607 camera->SetCustomProjectionMatrix(false);
1608 }
1609 catch(Ogre::Exception &e)
1610 {
1611 MMechostr(MSKDEBUG, "SO3CameraSetProjectionMatrix matrix error : %s\n", e.what());
1612 }
1613 }
1614
1615 MMset(m, 0, ITOM(1));
1616
1617 return 0;
1618}
1619
1628{
1629 #ifdef _SCOL_DEBUG_
1630 MMechostr(MSKDEBUG, "SO3CameraGetProjectionMatrix\n");
1631 #endif
1632
1633 int cam = MMget(m, 0);
1634 if(cam==NIL)
1635 {
1636 MMset(m, 0, NIL);
1637 return 0;
1638 }
1639
1640 SNode* node = MMgetPointer<SNode*>(m, MTOP(cam));
1641 if(node == 0)
1642 {
1643 MMset(m, 0, NIL);
1644 return 0;
1645 }
1646
1647 if (node->GetNodeType() != SNode::CAMERA_TYPE_ID)
1648 {
1649 MMset(m, 0, NIL);
1650 return 0;
1651 }
1652
1653 SCamera* camera = static_cast<SCamera*>(node);
1654 if (camera == 0)
1655 {
1656 MMset(m, 0, NIL);
1657 return 0;
1658 }
1659
1660 Ogre::Matrix4 proj_mat = camera->GetProjectionMatrix();
1661
1662 int tupleMat = MMmalloc(m, 4, TYPETAB);
1663 if(tupleMat==NIL)
1664 {
1665 MMset(m, 0, NIL);
1666 return 0;
1667 }
1668
1669 int tupleMat0 = MMmalloc(m, 4, TYPETAB);
1670 if(tupleMat0==NIL)
1671 {
1672 MMset(m, 0, NIL);
1673 return 0;
1674 }
1675
1676 MMstore(m, tupleMat0, 0, FTOM(static_cast<float>(proj_mat[0][0])));
1677 MMstore(m, tupleMat0, 1, FTOM(static_cast<float>(proj_mat[0][1])));
1678 MMstore(m, tupleMat0, 2, FTOM(static_cast<float>(proj_mat[0][2])));
1679 MMstore(m, tupleMat0, 3, FTOM(static_cast<float>(proj_mat[0][3])));
1680 MMpush(m, PTOM(tupleMat0));
1681
1682 int tupleMat1 = MMmalloc(m, 4, TYPETAB);
1683 if(tupleMat1==NIL)
1684 {
1685 MMset(m, 0, NIL);
1686 return 0;
1687 }
1688
1689 MMstore(m, tupleMat1, 0, FTOM(static_cast<float>(proj_mat[1][0])));
1690 MMstore(m, tupleMat1, 1, FTOM(static_cast<float>(proj_mat[1][1])));
1691 MMstore(m, tupleMat1, 2, FTOM(static_cast<float>(proj_mat[1][2])));
1692 MMstore(m, tupleMat1, 3, FTOM(static_cast<float>(proj_mat[1][3])));
1693 MMpush(m, PTOM(tupleMat1));
1694
1695 int tupleMat2 = MMmalloc(m, 4, TYPETAB);
1696 if(tupleMat2==NIL)
1697 {
1698 MMset(m, 0, NIL);
1699 return 0;
1700 }
1701
1702 MMstore(m, tupleMat2, 0, FTOM(static_cast<float>(proj_mat[2][0])));
1703 MMstore(m, tupleMat2, 1, FTOM(static_cast<float>(proj_mat[2][1])));
1704 MMstore(m, tupleMat2, 2, FTOM(static_cast<float>(proj_mat[2][2])));
1705 MMstore(m, tupleMat2, 3, FTOM(static_cast<float>(proj_mat[2][3])));
1706 MMpush(m, PTOM(tupleMat2));
1707
1708 int tupleMat3 = MMmalloc(m, 4, TYPETAB);
1709 if(tupleMat==NIL)
1710 {
1711 MMset(m, 0, NIL);
1712 return 0;
1713 }
1714
1715 MMstore(m, tupleMat3, 0, FTOM(static_cast<float>(proj_mat[3][0])));
1716 MMstore(m, tupleMat3, 1, FTOM(static_cast<float>(proj_mat[3][1])));
1717 MMstore(m, tupleMat3, 2, FTOM(static_cast<float>(proj_mat[3][2])));
1718 MMstore(m, tupleMat3, 3, FTOM(static_cast<float>(proj_mat[3][3])));
1719 MMpush(m, PTOM(tupleMat3));
1720
1721 MMstore(m, tupleMat, 0, MMget(m, 3));
1722 MMstore(m, tupleMat, 1, MMget(m, 2));
1723 MMstore(m, tupleMat, 2, MMget(m, 1));
1724 MMstore(m, tupleMat, 3, MMget(m, 0));
1725
1726 MMpull(m);
1727 MMpull(m);
1728 MMpull(m);
1729 MMpull(m);
1730 MMpush(m, PTOM(tupleMat));
1731
1732 #ifdef _SCOL_DEBUG_
1733 MMechostr(MSKDEBUG, "ok\n");
1734 #endif
1735 return 0;
1736}
1737
1738
1739NativeDefinition natSO3Camera[] = {
1740 { "SO3CameraCreate", 2, "fun [SO3_SCENE S] SO3_OBJECT", SO3CameraCreate },
1741 { "SO3CameraLookAt", 2, "fun [SO3_OBJECT [F F F]] I", SO3CameraLookAt },
1742 { "SO3CameraGetDirection", 1, "fun [SO3_OBJECT] [F F F]", SO3CameraGetDirection },
1743 { "SO3CameraGetDerivedDirection", 1, "fun [SO3_OBJECT] [F F F]", SO3CameraGetDerivedDirection },
1744 { "SO3CameraGetDerivedUp", 1, "fun [SO3_OBJECT] [F F F]", SO3CameraGetDerivedUp },
1745 { "SO3CameraSetViewport", 2, "fun [SO3_VIEWPORT SO3_OBJECT] I", SO3CameraSetViewport },
1746 { "SO3CameraSetFocalLenght", 2, "fun [SO3_OBJECT F] I", SO3CameraSetFocalLength },
1747 { "SO3CameraSetFocalLength", 2, "fun [SO3_OBJECT F] I", SO3CameraSetFocalLength },
1748 { "SO3CameraGetFocalLenght", 1, "fun [SO3_OBJECT] F", SO3CameraGetFocalLength },
1749 { "SO3CameraGetFocalLength", 1, "fun [SO3_OBJECT] F", SO3CameraGetFocalLength },
1750 { "SO3CameraSetFOVy", 2, "fun [SO3_OBJECT F] I", SO3CameraSetFOVy },
1751 { "SO3CameraGetFOVy", 1, "fun [SO3_OBJECT] F", SO3CameraGetFOVy },
1752 { "SO3CameraSetLODbias", 2, "fun [SO3_OBJECT F] I", SO3CameraSetLODbias },
1753 { "SO3CameraGetLODbias", 1, "fun [SO3_OBJECT] F", SO3CameraGetLODbias },
1754 { "SO3CameraSetAspectRatio", 2, "fun [SO3_OBJECT F] I", SO3CameraSetAspectRatio },
1755 { "SO3CameraGetAspectRatio", 1, "fun [SO3_OBJECT] F", SO3CameraGetAspectRatio },
1756 { "SO3CameraSetAutoAspectRatio", 2, "fun [SO3_OBJECT I] I", SO3CameraSetAutoAspectRatio },
1757 { "SO3CameraSetFrustumOffset", 3, "fun [SO3_OBJECT F F] I", SO3CameraSetFrustumOffset },
1758 { "SO3CameraGetFrustumOffset", 1, "fun [SO3_OBJECT] [F F]", SO3CameraGetFrustumOffset },
1759 { "SO3CameraSetPolygonMode", 2, "fun [SO3_OBJECT I] I", SO3CameraSetPolygonMode },
1760 { "SO3CameraGetPolygonMode", 1, "fun [SO3_OBJECT] I", SO3CameraGetPolygonMode },
1761 { "SO3CameraSetNearClipDistance", 2, "fun [SO3_OBJECT F] I", SO3CameraSetNearClipDistance },
1762 { "SO3CameraGetNearClipDistance", 1, "fun [SO3_OBJECT] F", SO3CameraGetNearClipDistance },
1763 { "SO3CameraSetFarClipDistance", 2, "fun [SO3_OBJECT F] I", SO3CameraSetFarClipDistance },
1764 { "SO3CameraGetFarClipDistance", 1, "fun [SO3_OBJECT] F", SO3CameraGetFarClipDistance },
1765 { "SO3CameraGetViewport", 1, "fun [SO3_OBJECT] SO3_VIEWPORT", SO3CameraGetViewport },
1766 { "SO3CameraGetNumRenderedFaces", 1, "fun [SO3_OBJECT] I", SO3CameraGetNumRenderedFaces },
1767 { "SO3CameraSetProjectionType", 2, "fun [SO3_OBJECT I] I", SO3CameraSetProjectionType },
1768 { "SO3CameraGetProjectionType", 1, "fun [SO3_OBJECT] I", SO3CameraGetProjectionType },
1769 { "SO3CameraSetOrthoWindow", 3, "fun [SO3_OBJECT F F] I", SO3CameraSetOrthoWindow },
1770 { "SO3CameraGetOrthoWindow", 1, "fun [SO3_OBJECT] [F F]", SO3CameraGetOrthoWindow },
1771 { "SO3CameraSetProjectionMatrix", 2, "fun [SO3_OBJECT [[F F F F] [F F F F] [F F F F] [F F F F]]] I", SO3CameraSetProjectionMatrix },
1772 { "SO3CameraGetProjectionMatrix", 1, "fun [SO3_OBJECT] [[F F F F] [F F F F] [F F F F] [F F F F]]", SO3CameraGetProjectionMatrix },
1773 { "SO3CameraGetTriangleCount", 1, "fun [SO3_OBJECT] I", SO3CameraGetTriangleCount },
1774 { "SO3CameraGetBatchCount", 1, "fun [SO3_OBJECT] I", SO3CameraGetBatchCount }
1775};
1776
1777
1783int SCOLloadCamera(mmachine m,cbmachine w)
1784{
1785 return PKhardpak2(m, "SO3Camera.pkg", sizeof(natSO3Camera) / sizeof(natSO3Camera[0]), natSO3Camera);
1786}
1787
1788
1794{
1795 return 0;
1796}
int SCOLfreeCamera()
free the SO3Engine Viewport function
NativeDefinition natSO3Camera[]
int SO3CameraGetProjectionMatrix(mmachine m)
SO3CameraGetProjectionMatrix : This function return the projection matrix Prototype: fun [SO3_OBJECT]...
int SCOLloadCamera(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 SO3VPTYPE
Definition SO3SCOL.cpp:94
int createObject(mmachine m, SNode *curNode, SScene *curScene)
int SO3CameraGetNumRenderedFaces(mmachine m)
SO3CameraGetNumRenderedFaces : Get the numbered of rendered faces for a camera.
int SO3CameraGetOrthoWindow(mmachine m)
SO3CameraGetOrthoWindow : Gets the orthographic window settings, for use with orthographic rendering ...
int SO3CameraGetLODbias(mmachine m)
SO3CameraGetLODbias : Get the a camera LOD bias.
int SO3CameraSetProjectionMatrix(mmachine m)
SO3CameraSetProjectionMatrix : Set the camera projection matrix.
int SO3CameraGetAspectRatio(mmachine m)
SO3CameraGetAspectRatio : get the aspect ratio of a camera.
int SO3CameraGetFarClipDistance(mmachine m)
SO3CameraGetFarClipDistance : Get the far clip distance of a camera.
int SO3CameraGetDerivedDirection(mmachine m)
SO3CameraGetDerivedDirection : Get the derivated direction of a camera.
int SO3CameraSetProjectionType(mmachine m)
SO3CameraSetProjectionType : Sets the type of projection to use (orthographic or perspective)....
int SO3CameraSetFocalLength(mmachine m)
SO3CameraSetFocalLength : defines focal length of a camera.
int SO3CameraCreate(mmachine m)
main include
int SO3CameraSetPolygonMode(mmachine m)
SO3CameraSetPolygonMode : Set the polygon Mode for a given camera.
int SO3CameraGetDirection(mmachine m)
SO3CameraGetDirection : Get the direction of a camera.
int SO3CameraSetAutoAspectRatio(mmachine m)
SO3CameraSetAutoAspectRatio : set a camera aspect ratio to automatic.
int SO3CameraGetPolygonMode(mmachine m)
SO3CameraGetPolygonMode : Get the Polygon mode of a camera.
int SO3CameraGetProjectionType(mmachine m)
SO3CameraGetProjectionType : Get the camera projection type.
int SO3CameraSetAspectRatio(mmachine m)
SO3CameraSetAspectRatio : defines the aspect ratio of a camera.
int SO3CameraSetFOVy(mmachine m)
SO3CameraSetFOVy : defines FOVy of a camera.
int SO3CameraGetNearClipDistance(mmachine m)
SO3CameraGetNearClipDistance : Get the near clip distance of a camera.
int SO3CameraGetFrustumOffset(mmachine m)
SO3CameraGetFrustumOffset : get the frustum offset of a camera.
int SO3CameraSetNearClipDistance(mmachine m)
SO3CameraSetNearClipDistance : defines near clip distance of a camera.
int SO3CameraSetLODbias(mmachine m)
SO3CameraSetLODbias : defines a camera LOD bias.
int SO3CameraGetDerivedUp(mmachine m)
SO3CameraGetDerivedUp : Gets the derived up vector of the camera, including any rotation inherited fr...
int SO3CameraGetFOVy(mmachine m)
SO3CameraGetFOVy : Get the FOVy of a camera.
int SO3CameraSetOrthoWindow(mmachine m)
SO3CameraSetOrthoWindow : Sets the orthographic window settings, for use with orthographic rendering ...
int SO3CameraGetTriangleCount(mmachine m)
SO3CameraGetTriangleCount : get the number of triangles rendered in last update.
int SO3CameraSetFarClipDistance(mmachine m)
SO3CameraSetFarClipDistance : defines far clip distance of a camera.
int SO3CameraGetFocalLength(mmachine m)
SO3CameraGetFocalLength : Get the focal length of a camera.
int SO3CameraSetViewport(mmachine m)
SO3CameraSetViewport : Attach a camera to a viewport.
int SO3CameraGetViewport(mmachine m)
SO3CameraGetViewport : Get the current viewport attached to a camera.
int SO3CameraGetBatchCount(mmachine m)
SO3CameraGetBatchCount : get the number of batch rendered in last update.
int SO3CameraSetFrustumOffset(mmachine m)
SO3CameraSetFrustumOffset : defines the frustum offset of a camera.
int SO3CameraLookAt(mmachine m)
SO3CameraLookAt : Set a "look at" on the camera.