コード例 #1
0
        public ObjectFaceF InitMember(IList <Vector3> vertices, IList <int> triangles)
        {
            if (weak_faceFs != null)
            {
                weak_faceFs.Dispose();
            }
            weak_faceFs = CollectionPool <FaceF> .ListCell.Create();

            for (int i = 0; i + 2 < triangles.Count; i += 3)
            {
                var faceF = ObjectPool <FaceF> .Create(initFacef, construct);

                weak_faceFs.Add(faceF);

                void initFacef(FaceF cell) => cell.InitMember(
                    vertices[triangles[i]],
                    vertices[triangles[i + 1]],
                    vertices[triangles[i + 2]]);
                FaceF construct() => new FaceF(
                    vertices[triangles[i]],
                    vertices[triangles[i + 1]],
                    vertices[triangles[i + 2]]);
            }
            disposedValue = false;
            return(this);
        }