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

Function LaraDeflectEdge

TombEngine/Game/Lara/lara_collide.cpp:38–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

36// -----------------------------
37
38bool LaraDeflectEdge(ItemInfo* item, CollisionInfo* coll)
39{
40 auto* lara = GetLaraInfo(item);
41
42 if (coll->CollisionType == CollisionType::Front || coll->CollisionType == CollisionType::TopFront)
43 {
44 ShiftItem(item, coll);
45
46 item->Animation.TargetState = LS_IDLE;
47 item->Animation.Velocity.z = 0;
48 return true;
49 }
50
51 if (coll->CollisionType == CollisionType::Left)
52 {
53 ShiftItem(item, coll);
54 item->Pose.Orientation.y += coll->DiagonalStepAtLeft() ? DEFLECT_DIAGONAL_ANGLE : DEFLECT_STRAIGHT_ANGLE;
55 }
56 else if (coll->CollisionType == CollisionType::Right)
57 {
58 ShiftItem(item, coll);
59 item->Pose.Orientation.y -= coll->DiagonalStepAtRight() ? DEFLECT_DIAGONAL_ANGLE : DEFLECT_STRAIGHT_ANGLE;
60 }
61 else if (coll->LastBridgeItemNumber != NO_VALUE)
62 {
63 ShiftItem(item, coll);
64 }
65
66 return false;
67}
68
69bool LaraDeflectTopSide(ItemInfo* item, CollisionInfo* coll)
70{

Callers 11

lara_col_walk_forwardFunction · 0.85
lara_col_run_forwardFunction · 0.85
lara_col_run_backFunction · 0.85
lara_col_walk_backFunction · 0.85
lara_col_step_rightFunction · 0.85
lara_col_step_leftFunction · 0.85
lara_col_wade_forwardFunction · 0.85
lara_col_sprintFunction · 0.85
lara_col_sprint_slideFunction · 0.85
lara_col_slide_forwardFunction · 0.85
lara_col_slide_backFunction · 0.85

Calls 3

ShiftItemFunction · 0.85
DiagonalStepAtLeftMethod · 0.80
DiagonalStepAtRightMethod · 0.80

Tested by

no test coverage detected