All Projects → ashconnell → physx-js

ashconnell / physx-js

Licence: other
PhysX for JavaScript

Programming Languages

shell
77523 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to physx-js

bevy verlet
Verlet physics plugin for bevy.
Stars: ✭ 29 (-63.75%)
Mutual labels:  physics, physics-3d
LocalSimulation
This plugin allows you to essentially create PxScene or Physic Scenes by placing an Actor, and adding other Static Mesh Components and soon Skeletal Mesh components within this space. Adding Constraints, and Forces will work as expected, but now with the additional layer of abstraction so that simulation can be anchored to a transform.
Stars: ✭ 42 (-47.5%)
Mutual labels:  physics, physx
Libbulletjme
A JNI interface to Bullet Physics and V-HACD
Stars: ✭ 55 (-31.25%)
Mutual labels:  physics, physics-3d
ign-physics
Abstract physics interface designed to support simulation and rapid development of robot applications.
Stars: ✭ 40 (-50%)
Mutual labels:  physics, physics-3d
use-spring
Hooke's law hook
Stars: ✭ 53 (-33.75%)
Mutual labels:  physics
Measurements.jl
Error propagation calculator and library for physical measurements. It supports real and complex numbers with uncertainty, arbitrary precision calculations, operations with arrays, and numerical integration.
Stars: ✭ 248 (+210%)
Mutual labels:  physics
Haskanoid
A breakout game in Haskell using SDL and FRP, with Wiimote and Kinect support.
Stars: ✭ 242 (+202.5%)
Mutual labels:  physics
Pydy
Multibody dynamics tool kit.
Stars: ✭ 232 (+190%)
Mutual labels:  physics
masci-tools
Tools, utility, parsers useful in daily material science work
Stars: ✭ 18 (-77.5%)
Mutual labels:  physics
spicyphysics
Sup bois, here's my work
Stars: ✭ 22 (-72.5%)
Mutual labels:  physics
mechamodlearn
Structured framework for learning mechanical systems in PyTorch
Stars: ✭ 22 (-72.5%)
Mutual labels:  physics
roswasm suite
Libraries for compiling C++ ROS nodes to Webassembly using Emscripten
Stars: ✭ 62 (-22.5%)
Mutual labels:  emscripten
cplot
Function plotter
Stars: ✭ 27 (-66.25%)
Mutual labels:  physics
Artiq
A leading-edge control system for quantum information experiments
Stars: ✭ 245 (+206.25%)
Mutual labels:  physics
InterfaceInteraction
Interact your app's interface elements with different effects!
Stars: ✭ 57 (-28.75%)
Mutual labels:  physics
Particulate Medusae
Soft body jellyfish simulation.
Stars: ✭ 239 (+198.75%)
Mutual labels:  physics
BowlerStudio
A Full-Stack Robotics Development Environment
Stars: ✭ 95 (+18.75%)
Mutual labels:  physics
bazel-emscripten
C++ to WASM or JS using Bazel and Emscripten
Stars: ✭ 40 (-50%)
Mutual labels:  emscripten
UnitedEngine
Lightweight physic engine designed for massive and fast simulations
Stars: ✭ 133 (+66.25%)
Mutual labels:  physics
MIMS
PyQt application for creating mass interaction models and compiling them into Faust dsp code, or ~gen objects (for Max/MSP)
Stars: ✭ 22 (-72.5%)
Mutual labels:  physics

PhysX JS

PhysX for JavaScript.

This repo complements the work being done over at prestomation/PhysX to create emscripten bindings for NVIDIAGameWorks/PhysX. At some point the prestomation/PhysX fork may be merged into NVIDIAGameWorks/PhysX and this repo will be updated to track that repo instead.

This repo serves multiple purposes:

  • Provide a Docker workflow for compiling and building PhysX to WebAssembly via Emscripten
  • Provide a Docker workflow for adding new bindings (the whole PhysX API is not currently covered yet)
  • To publish WebAssembly files to npm (physx-js) so that they can be used in projects via npm or CDN

Example

There is an example with threejs and physx-js using Webpack in the /example folder. The example is also available to preview here, it's hosted on now

Usage via npm

npm install physx-js

The physx.release.js file can be imported via Webpack or included as a script on the page

The physx.release.wasm file needs to be served in a static/public folder so that it can be loaded in a browser environment

See /examples for how this can be used in Node, Browser and Browser w/ Webpack.

Usage via CDN (jsDelivr)

You may want to load the WebAssembly files via CDN, in which case you can use jsDelivr's npm mirror, loaded as a script:

<script src="https://cdn.jsdelivr.net/npm/physx-js/dist/physx.release.js">

You can also target a specific version:

<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/physx.release.js">

Then configure this to also load the wasm file from the same place:

PHYSX({
  locateFile(path) {
    if (path.endsWith('.wasm')) {
      return 'https://cdn.jsdelivr.net/npm/[email protected]/dist/physx.release.wasm'
    }
    return path
  }
})

Development

You may want to make your own builds from source, or modify the bindings yourself. The full PhysX API isn't covered yet but more will be added in the future.

The only dependencies you need to do this are Docker, Node and Npm. All other dependencies are managed inside the docker image.

The scripts run from this repo expect the repo prestomation/PhysX#emscripten_wip to be mounted here at ./PhysX.

// Install dependencies
npm install

// Generate the project (i believe this only needs to be run once, can take a while)
npm run generate

// Build WebAssembly files (physx.release.js and physx.release.wasm)
// This is all that needs to be run after making changes to bindings.
npm run make

These scripts will start a docker container, mount the PhysX source code and then build and compile it using emscripten.

The output files (js and wasm) are copied into ./dist

If you want to add new bindings, edit ./PhysX/physx/source/physxwebbindings/src/PxWebBindings.cpp and then run npm run make to rebuild.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].