Пример #1
0
        private void CopyFloatStream(IMeshStream stream, BinaryWriter binaryWriter)
        {
            var reader = stream.GetReader <float>();

            foreach (var value in reader)
            {
                binaryWriter.Write(value);
            }
        }
Пример #2
0
        private void CopyStream(IMeshStream stream, BinaryWriter binaryWriter)
        {
            var reader = stream.GetReader <IEnumerable <float> >();

            foreach (var value in reader.SelectMany(_ => _))
            {
                binaryWriter.Write(value);
            }
        }
Пример #3
0
        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);
            }
        }
Пример #4
0
        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;
            }
        }