Skip to content

Commit a44b17f

Browse files
committed
Fix missing imports
1 parent aff8fd7 commit a44b17f

File tree

4 files changed

+7
-4
lines changed

4 files changed

+7
-4
lines changed

benchmark.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const addEntities = (iterations = 100, numEntities = 10_000) => {
3737
for (let i = 0; i < iterations; i++) {
3838
/* Add objects to grid */
3939
for (const entity of entities) {
40-
grid.set(entity, entity.position)
40+
grid.placeEntity(entity, entity.position)
4141
}
4242
grid.clear()
4343
}
@@ -53,7 +53,7 @@ const moveEntities = (iterations = 100, numEntities = 10_000) => {
5353
const grid = new BoundlessGrid(50)
5454

5555
for (const entity of entities) {
56-
grid.set(entity, entity.position)
56+
grid.placeEntity(entity, entity.position)
5757
}
5858

5959
const start = now()
@@ -64,7 +64,7 @@ const moveEntities = (iterations = 100, numEntities = 10_000) => {
6464
entity.position.x = Math.random() * 1000 - 1000
6565
entity.position.y = Math.random() * 1000 - 1000
6666
entity.position.z = Math.random() * 1000 - 1000
67-
grid.set(entity, entity.position)
67+
grid.placeEntity(entity, entity.position)
6868
}
6969
}
7070
const stop = now()

src/BoundlessGrid.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Grid } from "./Grid"
2+
import { IVector3 } from "./types"
23

34
type SpatialHash = string
45

src/Grid.ts

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
import { IVector3 } from "./types"
2+
13
export abstract class Grid<Entity = any> {
24
abstract placeEntity(entity: Entity, position: IVector3): void
35

src/types.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
interface IVector3 {
1+
export interface IVector3 {
22
x: number
33
y: number
44
z: number

0 commit comments

Comments
 (0)