/// <summary> Constructor with buffer. </summary> internal TriangleMesh(ref Buffer b) { Triangles = b.DeserializeArray <TriangleIndices>(); for (int i = 0; i < Triangles.Length; i++) { Triangles[i] = new TriangleIndices(ref b); } Vertices = b.DeserializeStructArray <GeometryMsgs.Point>(); VertexNormals = b.DeserializeStructArray <GeometryMsgs.Point>(); VertexColors = b.DeserializeStructArray <StdMsgs.ColorRGBA>(); TriangleColors = b.DeserializeStructArray <StdMsgs.ColorRGBA>(); VertexTextureCoords = b.DeserializeStructArray <GeometryMsgs.Point>(); FaceMaterials = b.DeserializeArray <MeshMsgs.MeshMaterial>(); for (int i = 0; i < FaceMaterials.Length; i++) { FaceMaterials[i] = new MeshMsgs.MeshMaterial(ref b); } Textures = b.DeserializeArray <SensorMsgs.Image>(); for (int i = 0; i < Textures.Length; i++) { Textures[i] = new SensorMsgs.Image(ref b); } Clusters = b.DeserializeArray <MeshMsgs.MeshFaceCluster>(); for (int i = 0; i < Clusters.Length; i++) { Clusters[i] = new MeshMsgs.MeshFaceCluster(ref b); } }
/// <summary> Constructor with buffer. </summary> internal MeshMaterials(ref Buffer b) { Clusters = b.DeserializeArray <MeshMsgs.MeshFaceCluster>(); for (int i = 0; i < Clusters.Length; i++) { Clusters[i] = new MeshMsgs.MeshFaceCluster(ref b); } Materials = b.DeserializeArray <MeshMsgs.MeshMaterial>(); for (int i = 0; i < Materials.Length; i++) { Materials[i] = new MeshMsgs.MeshMaterial(ref b); } ClusterMaterials = b.DeserializeStructArray <uint>(); VertexTexCoords = b.DeserializeArray <MeshMsgs.MeshVertexTexCoords>(); for (int i = 0; i < VertexTexCoords.Length; i++) { VertexTexCoords[i] = new MeshMsgs.MeshVertexTexCoords(ref b); } }