Class PushGeometry
A DEBUG PUSH_GEOMETRY sub-block (09 § 15): what the session holds as of the frame carrying it — its anchor or hull, its delivered cells, its
LOD level. Sent to a debugging session whenever it changes. In the experimental range: its layout can change without a protocol version.
public sealed class PushGeometry
- Inheritance
-
PushGeometry
- Inherited Members
Remarks
PUSH_GEOMETRY := u8 shape | u8 flags | body
SPHERE := f64 anchorX | f64 anchorY | f64 anchorZ | f32 radiusM | f32 slackM | u8 level | window
WORLD := u64 cursor every cell key below it delivered; 2⁶⁴ − 1 once the walk passed the last cell
REGION := u8 dims | varu vertexCount | (f64 x | f64 y [| f64 z if dims = 3])* | varu held | varu nearBudget | window
window := vari originX | vari originY | vari originZ | u8 W | row*
W rows, or W² if DEEP; each ⌈W / 8⌉ bytes little-endian, bit i = the cell at originX + i of the row's (y, z)
A sphere's radius is R′ as the session holds it (after any last-resort shrink), its slack the profile's half-band h; a region's held is the
near budget's estimate and nearBudget 0 when the profile has none. A region with no hull yet has no vertices.
Constructors
PushGeometry()
public PushGeometry()
Fields
MaxBytes
The largest payload: a sixteen-vertex deep region with the widest window.
public const int MaxBytes = 1790
Field Value
MaxRows
The window's most rows: 53 in a flat grid, 14² in a deep one (the window bound, 2 809 cells).
public const int MaxRows = 196
Field Value
MaxVertices
The most vertices a region carries.
public const int MaxVertices = 16
Field Value
Properties
AnchorX
A sphere's anchor x.
public double AnchorX { get; init; }
Property Value
AnchorY
A sphere's anchor y.
public double AnchorY { get; init; }
Property Value
AnchorZ
A sphere's anchor z.
public double AnchorZ { get; init; }
Property Value
Cursor
A World session's cursor.
public ulong Cursor { get; init; }
Property Value
Dims
A region's dimensions, 2 or 3.
public int Dims { get; init; }
Property Value
Flags
The flags.
public PushGeometryFlags Flags { get; init; }
Property Value
Held
A region's near-budget estimate.
public int Held { get; init; }
Property Value
Level
A sphere's LOD level.
public int Level { get; init; }
Property Value
NearBudget
A region profile's near budget; 0 for none.
public int NearBudget { get; init; }
Property Value
RadiusM
A sphere's radius R′, as the session holds it.
public double RadiusM { get; init; }
Property Value
Rows
The window's rows.
public ulong[] Rows { get; init; }
Property Value
- ulong[]
Shape
The shape.
public PushShape Shape { get; init; }
Property Value
SlackM
A sphere profile's half-band h.
public double SlackM { get; init; }
Property Value
Vertices
A region's vertices, Dims numbers each.
public double[] Vertices { get; init; }
Property Value
- double[]
Window
The window's width per axis, in cells; 0 for a World session.
public int Window { get; init; }
Property Value
WindowX
The window's lowest cell x.
public int WindowX { get; init; }
Property Value
WindowY
The window's lowest cell y.
public int WindowY { get; init; }
Property Value
WindowZ
The window's lowest cell z.
public int WindowZ { get; init; }
Property Value
Methods
Delivered(int, int, int)
Whether the session holds a cell: inside the window, with its bit set.
public bool Delivered(int cx, int cy, int cz)
Parameters
Returns
- bool
Whether it is delivered.
Read(ReadOnlySpan<byte>)
Reads a payload.
public static PushGeometry Read(ReadOnlySpan<byte> payload)
Parameters
payloadReadOnlySpan<byte>The sub-block's payload.
Returns
- PushGeometry
The geometry.
Exceptions
- WireFormatException
The payload is truncated, malformed or has bytes left over.
WriteRegion(ref WireWriter, PushGeometryFlags, int, scoped ReadOnlySpan<double>, int, int)
Writes a region's payload up to its window, which WriteWindow(ref WireWriter, int, int, int, int, scoped ReadOnlySpan<ulong>) writes next.
public static void WriteRegion(ref WireWriter w, PushGeometryFlags flags, int dims, scoped ReadOnlySpan<double> vertices, int held, int nearBudget)
Parameters
wWireWriterThe writer.
flagsPushGeometryFlagsThe flags.
dimsint2 or 3.
verticesReadOnlySpan<double>The vertices, three numbers each whatever
dims: a flat region's z is not written.heldintThe near budget's estimate.
nearBudgetintThe profile's near budget; 0 for none.
WriteSphere(ref WireWriter, PushGeometryFlags, double, double, double, double, double, int)
Writes a sphere's payload up to its window, which WriteWindow(ref WireWriter, int, int, int, int, scoped ReadOnlySpan<ulong>) writes next.
public static void WriteSphere(ref WireWriter w, PushGeometryFlags flags, double anchorX, double anchorY, double anchorZ, double radiusM, double slackM, int level)
Parameters
wWireWriterThe writer.
flagsPushGeometryFlagsThe flags.
anchorXdoubleThe anchor's x.
anchorYdoubleThe anchor's y.
anchorZdoubleThe anchor's z.
radiusMdoubleR′.
slackMdoubleThe profile's half-band.
levelintThe LOD level.
WriteWindow(ref WireWriter, int, int, int, int, scoped ReadOnlySpan<ulong>)
Writes a window: its origin, its width, and its rows.
public static void WriteWindow(ref WireWriter w, int originX, int originY, int originZ, int window, scoped ReadOnlySpan<ulong> rows)
Parameters
wWireWriterThe writer.
originXintThe window's lowest cell x.
originYintThe window's lowest cell y.
originZintThe window's lowest cell z.
windowintIts width per axis, at most 64.
rowsReadOnlySpan<ulong>Its rows:
window, or its square in a deep grid.
WriteWorld(ref WireWriter, PushGeometryFlags, ulong)
Writes a World session's payload, whole.
public static void WriteWorld(ref WireWriter w, PushGeometryFlags flags, ulong cursor)
Parameters
wWireWriterThe writer.
flagsPushGeometryFlagsThe flags.
cursorulongThe cursor.