{"id":13773799,"url":"https://github.com/fabmax/physx-js-webidl","last_synced_at":"2025-05-16T18:03:26.677Z","repository":{"id":39375897,"uuid":"329375258","full_name":"fabmax/physx-js-webidl","owner":"fabmax","description":"Javascript WASM bindings for Nvidia PhysX","archived":false,"fork":false,"pushed_at":"2025-03-26T18:37:32.000Z","size":60439,"stargazers_count":150,"open_issues_count":12,"forks_count":30,"subscribers_count":7,"default_branch":"main","last_synced_at":"2025-05-12T20:19:51.607Z","etag":null,"topics":["emscripten","javascript","physics","physx","wasm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/fabmax.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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":"2021-01-13T16:59:51.000Z","updated_at":"2025-04-30T08:09:09.000Z","dependencies_parsed_at":"2024-11-13T01:01:59.228Z","dependency_job_id":"f0d78ad7-a911-4371-9ecf-7485dbc60a63","html_url":"https://github.com/fabmax/physx-js-webidl","commit_stats":{"total_commits":43,"total_committers":3,"mean_commits":"14.333333333333334","dds":0.09302325581395354,"last_synced_commit":"f871a6423dedd2348b3a0252c1f031cff1246255"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabmax%2Fphysx-js-webidl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabmax%2Fphysx-js-webidl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabmax%2Fphysx-js-webidl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fabmax%2Fphysx-js-webidl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fabmax","download_url":"https://codeload.github.com/fabmax/physx-js-webidl/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254582901,"owners_count":22095518,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["emscripten","javascript","physics","physx","wasm"],"created_at":"2024-08-03T17:01:20.276Z","updated_at":"2025-05-16T18:03:26.611Z","avatar_url":"https://github.com/fabmax.png","language":"JavaScript","readme":"# physx-js-webidl\nJavascript/WASM bindings for Nvidia PhysX 5.6.0.\n\nLooking for pre-built binaries / build instructions? See [below](#pre-built-binaries)\n\n## Library coverage\n\nThe bindings include most major parts of the PhysX SDK (excluding CUDA stuff, which is not possible with WASM):\n- [x] Basics\n    - Static and dynamic actors\n    - All geometry types (box, capsule, sphere, plane, convex mesh, triangle mesh and height field)\n- [x] All joint types (revolute, spherical, prismatic, fixed, distance and D6)\n- [x] Articulations\n- [x] Vehicles\n- [x] Character controllers\n- [x] Scene serialization\n\n## Getting started\nThere is a basic [hello world example](dist/helloworld.html): 10 boxes falling on the ground (drawn as wireframe on a plain canvas).\n\n## Documentation\nThe API is very close to the original PhysX C++ API, so you can simply use the official\n[PhysX API documentation](https://nvidia-omniverse.github.io/PhysX/physx/5.6.0/index.html)\n\nHowever, in order to make the bindings work with emscripten a few additional wrappers are needed here and there. So it might\nmake sense to also take a look into the [PhysXWasm.idl](https://github.com/fabmax/PhysX/blob/webidl-bindings/physx/source/webidlbindings/src/wasm/PhysXWasm.idl)\ninterface definiton file.\n\nUpdate as of `v2.2.0`: Thanks to Shannon Poole, PhysX enums can now be accessed by their qualified names (e.g. `PhysX.PxIDENTITYEnum.PxIdentity`,\nsee also the hello world demo mentioned above).\n\n## Demos\nI use this library in my engine [kool](https://github.com/fabmax/kool) and have a few demos in place:\n- [Vehicle](https://fabmax.github.io/kool/kool-js/?demo=phys-vehicle): Basic vehicle demo with a few obstacles.\n- [Character](https://fabmax.github.io/kool/kool-js/?demo=phys-terrain): 3rd person character demo on an island.\n- [Ragdolls](https://fabmax.github.io/kool/kool-js/?demo=phys-ragdoll): A simple ragdoll demo.\n- [Joints](https://fabmax.github.io/kool/kool-js/?demo=phys-joints): A chain running over two gears.\n- [Collision](https://fabmax.github.io/kool/kool-js/?demo=physics): The obligatory box (and other shapes) collision physics demo.\n\nHowever, the demos are written in kotlin, not javascript.\n\n## Pre-built binaries\nThis library is published as a [npm package](https://www.npmjs.com/package/physx-js-webidl):\n```\nnpm i physx-js-webidl\n```\nAlternatively you can grab the pre-built binaries (.wasm + support .js) from the latest [Release](https://github.com/fabmax/physx-js-webidl/releases).\n\n## Building\nIn order to build the library you need a recent version of the [emscripten SDK](https://emscripten.org/docs/getting_started/downloads.html) - I'm\nusing version `3.1.51`. Alternatively, you can use docker as described below.\nAfter successful build, the binaries (.wasm + support .js) will appear in the `dist` directory.\n\n```\n# Clone this repo\ngit clone https://github.com/fabmax/physx-js-webidl\n\n# Enter that directory\ncd physx-js-webidl\n\n# Download submodule containing the PhysX code\ngit submodule update --init\n\n# Generate build-scripts\n./generate.sh\n\n# Build\n./make.sh\n```\n\nTo add bindings to additional PhysX interfaces you only have to edit the\n[PhysXJs.idl](https://github.com/fabmax/PhysX/blob/webidl-bindings/physx/source/webidlbindings/src/wasm/PhysXWasm.idl)\nfile located in `PhysX/physx/source/webidlbindings/src/wasm/` and recompile the library.\n\n### Build with Docker\n\nThe docker build also generates typescript definitions.\n\n```\n# Build the image\ndocker compose up\n\n# Build Release\ndocker compose run --rm builder ./make.sh\n\n# Build Profile\ndocker compose run --rm builder ./make-profile.sh\n\n# Build Debug\ndocker compose run --rm builder ./make-debug.sh\n```\n\n","funding_links":[],"categories":["Physics Engine"],"sub_categories":["Visual Animation Editor"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabmax%2Fphysx-js-webidl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffabmax%2Fphysx-js-webidl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffabmax%2Fphysx-js-webidl/lists"}