Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add Recognizer to game

  • Loading branch information...
commit 69c8a230d0190a4978827b85ebaa04a04c70890e 1 parent 814e6eb
Iain Churcher authored
View
4 GlTron/res/layout/preferences.xml
@@ -78,6 +78,10 @@
android:entries="@array/gameSpeedEntries"
android:entryValues="@array/gameSpeedValues" />
+ <CheckBoxPreference android:title="Draw Recognizer"
+ android:summary="Display the Recognizer in game (can slow framerate if enabled)"
+ android:defaultValue="true"
+ android:key="drawRecog" />
</PreferenceCategory>
</PreferenceScreen>
View
BIN  GlTron/res/raw/game_recognizer.ogg
Binary file not shown
View
11 GlTron/res/raw/recognizer.mtl
@@ -0,0 +1,11 @@
+#
+# Wavefront material file
+# Converted by 3D Exploration 1.3.00 BETA
+# XDimension Software
+# http://www.xdsoft.com/explorer/
+#
+newmtl Hull
+ Ka 0.2 0.290196 0.215686
+ Kd 0.14902 0.458824 0.164706
+ Ks 0.898039 0.898039 0.898039
+ illum 0
View
813 GlTron/res/raw/recognizerhigh.obj
@@ -0,0 +1,813 @@
+#
+# Wavefront OBJ file
+# Converted by the 3D Exploration 1.7
+# XDimension Software, LLC
+# http://www.xdsoft.com/explorer/
+#
+# object Middle Bar
+mtllib recognizer.mtl
+g Middle_Bar
+v -140.483 5 32.6104
+v 139.517 5 32.6104
+v -140.483 5 42.6104
+v 139.517 5 42.6104
+v -140.483 -52.488 32.6104
+v 139.517 -52.488 32.6104
+v -140.483 -55 42.6104
+v 139.517 -55 42.6104
+# 8 verticies
+vn 0 1 9.53674e-08
+vn 0 -0.969869 -0.243628
+vn 0 0 -1
+vn 1 0 0
+vn 0 -6.35783e-08 1
+vn -1 0 0
+# 6 normals
+usemtl Hull
+f 1//1 3//1 4//1
+f 4//1 2//1 1//1
+f 5//2 6//2 8//2
+f 8//2 7//2 5//2
+f 1//3 2//3 6//3
+f 6//3 5//3 1//3
+f 2//4 4//4 8//4
+f 8//4 6//4 2//4
+f 4//5 3//5 7//5
+f 7//5 8//5 4//5
+f 3//6 1//6 5//6
+f 5//6 7//6 3//6
+# object Shoulder01
+g Shoulder01
+v -150.491 5 90.6522
+v -10.4913 5 90.6522
+v -150.491 5 100.652
+v -10.4913 5 100.652
+v -150.491 -55 90.6522
+v -10.4913 -55 90.6522
+v -150.491 -55 100.652
+v -10.4913 -55 100.652
+# 8 verticies
+vn 0 1 9.53674e-08
+vn 0 -1 0
+vn 0 1.27157e-07 -1
+vn 1 0 0
+vn 0 -1.27157e-07 1
+vn -1 0 0
+# 6 normals
+f 9//7 11//7 12//7
+f 12//7 10//7 9//7
+f 13//8 14//8 16//8
+f 16//8 15//8 13//8
+f 9//9 10//9 14//9
+f 14//9 13//9 9//9
+f 10//10 12//10 16//10
+f 16//10 14//10 10//10
+f 12//11 11//11 15//11
+f 15//11 16//11 12//11
+f 11//12 9//12 13//12
+f 13//12 15//12 11//12
+# object Shoulder02
+g Shoulder02
+v 9.56645 5 90.6522
+v 149.566 5 90.6522
+v 9.56645 5 100.652
+v 149.566 5 100.652
+v 9.56645 -55 90.6522
+v 149.566 -55 90.6522
+v 9.56645 -55 100.652
+v 149.566 -55 100.652
+# 8 verticies
+vn 0 1 9.53674e-08
+vn 0 -1 0
+vn 0 1.27157e-07 -1
+vn 1 0 0
+vn 0 -1.27157e-07 1
+vn -1 0 0
+# 6 normals
+f 17//13 19//13 20//13
+f 20//13 18//13 17//13
+f 21//14 22//14 24//14
+f 24//14 23//14 21//14
+f 17//15 18//15 22//15
+f 22//15 21//15 17//15
+f 18//16 20//16 24//16
+f 24//16 22//16 18//16
+f 20//17 19//17 23//17
+f 23//17 24//17 20//17
+f 19//18 17//18 21//18
+f 21//18 23//18 19//18
+# object Chest01
+g Chest01
+v -27.9831 3.17897 67.8053
+v 27.0169 3.17897 67.8053
+v -39.7688 3.17897 88.366
+v 38.8026 3.17897 88.366
+v -27.9831 -52.2233 67.8052
+v 27.0169 -52.2233 67.8052
+v -39.7688 -50.0614 88.366
+v 38.8026 -50.0614 88.366
+# 8 verticies
+vn 0 1 -3.47874e-08
+vn 0 -0.994518 0.10457
+vn 0 1.37709e-07 -1
+vn 0.867575 1.32036e-07 -0.497307
+vn 0.867575 1.95589e-07 -0.497306
+vn 0.867575 6.84837e-08 -0.497307
+vn 0 -1.43301e-07 1
+vn -0.867575 7.7119e-09 -0.497306
+vn -0.867575 6.84837e-08 -0.497307
+vn -0.867575 -5.30599e-08 -0.497306
+# 10 normals
+f 25//19 27//19 28//19
+f 28//19 26//19 25//19
+f 29//20 30//20 32//20
+f 32//20 31//20 29//20
+f 25//21 26//21 30//21
+f 30//21 29//21 25//21
+f 26//22 28//23 32//22
+f 32//22 30//24 26//22
+f 28//25 27//25 31//25
+f 31//25 32//25 28//25
+f 27//26 25//27 29//26
+f 29//26 31//28 27//26
+# object LegA01
+g LegA01
+v -138.604 -2.5 44.6729
+v -111.604 -2.5 44.6729
+v -138.604 -2.5 89.0729
+v -111.604 -2.5 89.0729
+v -138.604 -47.5 44.6729
+v -111.604 -47.5 44.6729
+v -138.604 -47.5 89.0729
+v -111.604 -47.5 89.0729
+# 8 verticies
+vn 0 1 4.29583e-08
+vn 0 -1 8.59166e-08
+vn 0 8.4771e-08 -1
+vn 1 0 0
+vn 0 -1.69542e-07 1
+vn -1 0 0
+# 6 normals
+f 33//29 35//29 36//29
+f 36//29 34//29 33//29
+f 37//30 38//30 40//30
+f 40//30 39//30 37//30
+f 33//31 34//31 38//31
+f 38//31 37//31 33//31
+f 34//32 36//32 40//32
+f 40//32 38//32 34//32
+f 36//33 35//33 39//33
+f 39//33 40//33 36//33
+f 35//34 33//34 37//34
+f 37//34 39//34 35//34
+# object LegB01
+g LegB01
+v 110.638 -2.5 44.6729
+v 137.638 -2.5 44.6729
+v 110.638 -2.5 89.0729
+v 137.638 -2.5 89.0729
+v 110.638 -47.5 44.6729
+v 137.638 -47.5 44.6729
+v 110.638 -47.5 89.0729
+v 137.638 -47.5 89.0729
+# 8 verticies
+vn 0 1 4.29583e-08
+vn 0 -1 8.59166e-08
+vn 0 8.4771e-08 -1
+vn 1 0 0
+vn 0 -1.69542e-07 1
+vn -1 0 0
+# 6 normals
+f 41//35 43//35 44//35
+f 44//35 42//35 41//35
+f 45//36 46//36 48//36
+f 48//36 47//36 45//36
+f 41//37 42//37 46//37
+f 46//37 45//37 41//37
+f 42//38 44//38 48//38
+f 48//38 46//38 42//38
+f 44//39 43//39 47//39
+f 47//39 48//39 44//39
+f 43//40 41//40 45//40
+f 45//40 47//40 43//40
+# object Bar02
+g Bar02
+v 79.3256 -7.83574e-06 63.0187
+v 106.326 -7.83574e-06 63.0187
+v 79.3256 -7.42305e-06 73.0187
+v 106.326 -7.42305e-06 73.0187
+v 79.3256 -50 63.0187
+v 106.326 -50 63.0187
+v 79.3256 -50 73.0187
+v 106.326 -50 73.0187
+# 8 verticies
+vn 0 1 -4.12693e-08
+vn 0 -1 3.8147e-07
+vn 0 7.62939e-08 -1
+vn 1 0 0
+vn 0 0 1
+vn -1 0 0
+# 6 normals
+f 49//41 51//41 52//41
+f 52//41 50//41 49//41
+f 53//42 54//42 56//42
+f 56//42 55//42 53//42
+f 49//43 50//43 54//43
+f 54//43 53//43 49//43
+f 50//44 52//44 56//44
+f 56//44 54//44 50//44
+f 52//45 51//45 55//45
+f 55//45 56//45 52//45
+f 51//46 49//46 53//46
+f 53//46 55//46 51//46
+# object Bar01
+g Bar01
+v -107.292 -7.83574e-06 63.0187
+v -80.2918 -7.83574e-06 63.0187
+v -107.292 -7.42305e-06 73.0187
+v -80.2918 -7.42305e-06 73.0187
+v -107.292 -50 63.0187
+v -80.2918 -50 63.0187
+v -107.292 -50 73.0187
+v -80.2918 -50 73.0187
+# 8 verticies
+vn 0 1 -4.12693e-08
+vn 0 -1 3.8147e-07
+vn 0 7.62939e-08 -1
+vn 1 0 0
+vn 0 0 1
+vn -1 0 0
+# 6 normals
+f 57//47 59//47 60//47
+f 60//47 58//47 57//47
+f 61//48 62//48 64//48
+f 64//48 63//48 61//48
+f 57//49 58//49 62//49
+f 62//49 61//49 57//49
+f 58//50 60//50 64//50
+f 64//50 62//50 58//50
+f 60//51 59//51 63//51
+f 63//51 64//51 60//51
+f 59//52 57//52 61//52
+f 61//52 63//52 59//52
+# object LegA02
+g LegA02
+v -138.604 -2.5 -108.936
+v -75.413 -2.5 -108.936
+v -138.604 -2.5 -90.182
+v -111.604 -2.5 -90.182
+v -138.604 -2.5 31.0636
+v -111.604 -2.5 31.0636
+v -138.604 -47.5 -108.936
+v -75.413 -47.5 -108.936
+v -138.604 -47.5 -90.182
+v -111.604 -47.5 -90.182
+v -138.604 -47.5 31.0636
+v -111.604 -47.5 31.0636
+# 12 verticies
+vn 0 1 1.52553e-07
+vn 0 1 6.52712e-08
+vn 0 1 1.08912e-07
+vn 0 1 2.16305e-08
+vn 0 -1 2.03404e-07
+vn 0 -1 1.25115e-07
+vn 0 -1 4.68262e-08
+vn 0 -1 -3.14625e-08
+vn 0 0 -1
+vn 0.460093 0 0.887871
+vn 1 0 0
+vn 0 -4.23855e-08 1
+vn -1 0 0
+# 13 normals
+f 65//53 67//54 68//55
+f 68//55 66//53 65//53
+f 67//54 69//56 70//56
+f 70//56 68//55 67//54
+f 71//57 72//57 74//58
+f 74//58 73//59 71//57
+f 73//59 74//58 76//60
+f 76//60 75//60 73//59
+f 65//61 66//61 72//61
+f 72//61 71//61 65//61
+f 66//62 68//62 74//62
+f 74//62 72//62 66//62
+f 68//63 70//63 76//63
+f 76//63 74//63 68//63
+f 70//64 69//64 75//64
+f 75//64 76//64 70//64
+f 69//65 67//65 73//65
+f 73//65 75//65 69//65
+f 67//65 65//65 71//65
+f 71//65 73//65 67//65
+# object Lower Midd
+g Lower_Midd
+v -31.9831 2.44438 23.265
+v 31.0169 2.44438 23.265
+v -37.9831 2.44438 30.6854
+v 37.0169 2.44438 30.6854
+v -31.9831 -49.7811 23.2649
+v 31.0169 -49.7811 23.2649
+v -37.9831 -52.4122 30.6854
+v 37.0169 -52.4122 30.6854
+# 8 verticies
+vn 0 1 0
+vn 0 -0.942507 -0.334187
+vn 0 3.65214e-08 -1
+vn 0.777605 3.33431e-08 -0.628754
+vn 0.777605 4.37232e-08 -0.628754
+vn 0.777604 2.2963e-08 -0.628754
+vn 0 -6.95395e-08 1
+vn -0.777605 3.33431e-08 -0.628754
+vn -0.777605 2.2963e-08 -0.628754
+vn -0.777604 4.37232e-08 -0.628754
+# 10 normals
+f 77//66 79//66 80//66
+f 80//66 78//66 77//66
+f 81//67 82//67 84//67
+f 84//67 83//67 81//67
+f 77//68 78//68 82//68
+f 82//68 81//68 77//68
+f 78//69 80//70 84//69
+f 84//69 82//71 78//69
+f 80//72 79//72 83//72
+f 83//72 84//72 80//72
+f 79//73 77//74 81//73
+f 81//73 83//75 79//73
+# object Head
+g Head
+v -26.0768 4.99999 104.591
+v 25.1107 4.99999 104.591
+v -20.8268 0.818023 119.111
+v 19.8607 0.818023 119.111
+v -26.0768 -55 104.591
+v 25.1107 -55 104.591
+v -20.8268 -44.5524 119.111
+v 19.8607 -44.5524 119.111
+# 8 verticies
+vn 0 0.960938 0.276762
+vn 0 -0.811715 0.584054
+vn 0 0 -1
+vn 0.940417 -1.97673e-08 0.340025
+vn 0.940417 -3.95346e-08 0.340025
+vn 0.940417 0 0.340025
+vn 0 0 1
+vn -0.940417 1.97673e-08 0.340025
+vn -0.940417 0 0.340025
+vn -0.940417 3.95346e-08 0.340025
+# 10 normals
+f 85//76 87//76 88//76
+f 88//76 86//76 85//76
+f 89//77 90//77 92//77
+f 92//77 91//77 89//77
+f 85//78 86//78 90//78
+f 90//78 89//78 85//78
+f 86//79 88//80 92//79
+f 92//79 90//81 86//79
+f 88//82 87//82 91//82
+f 91//82 92//82 88//82
+f 87//83 85//84 89//83
+f 89//83 91//85 87//83
+# object Chest02
+g Chest02
+v 9.50792 3.17897 66.114
+v 9.50792 3.17897 52.5693
+v 65.8137 3.17897 52.5693
+v 81.2614 3.17896 88.9498
+v 42.0824 3.17896 88.9498
+v 29.1534 3.17897 66.114
+v 9.50793 -52.4011 66.114
+v 9.50793 -53.8253 52.5693
+v 65.8137 -53.8253 52.5693
+v 81.2614 -50 88.9498
+v 42.0825 -50 88.9498
+v 29.1534 -52.4011 66.114
+# 12 verticies
+vn -1 -1.69442e-07 9.0208e-09
+vn -1 -1.67299e-07 5.88969e-15
+vn -1 -1.71586e-07 1.80416e-08
+vn 0 0 -1
+vn 0.920458 1.32055e-07 -0.390841
+vn 0.920458 2.6411e-07 -0.390841
+vn 0.920458 0 -0.390841
+vn 0 0 1
+vn -0.870205 -1.87175e-07 0.49269
+vn -0.870205 -1.87083e-07 0.49269
+vn -0.870205 -1.87268e-07 0.49269
+vn 0 -1.37268e-07 1
+vn 2.37897e-08 1 7.8056e-08
+vn 3.56845e-08 1 1.34686e-07
+vn 0 1 1.11409e-07
+vn 2.37897e-08 1 2.91848e-08
+vn 0 1 -3.52046e-08
+vn 6.79452e-08 -0.994518 0.10457
+vn 0 -0.994518 0.10457
+vn 1.01918e-07 -0.994518 0.10457
+vn 6.79452e-08 -0.994518 0.10457
+vn 0 -0.994518 0.10457
+# 22 normals
+f 93//86 94//87 100//86
+f 93//86 100//86 99//88
+f 94//89 95//89 101//89
+f 94//89 101//89 100//89
+f 95//90 96//91 102//90
+f 95//90 102//90 101//92
+f 96//93 97//93 103//93
+f 96//93 103//93 102//93
+f 97//94 98//95 104//94
+f 97//94 104//94 103//96
+f 98//97 93//97 99//97
+f 98//97 99//97 104//97
+f 95//98 97//99 96//100
+f 95//98 98//101 97//99
+f 94//102 98//101 95//98
+f 94//102 93//102 98//101
+f 101//103 102//104 103//105
+f 101//103 103//105 104//106
+f 100//107 101//103 104//106
+f 100//107 104//106 99//107
+# object Upper Midd
+g Upper_Midd
+v -61.7065 3.17897 44.7497
+v 60.7403 3.17897 44.7497
+v -64.9831 3.17897 50.8321
+v 64.0169 3.17897 50.8321
+v -61.7065 -54.6475 44.7497
+v 60.7403 -54.6475 44.7497
+v -64.9831 -54.008 50.8321
+v 64.0169 -54.008 50.8321
+# 8 verticies
+vn 0 1 0
+vn 0 -0.994518 0.104569
+vn 0 0 -1
+vn 0.880381 1.58182e-08 -0.474268
+vn 0.880381 3.16364e-08 -0.474268
+vn 0.88038 0 -0.474268
+vn 0 -6.67058e-08 1
+vn -0.880381 1.58182e-08 -0.474268
+vn -0.880381 0 -0.474268
+vn -0.88038 3.16364e-08 -0.474268
+# 10 normals
+f 105//108 107//108 108//108
+f 108//108 106//108 105//108
+f 109//109 110//109 112//109
+f 112//109 111//109 109//109
+f 105//110 106//110 110//110
+f 110//110 109//110 105//110
+f 106//111 108//112 112//111
+f 112//111 110//113 106//111
+f 108//114 107//114 111//114
+f 111//114 112//114 108//114
+f 107//115 105//116 109//115
+f 109//115 111//117 107//115
+# object Head01
+g Head01
+v 19.2607 2.00002 118.603
+v -20.2269 2.00001 118.603
+v -11.1143 -6.31388 145.091
+v 10.1482 -6.31388 145.091
+v 15.3119 -46.6 114.103
+v -16.2781 -46.6 114.103
+v -16.2781 -3.39998 114.103
+v 15.3119 -3.39998 114.103
+v -20.2268 -52 118.603
+v -11.1143 -26.7259 145.091
+v -10.0512 -27.0406 149.972
+v 9.08504 -27.0406 149.972
+v 9.08503 -8.66976 149.972
+v -10.0512 -8.66976 149.972
+v 10.1482 -26.7259 145.091
+v 19.2607 -52 118.603
+v 12.2744 -30.1023 147.813
+v -13.2406 -30.1024 147.813
+v -13.2406 -5.60795 147.813
+v 12.2744 -5.60794 147.813
+v 12.1079 -42.3555 128.711
+v 9.58973 -32.7047 138.825
+v 9.93852 -34.8278 136.6
+v -13.0741 -42.3555 128.711
+v -10.5559 -32.7047 138.825
+v -13.0551 -42.2632 128.807
+v -13.0741 -42.4313 128.711
+v 12.1079 -42.4313 128.711
+v 9.58974 -37.1741 137.868
+v -10.5559 -37.1741 137.868
+# 30 verticies
+vn -1.71999e-07 0.954108 0.299464
+vn -1.72822e-07 0.954108 0.299464
+vn -1.7868e-07 0.992766 0.120065
+vn -1.81468e-07 0.997549 -0.0699663
+vn -1.20756e-07 8.83031e-08 -1
+vn -2.41513e-07 -4.26527e-14 -1
+vn -3.19895e-14 1.76606e-07 -1
+vn -0.945609 -1.78141e-07 0.325306
+vn -0.945609 -1.7672e-07 0.325306
+vn -0.945609 -1.79561e-07 0.325306
+vn -0.293234 -5.13759e-08 0.956041
+vn 0.293234 6.089e-08 0.956041
+vn 0.293234 5.32787e-08 0.956041
+vn -0.293234 -4.56675e-08 0.956041
+vn 0.945609 1.4888e-07 0.325306
+vn 0.945609 1.2104e-07 0.325306
+vn 0.945609 1.7672e-07 0.325306
+vn 4.63837e-08 -0.640184 -0.768222
+vn 1.2369e-07 -0.640183 -0.768222
+vn -3.09227e-08 -0.640184 -0.768222
+vn -1.1596e-07 0.640185 -0.768221
+vn -0.751644 -7.2877e-08 -0.659569
+vn -0.751645 -1.3009e-08 -0.659568
+vn -0.751644 -1.32745e-07 -0.659569
+vn 0.751645 2.37581e-07 -0.659568
+vn 0.751645 2.25932e-07 -0.659568
+vn 0.751644 2.49229e-07 -0.659568
+vn 7.50588e-08 -0.627548 -0.778578
+vn 5.62941e-08 -0.627548 -0.778578
+vn 9.38235e-08 -0.627548 -0.778578
+vn -1.7728e-07 0.967966 -0.251083
+vn -1.80898e-07 0.967966 -0.251083
+vn -0.788013 -1.50336e-07 -0.615659
+vn -0.788013 -1.47268e-07 -0.615659
+vn -0.788013 -1.53404e-07 -0.615659
+vn 0.788013 1.34995e-07 -0.615659
+vn 0.788013 1.47268e-07 -0.615659
+vn 0.788013 1.22723e-07 -0.615659
+vn 1.00538e-07 -0.576393 0.817173
+vn 8.61753e-08 -0.576393 0.817173
+vn 1.149e-07 -0.576393 0.817173
+vn 0.560687 1.01873e-07 0.828028
+vn 0.560687 8.73199e-08 0.828028
+vn -1.11309e-07 0.576391 0.817174
+vn -1.07719e-07 0.576391 0.817174
+vn -1.149e-07 0.576391 0.817174
+vn -0.560687 -9.8235e-08 0.828028
+vn -0.560687 -1.0915e-07 0.828028
+vn 6.22973e-08 -0.723497 0.690327
+vn -1.17426e-06 -0.723497 0.690327
+vn -7.03585e-07 -0.723497 0.690327
+vn 1.95224e-07 -0.723497 0.690327
+vn -8.38773e-05 -0.723492 0.690332
+vn -3.04282e-07 -0.540835 0.841129
+vn -2.37337e-06 -0.723497 0.690327
+vn -0.000140798 -0.723489 0.690336
+vn 1.07309e-06 -0.574707 0.818359
+vn -0.000209962 -0.723485 0.69034
+vn 6.56878e-08 -0.867253 0.497868
+vn 1.31376e-07 -0.867253 0.497868
+vn 0 -0.867253 0.497868
+vn 0 0 -1
+vn 0.964211 0 0.265138
+vn 0.964211 3.06608e-07 0.265138
+vn 0.970348 -0.0137885 0.241319
+vn 0.980307 -0.0413331 0.193105
+vn 0.97313 -0.0206848 0.229327
+vn 0 -0.209306 0.97785
+vn 1.98166e-08 -0.209306 0.97785
+vn -0.952257 -0.0639002 0.298534
+vn -0.952254 -0.0639105 0.298543
+vn -0.963611 -0.0426831 0.263879
+vn -0.968654 -0.0320246 0.246339
+vn -0.981172 0 0.193138
+# 74 normals
+f 113//118 114//119 115//120
+f 115//120 116//121 113//118
+f 117//122 118//123 119//122
+f 119//122 120//124 117//122
+f 121//125 122//126 115//125
+f 115//125 114//127 121//125
+f 123//128 124//129 125//130
+f 125//130 126//131 123//128
+f 127//132 128//133 113//132
+f 113//132 116//134 127//132
+f 128//135 121//136 118//135
+f 118//135 117//137 128//135
+f 114//138 113//138 120//138
+f 120//138 119//138 114//138
+f 121//139 114//140 119//139
+f 119//139 118//141 121//139
+f 113//142 128//143 117//142
+f 117//142 120//144 113//142
+f 122//145 127//146 129//145
+f 129//145 130//147 122//145
+f 116//121 115//120 131//148
+f 131//148 132//149 116//121
+f 115//150 122//151 130//150
+f 130//150 131//152 115//150
+f 127//153 116//154 132//153
+f 132//153 129//155 127//153
+f 130//156 129//157 124//156
+f 124//156 123//158 130//156
+f 129//159 132//160 125//130
+f 125//130 124//129 129//159
+f 132//161 131//162 126//161
+f 126//161 125//163 132//161
+f 131//164 130//165 123//128
+f 123//128 126//131 131//164
+f 128//166 127//167 133//168
+f 128//166 133//168 121//169
+f 127//167 122//170 134//171
+f 135//172 127//167 134//171
+f 127//167 135//172 133//168
+f 122//170 121//169 136//173
+f 136//173 121//169 133//168
+f 134//171 122//170 137//174
+f 122//170 136//173 138//175
+f 137//174 122//170 138//175
+f 139//176 140//177 141//176
+f 141//176 142//178 139//176
+f 133//179 140//179 139//179
+f 140//180 133//181 141//182
+f 134//183 141//182 135//184
+f 141//185 134//171 142//186
+f 133//181 135//184 141//182
+f 133//179 139//179 136//179
+f 137//174 142//186 134//171
+f 142//187 137//188 139//189
+f 139//189 138//190 136//191
+f 138//190 139//189 137//188
+# object Head02
+g Head02
+v -81.7331 4.99999 104.591
+v -26.4755 4.99999 104.591
+v -13.6081 -6.46815 144.624
+v -11.9564 -6.46815 144.624
+v -81.7331 -55 104.591
+v -26.4755 -55 104.591
+v -13.6081 -26.6205 144.624
+v -11.9564 -26.6205 144.624
+# 8 verticies
+vn 0 0.961333 0.27539
+vn 0 -0.815805 0.578326
+vn 0 0 -1
+vn 0.940083 0 -0.340947
+vn 0 0 1
+vn -0.348607 0 0.937269
+vn -0.174303 0 0.984692
+vn -0.506639 0 0.862158
+# 8 normals
+f 143//192 145//192 146//192
+f 146//192 144//192 143//192
+f 147//193 148//193 150//193
+f 150//193 149//193 147//193
+f 143//194 144//194 148//194
+f 148//194 147//194 143//194
+f 144//195 146//195 150//195
+f 150//195 148//195 144//195
+f 146//196 145//197 149//198
+f 149//198 150//196 146//196
+f 145//197 143//199 147//199
+f 147//199 149//198 145//197
+# object Chest03
+g Chest03
+v -66.7799 3.17895 52.5693
+v -10.4741 3.17895 52.5693
+v -10.4741 3.17895 66.114
+v -30.1196 3.17895 66.114
+v -43.0486 3.17895 88.9498
+v -82.2276 3.17895 88.9498
+v -66.7799 -53.7851 52.5693
+v -10.4741 -53.7851 52.5693
+v -10.4741 -52.3759 66.114
+v -30.1196 -52.3759 66.114
+v -43.0486 -50 88.9498
+v -82.2276 -50 88.9498
+# 12 verticies
+vn 0 1.33934e-07 -1
+vn 1 0 0
+vn 0 -1.37331e-07 1
+vn 0.870206 -3.38307e-08 0.492689
+vn 0.870205 0 0.492689
+vn 0.870206 -6.76614e-08 0.492689
+vn 0 0 1
+vn -0.920459 2.61733e-08 -0.39084
+vn -0.920459 5.23466e-08 -0.39084
+vn -0.920459 0 -0.39084
+vn -1.00186e-09 1 3.99743e-08
+vn -6.6791e-10 1 3.83844e-08
+vn 0 1 3.93208e-08
+vn -6.6791e-10 1 3.70123e-08
+vn 0 1 3.52045e-08
+vn -5.11222e-08 -0.994631 0.103482
+vn 0 -0.994631 0.103482
+vn -3.40815e-08 -0.994631 0.103482
+vn -3.40815e-08 -0.994631 0.103482
+vn 0 -0.994631 0.103482
+# 20 normals
+f 151//200 152//200 158//200
+f 151//200 158//200 157//200
+f 152//201 153//201 159//201
+f 152//201 159//201 158//201
+f 153//202 154//202 160//202
+f 153//202 160//202 159//202
+f 154//203 155//204 161//203
+f 154//203 161//203 160//205
+f 155//206 156//206 162//206
+f 155//206 162//206 161//206
+f 156//207 151//208 157//207
+f 156//207 157//207 162//209
+f 155//210 151//211 156//212
+f 154//213 151//211 155//210
+f 154//213 152//214 151//211
+f 153//214 152//214 154//213
+f 161//215 162//216 157//217
+f 160//218 161//215 157//217
+f 160//218 157//217 158//219
+f 159//219 160//218 158//219
+# object LegB02
+g LegB02
+v 137.638 -47.5 -108.936
+v 74.4468 -47.5 -108.936
+v 137.638 -47.5 -90.182
+v 110.638 -47.5 -90.182
+v 137.638 -47.5 31.0636
+v 110.638 -47.5 31.0636
+v 137.638 -2.49998 -108.936
+v 74.4468 -2.49999 -108.936
+v 137.638 -2.49997 -90.182
+v 110.638 -2.49998 -90.182
+v 137.638 -2.49998 31.0636
+v 110.638 -2.49998 31.0636
+# 12 verticies
+vn 1.61194e-07 -1 2.86615e-08
+vn 1.8838e-07 -1 -1.04875e-08
+vn 1.54557e-07 -1 8.62018e-09
+vn 1.81102e-07 -1 5.73231e-08
+vn 2.8257e-07 -1 0
+vn 2.11928e-07 -1 -1.57313e-08
+vn -1.85156e-07 1 -1.77574e-07
+vn -1.84875e-07 1 -1.77169e-07
+vn -1.85249e-07 1 -1.09206e-07
+vn -1.85437e-07 1 -4.09729e-08
+vn -1.85437e-07 1 2.75297e-08
+vn -1.85437e-07 1 2.75297e-08
+vn -1.20735e-07 -1.02348e-14 -1
+vn -1.20735e-07 -2.04696e-14 -1
+vn -1.20735e-07 0 -1
+vn -0.460093 -1.53271e-07 0.887871
+vn -0.460093 -2.28537e-07 0.887871
+vn -0.460093 -7.80051e-08 0.887871
+vn -1 -2.54313e-07 3.14625e-08
+vn -1 -3.39084e-07 6.29251e-08
+vn -1 -1.69542e-07 -4.66745e-15
+vn 0 0 1
+vn 1 0 0
+# 23 normals
+f 163//220 165//221 166//222
+f 166//222 164//223 163//220
+f 165//221 167//224 168//225
+f 168//225 166//222 165//221
+f 169//226 170//227 172//228
+f 172//228 171//229 169//226
+f 171//229 172//228 174//230
+f 174//230 173//231 171//229
+f 163//232 164//233 170//232
+f 170//232 169//234 163//232
+f 164//235 166//236 172//235
+f 172//235 170//237 164//235
+f 166//238 168//239 174//238
+f 174//238 172//240 166//238
+f 168//241 167//241 173//241
+f 173//241 174//241 168//241
+f 167//242 165//242 171//242
+f 171//242 173//242 167//242
+f 165//242 163//242 169//242
+f 169//242 171//242 165//242
+# object Head04
+g Head04
+v 80.7669 -55 104.591
+v 25.5093 -55 104.591
+v 12.6419 -26.6205 144.624
+v 10.9902 -26.6205 144.624
+v 80.7669 5.00002 104.591
+v 25.5093 5.00001 104.591
+v 12.6419 -6.46814 144.624
+v 10.9902 -6.46814 144.624
+# 8 verticies
+vn 8.44784e-08 -0.815806 0.578326
+vn 0 -0.815806 0.578326
+vn 1.68957e-07 -0.815805 0.578326
+vn -6.80931e-08 0.961333 0.27539
+vn -1.36186e-07 0.961333 0.27539
+vn 0 0.961332 0.27539
+vn -6.90348e-08 -6.35783e-08 -1
+vn 0 0 -1
+vn -1.3807e-07 -1.27157e-07 -1
+vn -0.940083 -1.78629e-07 -0.340947
+vn -0.940083 -1.77951e-07 -0.340947
+vn -0.940083 -1.79307e-07 -0.340947
+vn 0 0 1
+vn 0.348607 1.15039e-07 0.937269
+vn 0.174303 3.29944e-08 0.984692
+vn 0.506639 2.38474e-07 0.862158
+vn 0.506639 1.67189e-07 0.862158
+# 17 normals
+f 175//243 177//244 178//243
+f 178//243 176//245 175//243
+f 179//246 180//247 182//246
+f 182//246 181//248 179//246
+f 175//249 176//250 180//249
+f 180//249 179//251 175//249
+f 176//252 178//253 182//252
+f 182//252 180//254 176//252
+f 178//255 177//256 181//257
+f 181//257 182//255 178//255
+f 177//256 175//258 179//259
+f 179//259 181//257 177//256
View
29 GlTron/src/com/glTron/Game/GLTronGame.java
@@ -56,12 +56,15 @@
private GLTexture SplashScreen;
private Model LightBike;
+ private Model RecognizerModel;
private Video Visual;
private WorldGraphics World;
private Lighting Lights = new Lighting();
private Player Players[] = new Player[MAX_PLAYERS];
+ private Recognizer mRecognizer;
+
// Camera data
private Camera Cam;
@@ -79,6 +82,7 @@
public static int CRASH_SOUND = 1;
public static int ENGINE_SOUND = 2;
public static int MUSIC_SOUND = 3;
+ public static int RECOGNIZER_SOUND = 4;
float mEngineSoundModifier = 1.0f;
long mEngineStartTime = 0;
@@ -118,6 +122,7 @@ public void initialiseGame()
SoundManager.initSounds(mContext);
SoundManager.addSound(ENGINE_SOUND, R.raw.game_engine);
SoundManager.addSound(CRASH_SOUND, R.raw.game_crash);
+ SoundManager.addSound(RECOGNIZER_SOUND, R.raw.game_recognizer);
SoundManager.addMusic(R.raw.song_revenge_of_cats);
// Load HUD
@@ -132,6 +137,7 @@ public void initialiseGame()
// Load Models
LightBike = new Model(mContext,R.raw.lightcyclehigh);
+ RecognizerModel = new Model(mContext,R.raw.recognizerhigh);
World = new WorldGraphics(gl, mContext, mCurrentGridSize);
TrailRenderer = new Trails_Renderer(gl,mContext);
@@ -140,6 +146,8 @@ public void initialiseGame()
Players[player] = new Player(player, mCurrentGridSize, LightBike, tronHUD);
}
+ mRecognizer = new Recognizer(mCurrentGridSize);
+
Cam = new Camera(Players[OWN_PLAYER], CamType.E_CAM_TYPE_CIRCLING);
ExplodeTex = new GLTexture(gl,mContext, R.drawable.gltron_impact);
@@ -154,7 +162,7 @@ public void initialiseGame()
if(mPrefs.PlayMusic())
SoundManager.playMusic(true);
if(mPrefs.PlaySFX())
- SoundManager.playSoundLoop(ENGINE_SOUND, 1.0f);
+ SoundManager.playSoundLoop(RECOGNIZER_SOUND, 1.0f);
ResetTime();
@@ -183,10 +191,14 @@ public void resumeGame()
{
mPrefs.ReloadPrefs();
+ SoundManager.stopSound(RECOGNIZER_SOUND);
+
// Update options
if(!boInitialState)
{
Cam.updateType(mPrefs.CameraType());
+ if(mPrefs.PlaySFX() && mPrefs.DrawRecognizer())
+ SoundManager.playSoundLoop(RECOGNIZER_SOUND, 1.0f);
}
else
{
@@ -199,8 +211,9 @@ public void resumeGame()
SoundManager.stopMusic();
SoundManager.stopSound(ENGINE_SOUND);
- if(mPrefs.PlaySFX())
+ if(mPrefs.PlaySFX()) {
SoundManager.playSoundLoop(ENGINE_SOUND,mEngineSoundModifier);
+ }
else
SoundManager.stopSound(ENGINE_SOUND);
@@ -285,6 +298,9 @@ public void addTouchEvent(float x, float y)
if(mPrefs.PlayMusic())
SoundManager.playMusic(true);
+ if(mPrefs.PlaySFX() && mPrefs.DrawRecognizer())
+ SoundManager.playSoundLoop(RECOGNIZER_SOUND, 1.0f);
+
tronHUD.displayInstr(false);
boInitialState = false;
}
@@ -354,10 +370,13 @@ public void RunGame()
Players[plyr].setSpeed(mPrefs.Speed());
}
+ mRecognizer = new Recognizer(mCurrentGridSize);
+
tronHUD.resetConsole();
Cam = new Camera(Players[OWN_PLAYER], CamType.E_CAM_TYPE_CIRCLING);
SoundManager.stopSound(ENGINE_SOUND); // ensure sound is stopped before playing again.
+ SoundManager.stopSound(RECOGNIZER_SOUND);
tronHUD.displayInstr(true);
@@ -512,6 +531,9 @@ private void RenderGame()
}
+ if(mPrefs.DrawRecognizer())
+ mRecognizer.doMovement(TimeDt);
+
}
Cam.doCameraMovement(Players[OWN_PLAYER],TimeCurrent, TimeDt);
@@ -541,6 +563,9 @@ private void RenderGame()
gl.glDepthMask(true);
gl.glEnable(GL10.GL_DEPTH_TEST);
+
+ if(mPrefs.DrawRecognizer())
+ mRecognizer.draw(gl, RecognizerModel);
World.drawWalls(gl);
View
207 GlTron/src/com/glTron/Game/Recognizer.java
@@ -0,0 +1,207 @@
+/*
+ * Copyright © 2012 Iain Churcher
+ *
+ * Based on GLtron by Andreas Umbach (www.gltron.org)
+ *
+ * This file is part of GL TRON.
+ *
+ * GL TRON is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * GL TRON is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with GL TRON. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package com.glTron.Game;
+
+import java.nio.FloatBuffer;
+
+import javax.microedition.khronos.opengles.GL10;
+
+import android.util.FloatMath;
+
+import com.glTron.Video.GraphicUtils;
+import com.glTron.Video.Model;
+import com.glTron.Video.Vec;
+
+public class Recognizer {
+
+ /*
+ * Private items
+ */
+ private float mAlpha;
+ private float mGridSize;
+ private FloatBuffer mColour;
+ private FloatBuffer mShadow;
+
+ /*
+ * Constants
+ */
+ private final float xv[] = {0.5f, 0.3245f, 0.6f, 0.5f, 0.68f, -0.3f};
+ private final float yv[] = {0.8f, 1.0f, 0.0f, 0.2f, 0.2f, 0.0f};
+ //private final float colour[] = {0.05f, 0.14f, 0.05f, 0.50f};
+ private final float colour[] = {0.6f, 0.16f, 0.2f, 0.50f};
+
+ private final float ShadowMatrix[] = {
+ 4.0f, 0.0f, 0.0f, 0.0f,
+ 0.0f, 4.0f, 0.0f, 0.0f,
+ -2.0f, -2.0f, 0.0f, 0.0f,
+ 0.0f, 0.0f, 0.0f, 4.0f
+ };
+
+ private final float scaleFactor = 0.25f;
+ private final float HEIGHT = 40.0f;
+
+ public Recognizer(float gridSize)
+ {
+ mAlpha = 0.0f;
+ mGridSize = gridSize;
+ mColour = GraphicUtils.ConvToFloatBuffer(colour);
+ mShadow = GraphicUtils.ConvToFloatBuffer(ShadowMatrix);
+ }
+
+ public void doMovement(long dt)
+ {
+ mAlpha += dt / 2000.0f;
+ }
+
+ public void reset()
+ {
+ mAlpha = 0.0f;
+ }
+
+ public void draw(GL10 gl, Model mesh)
+ {
+ Vec p,v;
+ float dirx;
+
+ gl.glPushMatrix();
+
+ p = getPosition(mesh);
+ v = getVelocity();
+
+ dirx = getAngle(v);
+
+ gl.glTranslatef(p.v[0], p.v[1], HEIGHT);
+ gl.glRotatef(dirx, 0.0f, 0.0f, 1.0f);
+
+ gl.glScalef(scaleFactor, scaleFactor, scaleFactor);
+
+ gl.glDisable(GL10.GL_LIGHT0);
+ gl.glDisable(GL10.GL_LIGHT1);
+ gl.glLightfv(GL10.GL_LIGHT2, GL10.GL_SPECULAR, mColour);
+ gl.glEnable(GL10.GL_LIGHT2);
+
+ gl.glDisable(GL10.GL_BLEND);
+ gl.glEnable(GL10.GL_CULL_FACE);
+
+ gl.glEnable(GL10.GL_LIGHTING);
+
+ gl.glEnable(GL10.GL_POLYGON_OFFSET_FILL);
+ gl.glPolygonOffset(1.0f, 1.0f);
+
+ gl.glEnable(GL10.GL_NORMALIZE);
+ gl.glColor4f(0.0f, 0.0f, 0.0f, 1.0f);
+
+ mesh.Draw(gl);
+
+ gl.glDisable(GL10.GL_POLYGON_OFFSET_FILL);
+ gl.glDisable(GL10.GL_LIGHT2);
+ gl.glEnable(GL10.GL_LIGHT1);
+ gl.glDisable(GL10.GL_LIGHTING);
+
+ // TODO:
+ // Original glTron used to render another model in wireframe mode over the existing recognizer
+ // OpenGL ES does not support this wireframe rendering mode. Need to come up with a replacement
+
+ gl.glDisable(GL10.GL_CULL_FACE);
+
+ gl.glPopMatrix();
+
+ // Draw the shadow
+ gl.glEnable(GL10.GL_STENCIL_TEST);
+ gl.glStencilOp(GL10.GL_REPLACE, GL10.GL_REPLACE, GL10.GL_REPLACE);
+ gl.glStencilFunc(GL10.GL_GREATER, 1, 1);
+ gl.glEnable(GL10.GL_BLEND);
+ gl.glColor4f(0.0f,0.0f,0.0f,0.8f);
+ gl.glBlendFunc(GL10.GL_SRC_ALPHA, GL10.GL_ONE_MINUS_SRC_ALPHA);
+
+ gl.glPushMatrix();
+ gl.glMultMatrixf(mShadow);
+ gl.glTranslatef(p.v[0], p.v[1], HEIGHT);
+ gl.glRotatef(dirx, 0.0f, 0.0f, 1.0f);
+ gl.glScalef(scaleFactor,scaleFactor,scaleFactor);
+ gl.glEnable(GL10.GL_NORMALIZE);
+ mesh.Draw(gl);
+ gl.glDisable(GL10.GL_STENCIL_TEST);
+ gl.glDisable(GL10.GL_BLEND);
+ gl.glDisable(GL10.GL_CULL_FACE);
+ gl.glPopMatrix();
+
+ }
+
+ /*
+ * Private methods
+ */
+ private float getAngle(Vec velocity)
+ {
+ float dxval = velocity.v[0];
+ float dyval = velocity.v[0];
+
+ float phi = (float)Math.acos(dxval / FloatMath.sqrt(dxval * dxval + dyval * dyval));
+
+ if(dyval < 0.0f)
+ phi = (float)(2.0f * Math.PI - phi);
+
+ return (float)((phi + Math.PI / 2.0f) * 180.0f / Math.PI);
+ }
+
+ private Vec getPosition(Model mesh)
+ {
+ float x,y;
+ float max = mesh.GetBBoxSize().v[0] * scaleFactor;
+ float boundary = mGridSize - max;
+ Vec pos;
+
+ x = (max + (getx() + 1.0f) * boundary) / 2.0f;
+ y = (max + (gety() + 1.0f) * boundary) / 2.0f;
+
+ pos = new Vec(x,y,0.0f);
+
+ return pos;
+ }
+
+ private Vec getVelocity()
+ {
+ Vec vel = new Vec(getdx() * mGridSize / 100.0f, getdy() * mGridSize / 100.0f,0.0f);
+ return vel;
+ }
+
+ private float getx()
+ {
+ return (xv[0] * FloatMath.sin(xv[1] * mAlpha + xv[2]) - xv[3] * FloatMath.sin(xv[4] * mAlpha + xv[5]));
+ }
+
+ private float gety()
+ {
+ return (yv[0] * FloatMath.cos(yv[1] * mAlpha + yv[2] - yv[3] * FloatMath.sin(yv[4] * mAlpha + yv[5])));
+ }
+
+ private float getdx()
+ {
+ return (xv[1] * xv[0] * FloatMath.cos(xv[1] * mAlpha + xv[2]) - xv[4] * xv[3] * FloatMath.cos(xv[4] * mAlpha + xv[5]));
+ }
+
+ private float getdy()
+ {
+ return -(yv[1] * yv[0] * FloatMath.sin(yv[1] * mAlpha + yv[2]) - yv[4] * yv[3] * FloatMath.sin(yv[4] * mAlpha + yv[5]));
+ }
+
+}
View
7 GlTron/src/com/glTron/Game/UserPrefs.java
@@ -50,6 +50,7 @@
private boolean mSFX;
private boolean mFPS;
+ private boolean mDrawRecog;
private int mNumOfPlayers;
private float mGridSize;
@@ -99,6 +100,7 @@ public void ReloadPrefs()
speedIndex = Integer.valueOf(prefs.getString("gameSpeed", "1"));
mSpeed = C_SPEED[speedIndex];
mPlayerColourIndex = Integer.valueOf(prefs.getString("playerBike","0"));
+ mDrawRecog = prefs.getBoolean("drawRecog", true);
}
public Camera.CamType CameraType()
@@ -141,4 +143,9 @@ public int PlayerColourIndex()
{
return mPlayerColourIndex;
}
+
+ public boolean DrawRecognizer()
+ {
+ return mDrawRecog;
+ }
}
View
2  GlTron/src/com/glTron/Sound/SoundManager.java
@@ -42,7 +42,7 @@
private static AudioManager mAudioManager;
private static Context mContext;
- private static final int MAX_SOUNDS = 4;
+ private static final int MAX_SOUNDS = 10;
private static int MAX_INDEX = 10;
View
15 GlTron/src/com/glTron/Video/Model.java
@@ -277,17 +277,19 @@ private void readMesh(Context ctx, int resId)
mIndicesBuffer[i].position(0);
}
- float[] HullColour = {0.0f, 0.1f, 0.9f, 1.0f};
-
- mMaterials.SetMaterialColour("Hull", ColourType.E_AMBIENT, HullColour);
- mMaterials.SetMaterialColour("Hull", ColourType.E_DIFFUSE, HullColour);
-
computeBBox();
}
public void Draw(GL10 gl, float ambient_color[], float diffuse_color[])
{
+ mMaterials.SetMaterialColour("Hull", ColourType.E_AMBIENT, ambient_color);
+ mMaterials.SetMaterialColour("Hull", ColourType.E_DIFFUSE, diffuse_color);
+ Draw(gl);
+ }
+
+ public void Draw(GL10 gl)
+ {
int MaterialCount = mMaterials.GetNumber();
gl.glEnableClientState(GL10.GL_VERTEX_ARRAY);
@@ -295,9 +297,6 @@ public void Draw(GL10 gl, float ambient_color[], float diffuse_color[])
gl.glVertexPointer(3, GL10.GL_FLOAT, 0, mVertexBuffer);
gl.glNormalPointer(GL10.GL_FLOAT, 0, mNormalBuffer);
- mMaterials.SetMaterialColour("Hull", ColourType.E_AMBIENT, ambient_color);
- mMaterials.SetMaterialColour("Hull", ColourType.E_DIFFUSE, diffuse_color);
-
for(int i=0; i<MaterialCount;i++) {
if(mIndicesBuffer[i].capacity() > 0) {
Please sign in to comment.
Something went wrong with that request. Please try again.