Skip to content

Components and systems

William Caine edited this page Apr 12, 2024 · 4 revisions

Components

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
})

Systems

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.
src/world/worldPlayerControlSystem System that controls player movement

Optimizing

See here for a optimization considerations: Optimizing.

Clone this wiki locally