Example #1
0
bool Line::Collides(Line &line) {

	if(!this->bounds.Collides(line.bounds)) {
		return false;
	}

	Point intersection = _getLineIntersection(*this, line);
	if(intersection.x != INFINITY && intersection.y != INFINITY) {
		return true;
	}

	return false;
}
Example #2
0
int Line::_removeIntersect(std::vector<Point>::size_type err_point){
	for (
	    std::vector<Point>::size_type end = err_point;
      end < m_Points.size() - 2; 
      end++
  ) {
		for (
		    size_t start = err_point - 1;
        start > 1;
        start--
    ) {
		  Point int_point = { -1, -1, false };
			bool found = _getLineIntersection(start, end, &int_point);

			if (found){
				_smoothLine(start, end, int_point);
				return(start);
			}
		}
	}
	return(-1);
}