Skip to main content
←API Reference ←NianticSpatial.NSDK.AR.Subsystems

LocationMeshManager

↳ extends UnityEngine.MonoBehaviour
MonoBehaviour that manages the downloading and rendering of location meshes

Declaration​

public class LocationMeshManager : MonoBehaviour

Properties​

NameTypeSummary
TexturedMeshMaterialMaterial
Get or set the material to use for textured meshes
A custom material can be provided to render the meshes with a custom shader
VertexColorMaterialMaterial
Get or set the material to use for vertex colored meshes
A custom material can be provided to render the meshes with a custom shader

Fields​

NameTypeSummary
static DefaultMaxDecodedSizeKbuint
Default decoded-size budget of the asset mesh downloads, sized for phones.

Methods​

NameTypeSummary
ConfigureCachevoid
Enable or disable the on-disk cache of downloaded mesh data, or change its budget. With
the cache enabled, downloaded geometry and textures are kept on disk per chunk.
Downloading the same asset again reads the chunks already on disk instead of the
network, and an interrupted download resumes where it stopped. The cache is off by
default. The Cache Enabled and Cache Max Mb fields in the Inspector apply
the same settings when this manager starts.
CreateMeshChunkGameObject
Build a chunk GameObject from geometry yielded by
GetLocationMeshChunkDataByVpsMapAssetIdAsync, rendered with this manager's
materials. The chunk is the same as one yielded by
GetLocationMeshChunksByVpsMapAssetIdAsync.
GetLocationMeshChunkDataByVpsMapAssetIdAsyncIAsyncEnumerable<MeshChunkData>
Stream mesh chunks for a VPS map asset like
GetLocationMeshChunksByVpsMapAssetIdAsync, but yield each chunk's geometry
as MeshChunkData instead of building Unity objects for it.
GetLocationMeshChunksByVpsMapAssetIdAsyncIAsyncEnumerable<GameObject>
Stream mesh chunks for a VPS map asset, yielding each chunk as a GameObject as it completes.
Resolves the VPS map asset to its Mesh sibling in the same asset group. Chunks arrive
one at a time, closest-first based on the provided GPS position.
Iterate with await foreach to process each chunk as it arrives.
The download stops once the chunks delivered so far occupy
maxDecodedSizeKb kilobytes decoded: vertices, UVs, indices and
per-vertex colours at 4 bytes each, plus texture bytes as received. Pass 0 for no
budget.
async GetLocationMeshForPayloadAsyncTask<GameObject>
Get the mesh for an anchor payload