private static Mesh CreateHighlightMesh(string meshName, HighlightInterop highlight)
        {
            var mesh = new Mesh();

            mesh.name = meshName;

            var positions = new float[highlight.VertexCount * 3];

            Marshal.Copy(highlight.VertexPositions, positions, 0, positions.Length);

            var vertices = new Vector3[highlight.VertexCount];

            for (int i = 0; i < highlight.VertexCount; ++i)
            {
                vertices[i] = new Vector3(positions[i * 3], positions[i * 3 + 1], positions[i * 3 + 2]);
            }
            var triangles = new int[highlight.IndexCount];

            for (int i = 0; i < highlight.IndexCount; ++i)
            {
                short index = Marshal.ReadInt16(highlight.Indices, i * Marshal.SizeOf(typeof(short)));
                triangles[i] = (int)index;
            }
            mesh.vertices  = vertices;
            mesh.triangles = triangles;
            return(mesh);
        }
        internal static void OnHighlightMeshUpload(IntPtr highlightIdPtr, ulong meshId, int highlightRequestId, IntPtr highlightPtr)
        {
            string highlightIdString = Marshal.PtrToStringAnsi(highlightIdPtr);

            HighlightInterop highlight       = MarshalHighlightInterop(highlightPtr);
            string           highlightMeshId = GetHighlightGameObjectId(highlightIdString, meshId);
            Mesh             mesh            = CreateHighlightMesh(highlightMeshId, highlight);

            var originEcef = new DoubleVector3(highlight.OriginEcefX, highlight.OriginEcefY, highlight.OriginEcefZ);

            HighlightStreamer.AddObjectsForMeshes(new Mesh[] { mesh }, originEcef, "highlight");

            var request = HighlightRequests[highlightRequestId];

            HighlightIdsToAdd.Add(highlightMeshId);
            var gameObject = HighlightStreamer.GetObjects(highlightMeshId)[0];

            gameObject.GetComponent <MeshRenderer>().sharedMaterial = request.material;
        }