Nebula
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.cs
public static class WorldOrigin

The 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...).

This is the public world's frame, and is ScopeFrames.Public. A scope that asked for a frame of its own (a scoped chunk grid) keeps its origin in a ScopeFrame instead, so two scopes on one worker can both sit near Unity's origin; see docs/scope-frames.md.

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.

On this page