diff options
author | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-17 22:42:09 -0600 |
---|---|---|
committer | Elizabeth Hunt <elizabeth.hunt@simponic.xyz> | 2023-08-17 22:42:09 -0600 |
commit | 432ce5428f357f31ae090d55c5183b4eccd5a37c (patch) | |
tree | a616ff32a1ac2a3f305c089954cdf6e6432f1ad8 /engine/structures/RefreshingCollisionFinderBehavior.ts | |
parent | 1c28e10b860056d85cc07e5a834c4a54eac14563 (diff) | |
download | jumpstorm-432ce5428f357f31ae090d55c5183b4eccd5a37c.tar.gz jumpstorm-432ce5428f357f31ae090d55c5183b4eccd5a37c.zip |
increase collision performance _heavily_
Diffstat (limited to 'engine/structures/RefreshingCollisionFinderBehavior.ts')
-rw-r--r-- | engine/structures/RefreshingCollisionFinderBehavior.ts | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/engine/structures/RefreshingCollisionFinderBehavior.ts b/engine/structures/RefreshingCollisionFinderBehavior.ts new file mode 100644 index 0000000..21d690d --- /dev/null +++ b/engine/structures/RefreshingCollisionFinderBehavior.ts @@ -0,0 +1,14 @@ +import type { Coord2D, Dimension2D } from "../interfaces"; + +export interface BoxedEntry { + id: string; + dimension: Dimension2D; + center: Coord2D; +} + +export interface RefreshingCollisionFinderBehavior { + public clear(): void; + public insert(boxedEntry: BoxedEntry): void; + public getNeighborIds(boxedEntry: BoxedEntry): Set<string>; + public setTopLeft(topLeft: Coord2d): void; +} |