| 401 | } |
| 402 | |
| 403 | bool MoveLaraPosition(const Vector3i& offset, ItemInfo* item, ItemInfo* laraItem) |
| 404 | { |
| 405 | auto* lara = GetLaraInfo(laraItem); |
| 406 | |
| 407 | auto rotMatrix = item->Pose.Orientation.ToRotationMatrix(); |
| 408 | auto pos = Vector3::Transform(offset.ToVector3(), rotMatrix); |
| 409 | auto target = Pose(item->Pose.Position + Vector3i(pos), item->Pose.Orientation); |
| 410 | |
| 411 | if (!Objects[item->ObjectNumber].isPickup) |
| 412 | return Move3DPosTo3DPos(laraItem, laraItem->Pose, target, LARA_ALIGN_VELOCITY, ANGLE(2.0f)); |
| 413 | else |
| 414 | { |
| 415 | // Prevent picking up items which can result in so called "flare pickup bug" |
| 416 | int height = GetPointCollision(target.Position, laraItem->RoomNumber).GetFloorHeight(); |
| 417 | if (abs(height - laraItem->Pose.Position.y) <= CLICK(2)) |
| 418 | return Move3DPosTo3DPos(laraItem, laraItem->Pose, target, LARA_ALIGN_VELOCITY, ANGLE(2.0f)); |
| 419 | } |
| 420 | |
| 421 | if (lara->Control.IsMoving) |
| 422 | { |
| 423 | lara->Control.IsMoving = false; |
| 424 | lara->Control.HandStatus = HandStatus::Free; |
| 425 | } |
| 426 | |
| 427 | return false; |
| 428 | } |
| 429 | |
| 430 | static bool ItemCollide(int value, int radius) |
| 431 | { |
no test coverage detected