diff --git a/TODO.txt b/TODO.txt index 768ffae..6cb3e21 100644 --- a/TODO.txt +++ b/TODO.txt @@ -45,7 +45,7 @@ =========== BUGS ================= - the pinch collision test seems to sometimes stop the car e.g. after falling - from bigger height or when running into ramp at high speed - FIX + from bigger height or when running into ramp at high speed (or not?) - FIX =========== HANDLED ============== diff --git a/racing.h b/racing.h index 4426b6c..7eb8725 100644 --- a/racing.h +++ b/racing.h @@ -1344,18 +1344,15 @@ uint32_t LCR_racingStep(unsigned int input) LCR_racing.carDrifting = 0; } - /* The following fixes "sticking to a wall" issue by adding a small spin - to the car when trying to steer at very small velocity. */ if (steering && (input & (LCR_RACING_INPUT_FORW | LCR_RACING_INPUT_BACK)) && - (LCR_racing.wheelCollisions & 0x0f) && - LCR_racingGetCarSpeedUnsigned() < (LCR_GAME_UNIT / 25)) + (LCR_racing.wheelCollisions & 0x0f)) { - LCR_LOG2("spinning car a bit"); - - TPE_bodySpin(&LCR_racing.carBody,TPE_vec3(0, - steering == ((input & LCR_RACING_INPUT_LEFT) != 0) ? - TPE_F / 32 : -1 * TPE_F / 32,0)); + /* When steering, also slightly spin the car. This helps fix the car + getting "stuck" by its side to a wall when too close, becoming unable + to unstick itself. */ + TPE_bodySpin(&LCR_racing.carBody,_LCR_TPE_vec3DividePlain(carUp, + steering == ((input & LCR_RACING_INPUT_LEFT) != 0) ? 128 : -128)); } }