Skip to content

Commit

Permalink
feat: refactor/fix LOD, boards, block type definitions, builtin groun…
Browse files Browse the repository at this point in the history
…d cache, renaming
  • Loading branch information
etienne-85 committed Oct 21, 2024
1 parent cf28fba commit 342f1b1
Show file tree
Hide file tree
Showing 14 changed files with 488 additions and 403 deletions.
25 changes: 3 additions & 22 deletions src/api/WorldComputeProxy.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box2, Vector3 } from 'three'
import { Box2, Vector2 } from 'three'

import { Block, PatchKey } from '../common/types'
import { GroundPatch, WorldCompute, WorldUtils } from '../index'
Expand All @@ -17,7 +17,7 @@ export type ComputeApiParams = Partial<{
}>

/**
* Frontend exposing world APIs and proxying requests to internal modules: world-compute, world-cache,
* World API frontend proxying requests to internal modules: world-compute, world-cache,
* When optional worker is provided all compute request are proxied to worker
* instead of main thread
*/
Expand Down Expand Up @@ -72,7 +72,7 @@ export class WorldComputeProxy {
}

async computeBlocksBatch(
blockPosBatch: Vector3[],
blockPosBatch: Vector2[],
params = { includeEntitiesBlocks: false },
) {
const blocks = !this.worker
Expand All @@ -91,13 +91,6 @@ export class WorldComputeProxy {
return blocks
}

// *iterEntitiesBaking(entityKeys: EntityKey[]) {
// for (const entityKey of entityKeys) {
// const entityChunk = WorldCompute.bakeChunkEntity(entityKey)
// yield entityChunk
// }
// }

async queryOvergroundItems(queriedRegion: Box2) {
const overgroundItems = !this.worker
? WorldCompute.retrieveOvergroundItems(queriedRegion)
Expand Down Expand Up @@ -132,18 +125,6 @@ export class WorldComputeProxy {
return patchStub
}

async bakeEntities(queriedRange: Box2) {
// const entityChunks = !this.worker
// ? WorldCompute.queryBakeEntities(queriedRange)
// : await this.workerCall(ComputeApiCall.BakeEntities, [
// queriedRange,
// ])?.then((entityChunks: EntityChunkStub[]) =>
// // parse worker's data to recreate original objects
// entityChunks.map(chunkStub => EntityChunk.fromStub(chunkStub)),
// )
return []//entityChunks
}

// async requestBattleBoard(boardCenter: Vector3, boardParams: BoardParams, lastBoardBounds: Box2) {
// const boardData = !this.worker ?
// WorldCompute.computeBoardData(boardCenter, boardParams, lastBoardBounds) :
Expand Down
Loading

0 comments on commit 342f1b1

Please sign in to comment.