{"id":27068300,"url":"https://github.com/a740g/physac64","last_synced_at":"2026-01-20T10:32:56.051Z","repository":{"id":267718551,"uuid":"866873897","full_name":"a740g/Physac64","owner":"a740g","description":"QB64-PE bindings for Physac 2D physics library.","archived":false,"fork":false,"pushed_at":"2026-01-11T20:36:15.000Z","size":1292,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-12T00:07:47.440Z","etag":null,"topics":["math","physac","physics","physics-2d","physics-engine","qb64","qb64-pe","qb64pe","qb64phoenix","qbasic","qbasic64","quickbasic","quickbasic64"],"latest_commit_sha":null,"homepage":"https://qb64phoenix.com/forum/showthread.php?tid=3087","language":"QuickBASIC","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/a740g.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-03T03:13:02.000Z","updated_at":"2026-01-11T20:36:19.000Z","dependencies_parsed_at":"2024-12-12T06:33:29.770Z","dependency_job_id":null,"html_url":"https://github.com/a740g/Physac64","commit_stats":null,"previous_names":["a740g/physac64"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/a740g/Physac64","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a740g%2FPhysac64","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a740g%2FPhysac64/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a740g%2FPhysac64/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a740g%2FPhysac64/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/a740g","download_url":"https://codeload.github.com/a740g/Physac64/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/a740g%2FPhysac64/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28601855,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-20T09:39:28.479Z","status":"ssl_error","status_checked_at":"2026-01-20T09:38:10.511Z","response_time":117,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["math","physac","physics","physics-2d","physics-engine","qb64","qb64-pe","qb64pe","qb64phoenix","qbasic","qbasic64","quickbasic","quickbasic64"],"created_at":"2025-04-05T20:37:04.222Z","updated_at":"2026-01-20T10:32:56.035Z","avatar_url":"https://github.com/a740g.png","language":"QuickBASIC","readme":"# Physac for QB64-PE\n\n![Logo](physac.ico)\n\n[Physac for QB64-PE](https://github.com/a740g/Physac64) is a [QB64-PE](https://www.qb64phoenix.com/) binding library for [Physac](https://github.com/victorfisac/Physac). Physac is a small 2D physics engine written in C. The engine uses a fixed time-step thread loop to simluate physics. A physics step contains the following phases: get collision information, apply dynamics, collision solving and position correction. It uses a very simple TYPE for physic bodies with a position vector to be used in any 2D / 3D rendering API.\n\nThis version is completely standalone and does not have any [raylib-64](https://github.com/a740g/raylib-64) dependencies. As a bonus, it also contains the [reasings](https://github.com/raylib-extras/reasings) library (Robert Penner's [easing equations](https://easings.net/)) and [raymath](https://www.raylib.com/cheatsheet/raymath_cheatsheet.html) (raylib math library).\n\n![Screenshot 2](screenshots/screenshot2.png)\n![Screenshot 3](screenshots/screenshot3.png)\n![Screenshot 4](screenshots/screenshot4.png)\n![Screenshot 5](screenshots/screenshot5.png)\n![Screenshot 6](screenshots/screenshot6.png)\n![Screenshot 1](screenshots/screenshot1.png)\n\n## API\n\nThe PhysicsBody TYPE contains all dynamics information and collision shape. The user may use the following structure components:\n\n```vb\nTYPE PhysicsBody\n    AS _UNSIGNED LONG id ' Reference unique identifier\n    AS _BYTE enabled ' Enabled dynamics state (collisions are calculated anyway)\n    AS Vector2 position ' Physics body shape pivot\n    AS Vector2 velocity ' Current linear velocity applied to position\n    AS Vector2 force ' Current linear force (reset to 0 every step)\n    AS SINGLE angularVelocity ' Current angular velocity applied to orient\n    AS SINGLE torque ' Current angular force (reset to 0 every step)\n    AS SINGLE orient ' Rotation in radians\n    AS SINGLE inertia ' Moment of inertia\n    AS SINGLE inverseInertia ' Inverse value of inertia\n    AS SINGLE mass ' Physics body mass\n    AS SINGLE inverseMass ' Inverse value of mass\n    AS SINGLE staticFriction ' Friction when the body has not movement (0 to 1)\n    AS SINGLE dynamicFriction ' Friction when the body has movement (0 to 1)\n    AS SINGLE restitution ' Restitution coefficient of the body (0 to 1)\n    AS _BYTE useGravity ' Apply gravity force to dynamics\n    AS _BYTE isGrounded ' Physics grounded on other body state\n    AS _BYTE freezeOrient ' Physics rotation constraint\n    AS PhysicsShape shape ' Physics body shape information (type, radius, vertices, normals)\nEND TYPE\n```\n\nThe following Physac API functions are available for the user:\n\n```vb\n' Initializes physics values, pointers and (optionbally) creates the physics loop thread\nSUB InitPhysics (BYVAL isThreaded AS _BYTE)\n' Run physics step, to be used if isThreaded is set to FALSE when calling InitPhysics\nSUB RunPhysicsStep\n'Sets physics fixed time step in milliseconds. 1.666666 by default\nSUB SetPhysicsTimeStep (BYVAL delta AS DOUBLE)\n' Returns true if physics thread is currently enabled\nFUNCTION IsPhysicsEnabled%%\n' Sets physics global gravity force\nSUB SetPhysicsGravity (BYVAL x AS SINGLE, BYVAL y AS SINGLE)\n' Gets a physics body TYPE value from a pointer\nSUB GetPhysicsBodyOffset (body AS PhysicsBody, BYVAL bodyOffset AS _UNSIGNED _OFFSET)\n' Sets a physics body TYPE value to a pointer\nSUB SetPhysicsBodyOffset (BYVAL bodyOffset AS _UNSIGNED _OFFSET, body AS PhysicsBody)\n' Creates a new circle physics body with generic parameters\nFUNCTION CreatePhysicsBodyCircle~%\u0026 (position AS Vector2, BYVAL radius AS SINGLE, BYVAL density AS SINGLE)\n' Creates a new circle physics body with generic parameters\nSUB CreatePhysicsBodyCircle (position AS Vector2, BYVAL radius AS SINGLE, BYVAL density AS SINGLE, retVal AS PhysicsBody)\n' Creates a new rectangle physics body with generic parameters\nFUNCTION CreatePhysicsBodyRectangle~%\u0026 (position AS Vector2, BYVAL wid AS SINGLE, BYVAL hgt AS SINGLE, BYVAL density AS SINGLE)\n' Creates a new rectangle physics body with generic parameters\nSUB CreatePhysicsBodyRectangle (position AS Vector2, BYVAL wid AS SINGLE, BYVAL hgt AS SINGLE, BYVAL density AS SINGLE, retVal AS PhysicsBody)\n' Creates a new polygon physics body with generic parameters\nFUNCTION CreatePhysicsBodyPolygon~%\u0026 (position AS Vector2, BYVAL radius AS SINGLE, BYVAL sides AS LONG, BYVAL density AS SINGLE)\n' Creates a new polygon physics body with generic parameters\nSUB CreatePhysicsBodyPolygon (position AS Vector2, BYVAL radius AS SINGLE, BYVAL sides AS LONG, BYVAL density AS SINGLE, retVal AS PhysicsBody)\n' Adds a force to a physics body\nSUB PhysicsAddForce (BYVAL body AS _UNSIGNED _OFFSET, force AS Vector2)\n' Adds a angular force to a physics body\nSUB PhysicsAddTorque (BYVAL body AS _UNSIGNED _OFFSET, BYVAL amount AS SINGLE)\n' Shatters a polygon shape physics body to little physics bodies with explosion force\nSUB PhysicsShatter (BYVAL body AS _UNSIGNED _OFFSET, position AS Vector2, BYVAL force AS SINGLE)\n' Returns the current amount of created physics bodies\nFUNCTION GetPhysicsBodiesCount\u0026\n' Returns a physics body of the bodies pool at a specific index\nFUNCTION GetPhysicsBody~%\u0026 (BYVAL index AS LONG)\n' Returns a physics body of the bodies pool at a specific index\nSUB GetPhysicsBody (BYVAL index AS LONG, retVal AS PhysicsBody)\n' Returns the physics body shape type (PHYSICS_CIRCLE or PHYSICS_POLYGON)\nFUNCTION GetPhysicsShapeType\u0026 (BYVAL index AS LONG)\n' Returns the amount of vertices of a physics body shape\nFUNCTION GetPhysicsShapeVerticesCount\u0026 (BYVAL index AS LONG)\n' Returns transformed position of a body shape (body position + vertex transformed position)\nSUB GetPhysicsShapeVertex (BYVAL body AS _UNSIGNED _OFFSET, BYVAL vertex AS LONG, retVal AS Vector2)\n' Sets physics body shape transform based on radians parameter\nSUB SetPhysicsBodyRotation (BYVAL body AS _UNSIGNED _OFFSET, BYVAL radians AS SINGLE)\n' Unitializes physics pointers and closes physics loop thread\nSUB DestroyPhysicsBody (BYVAL body AS _UNSIGNED _OFFSET)\n' Unitializes physics pointers and closes physics loop thread\nSUB ClosePhysics\n```\n\n## EXAMPLES\n\nThere are 6 examples. 5 of them are for Physac and 1 for reasings.\n\n# NOTE\n\nThis library requires the latest 64-bit version of [QB64-PE](https://github.com/QB64-Phoenix-Edition/QB64pe/releases/latest).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa740g%2Fphysac64","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fa740g%2Fphysac64","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fa740g%2Fphysac64/lists"}