class MeshSaver (Niantic.ARDK.Extensions.Meshing.MeshSaver)

Overview

This helper can be placed in a scene to save mesh data into a binary file on demand plus a MockMeshInfo json file containing meta data. More…

class MeshSaver: MonoBehaviour {
public:
    // methods

    void DeleteFiles();
    void SaveMesh();
    void SaveMeshSequentially();
    void StopSaveMeshSequentially();
};

Detailed Documentation

This helper can be placed in a scene to save mesh data into a binary file on demand plus a MockMeshInfo json file containing meta data.

HEADER: The first 16 bytes are a “magic word” equal to the ASCII string “6DBLOCKMESH” (padded with 0) The next 16 bytes are 3 Int32 values for block, vertex, and face buffer sizes followed by 1 Float value for Mesh Block size

BUFFERS: Next is the block buffer (sizeof Int32 * block buffer size, no padding) Vertex buffer (sizeof Float * vertex buffer size, no padding) Face buffer (sizeof Int32 * face buffer size, no padding)

MockMeshInfo JSON: deviceModel: String dateTime: String (Format “yyyyMMdd-HHmmss”) ardkVersion: String vertices: int faces: int

More details on the byte layout can be found in IARMesh.cs. Mesh files produced by this script can be loaded into the Unity Editor play mode with Niantic.ARDK.VirtualStudio.AR.Mock.MockMesh (see MeshLoader example scene)

Methods

void DeleteFiles()

Delete all saved mesh files.

void SaveMesh()

Saves the current version of the mesh into a file plus meta information into a json.