5 releases

0.1.0-alpha.5 Jul 9, 2024
0.1.0-alpha.3 Dec 18, 2023
0.1.0-alpha.2 Dec 5, 2023
0.1.0-alpha.1 Nov 30, 2023

#471 in Game dev

Download history 10/week @ 2024-06-10 10/week @ 2024-06-17 7/week @ 2024-06-24 245/week @ 2024-07-08 26/week @ 2024-07-15 7/week @ 2024-07-22 37/week @ 2024-07-29 9/week @ 2024-08-05 3/week @ 2024-08-12 3/week @ 2024-08-19 6/week @ 2024-08-26 3/week @ 2024-09-09 24/week @ 2024-09-16 24/week @ 2024-09-23

53 downloads per month
Used in 5 crates (via magma_app)

MIT license

27KB
601 lines

Magma-ECS

Magma-ECS is the Entity-component-system for the Magma3D engine.

Features

  • Simple and Lightweight
  • Update funktion for systems

    Allow for easy execution of the systems

  • Parallel

    All code is automatically parallelized

Disclaimer

This is still in developement and not production ready.


lib.rs:

This crate provides the Entity-Component-System of the Magma3D-Engine.

The crate provides a World struct with Resources and Entities. An entity is just an index into the component storage. A resource is like a global component, independant from the Entities.

Example for creating and setting up a World:

use magma_ecs::World;

let world = World::new();
// register a component type
world.register_component::<u32>();
// add a resource
world.add_resource(10_u32);

// create entity with registered component.
// It is recommended to free read/write locks as quickly as possible. Use scopes to do that.
{
    let mut entities = world.entities_write();
    entities.create_entity().with_component(20_u32).unwrap();
}

Dependencies

~1.5MB
~25K SLoC