예제 #1
0
파일: ChunkAttach.cs 프로젝트: X-Hax/SA3D
 public override Attach Clone()
 {
     return(new ChunkAttach(VertexChunks.ContentClone(), PolyChunks.ContentClone())
     {
         Name = Name,
         MeshBounds = MeshBounds,
         VertexName = VertexName,
         PolyName = PolyName,
     });
 }
예제 #2
0
파일: ChunkAttach.cs 프로젝트: X-Hax/SA3D
        /// <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));
        }