From 9b28ed36306b762e44d19781e0c35765168359a7 Mon Sep 17 00:00:00 2001 From: Miloslav Ciz Date: Mon, 17 Feb 2025 16:06:46 +0100 Subject: [PATCH] Stop only front wheels on pinch --- TODO.txt | 3 +++ data | 8 +++++++- racing.h | 9 ++++++--- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/TODO.txt b/TODO.txt index 4e1ba70..9bf9b9b 100644 --- a/TODO.txt +++ b/TODO.txt @@ -1,5 +1,7 @@ =========== GENERAL ============== +- improve the car unstucking? maybe we can just keep the position of the car + and ONE wheel (other joint positions can be computed) - some kind of special map block that would say where 3D triangles don't have to be drawn? could optimize rendering and map loading a lot - maps to make: @@ -18,6 +20,7 @@ - some speed map - some (at least partially) interior map - something with multiple finishes + - U-ramp to build speed and jump up to catch a CP - try to speed up the slow culling - make a small txt game menual - test: diff --git a/data b/data index ad774b0..a4439a5 100644 --- a/data +++ b/data @@ -3,4 +3,10 @@ #Rrep2;testmap;482f70f9 00000843:0173:0081:0029:0111:0039:0071:00a3:0061:0169:0051:00b3:0041:0073:0081:0033:0041:0033:0231:0030:0098:0029:0011:0163:00f1:0053:0081:0033:0051:0023:0031:00f0:0032:0023:0131:00b9:0081:0023:00a1:0119:00e1:00c9:0071:0039:00a1:00d3:0021:01f9:0091:0079:0091:0039:0051:0049:0021:0083:0031:0083:0031:0083:0061:0089:0121:00a0:0058:002c:0048:0061:0013:0150:0052:00c0:00a1:0053:0041:0043:0031:0020:0092:0063:0181:0010:00a2:0013:0071:00e0:0028:00e9:0078:00a9:0043:0032:0123:0042:0080:0038:004c:01a8:0050:0032:0033:0101 #Btestmap; -#Maaaaa;4321 0 :*G1b:+n9H:!I1H :uJ3d- :vI3dL- :maaa +#Maaaaa;4321 0 +:*B1vJ :!wct :!wcA +:=n0s :fiba +:xo1t :fgb8 + +:]o1tI :fg11 :|o2tI :fg11 +:]o1A :fg11 :|o2A :fg11 diff --git a/racing.h b/racing.h index e1860fb..a45489f 100644 --- a/racing.h +++ b/racing.h @@ -1456,11 +1456,14 @@ uint32_t LCR_racingStep(unsigned int input) if (frontCollision) { - // stop the car immediately + // stop the front wheels LCR_LOG1("car front pierced"); - LCR_racing.carNotOKCount += - (LCR_racing.carNotOKCount < 20 ? 15 : 0); // TODO: consts + for (uint8_t i = 0; i < 3; ++i) + { + LCR_racing.carBody.joints[0].velocity[i] = 0; + LCR_racing.carBody.joints[1].velocity[i] = 0; + } } if ((LCR_racing.carBody.flags & TPE_BODY_FLAG_UNRESOLVED) || frontCollision ||