Appearance
@tmrw-realityos/world • Docs
@tmrw-realityos/world / World
Class: World
World is a collection of Entities and Components. The nodes of the entities are managed in a scene hierachy.
Example
Populate the world from a json file
ts
// Construct an empty world
const world = new World();
// Load entities
world.load("room.json");
Constructors
new World()
new World():
World
Create a new world with and empty entity.
Returns
Defined in
Properties
boundNodes
boundNodes:
Map
<string
,BaseComponent
[]>
Defined in
fx
fx:
FXStack
Defined in
rendererInterface?
optional
rendererInterface:RendererInterface
Defined in
root
root:
Entity
Defined in
scene
scene:
Scene
Defined in
Methods
add()
add(
e
):void
Adds an entity to the root node
Parameters
• e: Entity
Returns
void
Defined in
captureInput()
captureInput(
node
,component
):void
Parameters
• node: string
• component: BaseComponent
Returns
void
Defined in
configure()
configure(
data
):void
Parameters
• data: WorldDescriptor
Returns
void
Defined in
findComponent()
findComponent<
Type
>(ctor
):undefined
|Type
Search a component in this entity and its children
Type Parameters
• Type extends BaseComponent
Parameters
• ctor
Returns
undefined
| Type
Defined in
findEntityById()
findEntityById(
name
):undefined
|Entity
Parameters
• name: string
Returns
undefined
| Entity
Defined in
findEntityByName()
findEntityByName(
name
):undefined
|Entity
Parameters
• name: string
Returns
undefined
| Entity
Defined in
getBoundNodes()
getBoundNodes(
node
):undefined
|BaseComponent
[]
used to connect components with nodes hosted by other entities
Parameters
• node: string
Returns
undefined
| BaseComponent
[]
Defined in
load()
load(
url
):Promise
<unknown
>
loads one room
Parameters
• url: string
Returns
Promise
<unknown
>
Defined in
releaseInput()
releaseInput(
node
,component
):void
Parameters
• node: string
• component: BaseComponent
Returns
void
Defined in
update()
update(
dt
):void
Parameters
• dt: number
Returns
void