void DrawVertexPoints(PaintJob j, Vector3 point)
{
Profiler.BeginSample("Draw Vertex Points");
if (j.HasStream() && j.HasData())
{
PrepBrushMode(j);
}
if (j.renderer == null)
{
return;
}
// convert point into local space, so we don't have to convert every point
point = j.renderer.transform.worldToLocalMatrix.MultiplyPoint3x4(point);
// for some reason this doesn't handle scale, seems like it should
// we handle it poorly until I can find a better solution
float scale = 1.0f / Mathf.Abs(j.renderer.transform.lossyScale.x);
float bz = scale * brushSize;
for (int i = 0; i < j.verts.Length; ++i)
{
float d = Vector3.Distance(point, j.verts[i]);
if (d < bz)
{
Handles.color = Color.white;
Vector3 wp = j.meshFilter.transform.localToWorldMatrix.MultiplyPoint(j.verts[i]);
Handles.SphereCap(0, wp, Quaternion.identity, HandleUtility.GetHandleSize(wp) * 0.02f);
}
}
Profiler.EndSample();
}