Table of Contents

Class PushGeometry

Namespace
Typhon.Protocol
Assembly
Typhon.Protocol.dll

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

int

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

int

MaxVertices

The most vertices a region carries.

public const int MaxVertices = 16

Field Value

int

Properties

AnchorX

A sphere's anchor x.

public double AnchorX { get; init; }

Property Value

double

AnchorY

A sphere's anchor y.

public double AnchorY { get; init; }

Property Value

double

AnchorZ

A sphere's anchor z.

public double AnchorZ { get; init; }

Property Value

double

Cursor

A World session's cursor.

public ulong Cursor { get; init; }

Property Value

ulong

Dims

A region's dimensions, 2 or 3.

public int Dims { get; init; }

Property Value

int

Flags

The flags.

public PushGeometryFlags Flags { get; init; }

Property Value

PushGeometryFlags

Held

A region's near-budget estimate.

public int Held { get; init; }

Property Value

int

Level

A sphere's LOD level.

public int Level { get; init; }

Property Value

int

NearBudget

A region profile's near budget; 0 for none.

public int NearBudget { get; init; }

Property Value

int

RadiusM

A sphere's radius R′, as the session holds it.

public double RadiusM { get; init; }

Property Value

double

Rows

The window's rows.

public ulong[] Rows { get; init; }

Property Value

ulong[]

Shape

The shape.

public PushShape Shape { get; init; }

Property Value

PushShape

SlackM

A sphere profile's half-band h.

public double SlackM { get; init; }

Property Value

double

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

int

WindowX

The window's lowest cell x.

public int WindowX { get; init; }

Property Value

int

WindowY

The window's lowest cell y.

public int WindowY { get; init; }

Property Value

int

WindowZ

The window's lowest cell z.

public int WindowZ { get; init; }

Property Value

int

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

cx int

The cell's x.

cy int

The cell's y.

cz int

The cell's z; ignored in a flat grid.

Returns

bool

Whether it is delivered.

Read(ReadOnlySpan<byte>)

Reads a payload.

public static PushGeometry Read(ReadOnlySpan<byte> payload)

Parameters

payload ReadOnlySpan<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

w WireWriter

The writer.

flags PushGeometryFlags

The flags.

dims int

2 or 3.

vertices ReadOnlySpan<double>

The vertices, three numbers each whatever dims: a flat region's z is not written.

held int

The near budget's estimate.

nearBudget int

The 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

w WireWriter

The writer.

flags PushGeometryFlags

The flags.

anchorX double

The anchor's x.

anchorY double

The anchor's y.

anchorZ double

The anchor's z.

radiusM double

R′.

slackM double

The profile's half-band.

level int

The 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

w WireWriter

The writer.

originX int

The window's lowest cell x.

originY int

The window's lowest cell y.

originZ int

The window's lowest cell z.

window int

Its width per axis, at most 64.

rows ReadOnlySpan<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

w WireWriter

The writer.

flags PushGeometryFlags

The flags.

cursor ulong

The cursor.