blecsd 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +44 -4
- package/dist/{chunk-QIKIOVP2.js → chunk-35I22JJO.js} +1 -1
- package/dist/chunk-3APDF6RW.js +1 -0
- package/dist/{chunk-OUXUPF3V.js → chunk-4GISPPOH.js} +27 -27
- package/dist/chunk-6N6BRCEM.js +4 -0
- package/dist/chunk-EAY7B5GL.js +1 -0
- package/dist/{chunk-TDXJDLY6.js → chunk-EJ5WVDDZ.js} +1 -1
- package/dist/{chunk-B6Z2JFRY.js → chunk-FMFEOAML.js} +1 -1
- package/dist/chunk-JUWDTH25.js +1 -0
- package/dist/chunk-K3SX2LY5.js +1 -0
- package/dist/chunk-LB3JA744.js +19 -0
- package/dist/chunk-OB66FB4F.js +1 -0
- package/dist/{chunk-FC5FFAAC.js → chunk-VCW7EOZ4.js} +1 -1
- package/dist/chunk-WHF27JF3.js +4 -0
- package/dist/chunk-WY3KY2TR.js +1 -0
- package/dist/componentStorage-DTkj1Qyj.d.ts +246 -0
- package/dist/components/index.d.ts +2 -1
- package/dist/components/index.js +1 -1
- package/dist/core/index.d.ts +226 -193
- package/dist/core/index.js +1 -1
- package/dist/debug/index.js +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +1 -1
- package/dist/packedStore-480t2X74.d.ts +191 -0
- package/dist/systems/index.d.ts +235 -23
- package/dist/systems/index.js +1 -1
- package/dist/terminal/index.js +1 -1
- package/dist/{tilemap-D1HJvKy3.d.ts → tilemap-j0twN9-y.d.ts} +91 -2
- package/dist/utils/index.d.ts +3 -157
- package/dist/utils/index.js +1 -1
- package/dist/widgets/index.js +1 -1
- package/package.json +3 -2
- package/dist/chunk-AQ7LW75B.js +0 -1
- package/dist/chunk-J4JZ2NU2.js +0 -1
- package/dist/chunk-K37L3G4Z.js +0 -4
- package/dist/chunk-OVT2PPGW.js +0 -19
- package/dist/chunk-YAMOSPWB.js +0 -4
- package/dist/chunk-YD6ULIUR.js +0 -1
|
@@ -0,0 +1,191 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Packed Store: Cache-friendly storage with stable handles
|
|
3
|
+
*
|
|
4
|
+
* Implements the three-vector pattern for O(1) add/remove operations
|
|
5
|
+
* with stable identifiers and cache-friendly iteration:
|
|
6
|
+
*
|
|
7
|
+
* - data[]: Dense contiguous storage for actual values
|
|
8
|
+
* - dataIndex[]: Maps handle index → position in data array
|
|
9
|
+
* - id[]: Maps position in data → handle index (inverse mapping)
|
|
10
|
+
* - generations[]: Tracks generation at each slot for stale handle detection
|
|
11
|
+
*
|
|
12
|
+
* @module core/storage/packedStore
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Handle to an element in a packed store.
|
|
16
|
+
* The combination of index and generation ensures handles
|
|
17
|
+
* become invalid after the element is removed.
|
|
18
|
+
*/
|
|
19
|
+
interface PackedHandle {
|
|
20
|
+
readonly index: number;
|
|
21
|
+
readonly gen: number;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Packed store state. All arrays are parallel structures
|
|
25
|
+
* that work together to provide stable handles with O(1) operations.
|
|
26
|
+
*/
|
|
27
|
+
interface PackedStore<T> {
|
|
28
|
+
/** Dense contiguous data array for cache-friendly iteration */
|
|
29
|
+
readonly data: T[];
|
|
30
|
+
/** Maps handle index → position in data array */
|
|
31
|
+
readonly dataIndex: Int32Array;
|
|
32
|
+
/** Maps data position → handle index (inverse of dataIndex) */
|
|
33
|
+
readonly id: Int32Array;
|
|
34
|
+
/** Generation counter for each slot (bumped on removal) */
|
|
35
|
+
readonly generations: Uint32Array;
|
|
36
|
+
/** Number of live elements */
|
|
37
|
+
size: number;
|
|
38
|
+
/** Total allocated capacity */
|
|
39
|
+
capacity: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Creates a new packed store with optional initial capacity.
|
|
43
|
+
*
|
|
44
|
+
* @param initialCapacity - Initial capacity hint (default 64)
|
|
45
|
+
* @returns Empty packed store
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* import { createPackedStore, addToStore } from 'blecsd';
|
|
50
|
+
*
|
|
51
|
+
* interface Particle { x: number; y: number; vx: number; vy: number; }
|
|
52
|
+
* const particles = createPackedStore<Particle>();
|
|
53
|
+
* const handle = addToStore(particles, { x: 0, y: 0, vx: 1, vy: 0 });
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
declare function createPackedStore<T>(initialCapacity?: number): PackedStore<T>;
|
|
57
|
+
/**
|
|
58
|
+
* Adds a value to the packed store and returns a stable handle.
|
|
59
|
+
*
|
|
60
|
+
* If there are freed slots from prior deletions, one is reused.
|
|
61
|
+
* Otherwise, capacity is expanded as needed.
|
|
62
|
+
*
|
|
63
|
+
* @param store - The packed store
|
|
64
|
+
* @param value - Value to add
|
|
65
|
+
* @returns Handle to the stored value
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```typescript
|
|
69
|
+
* const handle = addToStore(store, { name: 'entity1' });
|
|
70
|
+
* // handle.index is stable even after other elements are removed
|
|
71
|
+
* ```
|
|
72
|
+
*/
|
|
73
|
+
declare function addToStore<T>(store: PackedStore<T>, value: T): PackedHandle;
|
|
74
|
+
/**
|
|
75
|
+
* Checks if a handle is valid (points to a live element).
|
|
76
|
+
*
|
|
77
|
+
* @param store - The packed store
|
|
78
|
+
* @param handle - Handle to validate
|
|
79
|
+
* @returns True if the handle points to a live element
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```typescript
|
|
83
|
+
* if (isValidHandle(store, handle)) {
|
|
84
|
+
* const value = getFromStore(store, handle);
|
|
85
|
+
* }
|
|
86
|
+
* ```
|
|
87
|
+
*/
|
|
88
|
+
declare function isValidHandle<T>(store: PackedStore<T>, handle: PackedHandle): boolean;
|
|
89
|
+
/**
|
|
90
|
+
* Gets the value associated with a handle.
|
|
91
|
+
*
|
|
92
|
+
* @param store - The packed store
|
|
93
|
+
* @param handle - Handle to the element
|
|
94
|
+
* @returns The value, or undefined if handle is invalid
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* const particle = getFromStore(particles, handle);
|
|
99
|
+
* if (particle) {
|
|
100
|
+
* console.log(particle.x, particle.y);
|
|
101
|
+
* }
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
104
|
+
declare function getFromStore<T>(store: PackedStore<T>, handle: PackedHandle): T | undefined;
|
|
105
|
+
/**
|
|
106
|
+
* Sets (replaces) the value at a handle.
|
|
107
|
+
*
|
|
108
|
+
* @param store - The packed store
|
|
109
|
+
* @param handle - Handle to the element
|
|
110
|
+
* @param value - New value
|
|
111
|
+
* @returns True if successful, false if handle is invalid
|
|
112
|
+
*/
|
|
113
|
+
declare function setInStore<T>(store: PackedStore<T>, handle: PackedHandle, value: T): boolean;
|
|
114
|
+
/**
|
|
115
|
+
* Removes an element from the packed store using swap-and-pop.
|
|
116
|
+
*
|
|
117
|
+
* The handle becomes invalid after removal. Any other handles
|
|
118
|
+
* remain valid (this is the key benefit of the three-vector pattern).
|
|
119
|
+
*
|
|
120
|
+
* @param store - The packed store
|
|
121
|
+
* @param handle - Handle to remove
|
|
122
|
+
* @returns True if removed, false if handle was invalid
|
|
123
|
+
*
|
|
124
|
+
* @example
|
|
125
|
+
* ```typescript
|
|
126
|
+
* removeFromStore(particles, handle);
|
|
127
|
+
* // handle is now invalid, but other handles remain valid
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
declare function removeFromStore<T>(store: PackedStore<T>, handle: PackedHandle): boolean;
|
|
131
|
+
/**
|
|
132
|
+
* Clears all elements from the store but retains capacity.
|
|
133
|
+
*
|
|
134
|
+
* @param store - The packed store to clear
|
|
135
|
+
*/
|
|
136
|
+
declare function clearStore<T>(store: PackedStore<T>): void;
|
|
137
|
+
/**
|
|
138
|
+
* Iterates over all live elements in the store.
|
|
139
|
+
* Iteration is cache-friendly as it traverses the dense data array.
|
|
140
|
+
*
|
|
141
|
+
* @param store - The packed store
|
|
142
|
+
* @param fn - Callback for each element (receives value and handle)
|
|
143
|
+
*
|
|
144
|
+
* @example
|
|
145
|
+
* ```typescript
|
|
146
|
+
* forEachInStore(particles, (particle, handle) => {
|
|
147
|
+
* particle.x += particle.vx;
|
|
148
|
+
* particle.y += particle.vy;
|
|
149
|
+
* });
|
|
150
|
+
* ```
|
|
151
|
+
*/
|
|
152
|
+
declare function forEachInStore<T>(store: PackedStore<T>, fn: (value: T, handle: PackedHandle) => void): void;
|
|
153
|
+
/**
|
|
154
|
+
* Maps over all live elements, producing a new array.
|
|
155
|
+
*
|
|
156
|
+
* @param store - The packed store
|
|
157
|
+
* @param fn - Transform function
|
|
158
|
+
* @returns Array of transformed values
|
|
159
|
+
*/
|
|
160
|
+
declare function mapStore<T, U>(store: PackedStore<T>, fn: (value: T, handle: PackedHandle) => U): U[];
|
|
161
|
+
/**
|
|
162
|
+
* Returns the dense data array for direct iteration.
|
|
163
|
+
* This is the fastest way to iterate when you don't need handles.
|
|
164
|
+
*
|
|
165
|
+
* WARNING: Do not modify the array structure (push/pop/splice).
|
|
166
|
+
* The returned array is a view into internal storage.
|
|
167
|
+
*
|
|
168
|
+
* @param store - The packed store
|
|
169
|
+
* @returns Readonly view of the dense data array (length = store.size)
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```typescript
|
|
173
|
+
* // Fastest iteration when handles aren't needed
|
|
174
|
+
* const data = getStoreData(particles);
|
|
175
|
+
* for (let i = 0; i < particles.size; i++) {
|
|
176
|
+
* const p = data[i];
|
|
177
|
+
* p.x += p.vx;
|
|
178
|
+
* }
|
|
179
|
+
* ```
|
|
180
|
+
*/
|
|
181
|
+
declare function getStoreData<T>(store: PackedStore<T>): readonly T[];
|
|
182
|
+
/**
|
|
183
|
+
* Gets the current number of live elements.
|
|
184
|
+
*/
|
|
185
|
+
declare function getStoreSize<T>(store: PackedStore<T>): number;
|
|
186
|
+
/**
|
|
187
|
+
* Gets the current capacity (including freed slots).
|
|
188
|
+
*/
|
|
189
|
+
declare function getStoreCapacity<T>(store: PackedStore<T>): number;
|
|
190
|
+
|
|
191
|
+
export { type PackedHandle as P, type PackedStore as a, addToStore as b, clearStore as c, createPackedStore as d, getStoreCapacity as e, forEachInStore as f, getFromStore as g, getStoreData as h, getStoreSize as i, isValidHandle as j, mapStore as m, removeFromStore as r, setInStore as s };
|
package/dist/systems/index.d.ts
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { S as Scheduler } from '../scheduler-DcfoFuum.js';
|
|
2
2
|
import { S as System, W as World, E as Entity, L as LoopPhase } from '../types-BcsvoKzf.js';
|
|
3
|
-
import { d as CollisionPair, f as EmitterAppearance, R as RenderedTileCell } from '../tilemap-
|
|
3
|
+
import { d as CollisionPair, f as EmitterAppearance, R as RenderedTileCell } from '../tilemap-j0twN9-y.js';
|
|
4
4
|
import { E as EventBus, U as UIEventMap } from '../events-BbbxkgvX.js';
|
|
5
|
+
import { a as PackedStore, P as PackedHandle } from '../packedStore-480t2X74.js';
|
|
5
6
|
import { b as KeyEvent } from '../keyParser-Bwm8-l7v.js';
|
|
6
7
|
import { M as MouseEvent } from '../mouseParser-Cfrbn3AX.js';
|
|
7
8
|
import { Writable } from 'node:stream';
|
|
8
9
|
import { c as CellChange, S as ScreenBufferData, C as Cell } from '../cell-DwIu2ryP.js';
|
|
9
10
|
import { D as DoubleBufferData } from '../doubleBuffer-CKQFmlPN.js';
|
|
11
|
+
import { a as ComponentStore } from '../componentStorage-DTkj1Qyj.js';
|
|
10
12
|
import { z } from 'zod';
|
|
11
13
|
import { V as VirtualizedLineStore } from '../virtualizedLineStore-DwPEvPkk.js';
|
|
12
14
|
import 'bitecs';
|
|
@@ -271,6 +273,10 @@ declare function updateCameras(world: World, deltaTime: number): void;
|
|
|
271
273
|
/**
|
|
272
274
|
* Collision system for detecting entity collisions.
|
|
273
275
|
* Processes all entities with Collider component.
|
|
276
|
+
*
|
|
277
|
+
* Uses PackedStore for cache-friendly dense iteration of active pairs,
|
|
278
|
+
* with numeric pair keys to eliminate per-frame string allocation.
|
|
279
|
+
*
|
|
274
280
|
* @module systems/collisionSystem
|
|
275
281
|
*/
|
|
276
282
|
|
|
@@ -296,16 +302,34 @@ interface CollisionEventMap {
|
|
|
296
302
|
/** Fired when an entity exits a trigger zone */
|
|
297
303
|
triggerExit: CollisionEventData;
|
|
298
304
|
}
|
|
305
|
+
/**
|
|
306
|
+
* Readonly view of active collision/trigger pairs.
|
|
307
|
+
* Provides dense data for cache-friendly iteration without
|
|
308
|
+
* exposing mutable store internals. Do not cache this view
|
|
309
|
+
* across frames, as the underlying data may be reallocated.
|
|
310
|
+
*/
|
|
311
|
+
interface ActivePairsView {
|
|
312
|
+
/** Dense array of active pairs. Read-only; do not mutate elements or indices. */
|
|
313
|
+
readonly data: ReadonlyArray<CollisionPair>;
|
|
314
|
+
/** Number of live pairs in the data array (iterate data[0..size-1]). */
|
|
315
|
+
readonly size: number;
|
|
316
|
+
}
|
|
299
317
|
/**
|
|
300
318
|
* Collision system state.
|
|
319
|
+
* Uses PackedStore for cache-friendly dense storage and iteration
|
|
320
|
+
* of active collision and trigger pairs.
|
|
301
321
|
*/
|
|
302
322
|
interface CollisionSystemState {
|
|
303
323
|
/** Event bus for collision events */
|
|
304
324
|
readonly eventBus: EventBus<CollisionEventMap>;
|
|
305
|
-
/** Currently active collision pairs */
|
|
306
|
-
readonly activePairs:
|
|
307
|
-
/** Currently active trigger pairs */
|
|
308
|
-
readonly activeTriggers:
|
|
325
|
+
/** Currently active collision pairs (dense packed storage) */
|
|
326
|
+
readonly activePairs: PackedStore<CollisionPair>;
|
|
327
|
+
/** Currently active trigger pairs (dense packed storage) */
|
|
328
|
+
readonly activeTriggers: PackedStore<CollisionPair>;
|
|
329
|
+
/** Maps numeric pair key to handle in activePairs for O(1) lookup */
|
|
330
|
+
readonly pairHandles: Map<number, PackedHandle>;
|
|
331
|
+
/** Maps numeric pair key to handle in activeTriggers for O(1) lookup */
|
|
332
|
+
readonly triggerHandles: Map<number, PackedHandle>;
|
|
309
333
|
}
|
|
310
334
|
/**
|
|
311
335
|
* Gets the collision event bus.
|
|
@@ -324,17 +348,53 @@ interface CollisionSystemState {
|
|
|
324
348
|
*/
|
|
325
349
|
declare function getCollisionEventBus(): EventBus<CollisionEventMap>;
|
|
326
350
|
/**
|
|
327
|
-
* Gets the current active collision pairs.
|
|
351
|
+
* Gets the current number of active collision pairs.
|
|
352
|
+
*
|
|
353
|
+
* @returns Number of active solid collision pairs
|
|
328
354
|
*
|
|
329
|
-
* @
|
|
355
|
+
* @example
|
|
356
|
+
* ```typescript
|
|
357
|
+
* import { getActiveCollisionCount } from 'blecsd';
|
|
358
|
+
*
|
|
359
|
+
* const count = getActiveCollisionCount();
|
|
360
|
+
* console.log(`${count} active collisions`);
|
|
361
|
+
* ```
|
|
330
362
|
*/
|
|
331
|
-
declare function
|
|
363
|
+
declare function getActiveCollisionCount(): number;
|
|
332
364
|
/**
|
|
333
|
-
* Gets the current active
|
|
365
|
+
* Gets the current active collision pairs as a readonly view.
|
|
366
|
+
* Iterate data[0..size-1] for dense, cache-friendly access.
|
|
367
|
+
*
|
|
368
|
+
* The returned view is a snapshot reference into the live store.
|
|
369
|
+
* Do not cache it across frames or mutate its contents.
|
|
370
|
+
*
|
|
371
|
+
* @returns Readonly view of active collision pairs
|
|
372
|
+
*/
|
|
373
|
+
declare function getActiveCollisions(): ActivePairsView;
|
|
374
|
+
/**
|
|
375
|
+
* Gets the current number of active trigger pairs.
|
|
376
|
+
*
|
|
377
|
+
* @returns Number of active trigger pairs
|
|
378
|
+
*
|
|
379
|
+
* @example
|
|
380
|
+
* ```typescript
|
|
381
|
+
* import { getActiveTriggerCount } from 'blecsd';
|
|
382
|
+
*
|
|
383
|
+
* const count = getActiveTriggerCount();
|
|
384
|
+
* console.log(`${count} active triggers`);
|
|
385
|
+
* ```
|
|
386
|
+
*/
|
|
387
|
+
declare function getActiveTriggerCount(): number;
|
|
388
|
+
/**
|
|
389
|
+
* Gets the current active trigger pairs as a readonly view.
|
|
390
|
+
* Iterate data[0..size-1] for dense, cache-friendly access.
|
|
391
|
+
*
|
|
392
|
+
* The returned view is a snapshot reference into the live store.
|
|
393
|
+
* Do not cache it across frames or mutate its contents.
|
|
334
394
|
*
|
|
335
|
-
* @returns
|
|
395
|
+
* @returns Readonly view of active trigger pairs
|
|
336
396
|
*/
|
|
337
|
-
declare function getActiveTriggers():
|
|
397
|
+
declare function getActiveTriggers(): ActivePairsView;
|
|
338
398
|
/**
|
|
339
399
|
* Resets the collision system state.
|
|
340
400
|
* Useful for testing or scene changes.
|
|
@@ -420,6 +480,7 @@ declare function createCollisionSystem(): System;
|
|
|
420
480
|
declare function registerCollisionSystem(scheduler: Scheduler, priority?: number): void;
|
|
421
481
|
/**
|
|
422
482
|
* Checks if an entity is currently colliding with any other entity.
|
|
483
|
+
* Uses dense iteration over the packed collision store.
|
|
423
484
|
*
|
|
424
485
|
* @param eid - The entity to check
|
|
425
486
|
* @returns true if entity is in any active collision
|
|
@@ -436,6 +497,7 @@ declare function registerCollisionSystem(scheduler: Scheduler, priority?: number
|
|
|
436
497
|
declare function isColliding(eid: number): boolean;
|
|
437
498
|
/**
|
|
438
499
|
* Checks if an entity is currently in any trigger zone.
|
|
500
|
+
* Uses dense iteration over the packed trigger store.
|
|
439
501
|
*
|
|
440
502
|
* @param eid - The entity to check
|
|
441
503
|
* @returns true if entity is in any active trigger
|
|
@@ -452,6 +514,7 @@ declare function isColliding(eid: number): boolean;
|
|
|
452
514
|
declare function isInTrigger(eid: number): boolean;
|
|
453
515
|
/**
|
|
454
516
|
* Gets all entities currently colliding with a specific entity.
|
|
517
|
+
* Uses dense iteration over the packed collision store.
|
|
455
518
|
*
|
|
456
519
|
* @param eid - The entity to check
|
|
457
520
|
* @returns Array of entity IDs colliding with this entity
|
|
@@ -469,6 +532,7 @@ declare function isInTrigger(eid: number): boolean;
|
|
|
469
532
|
declare function getCollidingEntities(eid: number): number[];
|
|
470
533
|
/**
|
|
471
534
|
* Gets all trigger zones an entity is currently in.
|
|
535
|
+
* Uses dense iteration over the packed trigger store.
|
|
472
536
|
*
|
|
473
537
|
* @param eid - The entity to check
|
|
474
538
|
* @returns Array of entity IDs of triggers this entity is in
|
|
@@ -486,6 +550,7 @@ declare function getCollidingEntities(eid: number): number[];
|
|
|
486
550
|
declare function getTriggerZones(eid: number): number[];
|
|
487
551
|
/**
|
|
488
552
|
* Checks if two specific entities are currently colliding.
|
|
553
|
+
* Uses handle-based O(1) lookup via numeric pair key.
|
|
489
554
|
*
|
|
490
555
|
* @param eidA - First entity
|
|
491
556
|
* @param eidB - Second entity
|
|
@@ -2399,6 +2464,8 @@ interface ParticleSystemConfig {
|
|
|
2399
2464
|
readonly particles: EntityProvider;
|
|
2400
2465
|
/** Maximum concurrent particles (default: 1000) */
|
|
2401
2466
|
readonly maxParticles?: number;
|
|
2467
|
+
/** Archetype pool name for zero-alloc entity recycling (optional) */
|
|
2468
|
+
readonly archetypeName?: string;
|
|
2402
2469
|
}
|
|
2403
2470
|
/**
|
|
2404
2471
|
* Spawns a single particle from an emitter at a random angle within the spread.
|
|
@@ -2406,9 +2473,10 @@ interface ParticleSystemConfig {
|
|
|
2406
2473
|
* @param world - The ECS world
|
|
2407
2474
|
* @param emitterId - The emitter entity ID
|
|
2408
2475
|
* @param appearance - Visual appearance config
|
|
2476
|
+
* @param archetypeName - Optional archetype pool name for entity recycling
|
|
2409
2477
|
* @returns The spawned particle entity ID, or -1 if spawn failed
|
|
2410
2478
|
*/
|
|
2411
|
-
declare function spawnParticle(world: World, emitterId: Entity, appearance: EmitterAppearance): Entity;
|
|
2479
|
+
declare function spawnParticle(world: World, emitterId: Entity, appearance: EmitterAppearance, archetypeName?: string): Entity;
|
|
2412
2480
|
/**
|
|
2413
2481
|
* Triggers a burst of particles from an emitter.
|
|
2414
2482
|
*
|
|
@@ -2446,10 +2514,14 @@ declare function moveParticle(world: World, eid: Entity, delta: number): void;
|
|
|
2446
2514
|
/**
|
|
2447
2515
|
* Removes a dead particle and cleans up tracking.
|
|
2448
2516
|
*
|
|
2517
|
+
* When an archetype name is provided, the entity is returned to the pool
|
|
2518
|
+
* instead of being fully removed from the world.
|
|
2519
|
+
*
|
|
2449
2520
|
* @param world - The ECS world
|
|
2450
2521
|
* @param eid - The particle entity ID
|
|
2522
|
+
* @param archetypeName - Optional archetype pool name for entity recycling
|
|
2451
2523
|
*/
|
|
2452
|
-
declare function killParticle(world: World, eid: Entity): void;
|
|
2524
|
+
declare function killParticle(world: World, eid: Entity, archetypeName?: string): void;
|
|
2453
2525
|
declare function createParticleSystem(config: ParticleSystemConfig): System;
|
|
2454
2526
|
|
|
2455
2527
|
/**
|
|
@@ -2866,6 +2938,11 @@ declare function createSmoothScrollSystem(physics?: Partial<ScrollPhysicsConfig>
|
|
|
2866
2938
|
* which entities overlap it. Enables efficient broad-phase collision
|
|
2867
2939
|
* detection by only checking entities in the same or adjacent cells.
|
|
2868
2940
|
*
|
|
2941
|
+
* Supports incremental updates: tracks which entities have moved since
|
|
2942
|
+
* the last frame via a PackedStore dirty set, and only re-hashes those
|
|
2943
|
+
* entities. Falls back to full rebuild when the dirty fraction exceeds
|
|
2944
|
+
* a configurable threshold.
|
|
2945
|
+
*
|
|
2869
2946
|
* @module systems/spatialHash
|
|
2870
2947
|
*/
|
|
2871
2948
|
|
|
@@ -2905,6 +2982,32 @@ interface SpatialHashStats {
|
|
|
2905
2982
|
readonly averageEntitiesPerCell: number;
|
|
2906
2983
|
readonly maxEntitiesInCell: number;
|
|
2907
2984
|
}
|
|
2985
|
+
/**
|
|
2986
|
+
* Cached bounds for a single entity (position + collider offset + size).
|
|
2987
|
+
*/
|
|
2988
|
+
interface PrevBounds {
|
|
2989
|
+
x: number;
|
|
2990
|
+
y: number;
|
|
2991
|
+
w: number;
|
|
2992
|
+
h: number;
|
|
2993
|
+
}
|
|
2994
|
+
/**
|
|
2995
|
+
* Internal state for the incremental spatial hash system.
|
|
2996
|
+
* Tracks which entities need re-hashing via a PackedStore dirty set,
|
|
2997
|
+
* and caches previous positions for change detection.
|
|
2998
|
+
*/
|
|
2999
|
+
interface SpatialHashSystemState {
|
|
3000
|
+
/** Dense packed store of dirty entity IDs for cache-friendly iteration */
|
|
3001
|
+
readonly dirtyEntities: PackedStore<number>;
|
|
3002
|
+
/** O(1) dedup: entity IDs currently in the dirty store */
|
|
3003
|
+
readonly dirtyLookup: Set<number>;
|
|
3004
|
+
/** Previous bounds per entity, backed by PackedStore for cache-friendly iteration */
|
|
3005
|
+
readonly prevBounds: ComponentStore<PrevBounds>;
|
|
3006
|
+
/** Whether the system has run at least once (first frame needs full rebuild) */
|
|
3007
|
+
initialized: boolean;
|
|
3008
|
+
/** Fraction of entities that must be dirty to trigger full rebuild (0.0-1.0) */
|
|
3009
|
+
dirtyThreshold: number;
|
|
3010
|
+
}
|
|
2908
3011
|
/** Default cell size */
|
|
2909
3012
|
declare const DEFAULT_CELL_SIZE = 8;
|
|
2910
3013
|
/**
|
|
@@ -3088,8 +3191,23 @@ declare function getSpatialHashStats(grid: SpatialHashGrid): SpatialHashStats;
|
|
|
3088
3191
|
* ```
|
|
3089
3192
|
*/
|
|
3090
3193
|
declare function rebuildSpatialHash(grid: SpatialHashGrid, world: World): void;
|
|
3194
|
+
/**
|
|
3195
|
+
* Creates a fresh spatial hash system state for incremental updates.
|
|
3196
|
+
*
|
|
3197
|
+
* @param dirtyThreshold - Fraction of entities above which full rebuild is used (default: 0.5)
|
|
3198
|
+
* @returns New system state
|
|
3199
|
+
*
|
|
3200
|
+
* @example
|
|
3201
|
+
* ```typescript
|
|
3202
|
+
* import { createSpatialHashSystemState } from 'blecsd';
|
|
3203
|
+
*
|
|
3204
|
+
* const state = createSpatialHashSystemState(0.3);
|
|
3205
|
+
* ```
|
|
3206
|
+
*/
|
|
3207
|
+
declare function createSpatialHashSystemState(dirtyThreshold?: number): SpatialHashSystemState;
|
|
3091
3208
|
/**
|
|
3092
3209
|
* Sets the spatial hash grid for the system to use.
|
|
3210
|
+
* Resets incremental state so the next tick performs a full rebuild.
|
|
3093
3211
|
*
|
|
3094
3212
|
* @param grid - The spatial hash grid
|
|
3095
3213
|
*
|
|
@@ -3109,7 +3227,96 @@ declare function setSpatialHashGrid(grid: SpatialHashGrid): void;
|
|
|
3109
3227
|
*/
|
|
3110
3228
|
declare function getSpatialHashGrid(): SpatialHashGrid | null;
|
|
3111
3229
|
/**
|
|
3112
|
-
*
|
|
3230
|
+
* Gets the current incremental update system state.
|
|
3231
|
+
*
|
|
3232
|
+
* @returns The system state
|
|
3233
|
+
*/
|
|
3234
|
+
declare function getSpatialHashSystemState(): SpatialHashSystemState;
|
|
3235
|
+
/**
|
|
3236
|
+
* Marks an entity as needing re-hashing on the next system tick.
|
|
3237
|
+
* Use this when an external system knows an entity's position or
|
|
3238
|
+
* collider changed, to avoid waiting for the position comparison scan.
|
|
3239
|
+
*
|
|
3240
|
+
* @param eid - Entity to mark dirty
|
|
3241
|
+
*
|
|
3242
|
+
* @example
|
|
3243
|
+
* ```typescript
|
|
3244
|
+
* import { markSpatialDirty } from 'blecsd';
|
|
3245
|
+
*
|
|
3246
|
+
* // After teleporting an entity, mark it dirty
|
|
3247
|
+
* Position.x[entity] = 100;
|
|
3248
|
+
* Position.y[entity] = 200;
|
|
3249
|
+
* markSpatialDirty(entity);
|
|
3250
|
+
* ```
|
|
3251
|
+
*/
|
|
3252
|
+
declare function markSpatialDirty(eid: Entity): void;
|
|
3253
|
+
/**
|
|
3254
|
+
* Gets the number of entities currently marked as dirty.
|
|
3255
|
+
*
|
|
3256
|
+
* @returns Count of dirty entities awaiting re-hash
|
|
3257
|
+
*
|
|
3258
|
+
* @example
|
|
3259
|
+
* ```typescript
|
|
3260
|
+
* import { getSpatialDirtyCount } from 'blecsd';
|
|
3261
|
+
*
|
|
3262
|
+
* console.log(`${getSpatialDirtyCount()} entities need re-hashing`);
|
|
3263
|
+
* ```
|
|
3264
|
+
*/
|
|
3265
|
+
declare function getSpatialDirtyCount(): number;
|
|
3266
|
+
/**
|
|
3267
|
+
* Resets the incremental spatial hash system state.
|
|
3268
|
+
* Clears dirty entities, position cache, and forces a full rebuild on next tick.
|
|
3269
|
+
* Useful for testing or scene transitions.
|
|
3270
|
+
*
|
|
3271
|
+
* @example
|
|
3272
|
+
* ```typescript
|
|
3273
|
+
* import { resetSpatialHashState } from 'blecsd';
|
|
3274
|
+
*
|
|
3275
|
+
* resetSpatialHashState();
|
|
3276
|
+
* ```
|
|
3277
|
+
*/
|
|
3278
|
+
declare function resetSpatialHashState(): void;
|
|
3279
|
+
/**
|
|
3280
|
+
* Sets the dirty threshold for the incremental update system.
|
|
3281
|
+
* When the fraction of dirty entities exceeds this value,
|
|
3282
|
+
* a full rebuild is used instead of incremental updates.
|
|
3283
|
+
*
|
|
3284
|
+
* @param threshold - Fraction between 0.0 and 1.0 (default: 0.5)
|
|
3285
|
+
*
|
|
3286
|
+
* @example
|
|
3287
|
+
* ```typescript
|
|
3288
|
+
* import { setSpatialDirtyThreshold } from 'blecsd';
|
|
3289
|
+
*
|
|
3290
|
+
* // Use full rebuild when more than 30% of entities moved
|
|
3291
|
+
* setSpatialDirtyThreshold(0.3);
|
|
3292
|
+
* ```
|
|
3293
|
+
*/
|
|
3294
|
+
declare function setSpatialDirtyThreshold(threshold: number): void;
|
|
3295
|
+
/**
|
|
3296
|
+
* Performs an incremental update of the spatial hash grid.
|
|
3297
|
+
* Only re-inserts entities that were marked dirty (moved, resized, or new).
|
|
3298
|
+
* Falls back to full rebuild when dirty count exceeds the threshold.
|
|
3299
|
+
*
|
|
3300
|
+
* @param grid - The spatial hash grid
|
|
3301
|
+
* @param state - The incremental update state
|
|
3302
|
+
* @param world - The ECS world
|
|
3303
|
+
*
|
|
3304
|
+
* @example
|
|
3305
|
+
* ```typescript
|
|
3306
|
+
* import { createSpatialHash, createSpatialHashSystemState, incrementalSpatialUpdate } from 'blecsd';
|
|
3307
|
+
*
|
|
3308
|
+
* const grid = createSpatialHash({ cellSize: 4 });
|
|
3309
|
+
* const state = createSpatialHashSystemState();
|
|
3310
|
+
* incrementalSpatialUpdate(grid, state, world);
|
|
3311
|
+
* ```
|
|
3312
|
+
*/
|
|
3313
|
+
declare function incrementalSpatialUpdate(grid: SpatialHashGrid, state: SpatialHashSystemState, world: World): void;
|
|
3314
|
+
/**
|
|
3315
|
+
* Spatial hash system with incremental updates.
|
|
3316
|
+
*
|
|
3317
|
+
* On the first frame, performs a full rebuild. On subsequent frames,
|
|
3318
|
+
* detects which entities moved and only re-hashes those. Falls back
|
|
3319
|
+
* to full rebuild when the dirty fraction exceeds the configured threshold.
|
|
3113
3320
|
*
|
|
3114
3321
|
* Register this in the EARLY_UPDATE phase to ensure collision queries
|
|
3115
3322
|
* use up-to-date spatial data.
|
|
@@ -3728,18 +3935,23 @@ interface CullingResult {
|
|
|
3728
3935
|
/** Number of entities culled (not visible) */
|
|
3729
3936
|
readonly culled: number;
|
|
3730
3937
|
}
|
|
3938
|
+
/**
|
|
3939
|
+
* Cached bounds for a single entity in the position cache.
|
|
3940
|
+
*/
|
|
3941
|
+
interface CachedBounds {
|
|
3942
|
+
x: number;
|
|
3943
|
+
y: number;
|
|
3944
|
+
w: number;
|
|
3945
|
+
h: number;
|
|
3946
|
+
}
|
|
3731
3947
|
/**
|
|
3732
3948
|
* Entity position cache for incremental updates.
|
|
3949
|
+
* Uses a single ComponentStore instead of 4 separate Maps,
|
|
3950
|
+
* reducing hash lookups from 4 to 1 per entity per frame.
|
|
3733
3951
|
*/
|
|
3734
3952
|
interface PositionCache {
|
|
3735
|
-
/** Previous
|
|
3736
|
-
readonly
|
|
3737
|
-
/** Previous y position per entity */
|
|
3738
|
-
readonly prevY: Map<number, number>;
|
|
3739
|
-
/** Previous width per entity */
|
|
3740
|
-
readonly prevW: Map<number, number>;
|
|
3741
|
-
/** Previous height per entity */
|
|
3742
|
-
readonly prevH: Map<number, number>;
|
|
3953
|
+
/** Previous bounds per entity */
|
|
3954
|
+
readonly bounds: ComponentStore<CachedBounds>;
|
|
3743
3955
|
}
|
|
3744
3956
|
/**
|
|
3745
3957
|
* Creates a position cache for tracking entity movement.
|
|
@@ -4033,4 +4245,4 @@ declare function getWorkerPoolState(): WorkerPoolState;
|
|
|
4033
4245
|
*/
|
|
4034
4246
|
declare function destroyWorkerPool(): void;
|
|
4035
4247
|
|
|
4036
|
-
export { type BehaviorSystemConfig, type BudgetAlert, type CellCoord, type CollisionEventData, type CollisionEventMap, type CollisionSystemState, ComputedLayout, type ComputedLayoutData, type CullingResult, DEFAULT_CELL_SIZE, type DirtyRect, type DragConstraints, type DragEndEvent, type DragEventMap, type DragMoveEvent, type DragStartEvent, type DragState, type DragVerifyCallback, type DropEvent, type EntityProvider, type FocusEventData, type FocusEventMap, type FocusEventType, type FrameBudgetConfig, type FrameBudgetManager, type FrameStats, type HitTestResult, type InputEventType, type InputSystemState, type LineRenderConfig, LineRenderConfigSchema, type MoveResult, type MovementApplier, type OutputState, type PanelConstraints, type PanelMoveConfig, type PanelMoveState, type ParticleSystemConfig, type PoolStats, type PoolTask, type PositionCache, type PositionResolver, type QueuedInputEvent, type QueuedKeyEvent, type QueuedMouseEvent, type RenderContext, type ResizeHandle, type ScrollAnimationState, type ScrollEvent, type ScrollPhysicsConfig, type SpatialHashConfig, type SpatialHashGrid, type SpatialHashStats, type SyncHandler, type SystemTiming, type TaskPriority, type TaskResult, type TileMapBuffer, type TileMapCamera, type TileMapRendererConfig, type Viewport, type VirtualizedRenderContext, type WorkerPoolConfig, type WorkerPoolState, ageParticle, animationSystem, applyScrollImpulse, areColliding, beginMove, beginResize, blurAll, burstParticles, cameraSystem, cancelAllOfType, cancelMoveOrResize, cancelTask, captureMouseTo, cleanup, cleanupEntityResources, cleanupVirtualizedRenderSystem, clearAllScrollStates, clearDragConstraints, clearEntityInput, clearEventQueue, clearFocusStack, clearLineRenderConfig, clearOutputBuffer, clearOutputStream, clearPositionCache, clearRenderBuffer, clearScreen, clearSpatialHash, clearTileMapRenderBuffer, clearVirtualizedRenderBuffer, collisionSystem, computeLayoutNow, createAnimationSystem, createBehaviorSystem, createCameraSystem, createCollisionSystem, createDragSystem, createEmptyBuffer, createFocusSystem, createFrameBudgetManager, createIncrementalSpatialSystem, createInputSystem, createLayoutSystem, createMovementSystem, createOutputState, createOutputSystem, createPanelConstraints, createPanelMoveConfig, createPanelMoveState, createParticleSystem, createPositionCache, createRenderSystem, createSmoothScrollSystem, createSpatialHash, createSpatialHashSystem, createStateMachineSystem, createTilemapRenderSystem, createVirtualizedRenderSystem, createVisibilityCullingSystem, createWorkerPool, cursorHome, destroyFrameBudgetManager, destroyWorkerPool, detectCollisions, detectResizeHandle, endMoveOrResize, endUserScroll, enterAlternateScreen, exportFrameBudgetMetrics, focusEntity, focusFirst, focusLast, focusNext, focusOffset, focusPop, focusPrev, focusPush, focusSystem, generateOutput, getActiveCollisions, getActiveTriggers, getCollidingEntities, getCollisionEventBus, getComputedBounds, getComputedLayout, getDragConstraints, getDragVerifyCallback, getEntitiesAtPoint, getEntitiesInCell, getEventQueue, getFocusEventBus, getFocusStackDepth, getFocusableEntities, getFocused, getFrameBudgetStats, getInputEventBus, getInteractiveEntityAt, getLineRenderConfig, getLineStore, getMouseCaptureEntity, getNearbyEntities, getOutputBuffer, getOutputState, getOutputStream, getRenderBuffer, getScrollPosition, getScrollState, getSpatialHashGrid, getSpatialHashStats, getStateAgeStore, getSystemStateAge, getTileMapRenderBuffer, getTileMapRendererConfig, getTriggerZones, getVirtualizedRenderBuffer, getWorkerPoolState, hasAnimationSystem, hasComputedLayout, hasMovementSystem, hideCursor, hitTest, inputState, inputSystem, insertEntity, invalidateAllLayouts, invalidateLayout, isColliding, isInTrigger, isMouseCaptured, isScrolling, keyboardMove, keyboardResize, killParticle, layoutSystem, leaveAlternateScreen, markAllDirty, mergeDirtyRects, moveParticle, movementSystem, onBudgetAlert, outputSystem, peekFocusStack, performCulling, pointInEntity, profiledSystem, queryAnimation, queryArea, queryCameras, queryColliders, queryInputReceivers, queryMovement, queryStateMachine, queryVisibleEntities, queueKeyEvent, queueMouseEvent, rebuildSpatialHash, recordFrameBudgetSystemTime, recordFrameTime, recordPhaseTime, registerAnimationSystem, registerCameraSystem, registerCollisionSystem, registerInputSystem, registerLineStore, registerMovementSystem, registerStateMachineSystem, registerTaskHandler, releaseMouse, removeEntityFromGrid, removeFromCache, removeScrollState, renderAllTileMaps, renderBackground, renderBorder, renderContent, renderRect, renderScrollbar, renderSystem, renderText, renderTileMapToBuffer, resetAttributes, resetCollisionState, resetDragStores, resetFocusEventBus, resetFrameBudget, resetInputState, resetOutputState, resetStateAge, resetTileMapRenderer, restoreFocus, rewindFocus, saveFocus, setDragConstraints, setDragVerifyCallback, setLineRenderConfig, setOutputBuffer, setOutputStream, setRenderBuffer, setScrollImmediate, setSpatialHashGrid, setTileMapRendererConfig, setVirtualizedRenderBuffer, showCursor, smoothScrollTo, spatialHashSystem, spawnParticle, startUserScroll, stateMachineSystem, submitTask, tilemapRenderSystem, unregisterLineStore, updateAnimations, updateCameras, updateEntityIfMoved, updateLineStore, updateMove, updateMovements, updateResize, updateScrollPhysics, updateStateAges, virtualizedRenderSystem, worldToCell, writeRaw };
|
|
4248
|
+
export { type ActivePairsView, type BehaviorSystemConfig, type BudgetAlert, type CachedBounds, type CellCoord, type CollisionEventData, type CollisionEventMap, type CollisionSystemState, ComputedLayout, type ComputedLayoutData, type CullingResult, DEFAULT_CELL_SIZE, type DirtyRect, type DragConstraints, type DragEndEvent, type DragEventMap, type DragMoveEvent, type DragStartEvent, type DragState, type DragVerifyCallback, type DropEvent, type EntityProvider, type FocusEventData, type FocusEventMap, type FocusEventType, type FrameBudgetConfig, type FrameBudgetManager, type FrameStats, type HitTestResult, type InputEventType, type InputSystemState, type LineRenderConfig, LineRenderConfigSchema, type MoveResult, type MovementApplier, type OutputState, type PanelConstraints, type PanelMoveConfig, type PanelMoveState, type ParticleSystemConfig, type PoolStats, type PoolTask, type PositionCache, type PositionResolver, type PrevBounds, type QueuedInputEvent, type QueuedKeyEvent, type QueuedMouseEvent, type RenderContext, type ResizeHandle, type ScrollAnimationState, type ScrollEvent, type ScrollPhysicsConfig, type SpatialHashConfig, type SpatialHashGrid, type SpatialHashStats, type SpatialHashSystemState, type SyncHandler, type SystemTiming, type TaskPriority, type TaskResult, type TileMapBuffer, type TileMapCamera, type TileMapRendererConfig, type Viewport, type VirtualizedRenderContext, type WorkerPoolConfig, type WorkerPoolState, ageParticle, animationSystem, applyScrollImpulse, areColliding, beginMove, beginResize, blurAll, burstParticles, cameraSystem, cancelAllOfType, cancelMoveOrResize, cancelTask, captureMouseTo, cleanup, cleanupEntityResources, cleanupVirtualizedRenderSystem, clearAllScrollStates, clearDragConstraints, clearEntityInput, clearEventQueue, clearFocusStack, clearLineRenderConfig, clearOutputBuffer, clearOutputStream, clearPositionCache, clearRenderBuffer, clearScreen, clearSpatialHash, clearTileMapRenderBuffer, clearVirtualizedRenderBuffer, collisionSystem, computeLayoutNow, createAnimationSystem, createBehaviorSystem, createCameraSystem, createCollisionSystem, createDragSystem, createEmptyBuffer, createFocusSystem, createFrameBudgetManager, createIncrementalSpatialSystem, createInputSystem, createLayoutSystem, createMovementSystem, createOutputState, createOutputSystem, createPanelConstraints, createPanelMoveConfig, createPanelMoveState, createParticleSystem, createPositionCache, createRenderSystem, createSmoothScrollSystem, createSpatialHash, createSpatialHashSystem, createSpatialHashSystemState, createStateMachineSystem, createTilemapRenderSystem, createVirtualizedRenderSystem, createVisibilityCullingSystem, createWorkerPool, cursorHome, destroyFrameBudgetManager, destroyWorkerPool, detectCollisions, detectResizeHandle, endMoveOrResize, endUserScroll, enterAlternateScreen, exportFrameBudgetMetrics, focusEntity, focusFirst, focusLast, focusNext, focusOffset, focusPop, focusPrev, focusPush, focusSystem, generateOutput, getActiveCollisionCount, getActiveCollisions, getActiveTriggerCount, getActiveTriggers, getCollidingEntities, getCollisionEventBus, getComputedBounds, getComputedLayout, getDragConstraints, getDragVerifyCallback, getEntitiesAtPoint, getEntitiesInCell, getEventQueue, getFocusEventBus, getFocusStackDepth, getFocusableEntities, getFocused, getFrameBudgetStats, getInputEventBus, getInteractiveEntityAt, getLineRenderConfig, getLineStore, getMouseCaptureEntity, getNearbyEntities, getOutputBuffer, getOutputState, getOutputStream, getRenderBuffer, getScrollPosition, getScrollState, getSpatialDirtyCount, getSpatialHashGrid, getSpatialHashStats, getSpatialHashSystemState, getStateAgeStore, getSystemStateAge, getTileMapRenderBuffer, getTileMapRendererConfig, getTriggerZones, getVirtualizedRenderBuffer, getWorkerPoolState, hasAnimationSystem, hasComputedLayout, hasMovementSystem, hideCursor, hitTest, incrementalSpatialUpdate, inputState, inputSystem, insertEntity, invalidateAllLayouts, invalidateLayout, isColliding, isInTrigger, isMouseCaptured, isScrolling, keyboardMove, keyboardResize, killParticle, layoutSystem, leaveAlternateScreen, markAllDirty, markSpatialDirty, mergeDirtyRects, moveParticle, movementSystem, onBudgetAlert, outputSystem, peekFocusStack, performCulling, pointInEntity, profiledSystem, queryAnimation, queryArea, queryCameras, queryColliders, queryInputReceivers, queryMovement, queryStateMachine, queryVisibleEntities, queueKeyEvent, queueMouseEvent, rebuildSpatialHash, recordFrameBudgetSystemTime, recordFrameTime, recordPhaseTime, registerAnimationSystem, registerCameraSystem, registerCollisionSystem, registerInputSystem, registerLineStore, registerMovementSystem, registerStateMachineSystem, registerTaskHandler, releaseMouse, removeEntityFromGrid, removeFromCache, removeScrollState, renderAllTileMaps, renderBackground, renderBorder, renderContent, renderRect, renderScrollbar, renderSystem, renderText, renderTileMapToBuffer, resetAttributes, resetCollisionState, resetDragStores, resetFocusEventBus, resetFrameBudget, resetInputState, resetOutputState, resetSpatialHashState, resetStateAge, resetTileMapRenderer, restoreFocus, rewindFocus, saveFocus, setDragConstraints, setDragVerifyCallback, setLineRenderConfig, setOutputBuffer, setOutputStream, setRenderBuffer, setScrollImmediate, setSpatialDirtyThreshold, setSpatialHashGrid, setTileMapRendererConfig, setVirtualizedRenderBuffer, showCursor, smoothScrollTo, spatialHashSystem, spawnParticle, startUserScroll, stateMachineSystem, submitTask, tilemapRenderSystem, unregisterLineStore, updateAnimations, updateCameras, updateEntityIfMoved, updateLineStore, updateMove, updateMovements, updateResize, updateScrollPhysics, updateStateAges, virtualizedRenderSystem, worldToCell, writeRaw };
|
package/dist/systems/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{
|
|
1
|
+
export{Xa as DEFAULT_CELL_SIZE,Ha as ageParticle,c as animationSystem,Oa as applyScrollImpulse,B as areColliding,va as beginMove,wa as beginResize,O as blurAll,Ga as burstParticles,i as cameraSystem,Wb as cancelAllOfType,Aa as cancelMoveOrResize,Vb as cancelTask,Na as clearAllScrollStates,E as clearDragConstraints,_ as clearFocusStack,Nb as clearPositionCache,eb as clearSpatialHash,Db as clearTileMapRenderBuffer,u as collisionSystem,d as createAnimationSystem,g as createBehaviorSystem,j as createCameraSystem,v as createCollisionSystem,H as createDragSystem,Fb as createEmptyBuffer,ba as createFocusSystem,ca as createFrameBudgetManager,Qb as createIncrementalSpatialSystem,pa as createMovementSystem,ua as createPanelConstraints,ta as createPanelMoveConfig,sa as createPanelMoveState,Ka as createParticleSystem,Kb as createPositionCache,Wa as createSmoothScrollSystem,Ya as createSpatialHash,rb as createSpatialHashSystem,hb as createSpatialHashSystemState,vb as createStateMachineSystem,Jb as createTilemapRenderSystem,Rb as createVisibilityCullingSystem,Sb as createWorkerPool,ka as destroyFrameBudgetManager,Yb as destroyWorkerPool,t as detectCollisions,Da as detectResizeHandle,za as endMoveOrResize,Sa as endUserScroll,la as exportFrameBudgetMetrics,N as focusEntity,R as focusFirst,S as focusLast,P as focusNext,Y as focusOffset,U as focusPop,Q as focusPrev,T as focusPush,aa as focusSystem,n as getActiveCollisionCount,o as getActiveCollisions,p as getActiveTriggerCount,q as getActiveTriggers,z as getCollidingEntities,m as getCollisionEventBus,D as getDragConstraints,G as getDragVerifyCallback,db as getEntitiesAtPoint,cb as getEntitiesInCell,J as getFocusEventBus,Z as getFocusStackDepth,L as getFocusableEntities,M as getFocused,ha as getFrameBudgetStats,bb as getNearbyEntities,Va as getScrollPosition,La as getScrollState,mb as getSpatialDirtyCount,jb as getSpatialHashGrid,fb as getSpatialHashStats,kb as getSpatialHashSystemState,tb as getStateAgeStore,zb as getSystemStateAge,Cb as getTileMapRenderBuffer,Bb as getTileMapRendererConfig,A as getTriggerZones,Xb as getWorkerPoolState,b as hasAnimationSystem,na as hasMovementSystem,pb as incrementalSpatialUpdate,_a as insertEntity,x as isColliding,y as isInTrigger,Ua as isScrolling,Ba as keyboardMove,Ca as keyboardResize,Ja as killParticle,lb as markSpatialDirty,Ea as mergeDirtyRects,Ia as moveParticle,oa as movementSystem,ia as onBudgetAlert,$ as peekFocusStack,Pb as performCulling,ga as profiledSystem,a as queryAnimation,ab as queryArea,h as queryCameras,s as queryColliders,ma as queryMovement,sb as queryStateMachine,Ob as queryVisibleEntities,gb as rebuildSpatialHash,da as recordFrameBudgetSystemTime,fa as recordFrameTime,ea as recordPhaseTime,e as registerAnimationSystem,k as registerCameraSystem,w as registerCollisionSystem,qa as registerMovementSystem,wb as registerStateMachineSystem,Tb as registerTaskHandler,$a as removeEntityFromGrid,Mb as removeFromCache,Ma as removeScrollState,Hb as renderAllTileMaps,Gb as renderTileMapToBuffer,r as resetCollisionState,I as resetDragStores,K as resetFocusEventBus,ja as resetFrameBudget,nb as resetSpatialHashState,yb as resetStateAge,Eb as resetTileMapRenderer,W as restoreFocus,X as rewindFocus,V as saveFocus,C as setDragConstraints,F as setDragVerifyCallback,Qa as setScrollImmediate,ob as setSpatialDirtyThreshold,ib as setSpatialHashGrid,Ab as setTileMapRendererConfig,Pa as smoothScrollTo,qb as spatialHashSystem,Fa as spawnParticle,Ra as startUserScroll,ub as stateMachineSystem,Ub as submitTask,Ib as tilemapRenderSystem,f as updateAnimations,l as updateCameras,Lb as updateEntityIfMoved,xa as updateMove,ra as updateMovements,ya as updateResize,Ta as updateScrollPhysics,xb as updateStateAges,Za as worldToCell}from'../chunk-3APDF6RW.js';export{h as captureMouseTo,N as cleanup,r as clearEntityInput,f as clearEventQueue,A as clearOutputBuffer,x as clearOutputStream,U as clearRenderBuffer,K as clearScreen,p as createInputSystem,t as createOutputState,E as createOutputSystem,W as createRenderSystem,L as cursorHome,I as enterAlternateScreen,u as generateOutput,e as getEventQueue,g as getInputEventBus,n as getInteractiveEntityAt,k as getMouseCaptureEntity,z as getOutputBuffer,B as getOutputState,w as getOutputStream,T as getRenderBuffer,G as hideCursor,m as hitTest,a as inputState,o as inputSystem,j as isMouseCaptured,J as leaveAlternateScreen,Z as markAllDirty,D as outputSystem,l as pointInEntity,s as queryInputReceivers,c as queueKeyEvent,d as queueMouseEvent,q as registerInputSystem,i as releaseMouse,O as renderBackground,P as renderBorder,Q as renderContent,Y as renderRect,R as renderScrollbar,V as renderSystem,X as renderText,M as resetAttributes,b as resetInputState,C as resetOutputState,y as setOutputBuffer,v as setOutputStream,S as setRenderBuffer,H as showCursor,F as writeRaw}from'../chunk-FMFEOAML.js';export{a as LineRenderConfigSchema,o as cleanupEntityResources,n as cleanupVirtualizedRenderSystem,k as clearLineRenderConfig,d as clearVirtualizedRenderBuffer,m as createVirtualizedRenderSystem,j as getLineRenderConfig,f as getLineStore,c as getVirtualizedRenderBuffer,e as registerLineStore,i as setLineRenderConfig,b as setVirtualizedRenderBuffer,g as unregisterLineStore,h as updateLineStore,l as virtualizedRenderSystem}from'../chunk-35I22JJO.js';import'../chunk-4LWWONFK.js';import'../chunk-JUWDTH25.js';import'../chunk-FGHEFXLK.js';import'../chunk-TWSWTBYL.js';import'../chunk-C5PCEQ6G.js';import'../chunk-VOCM5T2G.js';import'../chunk-JKVHO4LH.js';import'../chunk-OB66FB4F.js';import'../chunk-WY3KY2TR.js';export{a as ComputedLayout,h as computeLayoutNow,f as createLayoutSystem,i as getComputedBounds,b as getComputedLayout,c as hasComputedLayout,g as invalidateAllLayouts,d as invalidateLayout,e as layoutSystem}from'../chunk-XZA63ZPO.js';import'../chunk-H2YAOJDW.js';import'../chunk-BCADUCOZ.js';import'../chunk-EAY7B5GL.js';import'../chunk-K3SX2LY5.js';import'../chunk-KD55INV7.js';import'../chunk-LCN2ZITE.js';import'../chunk-W5OU7Z6J.js';import'../chunk-Z4EZERNE.js';import'../chunk-SHUC6JWA.js';import'../chunk-G7GIWWLE.js';import'../chunk-PXXGH3BV.js';import'../chunk-5PELJRUQ.js';
|