World partition
WorldOrigin
The floating origin: which cell currently sits at Unity's (0,0,0).
generated from the sources
Static class in namespace
Nebula.World · Packages/com.1by3.nebula/World/WorldOrigin.cspublic static class WorldOriginThe floating origin: which cell currently sits at Unity's (0,0,0). Every position a process handles is expressed in this frame (a "frame position"). When the frame moves, Shifted reports the delta to add to every frame position the streamer did not move itself (cached positions, history buffers, world-space particle systems...).
Properties
Cell
public static Vector3Int Cell { get; }The cell at Unity's origin.
Definition
public static WorldDefinition Definition { get; }ShiftCount
public static int ShiftCount { get; }Events
Shifted
public static event Action<Vector3> Shifted;Raised after the streamer has moved the loaded cells: the delta to add to any other frame position.
Methods
Reset
public static void Reset(WorldDefinition definition);ShiftDelta
public static Vector3 ShiftDelta(WorldDefinition definition, Vector3Int from, Vector3Int to);Delta every frame position gets when the origin moves from from to to.
ToFrame
public static Vector3 ToFrame(Vector3Int cell, Vector3 cellLocal);Frame position of a point given as cell coordinate plus local offset from that cell's centre.
CellOf
public static Vector3Int CellOf(Vector3 framePosition);Which cell a frame position lies in.