| 375 | } |
| 376 | |
| 377 | bool AlignLaraPosition(const Vector3i& offset, ItemInfo* item, ItemInfo* laraItem) |
| 378 | { |
| 379 | auto* lara = GetLaraInfo(laraItem); |
| 380 | |
| 381 | laraItem->Pose.Orientation = item->Pose.Orientation; |
| 382 | |
| 383 | auto rotMatrix = item->Pose.Orientation.ToRotationMatrix(); |
| 384 | auto pos = Vector3::Transform(offset.ToVector3(), rotMatrix); |
| 385 | auto target = item->Pose.Position.ToVector3() + pos; |
| 386 | |
| 387 | int height = GetPointCollision(target, laraItem->RoomNumber).GetFloorHeight(); |
| 388 | if ((laraItem->Pose.Position.y - height) <= CLICK(2)) |
| 389 | { |
| 390 | laraItem->Pose.Position = Vector3i(target); |
| 391 | return true; |
| 392 | } |
| 393 | |
| 394 | if (lara->Control.IsMoving) |
| 395 | { |
| 396 | lara->Control.IsMoving = false; |
| 397 | lara->Control.HandStatus = HandStatus::Free; |
| 398 | } |
| 399 | |
| 400 | return false; |
| 401 | } |
| 402 | |
| 403 | bool MoveLaraPosition(const Vector3i& offset, ItemInfo* item, ItemInfo* laraItem) |
| 404 | { |
no test coverage detected