Builtin collision functions. The ic argument stores the collision position.

fn lineToLine

fn lineToLine*(b1, e1, b2, e2: th::Vf2, ic: ^th::Vf2): bool {

Checks for a collision between 2 lines specified by their end points.

fn vf2ToQuad

fn vf2ToQuad*(p: th::Vf2, q: th::Quad, ic: ^th::Vf2): bool {

Checks for a collision between a vf2 and a quad.

fn lineToQuad

fn lineToQuad*(b, e: th::Vf2, q: th::Quad, ic1, ic2: ^th::Vf2): bool {

Check for a collision between a line and quad edges.

fn quadToQuad

fn quadToQuad*(q1, q2: th::Quad, ic: ^th::Vf2): bool {

Check for a collision between two quads.

fn vf2ToRect

fn vf2ToRect*(p: th::Vf2, r: rect::Rect): bool {

Check for a collision between a vf2 and a rectangle.

fn rectToRect

fn rectToRect*(r1, r2: rect::Rect): bool {

Check for a collision between two rects