| 465 | } |
| 466 | |
| 467 | static int GetJeepCollisionAnimation(ItemInfo* jeepItem, Vector3i* pos) |
| 468 | { |
| 469 | auto* jeep = GetJeepInfo(jeepItem); |
| 470 | |
| 471 | if (jeep->Gear != 0) |
| 472 | return 0; |
| 473 | |
| 474 | pos->x = jeepItem->Pose.Position.x - pos->x; |
| 475 | pos->z = jeepItem->Pose.Position.z - pos->z; |
| 476 | |
| 477 | if (pos->x || pos->z) |
| 478 | { |
| 479 | float sinY = phd_sin(jeepItem->Pose.Orientation.y); |
| 480 | float cosY = phd_cos(jeepItem->Pose.Orientation.y); |
| 481 | |
| 482 | int front = (pos->z * cosY) + (pos->x * sinY); |
| 483 | int side = (pos->z * -sinY) + (pos->x * cosY); |
| 484 | |
| 485 | if (abs(front) > abs(side)) |
| 486 | return ((front > 0) + 13); |
| 487 | else |
| 488 | return ((side <= 0) + 11); |
| 489 | } |
| 490 | |
| 491 | return 0; |
| 492 | } |
| 493 | |
| 494 | int JeepDynamics(ItemInfo* jeepItem, ItemInfo* laraItem) |
| 495 | { |
no test coverage detected