-
Notifications
You must be signed in to change notification settings - Fork 0
Components and systems
MovesWithWorld can be found in src/world/worldMoveComponent.ts. Add this component to any entity you wish to be moved by the Infinity Engine.
engine.defineComponent('moves-with-world-id', {
// id of entity
id: Schemas.String,
// position in world, 0,0,0 as origin relative to Infinity Engine scene origin, not scene 0,0,0
position: Schemas.Vector3
})| System | Desc |
|---|---|
src/world/movesWithWorldSystem |
System that moves the world around the player. The player is held in place via the Avatar Trap. |
src/world/worldSpacePartitionSystem |
System determines nearby entities to be loaded and remove far away entities. |
-
The more items the
MovesWithWorldSystemhas to move, the worse performance will be. -
Keep the number of tracked
MovesWithWorldcomponents to a minimum. Parent objects as a much as you can, and assign just the parent toMovesWithWorld. -
If you assign a
Transform.scaleto a parent entity usingMovesWithWorldit will affect the positions of the children. -
Will not work with any library that manipulates the
Transfrom.positioncomponent, unless those libraries account for accepting an alternative component,MovesWithWorld.position. For example: SDK7 Utils, NPC Toolkit, etc.- I do have ideas as to how these libraries could support alternate components.
-
MovesWithWorldnot work with Tween, as Tween manipulates theTransfrom.positioncomponent, but the Infinity Engine uses Transform to perform its work too.