private VertexDeclaration(_VertexElement[] elements, _VertexElement extra) { _Elements = new _VertexElement[elements.Length + 1]; elements.CopyTo(_Elements, 0); _Elements[_Elements.Length - 1] = extra; _Stride = _Elements.Sum(item => item._Dimensions); _HashCode = _Elements.Select(item => item.GetHashCode()).Aggregate((a, b) => (a * 17) ^ b); _PositionV3 = GetOffset("POSITION"); _NormalV3 = GetOffset("NORMAL"); }
public VertexDeclaration WithVector4(string attribute) { var e = new _VertexElement(attribute, 4, Stride); return(new VertexDeclaration(_Elements, e)); }
public VertexDeclaration() { _Elements = new _VertexElement[0]; }