Няма описание
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1234567891011121314151617181920212223242526272829
  1. using Unity.Collections;
  2. using Unity.Mathematics;
  3. using UnityEngine;
  4. namespace UnityEditor.U2D.Animation
  5. {
  6. internal class Triangulator : ITriangulator
  7. {
  8. public void Triangulate(ref int2[] edges, ref float2[] vertices, out int[] indices)
  9. {
  10. TriangulationUtility.Triangulate(ref edges, ref vertices, out indices, Allocator.Persistent);
  11. }
  12. 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)
  13. {
  14. return TriangulationUtility.ScheduleTriangulate(in vertices, in edges, ref outputVertices, ref outputEdges, ref outputIndices, ref result);
  15. }
  16. public void Tessellate(float minAngle, float maxAngle, float meshAreaFactor, float largestTriangleAreaFactor, float areaThreshold, int smoothIterations, ref float2[] vertices, ref int2[] edges, out int[] indices)
  17. {
  18. TriangulationUtility.Tessellate(minAngle, maxAngle, meshAreaFactor, largestTriangleAreaFactor, areaThreshold, 10, smoothIterations, ref vertices, ref edges, out indices, Allocator.Persistent);
  19. }
  20. 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)
  21. {
  22. return TriangulationUtility.ScheduleTessellate(minAngle, maxAngle, meshAreaFactor, largestTriangleAreaFactor, areaThreshold, 10, smoothIterations, in vertices, in edges, ref outputVertices, ref outputEdges, ref outputIndices, ref result);
  23. }
  24. }
  25. }