Coll
2d collision library for Go
Install / Use
/learn @setanarut/CollREADME
coll - 2d collision library for Go
Features
- Collisions only - no gravity, rigid body handling, or complex solvers
- Is data-oriented and functional
Conventions
"Sweep" tests indicate at least 1 of the objects is moving.
The number indicates how many objects are moving. e.g., box-box-sweep2 means we are comparing 2 aabbs, both of which are moving.
"Overlap" tests don't take movement into account, and this is a static check to see if the 2 entities overlap.
plural forms imply a collection. e.g., BoxSegmentsSweep1Indexed() checks one box segment against a set of line segments.
If there is more than one collision, the closest collision is set in the h *Hit argument.
Visualization of some (but not all) functions
Box-Box overlap

Box-Box sweep 1

Box-Box sweep 2

Box-OrientedBox overlap
Box-Segment sweep 1

Box-Segments sweep 1 indexed

Box-Segment overlap

Line-Circle overlap

Segment-Circle overlap

Examples (Ebitengine)
- Clone this repository
- In the terminal, change to the examples directory
cd examples - Run a folder with
go run ./foldername. Example:go run ./box_box_sweep1
Credits
Most of these collision checks were adapted from existing open source repos:
- github.com/mreinstein/collision-2d
- youtube.com/watch?v=NbSee-XM7WA - ray-tilemap (RayTilemapDDA)
- jonathanwhiting.com/tutorial/collision - box-tilemap (TileCollider)
Related Skills
node-connect
340.2kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
340.2kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
84.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
340.2kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
