Class RangeShape
- Namespace
- TDMaker.Unity.Authoring
- Assembly
- TDMaker.Unity.dll
The single source of the range ellipse used by every view, gizmo and editor preview. It matches the simulation
(Simulation.RangeDistanceSquared): a point is inside when dx²/r² + dy²/(k·r)² ≤ 1 (boundary included),
with k = range Y scale. The horizontal semi-axis is r and the vertical semi-axis is k·r,
so k < 1 flattens the ellipse vertically (an oblique top-down look).
public static class RangeShape
- Inheritance
-
RangeShape
- Inherited Members
Fields
DefaultYScale
Default range Y scale used by samples and fallbacks.
public const float DefaultYScale = 0.8
Field Value
Methods
Contains(Vector2, Vector2, float, float)
Whether point lies inside (or on) the range ellipse around center.
public static bool Contains(Vector2 center, Vector2 point, float range, float yScale)
Parameters
Returns
DistanceSquared(Vector2, Vector2, float)
Elliptical distance squared in horizontal units, equal to the simulation's range metric.
public static float DistanceSquared(Vector2 center, Vector2 point, float yScale)
Parameters
centerVector2pointVector2yScalefloat
Returns
Point(Vector2, float, float, float)
A point on the ellipse outline at angle radians.
public static Vector2 Point(Vector2 center, float range, float yScale, float angle)
Parameters
Returns
- Vector2
SemiAxes(float, float)
Horizontal (x) and vertical (y) semi-axes of a range ellipse: (r, k·r).
public static Vector2 SemiAxes(float range, float yScale)
Parameters
Returns
- Vector2
SpriteScale(float, float)
Local scale for a 1-unit sprite (circle or ring) so it covers the ellipse of radius range.
public static Vector3 SpriteScale(float range, float yScale)
Parameters
Returns
- Vector3