Skip to main content

rapier3d_mjcf/
lib.rs

1//! ## MJCF loader for the Rapier physics engine
2//!
3//! Rapier is a set of 2D and 3D physics engines for games, animation, and
4//! robotics. The `rapier3d-mjcf` crate lets you convert a [MuJoCo MJCF XML
5//! file](https://mujoco.readthedocs.io/en/stable/XMLreference.html) into a
6//! set of rigid-bodies, colliders, and joints, for use with the `rapier3d`
7//! physics engine.
8//!
9//! ### Disclaimer
10//!
11//! Most of this crate — source, tests, and documentation — was produced by
12//! an AI coding assistant working iteratively from MJCF reference scenes
13//! (primarily the [MuJoCo Menagerie](https://github.com/google-deepmind/mujoco_menagerie)),
14//! under human direction and review.
15//!
16//! ```no_run
17//! use rapier3d::prelude::*;
18//! use rapier3d_mjcf::{MjcfLoaderOptions, MjcfRobot};
19//!
20//! let mut bodies = RigidBodySet::new();
21//! let mut colliders = ColliderSet::new();
22//! let mut impulse_joints = ImpulseJointSet::new();
23//!
24//! let (robot, _model) =
25//!     MjcfRobot::from_file("robot.xml", MjcfLoaderOptions::default()).unwrap();
26//! robot.insert_using_impulse_joints(&mut bodies, &mut colliders, &mut impulse_joints);
27//! ```
28//!
29//! See the crate-level [README](https://github.com/dimforge/rapier/blob/master/crates/rapier3d-mjcf/README.md)
30//! for a feature matrix.
31
32#![warn(missing_docs)]
33
34mod hooks;
35mod loader;
36
37pub use hooks::*;
38pub use loader::*;
39pub use mjcf_rs;