|
Swadge 2024 2.0.0
APIs to develop games for the Magfest Swadge
|
Functions | |
| bool | circleCircleIntersection (circle_t circle1, circle_t circle2, vec_t *collisionVec) |
| Check if two circles intersect. | |
| bool | circlePointIntersection (circle_t circle, vec_t point, vec_t *collisionVec) |
| Check if a point and a circle intersect. | |
| bool | rectRectIntersection (rectangle_t rect1, rectangle_t rect2, vec_t *collisionVec) |
| Check if two rectangles intersect. | |
| bool | circleRectIntersection (circle_t circle, rectangle_t rect, vec_t *collisionVec) |
| Check if a circle and a rectangle intersect. | |
| bool | circleLineIntersection (circle_t circle, line_t line, vec_t *collisionVec) |
| Check if a circle and a line intersect. | |
| bool | lineLineIntersection (line_t line1, line_t line2) |
| Check if two lines intersect. | |
| bool | rectLineIntersection (rectangle_t rect, line_t line, vec_t *collisionVec) |
| Check if a line intersects with a rectangle. | |
| arrow_t | initArrow (vec_t base, vec_t tip, int32_t wingLen) |
| Initialize an arrow pointing from base to tip. | |
Check if two circles intersect.
| circle1 | [IN] One circle to check for intersection |
| circle2 | [IN] The other circle to check for intersection |
| collisionVec | [OUT] A vector pointing from the second circle to the first in the direction of the collision. May be NULL. |
Check if a point and a circle intersect.
| circle | [IN] A circle to check for intersection |
| point | [IN] A point to check for intersection |
| collisionVec | [OUT] A vector pointing from the point to the circle in the direction of the collision. May be NULL. |
| bool rectRectIntersection | ( | rectangle_t | rect1, |
| rectangle_t | rect2, | ||
| vec_t * | collisionVec ) |
Check if two rectangles intersect.
Adapted from https://www.jeffreythompson.org/collision-detection/rect-rect.php
| rect1 | [IN] One rectangle to check for intersection |
| rect2 | [IN] The other rectangle to check for intersection |
| collisionVec | [OUT] A vector pointing from the second rectangle to the first in the direction of the collision. May be NULL. |
| bool circleRectIntersection | ( | circle_t | circle, |
| rectangle_t | rect, | ||
| vec_t * | collisionVec ) |
Check if a circle and a rectangle intersect.
Adapted from https://www.jeffreythompson.org/collision-detection/circle-rect.php
| circle | [IN] The circle to check for intersection |
| rect | [IN] The rectangle to check for intersection |
| collisionVec | [OUT] A vector pointing from the rectangle to the circle in the direction of the collision. May be NULL. |
Check if a circle and a line intersect.
Adapted from https://www.jeffreythompson.org/collision-detection/line-circle.php
| circle | [IN] A circle to test intersection |
| line | [IN] A line to test intersection |
| collisionVec | [OUT] A vector pointing from the line to the circle in the direction of the collision. This may be NULL. |
Check if two lines intersect.
Adapted from https://www.jeffreythompson.org/collision-detection/line-line.php
| line1 | [IN] One line to check for intersection |
| line2 | [IN] Another line to check for intersection |
| bool rectLineIntersection | ( | rectangle_t | rect, |
| line_t | line, | ||
| vec_t * | collisionVec ) |
Check if a line intersects with a rectangle.
Adapted from https://www.jeffreythompson.org/collision-detection/line-rect.php
| rect | [IN] A rectangle to check for intersection |
| line | [IN] A line to check for intersection |
| collisionVec | [OUT] A vector pointing from the rectangle to the line in the direction of the collision. May be NULL. |