/** * Returns a new tri, possibly one resurrected from the dead. * Resurrection reduces the need for garbage collection of dead tris. */ private Tri makeTri(Node n0, Node n1, Node n2) { ++_ntri; int ndead = _deadTris.ntri(); if (ndead==0) { _troot = new Tri(n0,n1,n2); } else { _troot = _deadTris.remove(ndead-1); _troot.init(n0,n1,n2); } if (_ntriListeners>0) fireTriAdded(_troot); return _troot; }