diff options
author | Lorenzo Torres <torres@sideros.org> | 2025-03-28 15:34:36 +0100 |
---|---|---|
committer | Lorenzo Torres <torres@sideros.org> | 2025-03-28 15:34:36 +0100 |
commit | ff84d6ac5375587428f279c06ead111301a332ab (patch) | |
tree | a26f32397f66693494ab17187a212cb52729ff3f /src/ecs/components.zig | |
parent | 11f6bc2b04fae03a6e81735d4bcebe9505c5d76d (diff) |
the ECS is now using a more data oriented approach.
By defining archetypes using SOAs (Zig has this data structure in `std`,
called std.MultiArrayList), the engine can iterate faster over commonly
defined entities avoiding cache misses since each component is aligned
with other components of the same entity.
Diffstat (limited to 'src/ecs/components.zig')
-rw-r--r-- | src/ecs/components.zig | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/src/ecs/components.zig b/src/ecs/components.zig index 5c35cbf..1309e70 100644 --- a/src/ecs/components.zig +++ b/src/ecs/components.zig @@ -1,8 +1,6 @@ const std = @import("std"); const Allocator = std.mem.Allocator; -const COMPONENT_NUMBER = 2; - pub const Position = packed struct { x: f32, y: f32, @@ -13,6 +11,4 @@ pub const Position = packed struct { pub const Speed = packed struct { speed: f32, - - pub const id: usize = 1; }; |