Stop only front wheels on pinch
This commit is contained in:
parent
3c903ff49f
commit
9b28ed3630
3 changed files with 16 additions and 4 deletions
9
racing.h
9
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 ||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue