/newton-rs

Project to create a Rust wrapper for the newton-dynamics Physics simulation library

Primary LanguageRustMIT LicenseMIT

Work in progress
Things claimed in this README may not be implemented yet.

newton-rs

Build Status Master docs

Newton-Dynamics safe wrapper for Rust.

  • Newton-Dynamics version: 3.13a

Building

  1. Install build dependencies
  • rust (install using rustup)
  • cmake
  • libclang-dev
  • libsdl2-dev optional (testbed feature)
apt install cmake
apt install libclang-dev
apt install libsdl2-dev # optional
  1. Add dependency to your Cargo.toml
[dependencies]
newton = { git = "https://github.com/germangb/newton-rs.git" }

Implemented things

The wrapper gives coverage to a subset of the C API (see #1).

  • Most Body functions
  • Most Collision functions (except mesh)
  • Ray casting & convex casting
  • Constraints (joints)
  • Meshes (More or less)
  • Main callbacks

Unimplemented things

  • Materials
  • Inverse kinematics

Testbed

The newton testbed is a framework to run and inspect physics simulation.

Right now it is available under a feature flag, but eventually it will be moved into its own crate.

# Clone repository with submodules.
git clone --recursive https://github.com/germangb/newton-rs.git

# Change into the directory.
cd newton-rs

# Run one of the examples under the "examples/<name>.rs" directory.
# (the "testbed" feature has to be enabled).
cargo run --features testbed --example "<name>"