Table of Contents

Class PolygonLayer

Namespace
LansMap.Lines
public sealed class PolygonLayer : IDisposable
Inheritance
object
PolygonLayer
Implements

Constructors

PolygonLayer()

public PolygonLayer()

PolygonLayer(PolygonStore)

Shares an existing store - typically another PolygonLayer's - so the same fills render on this layer without copying, and a 2D-to-tabletop (or screen-to-in-texture) switch is a pure view swap. Mirrors PolylineLayer(PolylineStore)'s shared-store handling: PolygonStore has no Version counter, so Store.Dirty (single-consumer - whoever calls ClearDirty first eats it) is not a safe change signal for a second consumer, and Render/RenderWorld instead re-upload every call once anchored. Correct over fast, at the cost of the primary layer's dirty-range skip; fine for switch-and-view usage. A PolygonStore.Version counter would let this match MarkerLayer's cheaper Version-diff path, but PolygonStore.cs is outside this constructor's scope.

public PolygonLayer(PolygonStore sharedStore)

Parameters

sharedStore PolygonStore

Fields

Store

public readonly PolygonStore Store

Field Value

PolygonStore

SurfaceLiftPx

public float SurfaceLiftPx

Field Value

float

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

FillCommandBuffer(CommandBuffer)

Records the prepared polygon draw into cb. The triangle 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 triangles 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)

public void Render(MapViewTransform view)

Parameters

view MapViewTransform

RenderWorld(MapViewTransform, in SurfaceUvMap, Transform, Renderer)

Submits this frame's world-space draw: the same triangles, drawn as real 3D geometry standing above a SurfaceMapView's table instead of painted into its render texture, through SurfaceMercatorFrame so a fill 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 fills stand above; positions follow it every frame, so a moving table carries its fills rigidly.

planeRenderer Renderer

Renderer whose world bounds anchor the draw's culling bounds, expanded by the constant drape lift.