MCPcopy Create free account
hub / github.com/axmolengine/axmol / isLineOverlap

Method isLineOverlap

core/math/Vec2.cpp:284–299  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

282}
283
284bool Vec2::isLineOverlap(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D)
285{
286 // FAIL: Line undefined
287 if ((A.x == B.x && A.y == B.y) || (C.x == D.x && C.y == D.y))
288 {
289 return false;
290 }
291
292 if (crossProduct2Vector(A, B, C, D) == 0 &&
293 (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0))
294 {
295 return true;
296 }
297
298 return false;
299}
300
301bool Vec2::isSegmentOverlap(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D, Vec2* S, Vec2* E)
302{

Callers

nothing calls this directly

Calls 1

crossProduct2VectorFunction · 0.85

Tested by

no test coverage detected