bevy_2d_box_physics 0.1.1

A 2D box-collision physics engine for use with the bevy engine
Documentation

bevy_2d_box_physics

A 2D box-collision physics engine for use with the bevy engine

Usage

For the physics to work the PhysicsPlugin must be added. For adding forces/velocity to objects you can add the PhysicsBundle and for collisions (only collisionboxes are and will be supported) there is the CollisionBundle. Sensors, which lets us get information when two objects overlap can also be added with the SensorBundle. A very simple example can be seen below:

use bevy::prelude::*;
use bevy_2d_box_physics::*;

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_plugin(PhysicsPlugin)
        .add_startup_system(setup)
        .run();
}

fn setup(mut commands: Commands, asset_server: Res<AssetServer>) {
    commands.spawn_bundle(PhysicsBundle {
        rigidbody: RigidBody::Dynamic,
        ..default()
    })
    .insert(CollisionBundle {
        collision_box: CollisionBox(16.0, 16.0),
        collision_layers: CollisionLayers {
            layer_id: 0,
            collides_with_ids: vec![0, 1],
        },
        ..default()
    })
}

(Note that this doesn't do much as there are no textures, but hopefully you get the idea)