world
Descriptionβ
This library includes properties and functions related to the World.Propertiesβ
Property | Type | Description |
---|---|---|
allEntities | Set | Set of all scene entities. |
Functionsβ
createEntityβ
Create a new entity.
world.createEntity() // -> eid
deleteEntityβ
Delete an existing entity.
world.deleteEntity(eid) // -> void
getChildrenβ
Get children of an entity.
world.getChildren(eid) // -> Generator<Eid>
getParentβ
Get the parent of an entity.
world.getParent(eid) // -> eid
setParentβ
Set the parent of an entity.
world.setParent(eid, parent: eid) // -> void
getWorldTransformβ
Get the world transform of an entity. Copies the worldTransform of the target into the second parameter.
world.getWorldTransform(eid, transform: Mat4) // -> void
setTransformβ
Set transform of an entity.
world.setPosition(eid, transform: Mat4) // -> void
setPositionβ
Set position of an entity.
world.setPosition(eid, x: number, y: number, z: number) // -> void
setQuaternionβ
Set rotation of an entity.
world.setQuaternion(eid, x: number, y: number, z: number, w: number) // -> void
setScaleβ
Set scale of an entity.
world.setScale(eid, x: number, y: number, z: number) // -> void
normalizeQuaternionβ
Normalizes an entity's quaternion.
world.normalizeQuaternion(eid) // -> void