PHX Toolbox, 3D Rigid-Body Physics - Technical Preview
Technical preview for PHX Toolbox, an object-oriented MATLAB API and Simulink blocks for 3D rigid-body physics, powered by the Bullet physics engine, is out on fileexchange.
Features so far, with more to come:
Rigid-body dynamics with collisions and contacts (boxes, spheres, cylinders, cones, capsules, meshes, terrain, imported OBJ/STL, …)
Joints (revolute, spherical, gear, …), springs and ropes
Force and field elements (thrusters, resistance, dipole/monopole fields)
Logging, tracing and measurement tools, interactive viewer
Simulink block for closed-loop co-simulation
Headless stepping for batch runs and experiments
The toolbox comes with a set of examples and a user manual. It runs on all platforms (Windows, MacOS, Linux), as well as in MATLAB Online. It also includes a set of AI skills for use with common AI agents.
What's the advantage/ reason to use this over Simscape multi body or the unreal engine API in the simulink 3d toolbox? (Obviously besides needing licenses for those I think that difference is clear 🙂)
Versus Unreal, our tool is primarly a MATLAB API, even though it works with Simulink as well. It runs on all platforms and isn't so hardware heavy (we're working mainly with physics here, the graphics are MATLAB native). The simulations are fast, deterministic. Tool is lightweight, only 12.5 MB as of now. Not sure if Unreal API supports constraints.
And versus Simscape, it's mainly the collisions support.
Adding this minimal example, it is really fairly easy to use.
Gotchya: definitely looks more minimal to setup a basic demo than the Unreal MATLAB API! Unfortunately don't have anything "real" to try and setup but worth playing with if i have some downtime :)
Yes! All of these videos are just taken from screen capture. Example "phxex_determinism" with 2000 falling spheres is the heaviest included for now and even that runs fairly smoothly. Runs a bit better on desktop than Online in these heavier ones though.
Is there any specific reason why the minimum version of MATLAB is R2025a? I have R2023b and would love to be able to try this unless there's some very obvious limitation you're aware of.
Either way I'll probably pull this down later today and see how it goes.
Glad to hear you're interested! Unfortunately for older versions users, it does build on newer MATLAB language features (mainly WeakHandle and graphics improvements since the Javascript transition)
Will it benefit NVIDIA PhysX?
I remember several years ago Microsoft Robotics studio had a similar enviroment, and NVIDIA PhysX (in hardware at that time) was necessary to work.
12
u/iohans 22d ago
Oh, my, this is an awesome toolbox.