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

Function TestPlayerWaterStepOut

TombEngine/Game/Lara/lara_tests.cpp:887–922  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

885}
886
887bool TestPlayerWaterStepOut(ItemInfo* item, CollisionInfo* coll)
888{
889 auto& player = GetLaraInfo(*item);
890
891 // Get point collision.
892 auto pointColl = GetPointCollision(*item);
893 int vPos = item->Pose.Position.y;
894
895 if (coll->CollisionType == CollisionType::Front ||
896 pointColl.IsSteepFloor() ||
897 (pointColl.GetFloorHeight() - vPos) <= 0)
898 {
899 return false;
900 }
901
902 if (coll->Middle.Floor >= -CLICK(0.5f))
903 {
904 SetAnimation(item, LA_STAND_IDLE);
905 }
906 else
907 {
908 SetAnimation(item, LA_ONWATER_TO_WADE_1_STEP);
909 item->Animation.TargetState = LS_IDLE;
910 }
911
912 item->Pose.Position.y = pointColl.GetFloorHeight();
913 UpdateLaraRoom(item, -(STEPUP_HEIGHT - 3));
914
915 ResetPlayerLean(item);
916 item->Animation.Velocity.y = 0.0f;
917 item->Animation.Velocity.z = 0.0f;
918 item->Animation.IsAirborne = false;
919 player.Control.WaterStatus = WaterStatus::Wade;
920
921 return true;
922}
923
924bool TestLaraWaterClimbOut(ItemInfo* item, CollisionInfo* coll)
925{

Callers 1

LaraSurfaceCollisionFunction · 0.85

Calls 6

GetPointCollisionFunction · 0.85
SetAnimationFunction · 0.85
UpdateLaraRoomFunction · 0.85
ResetPlayerLeanFunction · 0.85
IsSteepFloorMethod · 0.45
GetFloorHeightMethod · 0.45

Tested by

no test coverage detected