{"id":23686374,"url":"https://github.com/lecodeurdudimanche/yetanotherc-sat","last_synced_at":"2026-04-29T09:37:08.025Z","repository":{"id":184256294,"uuid":"216893554","full_name":"LeCodeurDuDimanche/YetAnotherC-Sat","owner":"LeCodeurDuDimanche","description":"Custom C++ implementation of the Separated Axis Theorem","archived":false,"fork":false,"pushed_at":"2019-10-22T19:31:05.000Z","size":369,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-22T01:11:33.626Z","etag":null,"topics":["collision-detection","cpp","sat"],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LeCodeurDuDimanche.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2019-10-22T19:27:41.000Z","updated_at":"2019-10-22T19:32:05.000Z","dependencies_parsed_at":"2023-07-27T17:54:33.424Z","dependency_job_id":null,"html_url":"https://github.com/LeCodeurDuDimanche/YetAnotherC-Sat","commit_stats":null,"previous_names":["lecodeurdudimanche/yetanotherc-sat"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/LeCodeurDuDimanche/YetAnotherC-Sat","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeCodeurDuDimanche%2FYetAnotherC-Sat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeCodeurDuDimanche%2FYetAnotherC-Sat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeCodeurDuDimanche%2FYetAnotherC-Sat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeCodeurDuDimanche%2FYetAnotherC-Sat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LeCodeurDuDimanche","download_url":"https://codeload.github.com/LeCodeurDuDimanche/YetAnotherC-Sat/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LeCodeurDuDimanche%2FYetAnotherC-Sat/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32420350,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T06:29:02.080Z","status":"ssl_error","status_checked_at":"2026-04-29T06:29:00.631Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["collision-detection","cpp","sat"],"created_at":"2024-12-29T21:30:40.802Z","updated_at":"2026-04-29T09:37:08.004Z","avatar_url":"https://github.com/LeCodeurDuDimanche.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yet another SAT C++ implementation\n\nCustom C++ implementation of the Separated Axis Theorem (SAT, explained [here](http://www.dyn4j.org/2010/01/sat/))\n\n## Features :\n\n* Simple point, rectangle, circle and convex polygon collision\n* Support for any polygons (including concaves polygons)\n* Can load and save any shape, using a custom file format\n* A graphical shape editor is included\n\n### Dependencies\n\nThe graphical editor was only tested under Linux but should work on Windows.\n\nThe graphical editor depends on SDL2 and SDL2_image (`sdl2` and `sdl2_image` package on Archlinux, `libsdl2-dev` and `libsdl2-image-dev` on Ubuntu)\n\n### Build steps\n\n* To build both the library and the editor :\n\n `make`\n\n* To build the library only :\n\n`make release`\n\n\n* To build the editor only :\n\n`make editor`\n\n\n### Usage\n\nYou can create a Circle, a Rectangle, a Point or a Polygon like so :\n```c++\n    Circle circle(x, y, radius);\n    Rectangle rect(x, y, w, h), rotatedRect(x, y, w, h, angle, rotationCenter);\n    Point point(x, y);\n    Polygon polygon(vector_of_points);\n```\n\nNow you can test collision bewteen shapes :\n```c++\n    Shape circle = new Circle(10, 20, 5), rect = new Rectangle(15, 5, 10, 15);\n    Point point(10, 25);\n\n    circle-\u003eisColliding(point); //true\n    rect-\u003eisColliding(point); // false\n    circle-\u003eisColliding(rect); //true\n    //Same as\n    rect-\u003eisColliding(circle); // true\n```\n\nYou can specify an additional reference point (refX, refY) to the constructors thath defines the origin of the shape, used in rotations and displacements of the shape :\n```c++\n    Circle circle(refX, refY, centerX, centerY, radius);\n```\n*Note : rectangles always take the supplied (x, y) point as origin*\n\nYou can also load and save any shape from/to file :\n```c++\n    Polygon polygon(refX, refY, \"path/to/file\");\n    polygon-\u003esave(filename, deltaX, deltaY);\n```\n\nFinally, you can also move and rotate the shapes, and get information about rotation and position:\n```c++    \n    Shape rect = new Rectangle(15, 5, 10, 15);\n    rect-\u003emove(2, 2);\n    rect-\u003egetCoordinates(x, y); //x = 2 and y = 2\n    rect-\u003eadd(5, 5); // 7, 7\n    rect-\u003erotate(180); //Rotate 180 degrees around rect origin (upper left corner)\n    rect-\u003erotate(-90, rectCenter); // Rotate 270 degrees around a point\n    rect-\u003esetRotation(0); //Set rotation to an absolute angle value\n    rect-\u003egetRotation(); // = 0\n```\n\n### Editor\n\nThe editor allows to draw shapes by hand and to save them to use in your application.\n\nCommands:\n\n    Left click : add point, drag point if a point was near the click position\n    Right click : delete last point\n    Midddle click (mouse wheel button) : Move last point\n    Mouse wheel : delete points, leaving at least 4 points\n    K : save shape to file\n    O: open background image,\n    L : load shape from file\n    Left/right arrows : adjust line bright\n    W/A/S/D : move shape\n    Space/Enter : Not entirely implemented (does nothing)\n\n\n### Misc\n\nThe majority of variables names, comments and messages are in French.\n\nThe polygon decomposition algorithm was written by Mark Bayazit and published at https://mpen.ca/406/bayazit\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flecodeurdudimanche%2Fyetanotherc-sat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flecodeurdudimanche%2Fyetanotherc-sat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flecodeurdudimanche%2Fyetanotherc-sat/lists"}