From ff84d6ac5375587428f279c06ead111301a332ab Mon Sep 17 00:00:00 2001 From: Lorenzo Torres Date: Fri, 28 Mar 2025 15:34:36 +0100 Subject: 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. --- src/ecs/components.zig | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/ecs/components.zig') 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; }; -- cgit v1.2.3