Module pico8lib.physics
Collision functions, etc
Local Functions
collision_point_circle1 (px, py, cx, cy, cr) | Check for collision/overlap of a point and a circle 44 tokens |
collision_point_circle2 (px, py, cx, cy, cr) | Check for collision/overlap of a point and a circle 29 tokens and faster overflow and potential false positives for dxdx+dydy > 32767 |
dist_circ_line_w (x, y, r, x0, y0, x1, y1, w) | Distance from circle to line with optional width Wide line includes a circular cap at each end Negative distance indicates depth of overlap |
Local Functions
- collision_point_circle1 (px, py, cx, cy, cr)
-
Check for collision/overlap of a point and a circle
44 tokens
Parameters:
- px
- py
- cx
- cy
- cr
- collision_point_circle2 (px, py, cx, cy, cr)
-
Check for collision/overlap of a point and a circle
29 tokens and faster
overflow and potential false positives for dxdx+dydy > 32767
Parameters:
- px
- py
- cx
- cy
- cr
- dist_circ_line_w (x, y, r, x0, y0, x1, y1, w)
-
Distance from circle to line with optional width
Wide line includes a circular cap at each end
Negative distance indicates depth of overlap
Parameters:
- x
- y
- r
- x0
- y0
- x1
- y1
- w