| 909 | } |
| 910 | |
| 911 | bool CanQueueRunningJump(const ItemInfo& item, const CollisionInfo& coll) |
| 912 | { |
| 913 | constexpr auto UPPER_FLOOR_BOUND = CLICK(0.5f); |
| 914 | constexpr auto LOWER_CEIL_BOUND_BASE = -LARA_HEADROOM * 0.8f; |
| 915 | |
| 916 | auto& player = GetLaraInfo(item); |
| 917 | |
| 918 | // 1) Test if running jump is immediately possible. |
| 919 | if (CanRunJumpForward(item, coll)) |
| 920 | return IsRunJumpQueueableState(item.Animation.TargetState); |
| 921 | |
| 922 | // Get point collision. |
| 923 | auto pointColl = GetPointCollision(item, item.Pose.Orientation.y, BLOCK(1), -coll.Setup.Height); |
| 924 | |
| 925 | int lowerCeilingBound = (LOWER_CEIL_BOUND_BASE - coll.Setup.Height); |
| 926 | int relFloorHeight = pointColl.GetFloorHeight() - item.Pose.Position.y; |
| 927 | int relCeilHeight = pointColl.GetCeilingHeight() - item.Pose.Position.y; |
| 928 | |
| 929 | // 2) Assess point collision for possible running jump ahead. |
| 930 | if (relCeilHeight < lowerCeilingBound || // Ceiling height is above lower ceiling bound. |
| 931 | relFloorHeight >= UPPER_FLOOR_BOUND) // OR floor height ahead is below upper floor bound. |
| 932 | { |
| 933 | return IsRunJumpQueueableState(item.Animation.TargetState); |
| 934 | } |
| 935 | |
| 936 | return false; |
| 937 | } |
| 938 | |
| 939 | bool CanRunJumpForward(const ItemInfo& item, const CollisionInfo& coll) |
| 940 | { |
no test coverage detected