SwIntersection
From SWWorkshop
Utility functions for collision detection. This utility function for simple usage. In real simulation collision you should use swPhys API
bool swIntersectionLineAndLine(swPoint *line0Start,swPoint *line0End,swPoint *line1Start,swPoint *line1End); bool swIntersectionLineAndPoint(swPoint *lineStart,swPoint *lineEnd,swPoint *point); bool swIntersectionCircleAndPoint(swPoint *center,float radious,swPoint *point); bool swIntersectionCircleAndLine(swPoint *center,float radious,swPoint *line0Start,swPoint *line0End); bool swIntersectionCircleAndCircle(swPoint *center0,float radious0,swPoint *center1,float radious1); bool swIntersectionRectAndPoint(swRect *rect,swPoint *point); bool swIntersectionRectAndPoint2(swRect *rect,float x,float y); bool swIntersectionRectAndLine(swRect *rect,swPoint *line0Start,swPoint *line0End); bool swIntersectionBoundaryAndBoundary(swPolygon *b1,swPolygon *b2); bool swIntersectionBoundaryAndPoint(swPolygon *b1,swPoint *pos); bool swIntersectionBoundaryAndLine(swPolygon *b1,swPoint *line0Start,swPoint *line0End); bool swIntersectionBoundaryAndRect(swPolygon *boundary,swRect *rect); bool swIntersectionRectAndRect(swRect *r0,swRect *r1);
