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

Method isLineParallel

core/math/Vec2.cpp:262–282  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

260}
261
262bool Vec2::isLineParallel(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D)
263{
264 // FAIL: Line undefined
265 if ((A.x == B.x && A.y == B.y) || (C.x == D.x && C.y == D.y))
266 {
267 return false;
268 }
269
270 if (crossProduct2Vector(A, B, C, D) == 0)
271 {
272 // line overlap
273 if (crossProduct2Vector(C, D, C, A) == 0 || crossProduct2Vector(A, B, C, A) == 0)
274 {
275 return false;
276 }
277
278 return true;
279 }
280
281 return false;
282}
283
284bool Vec2::isLineOverlap(const Vec2& A, const Vec2& B, const Vec2& C, const Vec2& D)
285{

Callers

nothing calls this directly

Calls 1

crossProduct2VectorFunction · 0.85

Tested by

no test coverage detected