Stop only front wheels on pinch

This commit is contained in:
Miloslav Ciz 2025-02-17 16:06:46 +01:00
parent 3c903ff49f
commit 9b28ed3630
3 changed files with 16 additions and 4 deletions

View file

@ -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 ||