1 /* NAME:
2 QD3DCamera.c
3
4 DESCRIPTION:
5 Entry point for Quesa API calls. Performs parameter checking and
6 then forwards each API call to the equivalent E3xxxxx routine.
7
8 COPYRIGHT:
9 Copyright (c) 1999-2004, Quesa Developers. All rights reserved.
10
11 For the current release of Quesa, please see:
12
13 <http://www.quesa.org/>
14
15 Redistribution and use in source and binary forms, with or without
16 modification, are permitted provided that the following conditions
17 are met:
18
19 o Redistributions of source code must retain the above copyright
20 notice, this list of conditions and the following disclaimer.
21
22 o Redistributions in binary form must reproduce the above
23 copyright notice, this list of conditions and the following
24 disclaimer in the documentation and/or other materials provided
25 with the distribution.
26
27 o Neither the name of Quesa nor the names of its contributors
28 may be used to endorse or promote products derived from this
29 software without specific prior written permission.
30
31 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
34 A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
36 SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
37 TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
38 PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
39 LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
40 NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
41 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42 ___________________________________________________________________________
43 */
44 //=============================================================================
45 // Include files
46 //-----------------------------------------------------------------------------
47 #include "E3Prefix.h"
48 #include "E3Camera.h"
49
50
51
52
53
54 //=============================================================================
55 // Internal constants
56 //-----------------------------------------------------------------------------
57 // Internal constants go here
58
59
60
61
62
63 //=============================================================================
64 // Internal types
65 //-----------------------------------------------------------------------------
66 // Internal types go here
67
68
69
70
71
72 //=============================================================================
73 // Internal macros
74 //-----------------------------------------------------------------------------
75 // Internal macros go here
76
77
78
79
80
81 //=============================================================================
82 // Public functions
83 //-----------------------------------------------------------------------------
84 // Q3Camera_GetType : Quesa API entry point.
85 //-----------------------------------------------------------------------------
86 TQ3ObjectType
Q3Camera_GetType(TQ3CameraObject camera)87 Q3Camera_GetType(TQ3CameraObject camera)
88 {
89
90
91 // Release build checks
92 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3ObjectTypeInvalid ) ;
93
94
95
96 // Debug build checks
97 #if Q3_DEBUG
98 if (0) // Further checks on camera
99 return(kQ3ObjectTypeInvalid);
100 #endif
101
102
103
104 // Call the bottleneck
105 E3System_Bottleneck();
106
107
108
109 // Call our implementation
110 return ( (E3Camera*) camera )->GetType () ;
111 }
112
113
114
115
116
117 //=============================================================================
118 // Q3Camera_SetData : Quesa API entry point.
119 //-----------------------------------------------------------------------------
120 TQ3Status
Q3Camera_SetData(TQ3CameraObject camera,const TQ3CameraData * cameraData)121 Q3Camera_SetData(TQ3CameraObject camera, const TQ3CameraData *cameraData)
122 {
123
124
125 // Release build checks
126 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
127 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(cameraData), kQ3Failure);
128
129
130
131 // Debug build checks
132 #if Q3_DEBUG
133 if (0) // Further checks on camera
134 return(kQ3Failure);
135
136 // Further checks on cameraData
137 if (fabs( Q3FastVector3D_Length( &cameraData->placement.upVector ) - 1.0f ) > kQ3RealZero)
138 {
139 E3ErrorManager_PostWarning( kQ3WarningVector3DNotUnitLength );
140 }
141 #endif
142
143
144
145 // Call the bottleneck
146 E3System_Bottleneck();
147
148
149
150 // Call our implementation
151 return ( (E3Camera*) camera )->SetData ( cameraData ) ;
152 }
153
154
155
156
157
158 //=============================================================================
159 // Q3Camera_GetData : Quesa API entry point.
160 //-----------------------------------------------------------------------------
161 TQ3Status
Q3Camera_GetData(TQ3CameraObject camera,TQ3CameraData * cameraData)162 Q3Camera_GetData(TQ3CameraObject camera, TQ3CameraData *cameraData)
163 {
164
165
166 // Release build checks
167 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
168 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(cameraData), kQ3Failure);
169
170
171
172 // Debug build checks
173 #if Q3_DEBUG
174 if (0) // Further checks on camera
175 return(kQ3Failure);
176
177 if (0) // Further checks on cameraData
178 return(kQ3Failure);
179 #endif
180
181
182
183 // Call the bottleneck
184 E3System_Bottleneck();
185
186
187
188 // Call our implementation
189 return ( (E3Camera*) camera )->GetData ( cameraData ) ;
190 }
191
192
193
194
195
196 //=============================================================================
197 // Q3Camera_SetPlacement : Quesa API entry point.
198 //-----------------------------------------------------------------------------
199 TQ3Status
Q3Camera_SetPlacement(TQ3CameraObject camera,const TQ3CameraPlacement * placement)200 Q3Camera_SetPlacement(TQ3CameraObject camera, const TQ3CameraPlacement *placement)
201 {
202
203
204 // Release build checks
205 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
206 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(placement), kQ3Failure);
207
208
209
210 // Debug build checks
211 #if Q3_DEBUG
212 if (0) // Further checks on camera
213 return(kQ3Failure);
214
215 // Further checks on placement
216 if (fabs( Q3FastVector3D_Length( &placement->upVector ) - 1.0f ) > kQ3RealZero)
217 {
218 E3ErrorManager_PostWarning( kQ3WarningVector3DNotUnitLength );
219 }
220 #endif
221
222
223
224 // Call the bottleneck
225 E3System_Bottleneck();
226
227
228
229 // Call our implementation
230 return ( (E3Camera*) camera )->SetPlacement ( placement ) ;
231 }
232
233
234
235
236
237 //=============================================================================
238 // Q3Camera_GetPlacement : Quesa API entry point.
239 //-----------------------------------------------------------------------------
240 TQ3Status
Q3Camera_GetPlacement(TQ3CameraObject camera,TQ3CameraPlacement * placement)241 Q3Camera_GetPlacement(TQ3CameraObject camera, TQ3CameraPlacement *placement)
242 {
243
244
245 // Release build checks
246 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
247 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(placement), kQ3Failure);
248
249
250
251 // Debug build checks
252 #if Q3_DEBUG
253 if (0) // Further checks on camera
254 return(kQ3Failure);
255
256 if (0) // Further checks on placement
257 return(kQ3Failure);
258 #endif
259
260
261
262 // Call the bottleneck
263 E3System_Bottleneck();
264
265
266
267 // Call our implementation
268 return ( (E3Camera*) camera )->GetPlacement ( placement ) ;
269 }
270
271
272
273
274
275 //=============================================================================
276 // Q3Camera_SetRange : Quesa API entry point.
277 //-----------------------------------------------------------------------------
278 TQ3Status
Q3Camera_SetRange(TQ3CameraObject camera,const TQ3CameraRange * range)279 Q3Camera_SetRange(TQ3CameraObject camera, const TQ3CameraRange *range)
280 {
281
282
283 // Release build checks
284 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
285 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(range), kQ3Failure);
286
287
288
289 // Debug build checks
290 #if Q3_DEBUG
291 if (0) // Further checks on camera
292 return(kQ3Failure);
293
294 if (0) // Further checks on range
295 return(kQ3Failure);
296 #endif
297
298
299
300 // Call the bottleneck
301 E3System_Bottleneck();
302
303
304
305 // Call our implementation
306 return ( (E3Camera*) camera )->SetRange ( range ) ;
307 }
308
309
310
311
312
313 //=============================================================================
314 // Q3Camera_GetRange : Quesa API entry point.
315 //-----------------------------------------------------------------------------
316 TQ3Status
Q3Camera_GetRange(TQ3CameraObject camera,TQ3CameraRange * range)317 Q3Camera_GetRange(TQ3CameraObject camera, TQ3CameraRange *range)
318 {
319
320
321 // Release build checks
322 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
323 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(range), kQ3Failure);
324
325
326
327 // Debug build checks
328 #if Q3_DEBUG
329 if (0) // Further checks on camera
330 return(kQ3Failure);
331
332 if (0) // Further checks on range
333 return(kQ3Failure);
334 #endif
335
336
337
338 // Call the bottleneck
339 E3System_Bottleneck();
340
341
342
343 // Call our implementation
344 return ( (E3Camera*) camera )->GetRange ( range ) ;
345 }
346
347
348
349
350
351 //=============================================================================
352 // Q3Camera_SetViewPort : Quesa API entry point.
353 //-----------------------------------------------------------------------------
354 TQ3Status
Q3Camera_SetViewPort(TQ3CameraObject camera,const TQ3CameraViewPort * viewPort)355 Q3Camera_SetViewPort(TQ3CameraObject camera, const TQ3CameraViewPort *viewPort)
356 {
357
358
359 // Release build checks
360 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
361 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(viewPort), kQ3Failure);
362
363
364
365 // Debug build checks
366 #if Q3_DEBUG
367 if (0) // Further checks on camera
368 return(kQ3Failure);
369
370 if (0) // Further checks on viewPort
371 return(kQ3Failure);
372 #endif
373
374
375
376 // Call the bottleneck
377 E3System_Bottleneck();
378
379
380
381 // Call our implementation
382 return ( (E3Camera*) camera )->SetViewPort ( viewPort ) ;
383 }
384
385
386
387
388
389 //=============================================================================
390 // Q3Camera_GetViewPort : Quesa API entry point.
391 //-----------------------------------------------------------------------------
392 TQ3Status
Q3Camera_GetViewPort(TQ3CameraObject camera,TQ3CameraViewPort * viewPort)393 Q3Camera_GetViewPort(TQ3CameraObject camera, TQ3CameraViewPort *viewPort)
394 {
395
396
397 // Release build checks
398 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
399 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(viewPort), kQ3Failure);
400
401
402
403 // Debug build checks
404 #if Q3_DEBUG
405 if (0) // Further checks on camera
406 return(kQ3Failure);
407
408 if (0) // Further checks on viewPort
409 return(kQ3Failure);
410 #endif
411
412
413
414 // Call the bottleneck
415 E3System_Bottleneck();
416
417
418
419 // Call our implementation
420 return ( (E3Camera*) camera )->GetViewPort ( viewPort ) ;
421 }
422
423
424
425
426
427 //=============================================================================
428 // Q3Camera_GetWorldToView : Quesa API entry point.
429 //-----------------------------------------------------------------------------
430 TQ3Status
Q3Camera_GetWorldToView(TQ3CameraObject camera,TQ3Matrix4x4 * worldToView)431 Q3Camera_GetWorldToView(TQ3CameraObject camera, TQ3Matrix4x4 *worldToView)
432 {
433
434
435 // Release build checks
436 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
437 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(worldToView), kQ3Failure);
438
439
440
441 // Debug build checks
442 #if Q3_DEBUG
443 if (0) // Further checks on camera
444 return(kQ3Failure);
445
446 if (0) // Further checks on worldToView
447 return(kQ3Failure);
448 #endif
449
450
451
452 // Call the bottleneck
453 E3System_Bottleneck();
454
455
456
457 // Call our implementation
458 return ( (E3Camera*) camera )->GetWorldToView ( worldToView ) ;
459 }
460
461
462
463
464
465 //=============================================================================
466 // Q3Camera_GetWorldToFrustum : Quesa API entry point.
467 //-----------------------------------------------------------------------------
468 TQ3Status
Q3Camera_GetWorldToFrustum(TQ3CameraObject camera,TQ3Matrix4x4 * worldToFrustum)469 Q3Camera_GetWorldToFrustum(TQ3CameraObject camera, TQ3Matrix4x4 *worldToFrustum)
470 {
471
472
473 // Release build checks
474 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
475 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(worldToFrustum), kQ3Failure);
476
477
478
479 // Debug build checks
480 #if Q3_DEBUG
481 if (0) // Further checks on camera
482 return(kQ3Failure);
483
484 if (0) // Further checks on worldToFrustum
485 return(kQ3Failure);
486 #endif
487
488
489
490 // Call the bottleneck
491 E3System_Bottleneck();
492
493
494
495 // Call our implementation
496 return ( (E3Camera*) camera )->GetWorldToFrustum ( worldToFrustum ) ;
497 }
498
499
500
501
502
503 //=============================================================================
504 // Q3Camera_GetViewToFrustum : Quesa API entry point.
505 //-----------------------------------------------------------------------------
506 TQ3Status
Q3Camera_GetViewToFrustum(TQ3CameraObject camera,TQ3Matrix4x4 * viewToFrustum)507 Q3Camera_GetViewToFrustum(TQ3CameraObject camera, TQ3Matrix4x4 *viewToFrustum)
508 {
509
510
511 // Release build checks
512 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
513 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(viewToFrustum), kQ3Failure);
514
515
516
517 // Debug build checks
518 #if Q3_DEBUG
519 if (0) // Further checks on camera
520 return(kQ3Failure);
521
522 if (0) // Further checks on viewToFrustum
523 return(kQ3Failure);
524 #endif
525
526
527
528 // Call the bottleneck
529 E3System_Bottleneck();
530
531
532
533 // Call our implementation
534 return ( (E3Camera*) camera )->GetViewToFrustum ( viewToFrustum ) ;
535 }
536
537
538
539
540
541 //=============================================================================
542 // Q3OrthographicCamera_New : Quesa API entry point.
543 //-----------------------------------------------------------------------------
544 TQ3CameraObject
Q3OrthographicCamera_New(const TQ3OrthographicCameraData * orthographicData)545 Q3OrthographicCamera_New(const TQ3OrthographicCameraData *orthographicData)
546 {
547
548
549 // Release build checks
550 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(orthographicData), NULL);
551
552
553
554 // Debug build checks
555 #if Q3_DEBUG
556 // Further checks on orthographicData
557 if (fabs( Q3FastVector3D_Length( &orthographicData->cameraData.placement.upVector ) -
558 1.0f ) > kQ3RealZero)
559 {
560 E3ErrorManager_PostWarning( kQ3WarningVector3DNotUnitLength );
561 }
562 #endif
563
564
565
566 // Call the bottleneck
567 E3System_Bottleneck();
568
569
570
571 // Call our implementation
572 return(E3OrthographicCamera_New(orthographicData));
573 }
574
575
576
577
578
579 //=============================================================================
580 // Q3OrthographicCamera_GetData : Quesa API entry point.
581 //-----------------------------------------------------------------------------
582 TQ3Status
Q3OrthographicCamera_GetData(TQ3CameraObject camera,TQ3OrthographicCameraData * cameraData)583 Q3OrthographicCamera_GetData(TQ3CameraObject camera, TQ3OrthographicCameraData *cameraData)
584 {
585
586
587 // Release build checks
588 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
589 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(cameraData), kQ3Failure);
590
591
592
593 // Debug build checks
594 #if Q3_DEBUG
595 if (0) // Further checks on camera
596 return(kQ3Failure);
597
598 if (0) // Further checks on cameraData
599 return(kQ3Failure);
600 #endif
601
602
603
604 // Call the bottleneck
605 E3System_Bottleneck();
606
607
608
609 // Call our implementation
610 return ( (E3OrthographicCamera*) camera )->GetData ( cameraData ) ;
611 }
612
613
614
615
616
617 //=============================================================================
618 // Q3OrthographicCamera_SetData : Quesa API entry point.
619 //-----------------------------------------------------------------------------
620 TQ3Status
Q3OrthographicCamera_SetData(TQ3CameraObject camera,const TQ3OrthographicCameraData * cameraData)621 Q3OrthographicCamera_SetData(TQ3CameraObject camera, const TQ3OrthographicCameraData *cameraData)
622 {
623
624
625 // Release build checks
626 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
627 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(cameraData), kQ3Failure);
628
629
630
631 // Debug build checks
632 #if Q3_DEBUG
633 if (0) // Further checks on camera
634 return(kQ3Failure);
635
636 // Further checks on cameraData
637 if (fabs( Q3FastVector3D_Length( &cameraData->cameraData.placement.upVector ) -
638 1.0f ) > kQ3RealZero)
639 {
640 E3ErrorManager_PostWarning( kQ3WarningVector3DNotUnitLength );
641 }
642 #endif
643
644
645
646 // Call the bottleneck
647 E3System_Bottleneck();
648
649
650
651 // Call our implementation
652 return ( (E3OrthographicCamera*) camera )->SetData ( cameraData ) ;
653 }
654
655
656
657
658
659 //=============================================================================
660 // Q3OrthographicCamera_SetLeft : Quesa API entry point.
661 //-----------------------------------------------------------------------------
662 TQ3Status
Q3OrthographicCamera_SetLeft(TQ3CameraObject camera,float left)663 Q3OrthographicCamera_SetLeft(TQ3CameraObject camera, float left)
664 {
665
666
667 // Release build checks
668 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
669
670
671
672 // Debug build checks
673 #if Q3_DEBUG
674 if (0) // Further checks on camera
675 return(kQ3Failure);
676
677 if (0) // Further checks on left
678 return(kQ3Failure);
679 #endif
680
681
682
683 // Call the bottleneck
684 E3System_Bottleneck();
685
686
687
688 // Call our implementation
689 return ( (E3OrthographicCamera*) camera )->SetLeft ( left ) ;
690 }
691
692
693
694
695
696 //=============================================================================
697 // Q3OrthographicCamera_GetLeft : Quesa API entry point.
698 //-----------------------------------------------------------------------------
699 TQ3Status
Q3OrthographicCamera_GetLeft(TQ3CameraObject camera,float * left)700 Q3OrthographicCamera_GetLeft(TQ3CameraObject camera, float *left)
701 {
702
703
704 // Release build checks
705 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
706 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(left), kQ3Failure);
707
708
709
710 // Debug build checks
711 #if Q3_DEBUG
712 if (0) // Further checks on camera
713 return(kQ3Failure);
714
715 if (0) // Further checks on left
716 return(kQ3Failure);
717 #endif
718
719
720
721 // Call the bottleneck
722 E3System_Bottleneck();
723
724
725
726 // Call our implementation
727 return ( (E3OrthographicCamera*) camera )->GetLeft ( left ) ;
728 }
729
730
731
732
733
734 //=============================================================================
735 // Q3OrthographicCamera_SetTop : Quesa API entry point.
736 //-----------------------------------------------------------------------------
737 TQ3Status
Q3OrthographicCamera_SetTop(TQ3CameraObject camera,float top)738 Q3OrthographicCamera_SetTop(TQ3CameraObject camera, float top)
739 {
740
741
742 // Release build checks
743 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
744
745
746
747 // Debug build checks
748 #if Q3_DEBUG
749 if (0) // Further checks on camera
750 return(kQ3Failure);
751
752 if (0) // Further checks on top
753 return(kQ3Failure);
754 #endif
755
756
757
758 // Call the bottleneck
759 E3System_Bottleneck();
760
761
762
763 // Call our implementation
764 return ( (E3OrthographicCamera*) camera )->SetTop ( top ) ;
765 }
766
767
768
769
770
771 //=============================================================================
772 // Q3OrthographicCamera_GetTop : Quesa API entry point.
773 //-----------------------------------------------------------------------------
774 TQ3Status
Q3OrthographicCamera_GetTop(TQ3CameraObject camera,float * top)775 Q3OrthographicCamera_GetTop(TQ3CameraObject camera, float *top)
776 {
777
778
779 // Release build checks
780 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
781 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(top), kQ3Failure);
782
783
784
785 // Debug build checks
786 #if Q3_DEBUG
787 if (0) // Further checks on camera
788 return(kQ3Failure);
789
790 if (0) // Further checks on top
791 return(kQ3Failure);
792 #endif
793
794
795
796 // Call the bottleneck
797 E3System_Bottleneck();
798
799
800
801 // Call our implementation
802 return ( (E3OrthographicCamera*) camera )->GetTop ( top ) ;
803 }
804
805
806
807
808
809 //=============================================================================
810 // Q3OrthographicCamera_SetRight : Quesa API entry point.
811 //-----------------------------------------------------------------------------
812 TQ3Status
Q3OrthographicCamera_SetRight(TQ3CameraObject camera,float right)813 Q3OrthographicCamera_SetRight(TQ3CameraObject camera, float right)
814 {
815
816
817 // Release build checks
818 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
819
820
821
822 // Debug build checks
823 #if Q3_DEBUG
824 if (0) // Further checks on camera
825 return(kQ3Failure);
826
827 if (0) // Further checks on right
828 return(kQ3Failure);
829 #endif
830
831
832
833 // Call the bottleneck
834 E3System_Bottleneck();
835
836
837
838 // Call our implementation
839 return ( (E3OrthographicCamera*) camera )->SetRight ( right ) ;
840 }
841
842
843
844
845
846 //=============================================================================
847 // Q3OrthographicCamera_GetRight : Quesa API entry point.
848 //-----------------------------------------------------------------------------
849 TQ3Status
Q3OrthographicCamera_GetRight(TQ3CameraObject camera,float * right)850 Q3OrthographicCamera_GetRight(TQ3CameraObject camera, float *right)
851 {
852
853
854 // Release build checks
855 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
856 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(right), kQ3Failure);
857
858
859
860 // Debug build checks
861 #if Q3_DEBUG
862 if (0) // Further checks on camera
863 return(kQ3Failure);
864
865 if (0) // Further checks on right
866 return(kQ3Failure);
867 #endif
868
869
870
871 // Call the bottleneck
872 E3System_Bottleneck();
873
874
875
876 // Call our implementation
877 return ( (E3OrthographicCamera*) camera )->GetRight ( right ) ;
878 }
879
880
881
882
883
884 //=============================================================================
885 // Q3OrthographicCamera_SetBottom : Quesa API entry point.
886 //-----------------------------------------------------------------------------
887 TQ3Status
Q3OrthographicCamera_SetBottom(TQ3CameraObject camera,float bottom)888 Q3OrthographicCamera_SetBottom(TQ3CameraObject camera, float bottom)
889 {
890
891
892 // Release build checks
893 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
894
895
896
897 // Debug build checks
898 #if Q3_DEBUG
899 if (0) // Further checks on camera
900 return(kQ3Failure);
901
902 if (0) // Further checks on bottom
903 return(kQ3Failure);
904 #endif
905
906
907
908 // Call the bottleneck
909 E3System_Bottleneck();
910
911
912
913 // Call our implementation
914 return ( (E3OrthographicCamera*) camera )->SetBottom ( bottom ) ;
915 }
916
917
918
919
920
921 //=============================================================================
922 // Q3OrthographicCamera_GetBottom : Quesa API entry point.
923 //-----------------------------------------------------------------------------
924 TQ3Status
Q3OrthographicCamera_GetBottom(TQ3CameraObject camera,float * bottom)925 Q3OrthographicCamera_GetBottom(TQ3CameraObject camera, float *bottom)
926 {
927
928
929 // Release build checks
930 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
931 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(bottom), kQ3Failure);
932
933
934
935 // Debug build checks
936 #if Q3_DEBUG
937 if (0) // Further checks on camera
938 return(kQ3Failure);
939
940 if (0) // Further checks on bottom
941 return(kQ3Failure);
942 #endif
943
944
945
946 // Call the bottleneck
947 E3System_Bottleneck();
948
949
950
951 // Call our implementation
952 return ( (E3OrthographicCamera*) camera )->GetBottom ( bottom ) ;
953 }
954
955
956
957
958
959 //=============================================================================
960 // Q3ViewPlaneCamera_New : Quesa API entry point.
961 //-----------------------------------------------------------------------------
962 TQ3CameraObject
Q3ViewPlaneCamera_New(const TQ3ViewPlaneCameraData * cameraData)963 Q3ViewPlaneCamera_New(const TQ3ViewPlaneCameraData *cameraData)
964 {
965
966
967 // Release build checks
968 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(cameraData), NULL);
969
970
971
972 // Debug build checks
973 #if Q3_DEBUG
974 // Further checks on cameraData
975 if (fabs( Q3FastVector3D_Length( &cameraData->cameraData.placement.upVector ) -
976 1.0f ) > kQ3RealZero)
977 {
978 E3ErrorManager_PostWarning( kQ3WarningVector3DNotUnitLength );
979 }
980 #endif
981
982
983
984 // Call the bottleneck
985 E3System_Bottleneck();
986
987
988
989 // Call our implementation
990 return(E3ViewPlaneCamera_New(cameraData));
991 }
992
993
994
995
996
997 //=============================================================================
998 // Q3ViewPlaneCamera_GetData : Quesa API entry point.
999 //-----------------------------------------------------------------------------
1000 TQ3Status
Q3ViewPlaneCamera_GetData(TQ3CameraObject camera,TQ3ViewPlaneCameraData * cameraData)1001 Q3ViewPlaneCamera_GetData(TQ3CameraObject camera, TQ3ViewPlaneCameraData *cameraData)
1002 {
1003
1004
1005 // Release build checks
1006 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1007 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(cameraData), kQ3Failure);
1008
1009
1010
1011 // Debug build checks
1012 #if Q3_DEBUG
1013 if (0) // Further checks on camera
1014 return(kQ3Failure);
1015
1016 if (0) // Further checks on cameraData
1017 return(kQ3Failure);
1018 #endif
1019
1020
1021
1022 // Call the bottleneck
1023 E3System_Bottleneck();
1024
1025
1026
1027 // Call our implementation
1028 return ( (E3ViewPlaneCamera*) camera )->GetData ( cameraData ) ;
1029 }
1030
1031
1032
1033
1034
1035 //=============================================================================
1036 // Q3ViewPlaneCamera_SetData : Quesa API entry point.
1037 //-----------------------------------------------------------------------------
1038 TQ3Status
Q3ViewPlaneCamera_SetData(TQ3CameraObject camera,const TQ3ViewPlaneCameraData * cameraData)1039 Q3ViewPlaneCamera_SetData(TQ3CameraObject camera, const TQ3ViewPlaneCameraData *cameraData)
1040 {
1041
1042
1043 // Release build checks
1044 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1045 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(cameraData), kQ3Failure);
1046
1047
1048
1049 // Debug build checks
1050 #if Q3_DEBUG
1051 if (0) // Further checks on camera
1052 return(kQ3Failure);
1053
1054 // Further checks on cameraData
1055 if (fabs( Q3FastVector3D_Length( &cameraData->cameraData.placement.upVector ) -
1056 1.0f ) > kQ3RealZero)
1057 {
1058 E3ErrorManager_PostWarning( kQ3WarningVector3DNotUnitLength );
1059 }
1060 #endif
1061
1062
1063
1064 // Call the bottleneck
1065 E3System_Bottleneck();
1066
1067
1068
1069 // Call our implementation
1070 return ( (E3ViewPlaneCamera*) camera )->SetData ( cameraData ) ;
1071 }
1072
1073
1074
1075
1076
1077 //=============================================================================
1078 // Q3ViewPlaneCamera_SetViewPlane : Quesa API entry point.
1079 //-----------------------------------------------------------------------------
1080 TQ3Status
Q3ViewPlaneCamera_SetViewPlane(TQ3CameraObject camera,float viewPlane)1081 Q3ViewPlaneCamera_SetViewPlane(TQ3CameraObject camera, float viewPlane)
1082 {
1083
1084
1085 // Release build checks
1086 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1087
1088
1089
1090 // Debug build checks
1091 #if Q3_DEBUG
1092 if (0) // Further checks on camera
1093 return(kQ3Failure);
1094
1095 if (0) // Further checks on viewPlane
1096 return(kQ3Failure);
1097 #endif
1098
1099
1100
1101 // Call the bottleneck
1102 E3System_Bottleneck();
1103
1104
1105
1106 // Call our implementation
1107 return ( (E3ViewPlaneCamera*) camera )->SetViewPlane ( viewPlane ) ;
1108 }
1109
1110
1111
1112
1113
1114 //=============================================================================
1115 // Q3ViewPlaneCamera_GetViewPlane : Quesa API entry point.
1116 //-----------------------------------------------------------------------------
1117 TQ3Status
Q3ViewPlaneCamera_GetViewPlane(TQ3CameraObject camera,float * viewPlane)1118 Q3ViewPlaneCamera_GetViewPlane(TQ3CameraObject camera, float *viewPlane)
1119 {
1120
1121
1122 // Release build checks
1123 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1124 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(viewPlane), kQ3Failure);
1125
1126
1127
1128 // Debug build checks
1129 #if Q3_DEBUG
1130 if (0) // Further checks on camera
1131 return(kQ3Failure);
1132
1133 if (0) // Further checks on viewPlane
1134 return(kQ3Failure);
1135 #endif
1136
1137
1138
1139 // Call the bottleneck
1140 E3System_Bottleneck();
1141
1142
1143
1144 // Call our implementation
1145 return ( (E3ViewPlaneCamera*) camera )->GetViewPlane ( viewPlane ) ;
1146 }
1147
1148
1149
1150
1151
1152 //=============================================================================
1153 // Q3ViewPlaneCamera_SetHalfWidth : Quesa API entry point.
1154 //-----------------------------------------------------------------------------
1155 TQ3Status
Q3ViewPlaneCamera_SetHalfWidth(TQ3CameraObject camera,float halfWidthAtViewPlane)1156 Q3ViewPlaneCamera_SetHalfWidth(TQ3CameraObject camera, float halfWidthAtViewPlane)
1157 {
1158
1159
1160 // Release build checks
1161 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1162
1163
1164
1165 // Debug build checks
1166 #if Q3_DEBUG
1167 if (0) // Further checks on camera
1168 return(kQ3Failure);
1169
1170 if (0) // Further checks on halfWidthAtViewPlane
1171 return(kQ3Failure);
1172 #endif
1173
1174
1175
1176 // Call the bottleneck
1177 E3System_Bottleneck();
1178
1179
1180
1181 // Call our implementation
1182 return ( (E3ViewPlaneCamera*) camera )->SetHalfWidth ( halfWidthAtViewPlane ) ;
1183 }
1184
1185
1186
1187
1188
1189 //=============================================================================
1190 // Q3ViewPlaneCamera_GetHalfWidth : Quesa API entry point.
1191 //-----------------------------------------------------------------------------
1192 TQ3Status
Q3ViewPlaneCamera_GetHalfWidth(TQ3CameraObject camera,float * halfWidthAtViewPlane)1193 Q3ViewPlaneCamera_GetHalfWidth(TQ3CameraObject camera, float *halfWidthAtViewPlane)
1194 {
1195
1196
1197 // Release build checks
1198 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1199 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(halfWidthAtViewPlane), kQ3Failure);
1200
1201
1202
1203 // Debug build checks
1204 #if Q3_DEBUG
1205 if (0) // Further checks on camera
1206 return(kQ3Failure);
1207
1208 if (0) // Further checks on halfWidthAtViewPlane
1209 return(kQ3Failure);
1210 #endif
1211
1212
1213
1214 // Call the bottleneck
1215 E3System_Bottleneck();
1216
1217
1218
1219 // Call our implementation
1220 return ( (E3ViewPlaneCamera*) camera )->GetHalfWidth ( halfWidthAtViewPlane ) ;
1221 }
1222
1223
1224
1225
1226
1227 //=============================================================================
1228 // Q3ViewPlaneCamera_SetHalfHeight : Quesa API entry point.
1229 //-----------------------------------------------------------------------------
1230 TQ3Status
Q3ViewPlaneCamera_SetHalfHeight(TQ3CameraObject camera,float halfHeightAtViewPlane)1231 Q3ViewPlaneCamera_SetHalfHeight(TQ3CameraObject camera, float halfHeightAtViewPlane)
1232 {
1233
1234
1235 // Release build checks
1236 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1237
1238
1239
1240 // Debug build checks
1241 #if Q3_DEBUG
1242 if (0) // Further checks on camera
1243 return(kQ3Failure);
1244
1245 if (0) // Further checks on halfHeightAtViewPlane
1246 return(kQ3Failure);
1247 #endif
1248
1249
1250
1251 // Call the bottleneck
1252 E3System_Bottleneck();
1253
1254
1255
1256 // Call our implementation
1257 return ( (E3ViewPlaneCamera*) camera )->SetHalfHeight ( halfHeightAtViewPlane ) ;
1258 }
1259
1260
1261
1262
1263
1264 //=============================================================================
1265 // Q3ViewPlaneCamera_GetHalfHeight : Quesa API entry point.
1266 //-----------------------------------------------------------------------------
1267 TQ3Status
Q3ViewPlaneCamera_GetHalfHeight(TQ3CameraObject camera,float * halfHeightAtViewPlane)1268 Q3ViewPlaneCamera_GetHalfHeight(TQ3CameraObject camera, float *halfHeightAtViewPlane)
1269 {
1270
1271
1272 // Release build checks
1273 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1274 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(halfHeightAtViewPlane), kQ3Failure);
1275
1276
1277
1278 // Debug build checks
1279 #if Q3_DEBUG
1280 if (0) // Further checks on camera
1281 return(kQ3Failure);
1282
1283 if (0) // Further checks on halfHeightAtViewPlane
1284 return(kQ3Failure);
1285 #endif
1286
1287
1288
1289 // Call the bottleneck
1290 E3System_Bottleneck();
1291
1292
1293
1294 // Call our implementation
1295 return ( (E3ViewPlaneCamera*) camera )->GetHalfHeight ( halfHeightAtViewPlane ) ;
1296 }
1297
1298
1299
1300
1301
1302 //=============================================================================
1303 // Q3ViewPlaneCamera_SetCenterX : Quesa API entry point.
1304 //-----------------------------------------------------------------------------
1305 TQ3Status
Q3ViewPlaneCamera_SetCenterX(TQ3CameraObject camera,float centerXOnViewPlane)1306 Q3ViewPlaneCamera_SetCenterX(TQ3CameraObject camera, float centerXOnViewPlane)
1307 {
1308
1309
1310 // Release build checks
1311 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1312
1313
1314
1315 // Debug build checks
1316 #if Q3_DEBUG
1317 if (0) // Further checks on camera
1318 return(kQ3Failure);
1319
1320 if (0) // Further checks on centerXOnViewPlane
1321 return(kQ3Failure);
1322 #endif
1323
1324
1325
1326 // Call the bottleneck
1327 E3System_Bottleneck();
1328
1329
1330
1331 // Call our implementation
1332 return ( (E3ViewPlaneCamera*) camera )->SetCenterX ( centerXOnViewPlane ) ;
1333 }
1334
1335
1336
1337
1338
1339 //=============================================================================
1340 // Q3ViewPlaneCamera_GetCenterX : Quesa API entry point.
1341 //-----------------------------------------------------------------------------
1342 TQ3Status
Q3ViewPlaneCamera_GetCenterX(TQ3CameraObject camera,float * centerXOnViewPlane)1343 Q3ViewPlaneCamera_GetCenterX(TQ3CameraObject camera, float *centerXOnViewPlane)
1344 {
1345
1346
1347 // Release build checks
1348 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1349 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(centerXOnViewPlane), kQ3Failure);
1350
1351
1352
1353 // Debug build checks
1354 #if Q3_DEBUG
1355 if (0) // Further checks on camera
1356 return(kQ3Failure);
1357
1358 if (0) // Further checks on centerXOnViewPlane
1359 return(kQ3Failure);
1360 #endif
1361
1362
1363
1364 // Call the bottleneck
1365 E3System_Bottleneck();
1366
1367
1368
1369 // Call our implementation
1370 return ( (E3ViewPlaneCamera*) camera )->GetCenterX ( centerXOnViewPlane ) ;
1371 }
1372
1373
1374
1375
1376
1377 //=============================================================================
1378 // Q3ViewPlaneCamera_SetCenterY : Quesa API entry point.
1379 //-----------------------------------------------------------------------------
1380 TQ3Status
Q3ViewPlaneCamera_SetCenterY(TQ3CameraObject camera,float centerYOnViewPlane)1381 Q3ViewPlaneCamera_SetCenterY(TQ3CameraObject camera, float centerYOnViewPlane)
1382 {
1383
1384
1385 // Release build checks
1386 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1387
1388
1389
1390 // Debug build checks
1391 #if Q3_DEBUG
1392 if (0) // Further checks on camera
1393 return(kQ3Failure);
1394
1395 if (0) // Further checks on centerYOnViewPlane
1396 return(kQ3Failure);
1397 #endif
1398
1399
1400
1401 // Call the bottleneck
1402 E3System_Bottleneck();
1403
1404
1405
1406 // Call our implementation
1407 return ( (E3ViewPlaneCamera*) camera )->SetCenterY ( centerYOnViewPlane ) ;
1408 }
1409
1410
1411
1412
1413
1414 //=============================================================================
1415 // Q3ViewPlaneCamera_GetCenterY : Quesa API entry point.
1416 //-----------------------------------------------------------------------------
1417 TQ3Status
Q3ViewPlaneCamera_GetCenterY(TQ3CameraObject camera,float * centerYOnViewPlane)1418 Q3ViewPlaneCamera_GetCenterY(TQ3CameraObject camera, float *centerYOnViewPlane)
1419 {
1420
1421
1422 // Release build checks
1423 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1424 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(centerYOnViewPlane), kQ3Failure);
1425
1426
1427
1428 // Debug build checks
1429 #if Q3_DEBUG
1430 if (0) // Further checks on camera
1431 return(kQ3Failure);
1432
1433 if (0) // Further checks on centerYOnViewPlane
1434 return(kQ3Failure);
1435 #endif
1436
1437
1438
1439 // Call the bottleneck
1440 E3System_Bottleneck();
1441
1442
1443
1444 // Call our implementation
1445 return ( (E3ViewPlaneCamera*) camera )->GetCenterY ( centerYOnViewPlane ) ;
1446 }
1447
1448
1449
1450
1451
1452 //=============================================================================
1453 // Q3ViewAngleAspectCamera_New : Quesa API entry point.
1454 //-----------------------------------------------------------------------------
1455 TQ3CameraObject
Q3ViewAngleAspectCamera_New(const TQ3ViewAngleAspectCameraData * cameraData)1456 Q3ViewAngleAspectCamera_New(const TQ3ViewAngleAspectCameraData *cameraData)
1457 {
1458
1459
1460 // Release build checks
1461 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(cameraData), NULL);
1462
1463
1464
1465 // Debug build checks
1466 #if Q3_DEBUG
1467 // Further checks on cameraData
1468 if (fabs( Q3FastVector3D_Length( &cameraData->cameraData.placement.upVector ) -
1469 1.0f ) > kQ3RealZero)
1470 {
1471 E3ErrorManager_PostWarning( kQ3WarningVector3DNotUnitLength );
1472 }
1473 #endif
1474
1475
1476
1477 // Call the bottleneck
1478 E3System_Bottleneck();
1479
1480
1481
1482 // Call our implementation
1483 return(E3ViewAngleAspectCamera_New(cameraData));
1484 }
1485
1486
1487
1488
1489
1490 //=============================================================================
1491 // Q3ViewAngleAspectCamera_SetData : Quesa API entry point.
1492 //-----------------------------------------------------------------------------
1493 TQ3Status
Q3ViewAngleAspectCamera_SetData(TQ3CameraObject camera,const TQ3ViewAngleAspectCameraData * cameraData)1494 Q3ViewAngleAspectCamera_SetData(TQ3CameraObject camera, const TQ3ViewAngleAspectCameraData *cameraData)
1495 {
1496
1497
1498 // Release build checks
1499 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1500 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(cameraData), kQ3Failure);
1501
1502
1503
1504 // Debug build checks
1505 #if Q3_DEBUG
1506 if (0) // Further checks on camera
1507 return(kQ3Failure);
1508
1509 // Further checks on cameraData
1510 if (fabs( Q3FastVector3D_Length( &cameraData->cameraData.placement.upVector ) -
1511 1.0f ) > kQ3RealZero)
1512 {
1513 E3ErrorManager_PostWarning( kQ3WarningVector3DNotUnitLength );
1514 }
1515 #endif
1516
1517
1518
1519 // Call the bottleneck
1520 E3System_Bottleneck();
1521
1522
1523
1524 // Call our implementation
1525 return ( (E3ViewAngleAspectCamera*) camera )->SetData ( cameraData ) ;
1526 }
1527
1528
1529
1530
1531
1532 //=============================================================================
1533 // Q3ViewAngleAspectCamera_GetData : Quesa API entry point.
1534 //-----------------------------------------------------------------------------
1535 TQ3Status
Q3ViewAngleAspectCamera_GetData(TQ3CameraObject camera,TQ3ViewAngleAspectCameraData * cameraData)1536 Q3ViewAngleAspectCamera_GetData(TQ3CameraObject camera, TQ3ViewAngleAspectCameraData *cameraData)
1537 {
1538
1539
1540 // Release build checks
1541 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1542 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(cameraData), kQ3Failure);
1543
1544
1545
1546 // Debug build checks
1547 #if Q3_DEBUG
1548 if (0) // Further checks on camera
1549 return(kQ3Failure);
1550
1551 if (0) // Further checks on cameraData
1552 return(kQ3Failure);
1553 #endif
1554
1555
1556
1557 // Call the bottleneck
1558 E3System_Bottleneck();
1559
1560
1561
1562 // Call our implementation
1563 return ( (E3ViewAngleAspectCamera*) camera )->GetData ( cameraData ) ;
1564 }
1565
1566
1567
1568
1569
1570 //=============================================================================
1571 // Q3ViewAngleAspectCamera_SetFOV : Quesa API entry point.
1572 //-----------------------------------------------------------------------------
1573 TQ3Status
Q3ViewAngleAspectCamera_SetFOV(TQ3CameraObject camera,float fov)1574 Q3ViewAngleAspectCamera_SetFOV(TQ3CameraObject camera, float fov)
1575 {
1576
1577
1578 // Release build checks
1579 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1580
1581
1582
1583 // Debug build checks
1584 #if Q3_DEBUG
1585 if (0) // Further checks on camera
1586 return(kQ3Failure);
1587
1588 if (0) // Further checks on fov
1589 return(kQ3Failure);
1590 #endif
1591
1592
1593
1594 // Call the bottleneck
1595 E3System_Bottleneck();
1596
1597
1598
1599 // Call our implementation
1600 return ( (E3ViewAngleAspectCamera*) camera )->SetFOV ( fov ) ;
1601 }
1602
1603
1604
1605
1606
1607 //=============================================================================
1608 // Q3ViewAngleAspectCamera_GetFOV : Quesa API entry point.
1609 //-----------------------------------------------------------------------------
1610 TQ3Status
Q3ViewAngleAspectCamera_GetFOV(TQ3CameraObject camera,float * fov)1611 Q3ViewAngleAspectCamera_GetFOV(TQ3CameraObject camera, float *fov)
1612 {
1613
1614
1615 // Release build checks
1616 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1617 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(fov), kQ3Failure);
1618
1619
1620
1621 // Debug build checks
1622 #if Q3_DEBUG
1623 if (0) // Further checks on camera
1624 return(kQ3Failure);
1625
1626 if (0) // Further checks on fov
1627 return(kQ3Failure);
1628 #endif
1629
1630
1631
1632 // Call the bottleneck
1633 E3System_Bottleneck();
1634
1635
1636
1637 // Call our implementation
1638 return ( (E3ViewAngleAspectCamera*) camera )->GetFOV ( fov ) ;
1639 }
1640
1641
1642
1643
1644
1645 //=============================================================================
1646 // Q3ViewAngleAspectCamera_SetAspectRatio : Quesa API entry point.
1647 //-----------------------------------------------------------------------------
1648 TQ3Status
Q3ViewAngleAspectCamera_SetAspectRatio(TQ3CameraObject camera,float aspectRatioXToY)1649 Q3ViewAngleAspectCamera_SetAspectRatio(TQ3CameraObject camera, float aspectRatioXToY)
1650 {
1651
1652
1653 // Release build checks
1654 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1655
1656
1657
1658 // Debug build checks
1659 #if Q3_DEBUG
1660 if (0) // Further checks on camera
1661 return(kQ3Failure);
1662
1663 if (0) // Further checks on aspectRatioXToY
1664 return(kQ3Failure);
1665 #endif
1666
1667
1668
1669 // Call the bottleneck
1670 E3System_Bottleneck();
1671
1672
1673
1674 // Call our implementation
1675 return ( (E3ViewAngleAspectCamera*) camera )->SetAspectRatio ( aspectRatioXToY ) ;
1676 }
1677
1678
1679
1680
1681
1682 //=============================================================================
1683 // Q3ViewAngleAspectCamera_GetAspectRatio : Quesa API entry point.
1684 //-----------------------------------------------------------------------------
1685 TQ3Status
Q3ViewAngleAspectCamera_GetAspectRatio(TQ3CameraObject camera,float * aspectRatioXToY)1686 Q3ViewAngleAspectCamera_GetAspectRatio(TQ3CameraObject camera, float *aspectRatioXToY)
1687 {
1688
1689
1690 // Release build checks
1691 Q3_REQUIRE_OR_RESULT( E3Camera::IsOfMyClass ( camera ), kQ3Failure ) ;
1692 Q3_REQUIRE_OR_RESULT(Q3_VALID_PTR(aspectRatioXToY), kQ3Failure);
1693
1694
1695
1696 // Debug build checks
1697 #if Q3_DEBUG
1698 if (0) // Further checks on camera
1699 return(kQ3Failure);
1700
1701 if (0) // Further checks on aspectRatioXToY
1702 return(kQ3Failure);
1703 #endif
1704
1705
1706
1707 // Call the bottleneck
1708 E3System_Bottleneck();
1709
1710
1711
1712 // Call our implementation
1713 return ( (E3ViewAngleAspectCamera*) camera )->GetAspectRatio ( aspectRatioXToY ) ;
1714 }
1715
1716
1717
1718
1719
1720