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

Function GetLineIntersection

src/tools/map_replace_area.cpp:638–654  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

636}
637
638bool GetLineIntersection(const float aLine1[2], const float aLine2[2], float aIntersection[2])
639{
640 float aBorders[2] = {
641 std::max(aLine1[0], aLine2[0]),
642 std::min(aLine1[1], aLine2[1])};
643
644 if(aIntersection)
645 SetInexistent(aIntersection, 2);
646
647 if(aBorders[0] - aBorders[1] > 0.01f)
648 return false;
649
650 if(aIntersection)
651 mem_copy(aIntersection, aBorders, sizeof(float[2]));
652
653 return true;
654}
655
656void SetInexistent(float *pArray, const int Count)
657{

Callers 5

AdaptVisibleAreasFunction · 0.85
AdaptReplaceableAreasFunction · 0.85
SetExtendedAreaFunction · 0.85
GetVisibleAreaFunction · 0.85
GetReplaceableAreaFunction · 0.85

Calls 2

SetInexistentFunction · 0.85
mem_copyFunction · 0.85

Tested by

no test coverage detected