Every Unity.Mathematics using, alias and qualified name under Assets\Scripts and tools now names CultMath. The nine `using static ...noise;` lines are gone: snoise lives on CultMath's math. UnityExtensions loses float4.ToColor and Color.ToFloat4, which duplicate the bridge's ToColor and ToCultMath; the float3 colour pair stays because the bridge has none. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
34 lines
637 B
C#
34 lines
637 B
C#
using System;
|
|
using System.Collections;
|
|
using MIConvexHull;
|
|
using CultMath;
|
|
using static CultMath.math;
|
|
|
|
public class Vertex2 : IVertex
|
|
{
|
|
public float[] Position => new[] {StoredPosition.x, StoredPosition.y};
|
|
|
|
public float2 StoredPosition;
|
|
|
|
public float x { get { return StoredPosition.x; } }
|
|
public float y { get { return StoredPosition.y; } }
|
|
|
|
public Vertex2(float x, float y)
|
|
{
|
|
StoredPosition = float2(x, y);
|
|
}
|
|
|
|
public Vertex2(float2 pos)
|
|
{
|
|
StoredPosition = pos;
|
|
}
|
|
|
|
public float2 ToFloat2() {
|
|
return StoredPosition;
|
|
}
|
|
|
|
public float Distance(Vertex2 v)
|
|
{
|
|
return length(StoredPosition-v.StoredPosition);
|
|
}
|
|
}
|