perf: less particle systems

This commit is contained in:
cha0s 2024-08-04 21:51:48 -05:00
parent 91af56c9ff
commit e99ae1136b

View File

@ -4,6 +4,17 @@ import createEcs from '@/server/create/ecs.js';
import ClientEcs from './client-ecs.js';
const ecs = createEcs(ClientEcs);
[
'ClampPositions',
'Colliders',
'MaintainColliderHash',
'VisibleAabbs',
]
.forEach((system) => {
ecs.system(system).active = false;
})
ecs.$$caret = Math.pow(2, 31);
const emitter = new Emitter(ecs);
@ -30,7 +41,7 @@ function tick(now) {
ecs.tick(elapsed);
emitter.tick(elapsed);
const update = {};
const lastNearby = new Set(memory.values());
const lastNearby = new Set(memory);
for (const id in ecs.$$entities) {
const entity = ecs.$$entities[id];
if (ecs.$$detached.has(entity.id)) {