Continue smoothing

This commit is contained in:
Miloslav Ciz 2024-09-09 21:25:22 +02:00
parent 03b703d454
commit 08fb45b652
2 changed files with 203 additions and 171 deletions

329
assets.h
View file

@ -6229,101 +6229,101 @@ uint16_t LCR_getNextImagePixel(void)
static const int32_t LCR_carVertices[] = static const int32_t LCR_carVertices[] =
{ {
-700, -45, 354, -289, -45, 362, -700, -244, 437, -289, -700, -59, -504, -700, -540, -703, -700, -258, -421, -700,
-239, 442, -700, -327, 636, -289, -319, 636, -700, -244, 23, -703, -500, -493, -938, -700, -258, -985, -500, -258,
835, -289, -239, 830, -700, -45, 918, -289, -45, 910, -1035, -700, -59, -902, -500, -23, -938, -289, -65, -897,
-700, 153, 835, -289, 148, 830, -700, 236, 636, -289, -289, -258, -977, -289, -452, -897, -289, -532, -703, -500,
228, 636, -700, 153, 437, -289, 148, 442, -500, -45, -591, -703, -700, -458, -504, -500, -493, -468, -289, -452,
304, -500, -280, 401, -500, -377, 636, -500, -280, 871, -509, -289, -258, -429, -500, -258, -371, -289, -65, -509,
-500, -45, 968, -500, 189, 871, -500, 286, 636, -500, -500, -23, -468, -500, 73, -703, -289, 15, -703, -700,
189, 401, 698, -45, 918, 287, -45, 910, 698, -244, -458, -902, 698, -59, -902, 698, -540, -703, 698, -258,
835, 287, -239, 830, 698, -327, 636, 287, -319, 636, -985, 698, 23, -703, 498, -493, -468, 698, -258, -421,
698, -244, 437, 287, -239, 442, 698, -45, 354, 287, 498, -258, -371, 698, -59, -504, 498, -23, -468, 287,
-45, 362, 698, 153, 437, 287, 148, 442, 698, 236, -65, -509, 287, -258, -429, 287, -452, -509, 287, -532,
636, 287, 228, 636, 698, 153, 835, 287, 148, 830, -703, 498, -591, -703, 698, -458, -902, 498, -493, -938,
498, -45, 968, 498, -280, 871, 498, -377, 636, 498, 287, -452, -897, 287, -258, -977, 498, -258, -1035, 287,
-280, 401, 498, -45, 304, 498, 189, 401, 498, 286, -65, -897, 498, -23, -938, 498, 73, -703, 287, 15,
636, 498, 189, 871, -700, -45, -1021, -289, -45, -1013, -703, 698, -458, -504, -357, -354, 227, -422, -87, 279,
-700, -244, -938, -289, -239, -933, -700, -327, -739, -289, -479, -118, -323, -201, 264, 202, -236, 233, -266, -234,
-319, -739, -700, -244, -540, -289, -239, -545, -700, -45, -279, 741, -254, -346, 315, 240, -279, 741, 278, -6,
-457, -289, -45, -465, -700, 153, -540, -289, 148, -545, 497, -245, -32, 706, 251, -32, 706, -212, -45, -585,
-700, 236, -739, -289, 228, -739, -700, 153, -938, -289, 207, 264, 202, -272, -6, 497, 242, 233, -266, -222,
148, -933, -500, -45, -1071, -500, -280, -974, -500, -377, -90, -763, 228, -90, -763, 238, -323, -811, -232, -323,
-739, -500, -280, -504, -500, -45, -407, -500, 189, -504, -811, -235, -406, -356, -384, -404, -257, 218, -45, -585,
-500, 286, -739, -500, 189, -974, 698, -45, -457, 287, 241, -406, -356, 260, -346, 315, 363, -354, 227, 390,
-45, -465, 698, -244, -540, 287, -239, -545, 698, -327, -404, -257, 485, -118, -323, 428, -87, 279, -700, -59,
-739, 287, -319, -739, 698, -244, -938, 287, -239, -933, 871, -700, -540, 671, -700, -258, 953, -700, 23, 671,
698, -45, -1021, 287, -45, -1013, 698, 153, -938, 287, -500, -493, 436, -700, -258, 390, -500, -258, 339, -700,
148, -933, 698, 236, -739, 287, 228, -739, 698, 153, -59, 472, -500, -23, 436, -289, -65, 478, -289, -258,
-540, 287, 148, -545, 498, -45, -407, 498, -280, -504, 397, -289, -452, 478, -289, -532, 671, -500, -591, 671,
498, -377, -739, 498, -280, -974, 498, -45, -1071, 498, -700, -458, 871, -500, -493, 906, -289, -452, 865, -289,
189, -974, 498, 286, -739, 498, 189, -504, -357, -140, -258, 945, -500, -258, 1004, -289, -65, 865, -500, -23,
192, -384, -190, -293, -422, 126, 243, -479, 95, -359, 906, -500, 73, 671, -289, 15, 671, -700, -458, 472,
-201, 477, 167, -236, 446, -302, -212, 168, -621, -222, 698, -59, 472, 698, -540, 671, 698, -258, 390, 698,
122, -799, -272, 207, 462, -232, -109, -847, -245, 180, 23, 671, 498, -493, 906, 698, -258, 953, 498, -258,
671, -234, -66, 705, -235, -192, -391, -254, -133, 279, 1004, 698, -59, 871, 498, -23, 906, 287, -65, 865,
363, -140, 192, 390, -190, -293, 428, 126, 243, 485, 287, -258, 945, 287, -452, 865, 287, -532, 671, 498,
95, -359, 207, 477, 167, 242, 446, -302, 218, 168, -591, 671, 698, -458, 472, 498, -493, 436, 287, -452,
-621, 228, 122, -799, 278, 207, 462, 238, -109, -847, 478, 287, -258, 397, 498, -258, 339, 287, -65, 478,
251, 180, 671, 240, -66, 705, 241, -192, -391, 260, 498, -23, 436, 498, 73, 671, 287, 15, 671, 698,
-133, 279 -458, 871
}; };
static const uint16_t LCR_carTriangles[] = static const uint16_t LCR_carTriangles[] =
{ {
58, 56, 52, 52, 60, 58, 65, 64, 48, 64, 71, 62, 64, 100, 102, 101, 101, 103, 100, 104, 106, 105, 106, 108, 107, 106,
49, 63, 64, 65, 51, 65, 66, 53, 52, 66, 65, 54, 67, 110, 109, 106, 104, 111, 104, 113, 112, 101, 113, 104, 114, 115,
66, 66, 67, 55, 67, 68, 57, 56, 68, 67, 68, 69, 59, 113, 113, 115, 116, 115, 118, 117, 102, 118, 115, 118, 120, 119,
58, 69, 68, 60, 70, 69, 60, 62, 71, 61, 70, 71, 70, 100, 120, 118, 103, 121, 120, 103, 107, 108, 122, 121, 108, 121,
61, 59, 52, 56, 54, 60, 52, 62, 62, 52, 48, 48, 52, 122, 119, 101, 102, 114, 103, 101, 107, 107, 101, 105, 105, 101,
50, 59, 61, 53, 59, 53, 57, 53, 55, 57, 61, 63, 53, 123, 119, 122, 112, 119, 112, 117, 112, 116, 117, 122, 109, 112,
63, 49, 53, 51, 53, 49, 65, 48, 50, 64, 62, 48, 64, 109, 110, 112, 111, 112, 110, 104, 105, 123, 106, 107, 105, 106,
63, 71, 64, 51, 49, 65, 53, 51, 52, 65, 50, 54, 66, 109, 108, 106, 111, 110, 104, 112, 111, 101, 104, 123, 114, 113,
52, 66, 55, 53, 67, 57, 55, 56, 67, 54, 68, 59, 57, 101, 113, 116, 112, 115, 117, 116, 102, 115, 114, 118, 119, 117,
58, 68, 56, 60, 69, 58, 60, 71, 70, 61, 71, 63, 70, 100, 118, 102, 103, 120, 100, 103, 108, 121, 122, 108, 109, 121,
59, 69, 82, 80, 76, 76, 84, 82, 89, 88, 72, 88, 95, 119, 120, 76, 78, 77, 77, 79, 76, 80, 82, 81, 82, 84,
86, 88, 73, 87, 88, 89, 75, 89, 90, 77, 76, 90, 89, 83, 82, 86, 85, 82, 80, 87, 80, 89, 88, 77, 89, 80,
78, 91, 90, 90, 91, 79, 91, 92, 81, 80, 92, 91, 92, 90, 91, 89, 89, 91, 92, 91, 94, 93, 78, 94, 91, 94,
93, 83, 82, 93, 92, 84, 94, 93, 84, 86, 95, 85, 94, 96, 95, 76, 96, 94, 79, 97, 96, 79, 83, 84, 98, 97,
95, 94, 85, 83, 76, 80, 78, 84, 76, 86, 86, 76, 72, 84, 97, 98, 95, 77, 78, 90, 79, 77, 83, 83, 77, 81,
72, 76, 74, 83, 85, 77, 83, 77, 81, 77, 79, 81, 85, 81, 77, 99, 95, 98, 88, 95, 88, 93, 88, 92, 93, 98,
87, 77, 87, 73, 77, 75, 77, 73, 89, 72, 74, 88, 86, 85, 88, 85, 86, 88, 87, 88, 86, 80, 81, 99, 82, 83,
72, 88, 87, 95, 88, 75, 73, 89, 77, 75, 76, 89, 74, 81, 82, 85, 84, 82, 87, 86, 80, 88, 87, 77, 80, 99,
78, 90, 76, 90, 79, 77, 91, 81, 79, 80, 91, 78, 92, 90, 89, 77, 89, 92, 88, 91, 93, 92, 78, 91, 90, 94,
83, 81, 82, 92, 80, 84, 93, 82, 84, 95, 94, 85, 95, 95, 93, 76, 94, 78, 79, 96, 76, 79, 84, 97, 98, 84,
87, 94, 83, 93, 96, 99, 98, 98, 101, 100, 107, 121, 109, 85, 97, 95, 96, 48, 50, 49, 49, 52, 51, 53, 55, 54,
118, 120, 106, 101, 99, 102, 118, 104, 114, 121, 107, 120, 100, 56, 58, 57, 52, 50, 59, 56, 61, 60, 55, 53, 58, 51,
104, 98, 114, 100, 115, 103, 117, 102, 103, 105, 119, 109, 104, 61, 49, 60, 51, 62, 63, 64, 59, 63, 66, 65, 54, 61,
107, 102, 99, 108, 99, 97, 108, 108, 97, 109, 103, 102, 105, 53, 59, 50, 67, 50, 68, 67, 67, 68, 54, 63, 59, 66,
108, 105, 102, 104, 109, 98, 98, 109, 96, 106, 107, 104, 102, 67, 66, 59, 61, 54, 49, 49, 54, 48, 57, 53, 61, 59,
116, 101, 122, 119, 105, 123, 122, 108, 96, 109, 97, 110, 113, 69, 52, 70, 65, 66, 71, 70, 67, 48, 54, 68, 72, 74,
111, 112, 115, 113, 109, 121, 123, 106, 104, 118, 115, 116, 113, 73, 75, 62, 74, 54, 55, 71, 57, 61, 56, 62, 69, 74,
100, 114, 104, 120, 107, 106, 114, 112, 118, 101, 115, 100, 117, 51, 60, 61, 58, 53, 57, 60, 75, 56, 52, 62, 51, 64,
116, 102, 119, 117, 103, 123, 121, 118, 116, 122, 113, 113, 122, 69, 59, 65, 64, 63, 71, 55, 56, 69, 70, 74, 74, 70,
111, 122, 123, 111, 117, 119, 116, 122, 116, 119, 118, 112, 123, 73, 70, 71, 73, 64, 65, 69, 70, 69, 65, 56, 75, 71,
112, 110, 123, 120, 118, 121, 115, 101, 116, 109, 123, 108, 122, 75, 72, 71, 58, 56, 55, 62, 52, 69, 54, 71, 67, 70,
105, 108, 110, 111, 123, 96, 97, 99, 98, 99, 101, 110, 112, 66, 67, 72, 73, 71, 48, 68, 50, 49, 50, 52, 72, 75,
113, 112, 114, 115, 10, 8, 4, 4, 12, 10, 17, 16, 0, 74, 75, 60, 62, 0, 2, 1, 1, 3, 0, 4, 6, 5,
16, 23, 14, 16, 1, 15, 16, 17, 3, 17, 18, 5, 4, 6, 8, 7, 6, 10, 9, 6, 4, 11, 4, 13, 12, 1,
18, 17, 6, 19, 18, 18, 19, 7, 19, 20, 9, 8, 20, 13, 4, 14, 15, 13, 13, 15, 16, 15, 18, 17, 2, 18,
19, 20, 21, 11, 10, 21, 20, 12, 22, 21, 12, 14, 23, 15, 18, 20, 19, 0, 20, 18, 3, 21, 20, 3, 7, 8,
13, 22, 23, 22, 13, 11, 4, 8, 6, 12, 4, 14, 14, 22, 21, 8, 21, 22, 19, 1, 2, 14, 3, 1, 7, 7,
4, 0, 0, 4, 2, 11, 13, 5, 11, 5, 9, 5, 7, 1, 5, 5, 1, 23, 19, 22, 12, 19, 12, 17, 12, 16,
9, 13, 15, 5, 15, 1, 5, 3, 5, 1, 17, 0, 2, 17, 22, 9, 12, 9, 10, 12, 11, 12, 10, 4, 5, 23,
16, 14, 0, 16, 15, 23, 16, 3, 1, 17, 5, 3, 4, 6, 7, 5, 6, 9, 8, 6, 11, 10, 4, 12, 11, 1,
17, 2, 6, 18, 4, 18, 7, 5, 19, 9, 7, 8, 19, 4, 23, 14, 13, 1, 13, 16, 12, 15, 17, 16, 2, 15,
6, 20, 11, 9, 10, 20, 8, 12, 21, 10, 12, 23, 22, 14, 18, 19, 17, 0, 18, 2, 3, 20, 0, 3, 8, 21,
13, 23, 15, 22, 11, 21, 34, 32, 28, 28, 36, 34, 41, 22, 8, 9, 21, 19, 20, 24, 26, 25, 25, 27, 24, 28,
40, 24, 40, 47, 38, 40, 25, 39, 40, 41, 27, 41, 42, 30, 29, 30, 32, 31, 30, 34, 33, 30, 28, 35, 28, 37,
29, 28, 42, 41, 30, 43, 42, 42, 43, 31, 43, 44, 33, 36, 25, 37, 28, 38, 39, 37, 37, 39, 40, 39, 42, 41,
32, 44, 43, 44, 45, 35, 34, 45, 44, 36, 46, 45, 36, 26, 42, 39, 42, 44, 43, 24, 44, 42, 27, 45, 44, 27,
38, 47, 37, 46, 47, 46, 37, 35, 28, 32, 30, 36, 28, 31, 32, 46, 45, 32, 45, 46, 43, 25, 26, 38, 27, 25,
38, 38, 28, 24, 24, 28, 26, 35, 37, 29, 35, 29, 33, 31, 31, 25, 29, 29, 25, 47, 43, 46, 36, 43, 36, 41,
29, 31, 33, 37, 39, 29, 39, 25, 29, 27, 29, 25, 41, 36, 40, 41, 46, 33, 36, 33, 34, 36, 35, 36, 34, 28,
24, 26, 40, 38, 24, 40, 39, 47, 40, 27, 25, 41, 29, 29, 47, 30, 31, 29, 30, 33, 32, 30, 35, 34, 28, 36,
27, 28, 41, 26, 30, 42, 28, 42, 31, 29, 43, 33, 31, 35, 25, 28, 47, 38, 37, 25, 37, 40, 36, 39, 41, 40,
32, 43, 30, 44, 35, 33, 34, 44, 32, 36, 45, 34, 36, 26, 39, 38, 42, 43, 41, 24, 42, 26, 27, 44, 24, 27,
47, 46, 37, 47, 39, 46, 35, 45 32, 45, 46, 32, 33, 45, 43, 44
}; };
static const uint16_t LCR_carUvs[] = static const uint16_t LCR_carUvs[] =
@ -6336,18 +6336,44 @@ static const uint16_t LCR_carUvs[] =
125, 127, 63, 127, 4, 127, 105, 360, 24, 276, 125, 127, 63, 127, 4, 127, 105, 360, 24, 276,
6, 317, 23, 359, 24, 276, 64, 377, 66, 260, 6, 317, 23, 359, 24, 276, 64, 377, 66, 260,
6, 317, 23, 359, 107, 278, 124, 320, 106, 361, 6, 317, 23, 359, 107, 278, 124, 320, 106, 361,
125, 219, 125, 2, 4, 2, 254, 196, 249, 113, 125, 219, 125, 2, 4, 2, 107, 278, 64, 377,
374, 114, 252, 10, 366, 10, 505, 241, 402, 237, 123, 319, 66, 260, 63, 219, 125, 188, 63, 188,
505, 345, 108, 392, 62, 494, 62, 397, 449, 75, 125, 158, 63, 158, 4, 158, 4, 188, 4, 219,
205, 394, 108, 500, 9, 399, 9, 492, 186, 96, 4, 251, 63, 251, 125, 251, 125, 34, 63, 2,
307, 387, 205, 497, 437, 497, 398, 494, 437, 395, 63, 34, 4, 34, 4, 65, 63, 65, 125, 65,
502, 398, 502, 494, 234, 194, 131, 171, 411, 199, 4, 96, 63, 96, 125, 96, 125, 127, 63, 127,
374, 193, 239, 239, 263, 208, 490, 82, 505, 156, 4, 127, 105, 360, 24, 276, 6, 317, 23, 359,
135, 108, 307, 504, 398, 397, 239, 347, 131, 240, 24, 276, 64, 377, 66, 260, 6, 317, 23, 359,
131, 346, 402, 349, 381, 214, 255, 196, 374, 192, 107, 278, 124, 320, 106, 361, 125, 219, 125, 2,
373, 112, 249, 112, 366, 9, 449, 75, 252, 9, 4, 2, 254, 196, 249, 113, 374, 114, 252, 10,
186, 95, 234, 194, 130, 171, 412, 198, 263, 377, 366, 10, 505, 241, 402, 237, 505, 345, 108, 392,
490, 82, 505, 156, 134, 108, 381, 372 62, 494, 62, 397, 449, 75, 205, 394, 108, 500,
9, 399, 9, 492, 186, 96, 307, 387, 205, 497,
437, 497, 398, 494, 437, 395, 502, 398, 502, 494,
234, 194, 131, 171, 411, 199, 374, 193, 239, 239,
263, 208, 490, 82, 505, 156, 135, 108, 307, 504,
398, 397, 239, 347, 131, 240, 131, 346, 402, 349,
381, 214, 255, 196, 374, 192, 373, 112, 249, 112,
366, 9, 449, 75, 252, 9, 186, 95, 234, 194,
130, 171, 412, 198, 263, 377, 490, 82, 505, 156,
134, 108, 381, 372, 107, 278, 64, 377, 123, 319,
66, 260, 63, 219, 125, 188, 63, 188, 125, 158,
63, 158, 4, 158, 4, 188, 4, 219, 4, 251,
63, 251, 125, 251, 125, 34, 63, 2, 63, 34,
4, 34, 4, 65, 63, 65, 125, 65, 4, 96,
63, 96, 125, 96, 125, 127, 63, 127, 4, 127,
105, 360, 24, 276, 6, 317, 23, 359, 24, 276,
64, 377, 66, 260, 6, 317, 23, 359, 107, 278,
124, 320, 106, 361, 125, 219, 125, 2, 4, 2,
107, 278, 64, 377, 123, 319, 66, 260, 63, 219,
125, 188, 63, 188, 125, 158, 63, 158, 4, 158,
4, 188, 4, 219, 4, 251, 63, 251, 125, 251,
125, 34, 63, 2, 63, 34, 4, 34, 4, 65,
63, 65, 125, 65, 4, 96, 63, 96, 125, 96,
125, 127, 63, 127, 4, 127, 105, 360, 24, 276,
6, 317, 23, 359, 24, 276, 64, 377, 66, 260,
6, 317, 23, 359, 107, 278, 124, 320, 106, 361,
125, 219, 125, 2, 4, 2
}; };
static const uint16_t LCR_carTriangleUvs[] = static const uint16_t LCR_carTriangleUvs[] =
@ -6362,60 +6388,61 @@ static const uint16_t LCR_carTriangleUvs[] =
9, 8, 6, 11, 10, 4, 12, 11, 14, 4, 40, 15, 16, 9, 8, 6, 11, 10, 4, 12, 11, 14, 4, 40, 15, 16,
41, 16, 18, 42, 17, 19, 18, 21, 17, 15, 20, 22, 19, 41, 16, 18, 42, 17, 19, 18, 21, 17, 15, 20, 22, 19,
24, 20, 21, 25, 23, 24, 25, 8, 26, 27, 8, 9, 26, 24, 20, 21, 25, 23, 24, 25, 8, 26, 27, 8, 9, 26,
22, 23, 0, 2, 1, 1, 3, 0, 4, 6, 5, 6, 8, 22, 23, 43, 45, 44, 44, 46, 43, 47, 49, 48, 49, 51,
7, 6, 10, 9, 6, 4, 11, 4, 13, 12, 14, 13, 4, 50, 49, 53, 52, 49, 47, 54, 47, 56, 55, 57, 56, 47,
15, 17, 16, 16, 17, 18, 17, 20, 19, 21, 20, 17, 20, 58, 60, 59, 59, 60, 61, 60, 63, 62, 64, 63, 60, 63,
23, 22, 24, 23, 20, 25, 26, 23, 25, 7, 8, 27, 26, 66, 65, 67, 66, 63, 68, 69, 66, 68, 50, 51, 70, 69,
8, 26, 27, 22, 1, 2, 28, 3, 1, 29, 29, 1, 30, 51, 69, 70, 65, 44, 45, 71, 46, 44, 72, 72, 44, 73,
30, 1, 31, 32, 34, 33, 32, 33, 35, 33, 36, 35, 34, 73, 44, 74, 75, 77, 76, 75, 76, 78, 76, 79, 78, 77,
37, 33, 37, 38, 33, 39, 33, 38, 4, 5, 40, 6, 7, 80, 76, 80, 81, 76, 82, 76, 81, 47, 48, 83, 49, 50,
5, 6, 9, 8, 6, 11, 10, 4, 12, 11, 14, 4, 40, 48, 49, 52, 51, 49, 54, 53, 47, 55, 54, 57, 47, 83,
15, 16, 41, 16, 18, 42, 17, 19, 18, 21, 17, 15, 20, 58, 59, 84, 59, 61, 85, 60, 62, 61, 64, 60, 58, 63,
22, 19, 24, 20, 21, 25, 23, 24, 25, 8, 26, 27, 8, 65, 62, 67, 63, 64, 68, 66, 67, 68, 51, 69, 70, 51,
9, 26, 22, 23, 43, 45, 44, 44, 47, 46, 48, 50, 49, 52, 69, 65, 66, 86, 88, 87, 87, 90, 89, 91, 93, 92,
51, 53, 52, 47, 45, 54, 51, 56, 55, 57, 58, 53, 46, 94, 96, 95, 90, 88, 97, 94, 99, 98, 100, 101, 96, 89,
59, 44, 55, 61, 60, 62, 64, 63, 62, 66, 65, 67, 59, 102, 87, 98, 104, 103, 105, 107, 106, 105, 109, 108, 110, 102,
68, 54, 45, 69, 45, 70, 69, 71, 72, 49, 73, 54, 74, 111, 97, 88, 112, 88, 113, 112, 114, 115, 92, 116, 97, 117,
69, 74, 54, 59, 67, 44, 44, 67, 43, 75, 68, 59, 63, 112, 117, 97, 102, 110, 87, 87, 110, 86, 118, 111, 102, 106,
77, 76, 78, 80, 79, 81, 78, 71, 82, 49, 72, 83, 85, 120, 119, 121, 123, 122, 124, 121, 114, 125, 92, 115, 126, 128,
84, 86, 87, 85, 49, 50, 81, 52, 56, 51, 87, 88, 85, 127, 129, 130, 128, 92, 93, 124, 95, 99, 94, 130, 131, 128,
61, 55, 56, 53, 58, 52, 89, 86, 90, 76, 60, 61, 64, 104, 98, 99, 96, 101, 95, 132, 129, 133, 119, 103, 104, 107,
77, 63, 65, 64, 62, 91, 92, 90, 88, 93, 85, 85, 93, 120, 106, 108, 107, 105, 134, 135, 133, 131, 136, 128, 128, 136,
84, 78, 81, 94, 95, 96, 88, 93, 88, 96, 90, 86, 91, 127, 121, 124, 137, 138, 139, 131, 136, 131, 139, 133, 129, 134,
86, 83, 91, 97, 90, 92, 60, 76, 77, 49, 81, 71, 78, 129, 126, 134, 140, 133, 135, 103, 119, 120, 92, 124, 114, 121,
79, 71, 98, 94, 81, 43, 70, 45, 44, 45, 47, 83, 86, 122, 114, 141, 137, 124, 86, 113, 88, 87, 88, 90, 126, 129,
85, 86, 89, 87, 0, 2, 1, 1, 3, 0, 4, 6, 5, 128, 129, 132, 130, 142, 144, 143, 143, 145, 142, 146, 148, 147,
6, 8, 7, 6, 10, 9, 6, 4, 11, 4, 13, 12, 14, 148, 150, 149, 148, 152, 151, 148, 146, 153, 146, 155, 154, 156,
13, 4, 15, 17, 16, 16, 17, 18, 17, 20, 19, 21, 20, 155, 146, 157, 159, 158, 158, 159, 160, 159, 162, 161, 163, 162,
17, 20, 23, 22, 24, 23, 20, 25, 26, 23, 25, 7, 8, 159, 162, 165, 164, 166, 165, 162, 167, 168, 165, 167, 149, 150,
27, 26, 8, 26, 27, 22, 1, 2, 28, 3, 1, 29, 29, 169, 168, 150, 168, 169, 164, 143, 144, 170, 145, 143, 171, 171,
1, 30, 30, 1, 31, 32, 34, 33, 32, 33, 35, 33, 36, 143, 172, 172, 143, 173, 174, 176, 175, 174, 175, 177, 175, 178,
35, 34, 37, 33, 37, 38, 33, 39, 33, 38, 4, 5, 40, 177, 176, 179, 175, 179, 180, 175, 181, 175, 180, 146, 147, 182,
6, 7, 5, 6, 9, 8, 6, 11, 10, 4, 12, 11, 14, 148, 149, 147, 148, 151, 150, 148, 153, 152, 146, 154, 153, 156,
4, 40, 15, 16, 41, 16, 18, 42, 17, 19, 18, 21, 17, 146, 182, 157, 158, 183, 158, 160, 184, 159, 161, 160, 163, 159,
15, 20, 22, 19, 24, 20, 21, 25, 23, 24, 25, 8, 26, 157, 162, 164, 161, 166, 162, 163, 167, 165, 166, 167, 150, 168,
27, 8, 9, 26, 22, 23, 0, 2, 1, 1, 3, 0, 4, 169, 150, 151, 168, 164, 165, 185, 187, 186, 186, 188, 185, 189,
6, 5, 6, 8, 7, 6, 10, 9, 6, 4, 11, 4, 13, 191, 190, 191, 193, 192, 191, 195, 194, 191, 189, 196, 189, 198,
12, 14, 13, 4, 15, 17, 16, 16, 17, 18, 17, 20, 19, 197, 199, 198, 189, 200, 202, 201, 201, 202, 203, 202, 205, 204,
21, 20, 17, 20, 23, 22, 24, 23, 20, 25, 26, 23, 25, 206, 205, 202, 205, 208, 207, 209, 208, 205, 210, 211, 208, 210,
7, 8, 27, 26, 8, 26, 27, 22, 1, 2, 28, 3, 1, 192, 193, 212, 211, 193, 211, 212, 207, 186, 187, 213, 188, 186,
29, 29, 1, 30, 30, 1, 31, 32, 34, 33, 32, 33, 35, 214, 214, 186, 215, 215, 186, 216, 217, 219, 218, 217, 218, 220,
33, 36, 35, 34, 37, 33, 37, 38, 33, 39, 33, 38, 4, 218, 221, 220, 219, 222, 218, 222, 223, 218, 224, 218, 223, 189,
5, 40, 6, 7, 5, 6, 9, 8, 6, 11, 10, 4, 12, 190, 225, 191, 192, 190, 191, 194, 193, 191, 196, 195, 189, 197,
11, 14, 4, 40, 15, 16, 41, 16, 18, 42, 17, 19, 18, 196, 199, 189, 225, 200, 201, 226, 201, 203, 227, 202, 204, 203,
21, 17, 15, 20, 22, 19, 24, 20, 21, 25, 23, 24, 25, 206, 202, 200, 205, 207, 204, 209, 205, 206, 210, 208, 209, 210,
8, 26, 27, 8, 9, 26, 22, 23 193, 211, 212, 193, 194, 211, 207, 208
}; };
static const uint8_t LCR_carVertexTypes[] = static const uint8_t LCR_carVertexTypes[] =
{ {
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3, 3
}; };
#endif #endif

