Vector3 StartEndpointCC(float angleOffset) { Vector3 circumBegin = TelescopeUtils.Circumcenter(points[1], points[2], points[3]); Vector3 normalBegin = Vector3.Cross(points[2] - points[1], points[3] - points[1]); Vector3 beginOffset = points[1] - circumBegin; Vector3 rotatedBegin = Quaternion.AngleAxis(-angleOffset, normalBegin) * beginOffset + circumBegin; //Vector3 diffBegin = (rotatedBegin - points[1]).normalized * 0.1f; return(rotatedBegin); }
Vector3 EndEndpointCC(float angleOffset) { int last = points.Count - 1; Vector3 circumEnd = TelescopeUtils.Circumcenter(points[last - 1], points[last - 2], points[last - 3]); Vector3 normalEnd = Vector3.Cross(points[last - 2] - points[last - 1], points[last - 3] - points[last - 1]); Vector3 endOffset = points[last - 1] - circumEnd; Vector3 rotatedEnd = Quaternion.AngleAxis(-angleOffset, normalEnd) * endOffset + circumEnd; //Vector3 diffEnd = (rotatedEnd - points[last - 1]).normalized * 0.1f; return(rotatedEnd); }