LEFT | RIGHT |
| 1 /* |
| 2 * ***** BEGIN GPL LICENSE BLOCK ***** |
| 3 * |
| 4 * This program is free software; you can redistribute it and/or |
| 5 * modify it under the terms of the GNU General Public License |
| 6 * as published by the Free Software Foundation; either version 2 |
| 7 * of the License, or (at your option) any later version. |
| 8 * |
| 9 * This program is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 * GNU General Public License for more details. |
| 13 * |
| 14 * You should have received a copy of the GNU General Public License |
| 15 * along with this program; if not, write to the Free Software Foundation, |
| 16 * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. |
| 17 * |
| 18 * Contributor(s): Tao Ju |
| 19 * |
| 20 * ***** END GPL LICENSE BLOCK ***** |
| 21 */ |
| 22 |
1 #ifndef PROJECTIONS_H | 23 #ifndef PROJECTIONS_H |
2 #define PROJECTIONS_H | 24 #define PROJECTIONS_H |
3 | 25 |
4 #include <stdio.h> | 26 #include <stdio.h> |
5 #include <stdlib.h> | 27 #include <stdlib.h> |
6 | 28 |
7 #define CONTAINS_INDEX | 29 #define CONTAINS_INDEX |
8 #define GRID_DIMENSION 20 | 30 #define GRID_DIMENSION 20 |
9 | 31 |
| 32 #if defined(_WIN32) && !defined(FREE_WINDOWS) |
| 33 #define LONG __int64 |
| 34 #else |
10 #define LONG int64_t | 35 #define LONG int64_t |
| 36 #endif |
11 #define UCHAR unsigned char | 37 #define UCHAR unsigned char |
12 | 38 |
13 /** | 39 /** |
14 * Structures and classes for computing projections of triangles | 40 * Structures and classes for computing projections of triangles |
15 * onto separating axes during scan conversion | 41 * onto separating axes during scan conversion |
16 * | 42 * |
17 * @author Tao Ju | 43 * @author Tao Ju |
18 */ | 44 */ |
19 | 45 |
20 | 46 |
21 const int vertmap[8][3] = {{0,0,0},{0,0,1},{0,1,0},{0,1,1},{1,0,0},{1,0,1},{1,1,
0},{1,1,1}} ; | 47 extern const int vertmap[8][3]; |
22 const int centmap[3][3][3][2] =· | 48 extern const int centmap[3][3][3][2]; |
23 {{{{0,0},{0,1},{1,1}},{{0,2},{0,3},{1,3}},{{2,2},{2,3},{3,3}}}, | 49 extern const int edgemap[12][2]; |
24 {{{0,4},{0,5},{1,5}},{{0,6},{0,7},{1,7}},{{2,6},{2,7},{3,7}}}, | 50 extern const int facemap[6][4]; |
25 {{{4,4},{4,5},{5,5}},{{4,6},{4,7},{5,7}},{{6,6},{6,7},{7,7}}}} ; | |
26 const int edgemap[12][2] = {{0,4},{1,5},{2,6},{3,7},{0,2},{1,3},{4,6},{5,7},{0,1
},{2,3},{4,5},{6,7}}; | |
27 const int facemap[6][4] = { | |
28 » { 0,1,2,3 }, | |
29 » { 4,5,6,7 }, | |
30 » { 0,1,4,5 }, | |
31 » { 2,3,6,7 }, | |
32 » { 0,2,4,6 }, | |
33 » { 1,3,5,7 }} ; | |
34 | 51 |
35 /** | 52 /** |
36 * Structure for the projections inheritable from parent | 53 * Structure for the projections inheritable from parent |
37 */ | 54 */ |
38 struct InheritableProjections | 55 struct InheritableProjections |
39 { | 56 { |
40 /// Projections of triangle | 57 /// Projections of triangle |
41 LONG trigProj[13][2] ; | 58 LONG trigProj[13][2] ; |
42 | 59 |
43 /// Projections of triangle vertices on primary axes | 60 /// Projections of triangle vertices on primary axes |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
818 mag = sqrt( mag ) ; | 835 mag = sqrt( mag ) ; |
819 a[0] /= mag ; | 836 a[0] /= mag ; |
820 a[1] /= mag ; | 837 a[1] /= mag ; |
821 a[2] /= mag ; | 838 a[2] /= mag ; |
822 } | 839 } |
823 } | 840 } |
824 | 841 |
825 }; | 842 }; |
826 | 843 |
827 #endif | 844 #endif |
LEFT | RIGHT |