diff --git a/README.md b/README.md index 3f40f73..29d692c 100644 --- a/README.md +++ b/README.md @@ -1,64 +1,5 @@ Physics library for use in Specs, using cgmath and collision-rs. -# Example - -```rust -extern crate cgmath; -extern crate rhusics; -extern crate shrev; -extern crate specs; - -use cgmath::{Point2, Rad, Rotation2, Transform}; -use shrev::EventChannel; -use specs::{RunNow, World}; - -use rhusics::ecs::collide::prelude2d::{register_collision, BasicCollisionSystem2, BodyPose2, - BroadBruteForce2, CollisionMode, CollisionShape2, - CollisionStrategy, ContactEvent2, GJK2, Rectangle}; - -pub fn main() { - let mut world = World::new(); - register_collision::, ()>(&mut world); - - let mut reader_1 = world - .write_resource::>>() - .register_reader(); - - world - .create_entity() - .with(CollisionShape2::, ()>::new_simple( - CollisionStrategy::FullResolution, - CollisionMode::Discrete, - Rectangle::new(10., 10.).into(), - )) - .with(BodyPose2::::one()); - - world - .create_entity() - .with(CollisionShape2::, ()>::new_simple( - CollisionStrategy::FullResolution, - CollisionMode::Discrete, - Rectangle::new(10., 10.).into(), - )) - .with(BodyPose2::new( - Point2::new(3., 2.), - Rotation2::from_angle(Rad(0.)), - )); - - let mut system = BasicCollisionSystem2::, ()>::new() - .with_broad_phase(BroadBruteForce2::default()) - .with_narrow_phase(GJK2::new()); - system.run_now(&world.res); - println!( - "Contacts: {:?}", - world - .read_resource::>>() - .read(&mut reader_1) - .collect::>() - ); -} -``` - # Features: * Has support for all primitives in collision-rs diff --git a/rhusics-core/Cargo.toml b/rhusics-core/Cargo.toml index 525407a..197a03c 100644 --- a/rhusics-core/Cargo.toml +++ b/rhusics-core/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://github.com/rustgd/rhusics.git" license = "MIT OR Apache-2.0" readme = "README.md" -documentation = "https://docs.rs/rhusics" +documentation = "https://docs.rs/rhusics-core" description = "Physics library for use with `specs`" keywords = ["gamedev", "cgmath", "specs", "physics"] diff --git a/rhusics-ecs/Cargo.toml b/rhusics-ecs/Cargo.toml index 3afcf12..d4a072e 100644 --- a/rhusics-ecs/Cargo.toml +++ b/rhusics-ecs/Cargo.toml @@ -7,7 +7,7 @@ homepage = "https://github.com/rustgd/rhusics.git" license = "MIT OR Apache-2.0" readme = "README.md" -documentation = "https://docs.rs/rhusics" +documentation = "https://docs.rs/rhusics-ecs" description = "Physics library for use with `specs`" keywords = ["gamedev", "cgmath", "specs", "physics"]