Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
/!\ This library is still under heavy development and is still missing many features.
The goal of nexus is to essentially be "rapier on the GPU". It aims to be a cross-platform GPU-accelerated multiphysics engine, running compute shaders via WebGPU. Shaders are written in Rust using Rust-GPU and compiled to SPIR-V.
Physics modules
Nexus is organized into independent physics modules, each available in 2D and 3D:
- nexus_rbd - Rigid-body dynamics: colliders (boxes, balls, convex shapes, trimeshes, heightfields), joints (ball, fixed, prismatic, revolute), contact resolution.
Prerequisites
Install cargo gpu
Nexus uses cargo gpu to compile its Rust-GPU shaders to SPIR-V during
the build. You must install it before building, otherwise the shader compilation step will fail:
For building running on the browser:
WebGpu might not be enabled on your browser:
- It is often already enabled by default on Windows and Macos major browsers.
- On Firefox, go to
about:configthen setdom.webgpu.enabledtotrue. - On chromium, go to
chrome://flagsthen setUnsafe WebGPU SupporttoEnabled. Keep in mind that, on Ubuntu, we observed WebGPU performances to be significantly worse on chromium compared to Firefox. - Safari is currently not supported by Nexus.
Running the examples
The example binaries launch a viewer window with all available demos. Use the --release flag for good performance,
as debug builds of GPU physics code will be very slow.
# Run natively
# Run on the browser
Python bindings
The 3D engine and viewer are also available from Python as the nexus3d module
(PyO3 + maturin), mirroring the Rust API closely. See
crates/nexus_python3d/README.md for building
instructions and a full set of example scripts (rigid bodies, joints, and
URDF/MJCF robots).
License
MIT OR Apache-2.0