MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / CanFall

Function CanFall

TombEngine/Game/Lara/PlayerContext.cpp:771–790  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

769 }
770
771 bool CanFall(const ItemInfo& item, const CollisionInfo& coll)
772 {
773 constexpr auto UPPER_FLOOR_BOUND = STEPUP_HEIGHT;
774
775 const auto& player = GetLaraInfo(item);
776
777 // 1) Test player water status.
778 if (player.Control.WaterStatus == WaterStatus::Wade)
779 return false;
780
781 // Get point collision.
782 auto pointColl = GetPointCollision(item, 0, 0, -coll.Setup.Height / 2);
783 int relFloorHeight = pointColl.GetFloorHeight() - item.Pose.Position.y;
784
785 // 2) Assess point collision.
786 if (relFloorHeight > UPPER_FLOOR_BOUND) // Floor height is below upper floor bound.
787 return true;
788
789 return false;
790 }
791
792 bool CanLand(const ItemInfo& item, const CollisionInfo& coll)
793 {

Callers 15

lara_col_jump_prepareFunction · 0.85
lara_col_walk_forwardFunction · 0.85
lara_col_run_forwardFunction · 0.85
lara_col_idleFunction · 0.85
lara_col_walk_backFunction · 0.85
lara_col_step_rightFunction · 0.85
lara_col_step_leftFunction · 0.85
lara_col_sprintFunction · 0.85
lara_col_sprint_diveFunction · 0.85
lara_col_sprint_slideFunction · 0.85
lara_col_crouch_idleFunction · 0.85

Calls 2

GetPointCollisionFunction · 0.85
GetFloorHeightMethod · 0.45

Tested by

no test coverage detected