public static void DrawRing(Vector3 centre, Vector3 normal, float startAngle, float angle, float innerRadius, float outerRadius) { Mesh mesh = CreateOrRecycleMesh(); RingMesh.GenerateMesh(mesh, angle, innerRadius, outerRadius); //float localYAngle = (startAngle - angle / 2); // centre angle float localYAngle = startAngle; var rot = Quaternion.AngleAxis(localYAngle, normal) * Quaternion.FromToRotation(Vector3.up, normal); CreateVisualElement(mesh, centre, rot, Vector3.one); }
public static void DrawRing(Vector3 centre, Vector3 normal, float startAngle, float angle, float innerRadius, float outerRadius, Color colour, Style style = Style.Standard) { Init(); Mesh mesh = CreateOrRecycleMesh(); RingMesh.GenerateMesh(mesh, angle, innerRadius, outerRadius); //float localYAngle = (startAngle - angle / 2); // centre angle float localYAngle = 0; var rot = Quaternion.AngleAxis(localYAngle, normal) * Quaternion.FromToRotation(Vector3.up, normal); drawList.Add(new DrawInfo(mesh, centre, rot, Vector3.one, colour, style)); }