A game about forced loneliness, made by TACStudios
1using Unity.Collections;
2using Unity.Mathematics;
3using UnityEngine;
4
5namespace UnityEditor.U2D.Animation
6{
7 internal class Triangulator : ITriangulator
8 {
9 public void Triangulate(ref int2[] edges, ref float2[] vertices, out int[] indices)
10 {
11 TriangulationUtility.Triangulate(ref edges, ref vertices, out indices, Allocator.Persistent);
12 }
13
14 public Unity.Jobs.JobHandle ScheduleTriangulate(in float2[] vertices, in int2[] edges, ref NativeArray<float2> outputVertices, ref NativeArray<int> outputIndices, ref NativeArray<int2> outputEdges, ref NativeArray<int4> result)
15 {
16 return TriangulationUtility.ScheduleTriangulate(in vertices, in edges, ref outputVertices, ref outputEdges, ref outputIndices, ref result);
17 }
18
19 public void Tessellate(float minAngle, float maxAngle, float meshAreaFactor, float largestTriangleAreaFactor, float areaThreshold, int smoothIterations, ref float2[] vertices, ref int2[] edges, out int[] indices)
20 {
21 TriangulationUtility.Tessellate(minAngle, maxAngle, meshAreaFactor, largestTriangleAreaFactor, areaThreshold, 10, smoothIterations, ref vertices, ref edges, out indices, Allocator.Persistent);
22 }
23
24 public Unity.Jobs.JobHandle ScheduleTessellate(float minAngle, float maxAngle, float meshAreaFactor, float largestTriangleAreaFactor, float areaThreshold, int smoothIterations, in float2[] vertices, in int2[] edges, ref NativeArray<float2> outputVertices, ref NativeArray<int> outputIndices, ref NativeArray<int2> outputEdges, ref NativeArray<int4> result)
25 {
26 return TriangulationUtility.ScheduleTessellate(minAngle, maxAngle, meshAreaFactor, largestTriangleAreaFactor, areaThreshold, 10, smoothIterations, in vertices, in edges, ref outputVertices, ref outputEdges, ref outputIndices, ref result);
27 }
28 }
29}