public static MeshPrimitive WithVertexAccessors <TVertex>(this MeshPrimitive primitive, IReadOnlyList <TVertex> vertices) where TVertex : IVertexBuilder { var memAccessors = VertexUtils.CreateVertexMemoryAccessors(vertices, new PackedEncoding()); return(primitive.WithVertexAccessors(memAccessors)); }
public static MeshPrimitive WithVertexAccessors <TVertex>(this MeshPrimitive primitive, IReadOnlyList <TVertex> vertices) where TVertex : struct, Geometry.VertexTypes.IVertexPosition { var xvertices = vertices.Select(item => (item, default(Geometry.VertexTypes.VertexEmpty), default(Geometry.VertexTypes.VertexEmpty))).ToList(); return(primitive.WithVertexAccessors(xvertices)); }
public static MeshPrimitive WithVertexAccessors(this MeshPrimitive primitive, IReadOnlyList <VertexPositionNormal> vertices) { var xvertices = vertices .Select(item => new VertexBuilder <VertexPositionNormal, VertexEmpty, VertexEmpty>(item)) .ToList(); return(primitive.WithVertexAccessors(xvertices)); }
public static MeshPrimitive WithVertexAccessors <TVertex>(this MeshPrimitive primitive, IReadOnlyList <TVertex> vertices) where TVertex : IVertexBuilder { var indices = vertices.Select(item => item.GetSkinning().GetWeights().MaxIndex); var maxIndex = indices.Any() ? indices.Max() : 0; var encoding = maxIndex < 256 ? Schema2.EncodingType.UNSIGNED_BYTE : EncodingType.UNSIGNED_SHORT; var memAccessors = VertexUtils.CreateVertexMemoryAccessors(vertices, encoding); return(primitive.WithVertexAccessors(memAccessors)); }