Skip to main content

class GroundBuilderAsync

(Niantic.Lightship.Maps.Builders.Performance.Ground.GroundBuilderAsync)

Overview

A builder that generates a base ground mesh covering the entire maptile. Due to the simplicity and ubiquity of ground meshes, each IMapTile using this builder shares the same Mesh.

    class GroundBuilderAsync: Niantic.Lightship.Maps.Builders.Performance.MeshBuilderAsync {
public:
// methods

virtual override void Initialize(ILightshipMapView lightshipMapView);

virtual override bool PreBuild(
IReadOnlyList<MeshTile> tiles,
out IReadOnlyList<MeshTile> tilesToBuild
);

virtual override void Build(IReadOnlyList<MeshTile> tiles);
virtual override void Release(MeshFilter meshFilter);
};

Inherited Members

public:
// fields

int MinLOD => _minLOD;
int MaxLOD => _maxLOD;

// properties

Guid Id;
int MinLOD;
int MaxLOD;
Guid Id;

// methods

virtual void Initialize(ILightshipMapView lightshipMapView);
MeshFilter CreateMeshComponents(IMapTileObject mapTileObject);
void Release(MeshFilter meshFilter);
MeshFilter CreateMeshComponents(IMapTileObject mapTileObject);
virtual void Release(MeshFilter meshFilter);

bool PreBuild(
IReadOnlyList<MeshTile> tiles,
out IReadOnlyList<MeshTile> tilesToBuild
);

void Build(IReadOnlyList<MeshTile> tiles);

virtual bool PreBuild(
IReadOnlyList<MeshTile> tiles,
out IReadOnlyList<MeshTile> tilesToBuild
);

virtual abstract void Build(IReadOnlyList<MeshTile> tiles) = 0;
protected:
// fields

string BuilderName => _builderName.NullIfEmptyOrWhitespace() ?? name;
LayerKind Layer => _mapLayer;
List<FeatureKind> Features => _features;
Material[] _materials;

// properties

Vector3 ZOffset;

// methods

static void SetMeshForFilter(Mesh mesh, MeshFilter meshFilter);

IReadOnlyList<MeshTile> GetValidTilesAndClearInvalidTiles(
IReadOnlyList<MeshTile> tiles,
int minLOD,
int maxLOD
);

IReadOnlyList<IReadOnlyList<T>> GetFeaturesByTile< T >(IReadOnlyList<MeshTile> mapTiles);
IReadOnlyList<T> GetFeaturesForTile< T >(MeshTile tile);

bool ApplyMeshInternal(
Mesh.MeshDataArray meshDataToApply,
CancellationToken token,
out Mesh outputMesh
);

Detailed Documentation

A builder that generates a base ground mesh covering the entire maptile. Due to the simplicity and ubiquity of ground meshes, each IMapTile using this builder shares the same Mesh.

Methods

Initialize

virtual override void Initialize(ILightshipMapView lightshipMapView)

Builders may optionally implement this method if they need to perform any initialization or might need access to their parent ILightshipMapView instance later on.

Additionally, creates the shared Mesh used by all IMapTiles using this builder.

PreBuild

virtual override bool PreBuild(
IReadOnlyList<MeshTile> tiles,
out IReadOnlyList<MeshTile> tilesToBuild
)

No-op

    Parameters:

    tiles - The tiles to be built

    tilesToBuild - Assigned to tiles

    Returns:

    Always true

Build

virtual override void Build(IReadOnlyList<MeshTile> tiles)

Generates the Meshes for the ground layer, which is always the unit square covering the tile.

Release

virtual override void Release(MeshFilter meshFilter)

No-op override of Release