World partition
NebulaWorldStreaming
Decides, per role, which cells this process keeps loaded and where the floating origin sits: worker: the cells of every container it leases plus NebulaConfig.WorkerLoadRingCells rings around them so ghosts and boundary physics have the n...
generated from the sources
Class in namespace
Nebula · Packages/com.1by3.nebula/Runtime/World/NebulaWorldStreaming.cspublic sealed class NebulaWorldStreaming : MonoBehaviour, IWorldAnchorDecides, per role, which cells this process keeps loaded and where the floating origin sits:
- worker: the cells of every container it leases plus
NebulaConfig.WorkerLoadRingCellsrings around them so ghosts and boundary physics have the neighboring geometry. The origin follows the center of the owned cells. - client (players and bots):
NebulaConfig.ClientLoadRadiusCellsaround its content anchor — the local pawn by default, or whateverNebulaClient.SetContentAnchorwas given (a strategy camera) — and the origin follows the same anchor. Before either exists, the cells around the origin cell. - gateway / orchestrator: nothing. They only need the container maths, which the manifest provides.
The origin shifts once the anchor/centroid is more than NebulaConfig.OriginShiftThresholdCells cells from the origin cell, so a shift is rare and never happens while pacing on a cell boundary.
Properties
Config
public NebulaConfig Config { get; }Worker
public NebulaWorker Worker { get; }Client
public NebulaClient Client { get; }OwnedCellCount
public int OwnedCellCount { get; }RequiredCellCount
public int RequiredCellCount { get; }NearCells
public int NearCells { get; }Cells of content a client keeps loaded: InterestSettings.NearCells of the world's cell size.
Methods
Initialize
public void Initialize(NebulaConfig config, NebulaWorker worker, NebulaClient client);Centroid
public static Vector3Int Centroid(ICollection<Vector3Int> cells);Rounded average coordinate of a set of cells.