Table of Contents

Class PolylineLayer

Namespace
LansMap.Lines

GPU polyline tier: every segment of every line in one instanced draw on the same transform as the tiles.

public sealed class PolylineLayer : IDisposable
Inheritance
object
PolylineLayer
Implements

Constructors

PolylineLayer()

Creates a layer that owns a new empty PolylineStore.

public PolylineLayer()

PolylineLayer(PolylineStore)

Shares an existing store - typically another PolylineLayer's - so the same lines render on this layer without copying, and a 2D-to-tabletop (or screen-to-in-texture) switch is a pure view swap. Mirrors SurfaceWorldMarkerRenderer(MarkerStore)'s shared-store intent, but PolylineStore carries no Version counter the way MarkerStore does: Store.Dirty is single-consumer (whoever calls ClearDirty first eats it) and SegmentCount does not move for an in-place mutation (AppendRingPoint, RemovePolyline before Compact), so neither is a safe change signal for a second consumer. This layer's Render/RenderWorld therefore re-upload every call once anchored, trading the primary layer's dirty-range fast path for always-correct - fine for switch-and-view usage, wrong for two heavily-mutating tiers both rendering the same shared store every frame. A PolylineStore.Version counter would let this match the cheaper Version-diff path MarkerLayer's shared constructor uses, but PolylineStore.cs is outside this constructor's scope.

public PolylineLayer(PolylineStore sharedStore)

Parameters

sharedStore PolylineStore

Fields

Store

Line data this layer draws.

public readonly PolylineStore Store

Field Value

PolylineStore

SurfaceLiftPx

Extra lift for world-space segments above the table, in texture px (the same unit as segment WidthPx).

public float SurfaceLiftPx

Field Value

float

Methods

Dispose()

Releases GPU buffers and both draw materials.

public void Dispose()

FillCommandBuffer(CommandBuffer)

Records the prepared polyline draw into cb. The segment buffer binds through a per-draw property block: command buffers do not snapshot material buffer state.

public void FillCommandBuffer(CommandBuffer cb)

Parameters

cb CommandBuffer

Command buffer already bound to the camera target.

PrepareDraw(MapViewTransform)

Uploads dirty segments and stashes uniforms for view. Call from the game thread before FillCommandBuffer(CommandBuffer).

public void PrepareDraw(MapViewTransform view)

Parameters

view MapViewTransform

Current map view.

Render(MapViewTransform)

Uploads dirty segments if needed and paints them into a ScreenMapView or SurfaceMapView.

public void Render(MapViewTransform view)

Parameters

view MapViewTransform

Current map view.

RenderWorld(MapViewTransform, in SurfaceUvMap, Transform, Renderer)

Submits this frame's world-space draw: the same segments, drawn as camera-facing ribbons standing above a SurfaceMapView's table instead of painted into its render texture. Altitude-aware endpoints through SurfaceMercatorFrame, so a route can never desync from the flat draw sharing this Store. Call once per frame after the surface view is final (LateUpdate).

public void RenderWorld(MapViewTransform view, in SurfaceUvMap uvMap, Transform plane, Renderer planeRenderer)

Parameters

view MapViewTransform

The surface's own view (pitch 0).

uvMap SurfaceUvMap

UV parameterisation of the table mesh.

plane Transform

The table transform lines stand above; positions and width follow it every frame, so a moving table carries its lines rigidly.

planeRenderer Renderer

Renderer whose world bounds anchor the draw's culling bounds, expanded upward by the tallest segment endpoint.