Fixed bug in AABBTree::AABBTreeNode::IntersectSphere that would cause it to return a bad distance to the triangle. I added Triangle::DistanceToPoint to correctly calculate this distance. This bug would make TweakBrush::queryPoints often pick the wrong triangle as the center of its update with the Connected-Only brush option on. This, in turn, would cause
Mesh::ConnectedPointsInSphere to misbehave, causing brushes to unweld vertices. It might also sometimes cause brushes to have no effect on some vertices that they should effect.
Fixed bug in Mesh::ConnectedPointsInSphere that would cause it to often miss welded vertices. This would cause the Connected-Only brush option to sometimes make brushes unweld vertices.
Simplified Mesh::ConnectedPointsInSphere a little.
Added Mesh::ConnectedPointsInTwoSpheres for use by brushes with the "NeedMirrorMergedQuery" flag. This fixes a bug that would rarely cause points to not get adjusted.
Fixed flaw in Mesh::SmoothNormals that would cause triangles to sometimes flicker black. The problem was that it would zero the normals before calculating them. I made it do the calculation in a temporary copy of the normals.
Fixed bug in Mesh::SmoothNormals that would cause it to produce bad results for welded vertices in a partial update. ("!= 0" should have been "== 0"). This would make triangles flicker near welded vertices when using a brush with live normal updates.
Fixed flaw in live-normals updating where it wouldn't update the normals of vertices adjacent to a changed vertex, despite the fact that those vertices have changed normals too. This flaw would cause triangles to look wrong along the edge of the area affected by the brush until the brush stroke ended.
Used new return-value version of trinormal several places.