appl/
lib.rs

1//! Appl is a library that provides abstraction over the Rapier library.<br />
2//! Appl was created due to the lack of any physics engine for beginners to
3//! use.<br /> Appl's main purpose is to be simple and easy to use.<br />
4//!
5//! ## Example
6//!
7//! ```rust
8//! use appl::*;
9//!
10//! fn main() {
11//!   // Initialize Appl World
12//!   let mut appl = ApplWorld::new(Vect2 { x: 0.0, y: 9.81 }, 50.0);
13//!   // Create ground rigid body
14//!   let ground = appl.add_rigid_body(
15//!     BodyType::Static,
16//!     0.3,
17//!     BodyShape::Cuboid {
18//!       width: 64.0,
19//!       height: 32.0,
20//!     },
21//!     0.3,
22//!     Vect2 { x: 0.0, y: 320.0 }
23//!   );
24//!   // Create box1 rigid body
25//!   let box1 = appl.add_rigid_body(
26//!     BodyType::Dynamic,
27//!     0.3,
28//!     BodyShape::Cuboid {
29//!       width: 32.0,
30//!       height: 32.0,
31//!     },
32//!     0.3,
33//!     Vect2 { x: 0.0, y: 0.0 }
34//!   );
35//!
36//!   for _ in 0..200 {
37//!     // Update the world
38//!     appl.step();
39//!
40//!     // Prints box1 position
41//!     let box1_pos = appl.get_rigid_body_pos(box1);
42//!     println("{}, {}", box1_pos.x, box1_pos.y);
43//!   }
44//! }
45//! ```
46
47mod rigidbody;
48mod vector;
49mod world;
50
51pub use rigidbody::*;
52pub use vector::*;
53pub use world::*;