* feat(spatial): 添加空间查询包 - ISpatialQuery: 空间查询接口 - findInRadius, findInRect, findNearest, findKNearest - raycast, raycastFirst - IBounds, IRaycastHit, SpatialFilter 类型 - ISpatialIndex: 空间索引接口 - insert, remove, update, clear, getAll - GridSpatialIndex: 网格空间索引实现 - 基于均匀网格的空间划分 - 支持所有 ISpatialQuery 操作 - 工具函数 - createBounds, isPointInBounds, boundsIntersect - distanceSquared, distance * feat(spatial): 添加空间查询蓝图节点 - 添加 FindInRadius/FindInRect/FindNearest/FindKNearest 节点 - 添加 Raycast/RaycastFirst 射线检测节点 - 每个节点包含模板和执行器 - 使用 menuPath: ['Spatial', ...] 组织节点菜单
26 lines
748 B
TypeScript
26 lines
748 B
TypeScript
/**
|
|
* @zh 空间查询服务令牌
|
|
* @en Spatial Query Service Tokens
|
|
*/
|
|
|
|
import { createServiceToken } from '@esengine/ecs-framework';
|
|
import type { ISpatialIndex, ISpatialQuery } from './ISpatialQuery';
|
|
|
|
/**
|
|
* @zh 空间索引服务令牌
|
|
* @en Spatial index service token
|
|
*
|
|
* @zh 用于注入空间索引服务
|
|
* @en Used for injecting spatial index service
|
|
*/
|
|
export const SpatialIndexToken = createServiceToken<ISpatialIndex<unknown>>('spatialIndex');
|
|
|
|
/**
|
|
* @zh 空间查询服务令牌
|
|
* @en Spatial query service token
|
|
*
|
|
* @zh 用于注入空间查询服务(只读)
|
|
* @en Used for injecting spatial query service (read-only)
|
|
*/
|
|
export const SpatialQueryToken = createServiceToken<ISpatialQuery<unknown>>('spatialQuery');
|