{"id":18020070,"url":"https://github.com/polygonjs/example-plugin-physics","last_synced_at":"2026-06-17T21:03:35.470Z","repository":{"id":109050723,"uuid":"333599520","full_name":"polygonjs/example-plugin-physics","owner":"polygonjs","description":null,"archived":false,"fork":false,"pushed_at":"2022-04-27T16:35:45.000Z","size":4970,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2026-01-14T20:16:50.639Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/polygonjs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2021-01-28T00:32:28.000Z","updated_at":"2022-01-25T22:07:48.000Z","dependencies_parsed_at":"2023-09-22T22:00:53.694Z","dependency_job_id":null,"html_url":"https://github.com/polygonjs/example-plugin-physics","commit_stats":{"total_commits":16,"total_committers":1,"mean_commits":16.0,"dds":0.0,"last_synced_commit":"ce3c6ccf357576b6509ecb9b2e4f92f1b37c8348"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/polygonjs/example-plugin-physics","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonjs%2Fexample-plugin-physics","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonjs%2Fexample-plugin-physics/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonjs%2Fexample-plugin-physics/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonjs%2Fexample-plugin-physics/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/polygonjs","download_url":"https://codeload.github.com/polygonjs/example-plugin-physics/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/polygonjs%2Fexample-plugin-physics/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34465333,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-17T02:00:05.408Z","response_time":127,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2024-10-30T05:13:27.578Z","updated_at":"2026-06-17T21:03:35.453Z","avatar_url":"https://github.com/polygonjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Polygonjs Plugin Physics Example\n\nThis repository shows how to use the [Physics Plugin](https://github.com/polygonjs/plugin-physics) for the WebGL engine [Polygonjs](https://github.com/polygonjs/polygonjs).\n\n![Physics Example](https://github.com/polygonjs/example-plugin-physics/blob/main/doc/physics_examples.jpg?raw=true)\n\n## Open the scene in the WebGL editor\n\n`yarn \u0026\u0026 yarn polygon`\n\nand open your browser at:\n\n`http://localhost:8091?scene=default`\n\nThis will open the scene saved in this repo. It is a simple scene with the following setup:\n\nThe right branch, which creates the moving rigid bodies:\n\n- a Text node to create the geometry of a word\n- a Scatter node to create points on the text\n- a AttribCreate to add the `pscale` attribute on each point, with the expression `1*rand(@ptnum+945)+0.5`, which will give a random scale to each rigid body.\n- a Copy node to create boxes on all the points\n- a PhysicsRbdAttributes to add the attributes necessary to the simulation\n- another AttribCreate node to randomize the `restitution` attribute.\n\nThe left branch, which creates the static rigid bodies:\n\n- a box node to create a box\n- a transform to scale the geometry\n- a second transform to position the object\n- a PhysicsRbdAttributes to set the attributes for the simulation. The difference to the moving RBDs is that `active` is set to false, and `mass` is set to a very high number.\n- both boxes are merged (make sure to have the merge node set to `separate objects` by setting `compact` to false), so that their geometries are not merged into a single object.\n\nand finally both branches are merged into the `PhysicsSolver`, where all attributes are set to default.\n\n![Physics plugin example in the Polygonjs node-based Editor](https://github.com/polygonjs/example-plugin-physics/blob/main/doc/physics_example_in_editor.jpg?raw=true)\n\n## Open the export scene without the editor\n\n`yarn \u0026\u0026 yarn run snowpack dev`\n\nand open your browser at:\n\n`http://localhost:8080/`\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolygonjs%2Fexample-plugin-physics","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpolygonjs%2Fexample-plugin-physics","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpolygonjs%2Fexample-plugin-physics/lists"}