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

Function CanPerformMonkeySwingStep

TombEngine/Game/Lara/PlayerContext.cpp:574–591  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

572 }
573
574 bool CanPerformMonkeySwingStep(const ItemInfo& item, const CollisionInfo& coll)
575 {
576 constexpr auto LOWER_CEIL_BOUND = MONKEY_STEPUP_HEIGHT;
577 constexpr auto UPPER_CEIL_BOUND = -MONKEY_STEPUP_HEIGHT;
578
579 // Get point collision.
580 auto pointColl = GetPointCollision(item);
581 int relCeilHeight = pointColl.GetCeilingHeight() - (item.Pose.Position.y - LARA_HEIGHT_MONKEY);
582
583 // Assess point collision.
584 if (relCeilHeight <= LOWER_CEIL_BOUND && // Ceiling height is above lower ceiling bound.
585 relCeilHeight >= UPPER_CEIL_BOUND) // Ceiling height is below upper ceiling bound.
586 {
587 return true;
588 }
589
590 return false;
591 }
592
593 bool CanFallFromMonkeySwing(const ItemInfo& item, const CollisionInfo& coll)
594 {

Callers 5

lara_col_monkey_idleFunction · 0.85
lara_col_monkey_forwardFunction · 0.85
lara_col_monkey_backFunction · 0.85

Calls 2

GetPointCollisionFunction · 0.85
GetCeilingHeightMethod · 0.45

Tested by

no test coverage detected