private void CopyFloatStream(IMeshStream stream, BinaryWriter binaryWriter) { var reader = stream.GetReader <float>(); foreach (var value in reader) { binaryWriter.Write(value); } }
private void CopyStream(IMeshStream stream, BinaryWriter binaryWriter) { var reader = stream.GetReader <IEnumerable <float> >(); foreach (var value in reader.SelectMany(_ => _)) { binaryWriter.Write(value); } }
private void CopyVec2Stream(IMeshStream stream, BinaryWriter binaryWriter) { var reader = stream.GetReader <Vector2>(); foreach (var value in reader) { binaryWriter.Write(value.X); binaryWriter.Write(value.Y); } }
public StreamAccessor(StreamKey key, IMeshStream meshStream, VertexElementFormat elementFormat) { _meshStream = meshStream; Reader = meshStream.GetReader <T>(); VertexElementFormat = elementFormat; switch (key.Key) { case Streams.Position: VertexElementSemantic = VertexElementSemantic.Position; break; case Streams.Normal: VertexElementSemantic = VertexElementSemantic.Normal; break; case Streams.Color: VertexElementSemantic = VertexElementSemantic.Color; break; default: VertexElementSemantic = VertexElementSemantic.TextureCoordinate; break; } }