Exemple #1
0
 public void BeginBuffer()
 {
     _currentBuffer    = new MeshBufferView();
     _currentPrimitive = null;
     _positions        = null;
     _normals          = null;
     _colors           = null;
     _tangents         = null;
     _texCoord0        = null;
     _texCoord1        = null;
     _joints           = null;
     _weights          = null;
 }
Exemple #2
0
 public void BeginPrimitive(PrimitiveTopology topology)
 {
     if (_currentBuffer == null)
     {
         throw new InvalidOperationException("Call BeginBuffer() before BeginPrimitive()");
     }
     _currentPrimitive = new IndexMeshPrimitive(_currentBuffer)
     {
         Topology = topology
     };
     _positions?.ResetIndices();
     _normals?.ResetIndices();
     _colors?.ResetIndices();
     _tangents?.ResetIndices();
     _texCoord0?.ResetIndices();
     _texCoord1?.ResetIndices();
     _joints?.ResetIndices();
     _weights?.ResetIndices();
     _mesh.Primitives.Add(_currentPrimitive);
 }
        public IndexSetReader(List <int> buffer, IReadOnlyCollection <StreamKey> keys, IndexMeshPrimitive primitive)
        {
            _buffer  = buffer;
            _readers = new IReadOnlyList <int> [keys.Count];
            var i = 0;

            foreach (var streamKey in keys)
            {
                _readers[i] = primitive.GetIndexReader(streamKey);
                ++i;
            }
        }