I'll make that change to isPointOnLineSeg, thanks.
That function didn't work but I decided to make my own replacement.
It didn't change that much so I presume that unless the error is concurrent in both functions it not located in isPointOnLineSeg.Code:// test to see if the point coords are in between the start of the line seg and the end // by testing that the start and end points of the vector are lower and above the point in question bool AAH::math::isPointOnLineSegTEST(sf::Vector2f lineStart, sf::Vector2f lineEnd, sf::Vector2f point) { //is line vertical if (AreSame(lineStart.x, lineEnd.x)) { if (std::min(lineStart.y, lineEnd.y) < point.y && std::max(lineStart.y, lineEnd.y) > point.y) { return true; } } //is line horizontal else if (AreSame(lineStart.y, lineEnd.y)) { if (std::min(lineStart.x, lineEnd.x) < point.x && std::max(lineStart.x, lineEnd.x) > point.x) { return true; } } else { if (std::min(lineStart.x, lineEnd.x) < point.x && std::max(lineStart.x, lineEnd.x) > point.x && std::min(lineStart.y, lineEnd.y) < point.y && std::max(lineStart.y, lineEnd.y) > point.y) { return true; } } return false; }
However, I noticed this interesting behavior while testing that function. Sometimes pictures are better then words but videos are one up. So here is a video showing what happened. Make sure to read the short description as well.
https://www.youtube.com/watch?v=mnGJ...U&feature=plcp
Cheers for the help guys!



1Likes
LinkBack URL
About LinkBacks


