ScopeFrame
One scope's floating origin: which cell of that scope's grid currently sits at Unity's (0,0,0), and the delta every frame position of that scope gets when it moves.
Nebula.World · Packages/com.1by3.nebula/World/ScopeFrames.cspublic sealed class ScopeFrameOne scope's floating origin: which cell of that scope's grid currently sits at Unity's (0,0,0), and the delta every frame position of that scope gets when it moves. The public world's frame is ScopeFrames.Public, which is WorldOrigin itself, so a project with no scopes behaves exactly as it always did.
A worker may hold containers of many scopes whose coordinates have nothing to do with each other. Each of them keeps its own origin cell, so two scopes can both sit near Unity's origin on one worker without interfering: they are already in separate physics scenes (InstanceScenes) and separate container graphs. Design record: docs/scope-frames.md.
Properties
ScopeKey
public string ScopeKey { get; }The opaque scope key ("" is the public world).
InstanceId
public ulong InstanceId { get; }The 64-bit isolation id of ScopeKey; 0 for the public world.
IsPublic
public bool IsPublic { get; }Whether this is the public world's frame, which is WorldOrigin.
IsPinned
public bool IsPinned { get; }Whether this is an instance scope's frame (docs/scope-frames.md D11): an origin cell chosen once, near the instance's origin, when the instance's first container turned up here, and never shifted. A scoped grid that later names the same scope replaces it (ScopeFrames.Ensure).
IsFollowing
public bool IsFollowing { get; }Whether this frame follows the floating origin of a host container instead of keeping an origin cell (a hosted grid's frame, docs/container-tree.md D22). Its absolute coordinates are the host's own.
Cell
public Vector3Int Cell { get; }The cell of this scope's grid that sits at Unity's origin. A following frame reports the cell its origin falls in, which it never chose.
CellSize
public Vector3 CellSize { get; }Size of one cell of this scope's grid, in metres. The public frame's is the world definition's.
ShiftCount
public int ShiftCount { get; }How many times this scope's origin has moved.
OriginOffset
public Vector3 OriginOffset { get; }Where absolute (0,0,0) sits in this scope's frame: what turns an absolute box into a frame box. For a following frame, where the host's (0,0,0) sits in simulation space.
Events
Shifted
public event Action<Vector3> Shifted;Raised after this scope's containers were moved: the delta to add to any other frame position of this scope (cached positions, history buffers, world-space effects). The public frame re-raises WorldOrigin.Shifted.
Methods
OriginOffsetPrecise
public void OriginOffsetPrecise(out double x, out double y, out double z);OriginOffset in double, per axis: what an absolute position kept in double is shifted by before it is narrowed to float, so a placement far from the origin keeps its precision.
ShiftDelta
public Vector3 ShiftDelta(Vector3Int from, Vector3Int to);
public static Vector3 ShiftDelta(Vector3 cellSize, Vector3Int from, Vector3Int to);Delta every frame position of this scope gets when its origin moves from from to to.
ToString
public override string ToString();