Rename sides parameter to segments

This commit is contained in:
Oliver Booth 2022-06-03 12:11:34 +01:00
parent a4b6033b94
commit 519673d7ce
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
3 changed files with 190 additions and 190 deletions

View File

@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using X10D.Drawing;
using X10D.Numerics;
using X10D.Unity.Numerics;
@ -13,10 +13,10 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the circle.</param>
/// <param name="radius">The radius of the circle.</param>
/// <param name="sides">The number of sides to generate.</param>
public static void DrawCircle(Vector2 center, float radius, int sides)
/// <param name="segments">The number of segments to generate.</param>
public static void DrawCircle(Vector2 center, float radius, int segments)
{
DrawCircle(center, radius, sides, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawCircle(center, radius, segments, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
@ -24,11 +24,11 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the circle.</param>
/// <param name="radius">The radius of the circle.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the circle.</param>
public static void DrawCircle(Vector2 center, float radius, int sides, in Color color)
public static void DrawCircle(Vector2 center, float radius, int segments, in Color color)
{
DrawCircle(center, radius, sides, color, DefaultDrawDuration, DefaultDepthTest);
DrawCircle(center, radius, segments, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
@ -36,14 +36,14 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the circle.</param>
/// <param name="radius">The radius of the circle.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
/// The duration of the circle's visibility, in seconds. If 0 is passed, the circle is visible for a single frame.
/// </param>
public static void DrawCircle(Vector2 center, float radius, int sides, in Color color, float duration)
public static void DrawCircle(Vector2 center, float radius, int segments, in Color color, float duration)
{
DrawCircle(center, radius, sides, Vector2.zero, color, duration, DefaultDepthTest);
DrawCircle(center, radius, segments, Vector2.zero, color, duration, DefaultDepthTest);
}
/// <summary>
@ -51,7 +51,7 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the circle.</param>
/// <param name="radius">The radius of the circle.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
/// The duration of the circle's visibility, in seconds. If 0 is passed, the circle is visible for a single frame.
@ -60,9 +60,9 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the circle be obscured by objects closer to the camera.
/// </param>
public static void DrawCircle(Vector2 center, float radius, int sides, in Color color, float duration, bool depthTest)
public static void DrawCircle(Vector2 center, float radius, int segments, in Color color, float duration, bool depthTest)
{
DrawCircle(center, radius, sides, Vector2.zero, color, duration, depthTest);
DrawCircle(center, radius, segments, Vector2.zero, color, duration, depthTest);
}
/// <summary>
@ -70,7 +70,7 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the circle.</param>
/// <param name="radius">The radius of the circle.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the circle.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
@ -80,90 +80,90 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the circle be obscured by objects closer to the camera.
/// </param>
public static void DrawCircle(Vector2 center, float radius, int sides, in Vector3 offset, in Color color, float duration,
public static void DrawCircle(Vector2 center, float radius, int segments, in Vector3 offset, in Color color, float duration,
bool depthTest)
{
DrawCircle(new CircleF(center.ToSystemVector(), radius), sides, offset, color, duration, depthTest);
DrawCircle(new CircleF(center.ToSystemVector(), radius), segments, offset, color, duration, depthTest);
}
/// <summary>
/// Draws a circle with the specified color.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
public static void DrawCircle(in Circle circle, int sides)
/// <param name="segments">The number of segments to generate.</param>
public static void DrawCircle(in Circle circle, int segments)
{
DrawCircle((CircleF)circle, sides, Vector2.zero, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawCircle((CircleF)circle, segments, Vector2.zero, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the circle.</param>
public static void DrawCircle(in Circle circle, int sides, in Vector3 offset)
public static void DrawCircle(in Circle circle, int segments, in Vector3 offset)
{
DrawCircle((CircleF)circle, sides, offset, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawCircle((CircleF)circle, segments, offset, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the circle.</param>
public static void DrawCircle(in Circle circle, int sides, in Color color)
public static void DrawCircle(in Circle circle, int segments, in Color color)
{
DrawCircle((CircleF)circle, sides, Vector2.zero, color, DefaultDrawDuration, DefaultDepthTest);
DrawCircle((CircleF)circle, segments, Vector2.zero, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the circle.</param>
/// <param name="color">The color of the circle.</param>
public static void DrawCircle(in Circle circle, int sides, in Vector3 offset, in Color color)
public static void DrawCircle(in Circle circle, int segments, in Vector3 offset, in Color color)
{
DrawCircle((CircleF)circle, sides, offset, color, DefaultDrawDuration, DefaultDepthTest);
DrawCircle((CircleF)circle, segments, offset, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color and duration.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
/// The duration of the circle's visibility, in seconds. If 0 is passed, the circle is visible for a single frame.
/// </param>
public static void DrawCircle(in Circle circle, int sides, in Color color, float duration)
public static void DrawCircle(in Circle circle, int segments, in Color color, float duration)
{
DrawCircle((CircleF)circle, sides, Vector2.zero, color, duration, DefaultDepthTest);
DrawCircle((CircleF)circle, segments, Vector2.zero, color, duration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color and duration.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the circle.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
/// The duration of the circle's visibility, in seconds. If 0 is passed, the circle is visible for a single frame.
/// </param>
public static void DrawCircle(in Circle circle, int sides, in Vector3 offset, in Color color, float duration)
public static void DrawCircle(in Circle circle, int segments, in Vector3 offset, in Color color, float duration)
{
DrawCircle((CircleF)circle, sides, offset, color, duration, DefaultDepthTest);
DrawCircle((CircleF)circle, segments, offset, color, duration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color and duration.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
/// The duration of the circle's visibility, in seconds. If 0 is passed, the circle is visible for a single frame.
@ -172,16 +172,16 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the circle be obscured by objects closer to the camera.
/// </param>
public static void DrawCircle(in Circle circle, int sides, in Color color, float duration, bool depthTest)
public static void DrawCircle(in Circle circle, int segments, in Color color, float duration, bool depthTest)
{
DrawCircle((CircleF)circle, sides, Vector2.zero, color, duration, depthTest);
DrawCircle((CircleF)circle, segments, Vector2.zero, color, duration, depthTest);
}
/// <summary>
/// Draws a circle.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the circle.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
@ -191,89 +191,89 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the circle be obscured by objects closer to the camera.
/// </param>
public static void DrawCircle(in Circle circle, int sides, in Vector3 offset, in Color color, float duration, bool depthTest)
public static void DrawCircle(in Circle circle, int segments, in Vector3 offset, in Color color, float duration, bool depthTest)
{
DrawCircle((CircleF)circle, sides, offset, color, duration, depthTest);
DrawCircle((CircleF)circle, segments, offset, color, duration, depthTest);
}
/// <summary>
/// Draws a circle with the specified color.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
public static void DrawCircle(in CircleF circle, int sides)
/// <param name="segments">The number of segments to generate.</param>
public static void DrawCircle(in CircleF circle, int segments)
{
DrawCircle(circle, sides, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawCircle(circle, segments, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the circle.</param>
public static void DrawCircle(in CircleF circle, int sides, in Vector3 offset)
public static void DrawCircle(in CircleF circle, int segments, in Vector3 offset)
{
DrawCircle(circle, sides, offset, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawCircle(circle, segments, offset, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the circle.</param>
public static void DrawCircle(in CircleF circle, int sides, in Color color)
public static void DrawCircle(in CircleF circle, int segments, in Color color)
{
DrawCircle(circle, sides, Vector2.zero, color, DefaultDrawDuration, DefaultDepthTest);
DrawCircle(circle, segments, Vector2.zero, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the circle.</param>
/// <param name="color">The color of the circle.</param>
public static void DrawCircle(in CircleF circle, int sides, in Vector3 offset, in Color color)
public static void DrawCircle(in CircleF circle, int segments, in Vector3 offset, in Color color)
{
DrawCircle(circle, sides, offset, color, DefaultDrawDuration, DefaultDepthTest);
DrawCircle(circle, segments, offset, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color and duration.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
/// The duration of the circle's visibility, in seconds. If 0 is passed, the circle is visible for a single frame.
/// </param>
public static void DrawCircle(in CircleF circle, int sides, in Color color, float duration)
public static void DrawCircle(in CircleF circle, int segments, in Color color, float duration)
{
DrawCircle(circle, sides, Vector2.zero, color, duration, DefaultDepthTest);
DrawCircle(circle, segments, Vector2.zero, color, duration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color and duration.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the circle.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
/// The duration of the circle's visibility, in seconds. If 0 is passed, the circle is visible for a single frame.
/// </param>
public static void DrawCircle(in CircleF circle, int sides, in Vector3 offset, in Color color, float duration)
public static void DrawCircle(in CircleF circle, int segments, in Vector3 offset, in Color color, float duration)
{
DrawCircle(circle, sides, offset, color, duration, DefaultDepthTest);
DrawCircle(circle, segments, offset, color, duration, DefaultDepthTest);
}
/// <summary>
/// Draws a circle with the specified color and duration.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
/// The duration of the circle's visibility, in seconds. If 0 is passed, the circle is visible for a single frame.
@ -282,16 +282,16 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the circle be obscured by objects closer to the camera.
/// </param>
public static void DrawCircle(in CircleF circle, int sides, in Color color, float duration, bool depthTest)
public static void DrawCircle(in CircleF circle, int segments, in Color color, float duration, bool depthTest)
{
DrawCircle(circle, sides, Vector2.zero, color, duration, depthTest);
DrawCircle(circle, segments, Vector2.zero, color, duration, depthTest);
}
/// <summary>
/// Draws a circle.
/// </summary>
/// <param name="circle">The circle to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the circle.</param>
/// <param name="color">The color of the circle.</param>
/// <param name="duration">
@ -301,15 +301,15 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the circle be obscured by objects closer to the camera.
/// </param>
public static void DrawCircle(in CircleF circle, int sides, in Vector3 offset, in Color color, float duration, bool depthTest)
public static void DrawCircle(in CircleF circle, int segments, in Vector3 offset, in Color color, float duration, bool depthTest)
{
DrawPolyhedron(CreateCircle(circle.Radius, sides, Vector3.zero), offset, color, duration, depthTest);
DrawPolyhedron(CreateCircle(circle.Radius, segments, Vector3.zero), offset, color, duration, depthTest);
}
private static Polyhedron CreateCircle(float radius, int sides, in Vector3 axis)
private static Polyhedron CreateCircle(float radius, int segments, in Vector3 axis)
{
const float max = 2.0f * MathF.PI;
float step = max / sides;
float step = max / segments;
var points = new List<System.Numerics.Vector3>();
for (var theta = 0f; theta < max; theta += step)

View File

@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using X10D.Drawing;
namespace X10D.Unity;
@ -10,10 +10,10 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the ellipse.</param>
/// <param name="radius">The radius of the ellipse.</param>
/// <param name="sides">The number of sides to generate.</param>
public static void DrawEllipse(Vector2 center, Vector2 radius, int sides)
/// <param name="segments">The number of segments to generate.</param>
public static void DrawEllipse(Vector2 center, Vector2 radius, int segments)
{
DrawEllipse(center, radius.x, radius.y, sides, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse(center, radius.x, radius.y, segments, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
@ -21,11 +21,11 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the ellipse.</param>
/// <param name="radius">The radius of the ellipse.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
public static void DrawEllipse(Vector2 center, Vector2 radius, int sides, in Color color)
public static void DrawEllipse(Vector2 center, Vector2 radius, int segments, in Color color)
{
DrawEllipse(center, radius.x, radius.y, sides, color, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse(center, radius.x, radius.y, segments, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
@ -33,14 +33,14 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the ellipse.</param>
/// <param name="radius">The radius of the ellipse.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
/// The duration of the ellipse's visibility, in seconds. If 0 is passed, the ellipse is visible for a single frame.
/// </param>
public static void DrawEllipse(Vector2 center, Vector2 radius, int sides, in Color color, float duration)
public static void DrawEllipse(Vector2 center, Vector2 radius, int segments, in Color color, float duration)
{
DrawEllipse(center, radius.x, radius.y, sides, Vector2.zero, color, duration, DefaultDepthTest);
DrawEllipse(center, radius.x, radius.y, segments, Vector2.zero, color, duration, DefaultDepthTest);
}
/// <summary>
@ -48,7 +48,7 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the ellipse.</param>
/// <param name="radius">The radius of the ellipse.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
/// The duration of the ellipse's visibility, in seconds. If 0 is passed, the ellipse is visible for a single frame.
@ -57,9 +57,9 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the ellipse be obscured by objects closer to the camera.
/// </param>
public static void DrawEllipse(Vector2 center, Vector2 radius, int sides, in Color color, float duration, bool depthTest)
public static void DrawEllipse(Vector2 center, Vector2 radius, int segments, in Color color, float duration, bool depthTest)
{
DrawEllipse(center, radius.x, radius.y, sides, Vector2.zero, color, duration, depthTest);
DrawEllipse(center, radius.x, radius.y, segments, Vector2.zero, color, duration, depthTest);
}
/// <summary>
@ -67,7 +67,7 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the ellipse.</param>
/// <param name="radius">The radius of the ellipse.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the ellipse.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
@ -77,10 +77,10 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the ellipse be obscured by objects closer to the camera.
/// </param>
public static void DrawEllipse(Vector2 center, Vector2 radius, int sides, Vector2 offset, in Color color, float duration,
public static void DrawEllipse(Vector2 center, Vector2 radius, int segments, Vector2 offset, in Color color, float duration,
bool depthTest)
{
DrawEllipse(new EllipseF(center.x, center.y, radius.x, radius.y), sides, offset, color, duration, depthTest);
DrawEllipse(new EllipseF(center.x, center.y, radius.x, radius.y), segments, offset, color, duration, depthTest);
}
/// <summary>
@ -89,10 +89,10 @@ public static partial class DebugEx
/// <param name="center">The center point of the ellipse.</param>
/// <param name="radiusX">The horizontal radius of the ellipse.</param>
/// <param name="radiusY">The vertical radius of the ellipse.</param>
/// <param name="sides">The number of sides to generate.</param>
public static void DrawEllipse(Vector2 center, float radiusX, float radiusY, int sides)
/// <param name="segments">The number of segments to generate.</param>
public static void DrawEllipse(Vector2 center, float radiusX, float radiusY, int segments)
{
DrawEllipse(center, radiusX, radiusY, sides, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse(center, radiusX, radiusY, segments, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
@ -101,11 +101,11 @@ public static partial class DebugEx
/// <param name="center">The center point of the ellipse.</param>
/// <param name="radiusX">The horizontal radius of the ellipse.</param>
/// <param name="radiusY">The vertical radius of the ellipse.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
public static void DrawEllipse(Vector2 center, float radiusX, float radiusY, int sides, in Color color)
public static void DrawEllipse(Vector2 center, float radiusX, float radiusY, int segments, in Color color)
{
DrawEllipse(center, radiusX, radiusY, sides, color, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse(center, radiusX, radiusY, segments, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
@ -114,14 +114,14 @@ public static partial class DebugEx
/// <param name="center">The center point of the ellipse.</param>
/// <param name="radiusX">The horizontal radius of the ellipse.</param>
/// <param name="radiusY">The vertical radius of the ellipse.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
/// The duration of the ellipse's visibility, in seconds. If 0 is passed, the ellipse is visible for a single frame.
/// </param>
public static void DrawEllipse(Vector2 center, float radiusX, float radiusY, int sides, in Color color, float duration)
public static void DrawEllipse(Vector2 center, float radiusX, float radiusY, int segments, in Color color, float duration)
{
DrawEllipse(center, radiusX, radiusY, sides, Vector2.zero, color, duration, DefaultDepthTest);
DrawEllipse(center, radiusX, radiusY, segments, Vector2.zero, color, duration, DefaultDepthTest);
}
/// <summary>
@ -130,7 +130,7 @@ public static partial class DebugEx
/// <param name="center">The center point of the ellipse.</param>
/// <param name="radiusX">The horizontal radius of the ellipse.</param>
/// <param name="radiusY">The vertical radius of the ellipse.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
/// The duration of the ellipse's visibility, in seconds. If 0 is passed, the ellipse is visible for a single frame.
@ -139,10 +139,10 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the ellipse be obscured by objects closer to the camera.
/// </param>
public static void DrawEllipse(Vector2 center, float radiusX, float radiusY, int sides, in Color color, float duration,
public static void DrawEllipse(Vector2 center, float radiusX, float radiusY, int segments, in Color color, float duration,
bool depthTest)
{
DrawEllipse(center, radiusX, radiusY, sides, Vector2.zero, color, duration, depthTest);
DrawEllipse(center, radiusX, radiusY, segments, Vector2.zero, color, duration, depthTest);
}
/// <summary>
@ -151,7 +151,7 @@ public static partial class DebugEx
/// <param name="center">The center point of the ellipse.</param>
/// <param name="radiusX">The horizontal radius of the ellipse.</param>
/// <param name="radiusY">The vertical radius of the ellipse.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the ellipse.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
@ -161,90 +161,90 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the ellipse be obscured by objects closer to the camera.
/// </param>
public static void DrawEllipse(Vector2 center, float radiusX, float radiusY, int sides, Vector2 offset, in Color color,
public static void DrawEllipse(Vector2 center, float radiusX, float radiusY, int segments, Vector2 offset, in Color color,
float duration, bool depthTest)
{
DrawEllipse(new EllipseF(center.x, center.y, radiusX, radiusY), sides, offset, color, duration, depthTest);
DrawEllipse(new EllipseF(center.x, center.y, radiusX, radiusY), segments, offset, color, duration, depthTest);
}
/// <summary>
/// Draws an ellipse with the specified color.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
public static void DrawEllipse(Ellipse ellipse, int sides)
/// <param name="segments">The number of segments to generate.</param>
public static void DrawEllipse(Ellipse ellipse, int segments)
{
DrawEllipse((EllipseF)ellipse, sides, Vector2.zero, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse((EllipseF)ellipse, segments, Vector2.zero, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the ellipse.</param>
public static void DrawEllipse(Ellipse ellipse, int sides, Vector2 offset)
public static void DrawEllipse(Ellipse ellipse, int segments, Vector2 offset)
{
DrawEllipse((EllipseF)ellipse, sides, offset, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse((EllipseF)ellipse, segments, offset, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
public static void DrawEllipse(Ellipse ellipse, int sides, in Color color)
public static void DrawEllipse(Ellipse ellipse, int segments, in Color color)
{
DrawEllipse((EllipseF)ellipse, sides, Vector2.zero, color, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse((EllipseF)ellipse, segments, Vector2.zero, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the ellipse.</param>
/// <param name="color">The color of the ellipse.</param>
public static void DrawEllipse(Ellipse ellipse, int sides, Vector2 offset, in Color color)
public static void DrawEllipse(Ellipse ellipse, int segments, Vector2 offset, in Color color)
{
DrawEllipse((EllipseF)ellipse, sides, offset, color, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse((EllipseF)ellipse, segments, offset, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color and duration.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
/// The duration of the ellipse's visibility, in seconds. If 0 is passed, the ellipse is visible for a single frame.
/// </param>
public static void DrawEllipse(Ellipse ellipse, int sides, in Color color, float duration)
public static void DrawEllipse(Ellipse ellipse, int segments, in Color color, float duration)
{
DrawEllipse((EllipseF)ellipse, sides, Vector2.zero, color, duration, DefaultDepthTest);
DrawEllipse((EllipseF)ellipse, segments, Vector2.zero, color, duration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color and duration.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the ellipse.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
/// The duration of the ellipse's visibility, in seconds. If 0 is passed, the ellipse is visible for a single frame.
/// </param>
public static void DrawEllipse(Ellipse ellipse, int sides, Vector2 offset, in Color color, float duration)
public static void DrawEllipse(Ellipse ellipse, int segments, Vector2 offset, in Color color, float duration)
{
DrawEllipse((EllipseF)ellipse, sides, offset, color, duration, DefaultDepthTest);
DrawEllipse((EllipseF)ellipse, segments, offset, color, duration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color and duration.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
/// The duration of the ellipse's visibility, in seconds. If 0 is passed, the ellipse is visible for a single frame.
@ -253,16 +253,16 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the ellipse be obscured by objects closer to the camera.
/// </param>
public static void DrawEllipse(Ellipse ellipse, int sides, in Color color, float duration, bool depthTest)
public static void DrawEllipse(Ellipse ellipse, int segments, in Color color, float duration, bool depthTest)
{
DrawEllipse((EllipseF)ellipse, sides, Vector2.zero, color, duration, depthTest);
DrawEllipse((EllipseF)ellipse, segments, Vector2.zero, color, duration, depthTest);
}
/// <summary>
/// Draws an ellipse.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the ellipse.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
@ -272,89 +272,89 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the ellipse be obscured by objects closer to the camera.
/// </param>
public static void DrawEllipse(Ellipse ellipse, int sides, Vector2 offset, in Color color, float duration, bool depthTest)
public static void DrawEllipse(Ellipse ellipse, int segments, Vector2 offset, in Color color, float duration, bool depthTest)
{
DrawEllipse((EllipseF)ellipse, sides, offset, color, duration, depthTest);
DrawEllipse((EllipseF)ellipse, segments, offset, color, duration, depthTest);
}
/// <summary>
/// Draws an ellipse with the specified color.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
public static void DrawEllipse(EllipseF ellipse, int sides)
/// <param name="segments">The number of segments to generate.</param>
public static void DrawEllipse(EllipseF ellipse, int segments)
{
DrawEllipse(ellipse, sides, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse(ellipse, segments, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the ellipse.</param>
public static void DrawEllipse(EllipseF ellipse, int sides, Vector2 offset)
public static void DrawEllipse(EllipseF ellipse, int segments, Vector2 offset)
{
DrawEllipse(ellipse, sides, offset, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse(ellipse, segments, offset, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
public static void DrawEllipse(EllipseF ellipse, int sides, in Color color)
public static void DrawEllipse(EllipseF ellipse, int segments, in Color color)
{
DrawEllipse(ellipse, sides, Vector2.zero, color, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse(ellipse, segments, Vector2.zero, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the ellipse.</param>
/// <param name="color">The color of the ellipse.</param>
public static void DrawEllipse(EllipseF ellipse, int sides, Vector2 offset, in Color color)
public static void DrawEllipse(EllipseF ellipse, int segments, Vector2 offset, in Color color)
{
DrawEllipse(ellipse, sides, offset, color, DefaultDrawDuration, DefaultDepthTest);
DrawEllipse(ellipse, segments, offset, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color and duration.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
/// The duration of the ellipse's visibility, in seconds. If 0 is passed, the ellipse is visible for a single frame.
/// </param>
public static void DrawEllipse(EllipseF ellipse, int sides, in Color color, float duration)
public static void DrawEllipse(EllipseF ellipse, int segments, in Color color, float duration)
{
DrawEllipse(ellipse, sides, Vector2.zero, color, duration, DefaultDepthTest);
DrawEllipse(ellipse, segments, Vector2.zero, color, duration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color and duration.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the ellipse.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
/// The duration of the ellipse's visibility, in seconds. If 0 is passed, the ellipse is visible for a single frame.
/// </param>
public static void DrawEllipse(EllipseF ellipse, int sides, Vector2 offset, in Color color, float duration)
public static void DrawEllipse(EllipseF ellipse, int segments, Vector2 offset, in Color color, float duration)
{
DrawEllipse(ellipse, sides, offset, color, duration, DefaultDepthTest);
DrawEllipse(ellipse, segments, offset, color, duration, DefaultDepthTest);
}
/// <summary>
/// Draws an ellipse with the specified color and duration.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
/// The duration of the ellipse's visibility, in seconds. If 0 is passed, the ellipse is visible for a single frame.
@ -363,16 +363,16 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the ellipse be obscured by objects closer to the camera.
/// </param>
public static void DrawEllipse(EllipseF ellipse, int sides, in Color color, float duration, bool depthTest)
public static void DrawEllipse(EllipseF ellipse, int segments, in Color color, float duration, bool depthTest)
{
DrawEllipse(ellipse, sides, Vector2.zero, color, duration, depthTest);
DrawEllipse(ellipse, segments, Vector2.zero, color, duration, depthTest);
}
/// <summary>
/// Draws an ellipse.
/// </summary>
/// <param name="ellipse">The ellipse to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the ellipse.</param>
/// <param name="color">The color of the ellipse.</param>
/// <param name="duration">
@ -382,16 +382,16 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the ellipse be obscured by objects closer to the camera.
/// </param>
public static void DrawEllipse(EllipseF ellipse, int sides, Vector2 offset, in Color color, float duration, bool depthTest)
public static void DrawEllipse(EllipseF ellipse, int segments, Vector2 offset, in Color color, float duration, bool depthTest)
{
DrawPolygon(CreateEllipse(ellipse.HorizontalRadius, ellipse.VerticalRadius, sides), offset, color, duration, depthTest);
DrawPolygon(CreateEllipse(ellipse.HorizontalRadius, ellipse.VerticalRadius, segments), offset, color, duration,
depthTest);
}
private static PolygonF CreateEllipse(float radiusX, float radiusY, int sides)
private static PolygonF CreateEllipse(float radiusX, float radiusY, int segments)
{
const float max = 2.0f * MathF.PI;
float step = max / sides;
float step = max / segments;
var points = new List<System.Numerics.Vector2>();
for (var theta = 0f; theta < max; theta += step)

View File

@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using X10D.Drawing;
using X10D.Unity.Numerics;
@ -11,10 +11,10 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the sphere.</param>
/// <param name="radius">The radius of the sphere.</param>
/// <param name="sides">The number of sides to generate.</param>
public static void DrawSphere(Vector3 center, float radius, int sides)
/// <param name="segments">The number of segments to generate.</param>
public static void DrawSphere(Vector3 center, float radius, int segments)
{
DrawSphere(center, radius, sides, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawSphere(center, radius, segments, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
@ -22,11 +22,11 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the sphere.</param>
/// <param name="radius">The radius of the sphere.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the sphere.</param>
public static void DrawSphere(Vector3 center, float radius, int sides, in Color color)
public static void DrawSphere(Vector3 center, float radius, int segments, in Color color)
{
DrawSphere(center, radius, sides, color, DefaultDrawDuration, DefaultDepthTest);
DrawSphere(center, radius, segments, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
@ -34,14 +34,14 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the sphere.</param>
/// <param name="radius">The radius of the sphere.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the sphere.</param>
/// <param name="duration">
/// The duration of the sphere's visibility, in seconds. If 0 is passed, the sphere is visible for a single frame.
/// </param>
public static void DrawSphere(Vector3 center, float radius, int sides, in Color color, float duration)
public static void DrawSphere(Vector3 center, float radius, int segments, in Color color, float duration)
{
DrawSphere(center, radius, sides, Vector2.zero, color, duration, DefaultDepthTest);
DrawSphere(center, radius, segments, Vector2.zero, color, duration, DefaultDepthTest);
}
/// <summary>
@ -49,7 +49,7 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the sphere.</param>
/// <param name="radius">The radius of the sphere.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the sphere.</param>
/// <param name="duration">
/// The duration of the sphere's visibility, in seconds. If 0 is passed, the sphere is visible for a single frame.
@ -58,9 +58,9 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the sphere be obscured by objects closer to the camera.
/// </param>
public static void DrawSphere(Vector3 center, float radius, int sides, in Color color, float duration, bool depthTest)
public static void DrawSphere(Vector3 center, float radius, int segments, in Color color, float duration, bool depthTest)
{
DrawSphere(center, radius, sides, Vector2.zero, color, duration, depthTest);
DrawSphere(center, radius, segments, Vector2.zero, color, duration, depthTest);
}
/// <summary>
@ -68,7 +68,7 @@ public static partial class DebugEx
/// </summary>
/// <param name="center">The center point of the sphere.</param>
/// <param name="radius">The radius of the sphere.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the sphere.</param>
/// <param name="color">The color of the sphere.</param>
/// <param name="duration">
@ -78,90 +78,90 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the sphere be obscured by objects closer to the camera.
/// </param>
public static void DrawSphere(Vector3 center, float radius, int sides, Vector2 offset, in Color color, float duration,
public static void DrawSphere(Vector3 center, float radius, int segments, Vector2 offset, in Color color, float duration,
bool depthTest)
{
DrawSphere(new Sphere(center.ToSystemVector(), radius), sides, offset, color, duration, depthTest);
DrawSphere(new Sphere(center.ToSystemVector(), radius), segments, offset, color, duration, depthTest);
}
/// <summary>
/// Draws a sphere with the specified color.
/// </summary>
/// <param name="sphere">The sphere to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
public static void DrawSphere(Sphere sphere, int sides)
/// <param name="segments">The number of segments to generate.</param>
public static void DrawSphere(Sphere sphere, int segments)
{
DrawSphere(sphere, sides, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawSphere(sphere, segments, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a sphere with the specified color.
/// </summary>
/// <param name="sphere">The sphere to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the sphere.</param>
public static void DrawSphere(Sphere sphere, int sides, Vector2 offset)
public static void DrawSphere(Sphere sphere, int segments, Vector2 offset)
{
DrawSphere(sphere, sides, offset, Color.white, DefaultDrawDuration, DefaultDepthTest);
DrawSphere(sphere, segments, offset, Color.white, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a sphere with the specified color.
/// </summary>
/// <param name="sphere">The sphere to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the sphere.</param>
public static void DrawSphere(Sphere sphere, int sides, in Color color)
public static void DrawSphere(Sphere sphere, int segments, in Color color)
{
DrawSphere(sphere, sides, Vector2.zero, color, DefaultDrawDuration, DefaultDepthTest);
DrawSphere(sphere, segments, Vector2.zero, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a sphere with the specified color.
/// </summary>
/// <param name="sphere">The sphere to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the sphere.</param>
/// <param name="color">The color of the sphere.</param>
public static void DrawSphere(Sphere sphere, int sides, Vector2 offset, in Color color)
public static void DrawSphere(Sphere sphere, int segments, Vector2 offset, in Color color)
{
DrawSphere(sphere, sides, offset, color, DefaultDrawDuration, DefaultDepthTest);
DrawSphere(sphere, segments, offset, color, DefaultDrawDuration, DefaultDepthTest);
}
/// <summary>
/// Draws a sphere with the specified color and duration.
/// </summary>
/// <param name="sphere">The sphere to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the sphere.</param>
/// <param name="duration">
/// The duration of the sphere's visibility, in seconds. If 0 is passed, the sphere is visible for a single frame.
/// </param>
public static void DrawSphere(Sphere sphere, int sides, in Color color, float duration)
public static void DrawSphere(Sphere sphere, int segments, in Color color, float duration)
{
DrawSphere(sphere, sides, Vector2.zero, color, duration, DefaultDepthTest);
DrawSphere(sphere, segments, Vector2.zero, color, duration, DefaultDepthTest);
}
/// <summary>
/// Draws a sphere with the specified color and duration.
/// </summary>
/// <param name="sphere">The sphere to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the sphere.</param>
/// <param name="color">The color of the sphere.</param>
/// <param name="duration">
/// The duration of the sphere's visibility, in seconds. If 0 is passed, the sphere is visible for a single frame.
/// </param>
public static void DrawSphere(Sphere sphere, int sides, Vector2 offset, in Color color, float duration)
public static void DrawSphere(Sphere sphere, int segments, Vector2 offset, in Color color, float duration)
{
DrawSphere(sphere, sides, offset, color, duration, DefaultDepthTest);
DrawSphere(sphere, segments, offset, color, duration, DefaultDepthTest);
}
/// <summary>
/// Draws a sphere with the specified color and duration.
/// </summary>
/// <param name="sphere">The sphere to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="color">The color of the sphere.</param>
/// <param name="duration">
/// The duration of the sphere's visibility, in seconds. If 0 is passed, the sphere is visible for a single frame.
@ -170,16 +170,16 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the sphere be obscured by objects closer to the camera.
/// </param>
public static void DrawSphere(Sphere sphere, int sides, in Color color, float duration, bool depthTest)
public static void DrawSphere(Sphere sphere, int segments, in Color color, float duration, bool depthTest)
{
DrawSphere(sphere, sides, Vector2.zero, color, duration, depthTest);
DrawSphere(sphere, segments, Vector2.zero, color, duration, depthTest);
}
/// <summary>
/// Draws a sphere.
/// </summary>
/// <param name="sphere">The sphere to draw.</param>
/// <param name="sides">The number of sides to generate.</param>
/// <param name="segments">The number of segments to generate.</param>
/// <param name="offset">The drawing offset of the sphere.</param>
/// <param name="color">The color of the sphere.</param>
/// <param name="duration">
@ -189,10 +189,10 @@ public static partial class DebugEx
/// <see langword="true" /> if depth test should be applied; otherwise, <see langword="false" />. Passing
/// <see langword="true" /> will have the sphere be obscured by objects closer to the camera.
/// </param>
public static void DrawSphere(Sphere sphere, int sides, in Vector3 offset, in Color color, float duration, bool depthTest)
public static void DrawSphere(Sphere sphere, int segments, in Vector3 offset, in Color color, float duration, bool depthTest)
{
DrawPolyhedron(CreateCircle(sphere.Radius, sides, Vector3.zero), offset, color, duration, depthTest);
DrawPolyhedron(CreateCircle(sphere.Radius, sides, Vector3.left), offset, color, duration, depthTest);
DrawPolyhedron(CreateCircle(sphere.Radius, sides, Vector3.up), offset, color, duration, depthTest);
DrawPolyhedron(CreateCircle(sphere.Radius, segments, Vector3.zero), offset, color, duration, depthTest);
DrawPolyhedron(CreateCircle(sphere.Radius, segments, Vector3.left), offset, color, duration, depthTest);
DrawPolyhedron(CreateCircle(sphere.Radius, segments, Vector3.up), offset, color, duration, depthTest);
}
}