MCPcopy Create free account
hub / github.com/ddnet/ddnet / ThroughOffset

Function ThroughOffset

src/game/collision.cpp:1108–1138  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1106}
1107
1108void ThroughOffset(vec2 Pos0, vec2 Pos1, int *pOffsetX, int *pOffsetY)
1109{
1110 float x = Pos0.x - Pos1.x;
1111 float y = Pos0.y - Pos1.y;
1112 if(absolute(x) > absolute(y))
1113 {
1114 if(x < 0)
1115 {
1116 *pOffsetX = -32;
1117 *pOffsetY = 0;
1118 }
1119 else
1120 {
1121 *pOffsetX = 32;
1122 *pOffsetY = 0;
1123 }
1124 }
1125 else
1126 {
1127 if(y < 0)
1128 {
1129 *pOffsetX = 0;
1130 *pOffsetY = -32;
1131 }
1132 else
1133 {
1134 *pOffsetX = 0;
1135 *pOffsetY = 32;
1136 }
1137 }
1138}
1139
1140int CCollision::IntersectNoLaser(vec2 Pos0, vec2 Pos1, vec2 *pOutCollision, vec2 *pOutBeforeCollision) const
1141{

Callers 1

IntersectLineTeleHookMethod · 0.85

Calls 1

absoluteFunction · 0.85

Tested by

no test coverage detected