Skip to content

Commit

Permalink
Blob Shadows: remove WriteOnly from culling counters, refactor inters…
Browse files Browse the repository at this point in the history
…ection check [#176]
  • Loading branch information
Delt06 committed Dec 8, 2023
1 parent 97a6ca3 commit c369b20
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,14 @@ public void Encapsulate(float2 point)

public static class Bounds2DExtensions
{
private const float IntersectionSizeTolerance = 0.001f;

[BurstCompile]
public static bool Intersects(this in Bounds2D bounds, in Bounds2D otherBounds)
{
float2 intersectionMin = max(bounds.Min, otherBounds.Min);
float2 intersectionMax = min(bounds.Max, otherBounds.Max);
return all(intersectionMax - intersectionMin >= 0.001f);
return all(intersectionMax - intersectionMin >= IntersectionSizeTolerance);
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ public unsafe struct ToonBlobShadowsCullingJob : IJobParallelFor
public NativeArray<CullingGroup> CullingGroups;
[WriteOnly] [NativeDisableParallelForRestriction]
public NativeArray<int> SharedIndices;
[WriteOnly]
public NativeArray<int> SharedCounters;

public Bounds2D ReceiverBounds;
Expand Down

0 comments on commit c369b20

Please sign in to comment.