|
LineIntersectRect | |
State = LineIntersectRect(X1#, Y1#, X2#, Y2#, RectX1#, RectY1#, RectX2#, RectY2#) | |
Parameters: X1# = The X1 cord of line Y1# = The Y1 cord of line X2# = The X2 cord of line Y2# = The Y2 cord of line RectX1# = The Top Left X cord of the region RectY1# = The Top Left Y cord of the region RectX2# = The Bottom Right X cord of the region RectY2# = The Bottom Right Y cord of the region |
|
Returns: State = The intersection state (-1= line outside, 0 = line inside, 1=line intersects) |
|
The LineIntersectRect function checks if a line is inside/outside or intersects a rectangular region. Return Values -1 = Line is completely outside of region 0 = Line is inside this region 1 = Line intersects one or more of the region edges. FACTS: * If the line intersects the region, you can get it's new clipped coordinates using the GetIntersectX#() and GetIntersectY#() functions. Mini Tutorial: This example lets the user check for a intersection between a user controlled line and a rectangular region. If the line intersects, the clipped line segment (the segment inside the rectangle were clipping against) is displayed.
|
Related Info: | CirclesIntersect | GetDistance2D | GetIntersectX# | GetIntersectY# | LineIntersectCircle | LinesIntersect | PointIntersectCircle : |
|
|||||||||||||||||||||||||||||||||||||||
(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com |