C# Class HoloToolkit.Unity.SimpleMeshSerializer

SimpleMeshSerializer converts a UnityEngine.Mesh object to and from an array of bytes. This class saves minimal mesh data (vertices and triangle indices) in the following format: File header: vertex count (32 bit integer), triangle count (32 bit integer) Vertex list: vertex.x, vertex.y, vertex.z (all 32 bit float) Triangle index list: 32 bit integers
Afficher le fichier Open project: Microsoft/HoloToolkit-Unity Class Usage Examples

Méthodes publiques

Méthode Description
Deserialize ( byte data ) : IEnumerable

Deserializes a list of Mesh objects from the provided byte array.

Serialize ( IEnumerable meshes ) : byte[]

Serializes a list of Mesh objects into a byte array.

Private Methods

Méthode Description
ReadMesh ( BinaryReader reader ) : Mesh

Reads a single Mesh object from the data stream.

ReadMeshHeader ( BinaryReader reader, int &vertexCount, int &triangleIndexCount ) : void

Reads a mesh header from the data stream.

ReadTriangleIndicies ( BinaryReader reader, int triangleIndexCount ) : int[]

Reads the vertex indices that represent a mesh's triangles from the data stream

ReadVertices ( BinaryReader reader, int vertexCount ) : UnityEngine.Vector3[]

Reads a mesh's vertices from the data stream.

WriteMesh ( BinaryWriter writer, Mesh mesh ) : void

Writes a Mesh object to the data stream.

WriteMeshHeader ( BinaryWriter writer, int vertexCount, int triangleIndexCount ) : void

Writes a mesh header to the data stream.

WriteTriangleIndicies ( BinaryWriter writer, int triangleIndices ) : void

Writes the vertex indices that represent a mesh's triangles to the data stream

WriteVertices ( BinaryWriter writer, Vector3 vertices ) : void

Writes a mesh's vertices to the data stream.

Method Details

Deserialize() public static méthode

Deserializes a list of Mesh objects from the provided byte array.
public static Deserialize ( byte data ) : IEnumerable
data byte Binary data to be deserialized into a list of Mesh objects.
Résultat IEnumerable

Serialize() public static méthode

Serializes a list of Mesh objects into a byte array.
public static Serialize ( IEnumerable meshes ) : byte[]
meshes IEnumerable List of Mesh objects to be serialized.
Résultat byte[]