Collision
Collision detection functions
Contains
contains(outer: Rect, inner: Rect) → boolCheck whether one rectangle completely contains another rectangle.
Args
outer: The outer rectangle.inner: The inner rectangle.
Returns
bool : True if the outer rectangle completely contains the inner rectangle.
contains(rect: Rect, circle: Circle) → boolCheck whether a rectangle completely contains a circle.
Args
rect: The rectangle.circle: The circle.
Returns
bool : True if the rectangle completely contains the circle.
contains(rect: Rect, line: Line) → boolCheck whether a rectangle completely contains a line.
Args
rect: The rectangle.line: The line.
Returns
bool : True if the rectangle completely contains the line.
contains(outer: Circle, inner: Circle) → boolCheck whether one circle completely contains another circle.
Args
outer: The outer circle.inner: The inner circle.
Returns
bool : True if the outer circle completely contains the inner circle.
contains(circle: Circle, rect: Rect) → boolCheck whether a circle completely contains a rectangle.
Args
circle: The circle.rect: The rectangle.
Returns
bool : True if the circle completely contains the rectangle.
contains(circle: Circle, line: Line) → boolCheck whether a circle completely contains a line.
Args
circle: The circle.line: The line.
Returns
bool : True if the circle completely contains the line.
Overlap
overlap(a: Rect, b: Rect) → boolCheck whether two rectangles overlap.
Args
a: The first rectangle.b: The second rectangle.
Returns
bool : True if the rectangles overlap.
overlap(rect: Rect, circle: Circle) → boolCheck whether a rectangle and a circle overlap.
Args
rect: The rectangle.circle: The circle.
Returns
bool : True if the rectangle and circle overlap.
overlap(rect: Rect, line: Line) → boolCheck whether a rectangle and a line overlap.
Args
rect: The rectangle.line: The line.
Returns
bool : True if the rectangle and line overlap.
overlap(rect: Rect, point: Vec2) → boolCheck whether a rectangle contains a point.
Args
rect: The rectangle.point: The point.
Returns
bool : True if the rectangle contains the point.
overlap(a: Circle, b: Circle) → boolCheck whether two circles overlap.
Args
a: The first circle.b: The second circle.
Returns
bool : True if the circles overlap.
overlap(circle: Circle, rect: Rect) → boolCheck whether a circle and a rectangle overlap.
Args
circle: The circle.rect: The rectangle.
Returns
bool : True if the circle and rectangle overlap.
overlap(circle: Circle, line: Line) → boolCheck whether a circle and a line overlap.
Args
circle: The circle.line: The line.
Returns
bool : True if the circle and line overlap.
overlap(circle: Circle, point: Vec2) → boolCheck whether a circle contains a point.
Args
circle: The circle.point: The point.
Returns
bool : True if the circle contains the point.
overlap(a: Line, b: Line) → boolCheck whether two lines overlap (intersect).
Args
a: The first line.b: The second line.
Returns
bool : True if the lines intersect.
overlap(line: Line, rect: Rect) → boolCheck whether a line and a rectangle overlap.
Args
line: The line.rect: The rectangle.
Returns
bool : True if the line and rectangle overlap.
overlap(line: Line, circle: Circle) → boolCheck whether a line and a circle overlap.
Args
line: The line.circle: The circle.
Returns
bool : True if the line and circle overlap.
overlap(point: Vec2, rect: Rect) → boolCheck whether a point is inside a rectangle.
Args
point: The point.rect: The rectangle.
Returns
bool : True if the point is inside the rectangle.
overlap(point: Vec2, circle: Circle) → boolCheck whether a point is inside a circle.
Args
point: The point.circle: The circle.
Returns
bool : True if the point is inside the circle.
overlap(polygon: Polygon, point: Vec2) → boolCheck whether a polygon contains a point.
Args
polygon: The polygon.point: The point.
Returns
bool : True if the polygon contains the point.
overlap(point: Vec2, polygon: Polygon) → boolCheck whether a point is inside a polygon.
Args
point: The point.polygon: The polygon.
Returns
bool : True if the point is inside the polygon.
overlap(polygon: Polygon, rect: Rect) → boolCheck whether a polygon and a rectangle overlap.
Args
polygon: The polygon.rect: The rectangle.
Returns
bool : True if the polygon and rectangle overlap.
overlap(rect: Rect, polygon: Polygon) → boolCheck whether a rectangle and a polygon overlap.
Args
rect: The rectangle.polygon: The polygon.
Returns
bool : True if the rectangle and polygon overlap.