Esempio n. 1
0
 public override Attach Clone()
 {
     return(new ChunkAttach(VertexChunks.ContentClone(), PolyChunks.ContentClone())
     {
         Name = Name,
         MeshBounds = MeshBounds,
         VertexName = VertexName,
         PolyName = PolyName,
     });
 }
Esempio n. 2
0
        /// <summary>
        /// Updates the <see cref="HasWeight"/> property, since calculating it might take longer
        /// </summary>
        public void UpdateWeight()
        {
            if (PolyChunks == null || !PolyChunks.Any(a => a is PolyChunkStrip))
            {
                hasWeight = VertexChunks != null && VertexChunks.Any(a => a.HasWeight);
                return;
            }
            List <int> ids = new();

            if (VertexChunks != null)
            {
                foreach (var vc in VertexChunks)
                {
                    if (vc.HasWeight)
                    {
                        hasWeight = true;
                        return;
                    }
                    ids.AddRange(Enumerable.Range(vc.IndexOffset, vc.Vertices.Length));
                }
            }
            hasWeight = PolyChunks.OfType <PolyChunkStrip>().SelectMany(a => a.Strips).SelectMany(a => a.Corners).Any(a => !ids.Contains(a.Index));
        }