o
odin.langpkg.dev
packages / app / swept_aabb_collisions

swept_aabb_collisions

717abbaapp

A simple demo of collision detection between two AABBs using the Swept AABB algorithm

MIT · updated 2 years ago

Swept AABB Collision Detection

A simple demo of swept AABB collision detection.

Inspired by and loosely based on Dylan Falconer's Engine From Scratch Episode 08 video (Source code).

I also referenced the Swept AABB Collision Detection and Response article, but as it stands now, this demo doesn't implement any sort of deflection or sliding. Maybe I will do it later though.

Usage

Requires the Odin compiler. Im using the version dev-2024-07-nightly:b4ca044

Clone/dowload the source code:

git clone https://github.com/ethanavatar/swept_aabb_collisions.git

And use odin run in the source directory to run the demo:

# Change directory
cd swept_aabb_collisions

# Run the demo
odin run . --

Demo