Skip to content

@tripo3d/engine / World

Interface: World ​

Defined in: ecs/world.ts:7

Engine-owned Scene membership 边界。

Properties ​

PropertyModifierTypeDescriptionDefined in
destroyedreadonlybooleanWorld 是否已进入不可逆终态。ecs/world.ts:32
rootreadonlyEntity<Scene>与 scene 一一对应且作为 membership ancestry 起点的 Entity。ecs/world.ts:34
scenereadonlyScene当前 World 唯一的原生 Scene identity。ecs/world.ts:36

Methods ​

createQuery() ​

Call Signature ​

ts
createQuery(component): EntityQuery;

Defined in: ecs/world.ts:15

创建读取当前membership的单Component lazy Query。

Parameters ​
ParameterTypeDescription
componentComponentDefinition<unknown>Entity必须具有的Component identity。
Returns ​

EntityQuery

无注册、无dispose且identity稳定的Query。

Throws ​

World或Engine终态后调用时同步抛出。

Call Signature ​

ts
createQuery(descriptor): EntityQuery;

Defined in: ecs/world.ts:23

创建读取当前membership的组合lazy Query。

Parameters ​
ParameterTypeDescription
descriptorQueryDescriptor创建时复制并去重的Component组合条件。
Returns ​

EntityQuery

无注册、无dispose且identity稳定的Query。

Throws ​

World或Engine终态后调用时同步抛出。


destroy() ​

ts
destroy(): void;

Defined in: ecs/world.ts:29

销毁extra World root整棵Entity子树并退出Engine membership;重复调用无副作用。

Returns ​

void

Throws ​

default World、active frame或任一业务terminal callback失败时同步抛出。

基于 MIT 协议发布(内部使用)