View file

@ -14,7 +14,7 @@ typedef int32_t LCR_GameUnit; ///< abstract game unit
#define LCR_RACING_INPUT_BACK 0x04 #define LCR_RACING_INPUT_BACK 0x04
#define LCR_RACING_INPUT_LEFT 0x08 #define LCR_RACING_INPUT_LEFT 0x08
#define LCR_PHYSICS_UNIT 512 ///< length of map square for physics engine #define LCR_PHYSICS_UNIT 1024 ///< length of map square for physics engine
#include "map.h" #include "map.h"
#include "tinyphysicsengine.h" #include "tinyphysicsengine.h"
@ -22,7 +22,8 @@ typedef int32_t LCR_GameUnit; ///< abstract game unit
#define LCR_CAR_JOINTS 5 #define LCR_CAR_JOINTS 5
#define LCR_CAR_CONNECTIONS 10 #define LCR_CAR_CONNECTIONS 10
#define LCR_CAR_FORWARD_FRICTION (TPE_F / 14) #define LCR_GRAVITY 5
#define LCR_CAR_FORWARD_FRICTION TPE_F / 14
#define LCR_CAR_TURN_FRICTION (3 * TPE_F / 4) #define LCR_CAR_TURN_FRICTION (3 * TPE_F / 4)
#define LCR_CAR_ELASTICITY (TPE_F / 100) #define LCR_CAR_ELASTICITY (TPE_F / 100)
@ -103,14 +104,14 @@ void LCR_racingInit(void)
LCR_racing.carConnections,LCR_CAR_CONNECTIONS, LCR_racing.carConnections,LCR_CAR_CONNECTIONS,
TPE_F); TPE_F);
LCR_racing.carBody.friction = LCR_CAR_FORWARD_FRICTION;
LCR_racing.carBody.elasticity = LCR_CAR_ELASTICITY;
TPE_worldInit(&(LCR_racing.physicsWorld), TPE_worldInit(&(LCR_racing.physicsWorld),
&(LCR_racing.carBody),1,_LCR_racingEnvironmentFunction); &(LCR_racing.carBody),1,_LCR_racingEnvironmentFunction);
LCR_racing.physicsWorld.collisionCallback = _LCR_racingCollisionHandler; LCR_racing.physicsWorld.collisionCallback = _LCR_racingCollisionHandler;
LCR_racing.carBody.friction = LCR_CAR_FORWARD_FRICTION;
LCR_racing.carBody.elasticity = LCR_CAR_ELASTICITY;
LCR_racingRestart(); LCR_racingRestart();
} }
@ -188,9 +189,7 @@ void LCR_racingStep(unsigned int input)
TPE_bodyAccelerate(&(LCR_racing.carBody),vel); TPE_bodyAccelerate(&(LCR_racing.carBody),vel);
} }
TPE_bodyApplyGravity(&(LCR_racing.carBody), TPE_bodyApplyGravity(&(LCR_racing.carBody),LCR_GRAVITY);
TPE_F / 32
);
LCR_racing.wheelCollisions <<= 4; LCR_racing.wheelCollisions <<= 4;
TPE_worldStep(&(LCR_racing.physicsWorld)); TPE_worldStep(&(LCR_racing.physicsWorld));
@ -221,20 +220,26 @@ void LCR_racingStep(unsigned int input)
LCR_GAME_UNIT / 4),LCR_racing.carBody.joints[4].position); LCR_GAME_UNIT / 4),LCR_racing.carBody.joints[4].position);
} }
LCR_racing.carPositions[1] = LCR_racing.carPositions[0]; TPE_Vec3 tmpVec = LCR_racing.carPositions[0];
#define AVERAGE(c) \ LCR_racing.carPositions[0] =
(((((LCR_racing.carBody.joints[0].position.c + \ _LCR_TPE_vec3DividePlain(
LCR_racing.carBody.joints[1].position.c + \ TPE_vec3TimesPlain(
LCR_racing.carBody.joints[2].position.c + \ LCR_racing.carBody.joints[4].position,LCR_GAME_UNIT),
LCR_racing.carBody.joints[3].position.c) / 4) + \ LCR_PHYSICS_UNIT);
LCR_racing.carBody.joints[4].position.c) / 2) * \
LCR_GAME_UNIT) / LCR_PHYSICS_UNIT
LCR_racing.carPositions[0].x = AVERAGE(x); LCR_racing.carPositions[0] =
LCR_racing.carPositions[0].y = AVERAGE(y); TPE_vec3KeepWithinBox(
LCR_racing.carPositions[0].z = AVERAGE(z); LCR_racing.carPositions[1],
#undef AVERAGE LCR_racing.carPositions[0],
TPE_vec3(
LCR_PHYSICS_UNIT / 64, // TODO: 64
LCR_PHYSICS_UNIT / 64,
LCR_PHYSICS_UNIT / 64
)
);
LCR_racing.carPositions[1] = tmpVec;
} }
void LCR_physicsDebugDraw(LCR_GameUnit camPos[3], LCR_GameUnit camRot[2], void LCR_physicsDebugDraw(LCR_GameUnit camPos[3], LCR_GameUnit camRot[2],