From 6d5f1cd3f1fb6a69c562ef2e89bcd54e57f8639b Mon Sep 17 00:00:00 2001 From: Tyler Date: Mon, 26 Sep 2022 23:50:30 -0500 Subject: [PATCH] Fix CollisionLayer DistanceBetween bugs and make more jobs BurstSchedulable DistanceBetween using CollisionLayer didn't inflate the initial AABB collider. And none of the variants accounted for negative maxDistance values. This is all fixed now. In addition, I did a project-wide search to find more instances of IJob, IJobFor, and IJobParallelFor and switched them to their BurstSchedulable counterparts. I'm likely going to have to undo that when 1.0 drops, but whatevs. That's the least of my 1.0 concerns. --- .../Core/Containers/DestroyCommandBuffer.cs | 2 +- .../Core/Containers/DisableCommandBuffer.cs | 2 +- .../Core/Containers/EnableCommandBuffer.cs | 2 +- .../EntityOperationCommandBuffer.cs | 4 +- .../Containers/InstantiateCommandBuffer.cs | 2 +- .../Containers/UnsafeParallelBlockList.cs | 2 +- .../InstantiateCommandBufferUntyped.cs | 12 +++-- .../Physics/Debug/PhysicsDebug.DrawLayer.cs | 32 +++++++++---- .../Debug/PhysicsDebug.LogFindPairsStats.cs | 2 +- .../Internal/Queries/FindObjectsInternal.cs | 2 +- .../Internal/Queries/FindPairsInternal.cs | 36 +++++++-------- .../Queries/Physics.DistanceBetween.cs | 46 +++++++++++-------- .../Spatial/Queries/Physics.FindPairs.cs | 8 ++-- 13 files changed, 90 insertions(+), 62 deletions(-) diff --git a/Packages/com.latios.latios-framework/Core/Core/Containers/DestroyCommandBuffer.cs b/Packages/com.latios.latios-framework/Core/Core/Containers/DestroyCommandBuffer.cs index 35b17ac..4e3f410 100644 --- a/Packages/com.latios.latios-framework/Core/Core/Containers/DestroyCommandBuffer.cs +++ b/Packages/com.latios.latios-framework/Core/Core/Containers/DestroyCommandBuffer.cs @@ -121,7 +121,7 @@ private unsafe void RunPrepInJob(ref bool ran, ref NativeList entities) } [BurstCompile] - private struct PrepJob : IJob + private struct PrepJob : IJobBurstSchedulable { [ReadOnly] public EntityOperationCommandBuffer eocb; public NativeList entities; diff --git a/Packages/com.latios.latios-framework/Core/Core/Containers/DisableCommandBuffer.cs b/Packages/com.latios.latios-framework/Core/Core/Containers/DisableCommandBuffer.cs index 9631c6c..801742e 100644 --- a/Packages/com.latios.latios-framework/Core/Core/Containers/DisableCommandBuffer.cs +++ b/Packages/com.latios.latios-framework/Core/Core/Containers/DisableCommandBuffer.cs @@ -121,7 +121,7 @@ private void RunPrepInJob(BufferFromEntity linkedFE, ref bool } [BurstCompile] - private struct PrepJob : IJob + private struct PrepJob : IJobBurstSchedulable { [ReadOnly] public BufferFromEntity linkedFE; [ReadOnly] public EntityOperationCommandBuffer eocb; diff --git a/Packages/com.latios.latios-framework/Core/Core/Containers/EnableCommandBuffer.cs b/Packages/com.latios.latios-framework/Core/Core/Containers/EnableCommandBuffer.cs index 1ea93fe..394840a 100644 --- a/Packages/com.latios.latios-framework/Core/Core/Containers/EnableCommandBuffer.cs +++ b/Packages/com.latios.latios-framework/Core/Core/Containers/EnableCommandBuffer.cs @@ -121,7 +121,7 @@ private void RunPrepInJob(BufferFromEntity linkedFE, ref bool } [BurstCompile] - private struct PrepJob : IJob + private struct PrepJob : IJobBurstSchedulable { [ReadOnly] public BufferFromEntity linkedFE; [ReadOnly] public EntityOperationCommandBuffer eocb; diff --git a/Packages/com.latios.latios-framework/Core/Core/Containers/EntityOperationCommandBuffer.cs b/Packages/com.latios.latios-framework/Core/Core/Containers/EntityOperationCommandBuffer.cs index 7f3e304..13a3e04 100644 --- a/Packages/com.latios.latios-framework/Core/Core/Containers/EntityOperationCommandBuffer.cs +++ b/Packages/com.latios.latios-framework/Core/Core/Containers/EntityOperationCommandBuffer.cs @@ -91,7 +91,7 @@ internal EntityOperationCommandBuffer(AllocatorManager.AllocatorHandle allocator } [BurstCompile] - private struct DisposeJob : IJob + private struct DisposeJob : IJobBurstSchedulable { [NativeDisableUnsafePtrRestriction] public State* state; @@ -461,3 +461,5 @@ void CheckWriteAccess() + + diff --git a/Packages/com.latios.latios-framework/Core/Core/Containers/InstantiateCommandBuffer.cs b/Packages/com.latios.latios-framework/Core/Core/Containers/InstantiateCommandBuffer.cs index 2784698..6accd3a 100644 --- a/Packages/com.latios.latios-framework/Core/Core/Containers/InstantiateCommandBuffer.cs +++ b/Packages/com.latios.latios-framework/Core/Core/Containers/InstantiateCommandBuffer.cs @@ -103,7 +103,7 @@ void CheckDidNotPlayback() #region PlaybackJobs [BurstCompile] - private struct PlaybackJob : IJob + private struct PlaybackJob : IJobBurstSchedulable { [ReadOnly] public EntityOperationCommandBuffer eocb; public ExclusiveEntityTransaction eet; diff --git a/Packages/com.latios.latios-framework/Core/Core/Containers/UnsafeParallelBlockList.cs b/Packages/com.latios.latios-framework/Core/Core/Containers/UnsafeParallelBlockList.cs index 0152c00..0e96c65 100644 --- a/Packages/com.latios.latios-framework/Core/Core/Containers/UnsafeParallelBlockList.cs +++ b/Packages/com.latios.latios-framework/Core/Core/Containers/UnsafeParallelBlockList.cs @@ -228,7 +228,7 @@ void CheckBlockCountMatchesCount(int count, int blockCount) } [BurstCompile] - struct DisposeJob : IJob + struct DisposeJob : IJobBurstSchedulable { public UnsafeParallelBlockList upbl; diff --git a/Packages/com.latios.latios-framework/Core/Core/Internal/InstantiateCommandBufferUntyped.cs b/Packages/com.latios.latios-framework/Core/Core/Internal/InstantiateCommandBufferUntyped.cs index 1e6ed53..8e9654f 100644 --- a/Packages/com.latios.latios-framework/Core/Core/Internal/InstantiateCommandBufferUntyped.cs +++ b/Packages/com.latios.latios-framework/Core/Core/Internal/InstantiateCommandBufferUntyped.cs @@ -106,7 +106,7 @@ internal InstantiateCommandBufferUntyped(AllocatorManager.AllocatorHandle alloca } [BurstCompile] - private struct DisposeJob : IJob + private struct DisposeJob : IJobBurstSchedulable { [NativeDisableUnsafePtrRestriction] public State* state; @@ -356,7 +356,7 @@ public ParallelWriter AsParallelWriter() #region Implementation [BurstCompile] - private struct InstantiateAndBuildListsJob : IJob + private struct InstantiateAndBuildListsJob : IJobBurstSchedulable { [ReadOnly] public InstantiateCommandBufferUntyped icb; //public ExclusiveEntityTransaction eet; @@ -486,7 +486,7 @@ void TryRun(ref bool ran) } [BurstCompile] - private struct WriteComponentDataJob : IJobFor + private struct WriteComponentDataJob : IJobParallelForBurstSchedulable { [ReadOnly] public InstantiateCommandBufferUntyped icb; [ReadOnly] public NativeArray chunks; @@ -877,3 +877,9 @@ void CheckHasNotPlayedBack() + + + + + + diff --git a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Debug/PhysicsDebug.DrawLayer.cs b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Debug/PhysicsDebug.DrawLayer.cs index 05c5b64..0bde053 100644 --- a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Debug/PhysicsDebug.DrawLayer.cs +++ b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Debug/PhysicsDebug.DrawLayer.cs @@ -86,7 +86,7 @@ public JobHandle ScheduleSingle(JobHandle inputDeps = default) layer = layer, colors = colors, crossColor = crossColor - }.Schedule(layer.BucketCount, inputDeps); + }.Schedule(inputDeps); } /// @@ -101,7 +101,7 @@ public JobHandle ScheduleParallel(JobHandle inputDeps = default) layer = layer, colors = colors, crossColor = crossColor - }.ScheduleParallel(layer.BucketCount, 1, inputDeps); + }.Schedule(layer.BucketCount, 1, inputDeps); } } @@ -281,10 +281,10 @@ public JobHandle ScheduleSingle(JobHandle inputDeps = default) missColor = missColor, drawMisses = drawMisses }; - jh = job.Schedule(layerA.Count, jh); + jh = job.Schedule(jh); job.hitArray = hitArrayB; job.layer = layerB; - jh = job.Schedule(layerB.Count, jh); + jh = job.Schedule(jh); jh = hitArrayA.Dispose(jh); return hitArrayB.Dispose(jh); } @@ -300,7 +300,7 @@ public JobHandle ScheduleSingle(JobHandle inputDeps = default) hitColor = hitColor, missColor = missColor, drawMisses = drawMisses - }.Schedule(layerA.Count, jh); + }.Schedule(jh); return hitArray.Dispose(jh); } } @@ -326,10 +326,10 @@ public JobHandle ScheduleParallel(JobHandle inputDeps = default) missColor = missColor, drawMisses = drawMisses }; - jh = job.ScheduleParallel(layerA.Count, 64, jh); + jh = job.Schedule(layerA.Count, 64, jh); job.hitArray = hitArrayB; job.layer = layerB; - jh = job.ScheduleParallel(layerB.Count, 64, jh); + jh = job.Schedule(layerB.Count, 64, jh); jh = hitArrayA.Dispose(jh); return hitArrayB.Dispose(jh); } @@ -345,7 +345,7 @@ public JobHandle ScheduleParallel(JobHandle inputDeps = default) hitColor = hitColor, missColor = missColor, drawMisses = drawMisses - }.ScheduleParallel(layerA.Count, 64, jh); + }.Schedule(layerA.Count, 64, jh); return hitArray.Dispose(jh); } } @@ -385,12 +385,18 @@ public static void DrawAabb(Aabb aabb, Color color) #region DrawLayerUtils [BurstCompile] - private struct DebugDrawLayerJob : IJobFor + private struct DebugDrawLayerJob : IJobBurstSchedulable, IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layer; public FixedList512Bytes colors; public Color crossColor; + public void Execute() + { + for (int i = 0; i < layer.BucketCount; i++) + Execute(i); + } + public void Execute(int index) { if (index < layer.BucketCount - 1) @@ -442,7 +448,7 @@ public void Execute(in FindPairsResult result) } [BurstCompile] - private struct DebugFindPairsDrawJob : IJobFor + private struct DebugFindPairsDrawJob : IJobBurstSchedulable, IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layer; [ReadOnly] public NativeBitArray hitArray; @@ -450,6 +456,12 @@ private struct DebugFindPairsDrawJob : IJobFor public Color missColor; public bool drawMisses; + public void Execute() + { + for (int i = 0; i < layer.Count; i++) + Execute(i); + } + public void Execute(int i) { float3 min = new float3(layer.xmins[i], layer.yzminmaxs[i].xy); diff --git a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Debug/PhysicsDebug.LogFindPairsStats.cs b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Debug/PhysicsDebug.LogFindPairsStats.cs index 413c66c..557013a 100644 --- a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Debug/PhysicsDebug.LogFindPairsStats.cs +++ b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Debug/PhysicsDebug.LogFindPairsStats.cs @@ -90,7 +90,7 @@ internal static JobHandle LogFindPairsStats(CollisionLayer layerA, } [BurstCompile] - struct LogBucketCountsForLayerJob : IJob + struct LogBucketCountsForLayerJob : IJobBurstSchedulable { [ReadOnly] public CollisionLayer layer; public FixedString128Bytes layerName; diff --git a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Internal/Queries/FindObjectsInternal.cs b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Internal/Queries/FindObjectsInternal.cs index fd681dc..8267564 100644 --- a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Internal/Queries/FindObjectsInternal.cs +++ b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Internal/Queries/FindObjectsInternal.cs @@ -16,7 +16,7 @@ internal static class FindObjectsInternal { #region Jobs [BurstCompile] - public struct Single : IJob + public struct Single : IJobBurstSchedulable { [ReadOnly] public CollisionLayer layer; public T processor; diff --git a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Internal/Queries/FindPairsInternal.cs b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Internal/Queries/FindPairsInternal.cs index 60586e8..4655698 100644 --- a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Internal/Queries/FindPairsInternal.cs +++ b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Internal/Queries/FindPairsInternal.cs @@ -16,7 +16,7 @@ internal static class FindPairsInternal { #region Jobs [BurstCompile] - public struct LayerSelfSingle : IJob + public struct LayerSelfSingle : IJobBurstSchedulable { [ReadOnly] public CollisionLayer layer; public T processor; @@ -28,7 +28,7 @@ public void Execute() } [BurstCompile] - public struct LayerSelfPart1 : IJobParallelFor + public struct LayerSelfPart1 : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layer; public T processor; @@ -41,7 +41,7 @@ public void Execute(int index) } [BurstCompile] - public struct LayerSelfPart2 : IJob + public struct LayerSelfPart2 : IJobBurstSchedulable { [ReadOnly] public CollisionLayer layer; public T processor; @@ -58,7 +58,7 @@ public void Execute() } [BurstCompile] - public struct LayerSelfParallelUnsafe : IJobFor + public struct LayerSelfParallelUnsafe : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layer; public T processor; @@ -105,7 +105,7 @@ public static void RunImmediate(CollisionLayer layer, T processor) #if ENABLE_UNITY_COLLECTIONS_CHECKS // Scheudle for 2 iterations [BurstCompile] - public struct LayerSelfPart2_WithSafety : IJobFor + public struct LayerSelfPart2_WithSafety : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layer; public T processor; @@ -156,7 +156,7 @@ internal static class FindPairsInternal // Schedule for (2 * layer.BucketCount - 1) iterations [BurstCompile] - public struct LayerSelfPart1 : IJobParallelFor, IFindPairsProcessor + public struct LayerSelfPart1 : IJobParallelForBurstSchedulable, IFindPairsProcessor { [ReadOnly] public CollisionLayer layer; public T processor; @@ -188,7 +188,7 @@ public void Execute(in FindPairsResult result) } [BurstCompile] - public struct LayerSelfPart2 : IJob + public struct LayerSelfPart2 : IJobBurstSchedulable { [ReadOnly] public CollisionLayer layer; public T processor; @@ -220,7 +220,7 @@ public void Execute() // Schedule for 2 iterations [BurstCompile] - public struct LayerSelfPart2_WithSafety : IJobFor + public struct LayerSelfPart2_WithSafety : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layer; public T processor; @@ -277,7 +277,7 @@ internal static class FindPairsInternal { #region Jobs [BurstCompile] - public struct LayerLayerSingle : IJob + public struct LayerLayerSingle : IJobBurstSchedulable { [ReadOnly] public CollisionLayer layerA; [ReadOnly] public CollisionLayer layerB; @@ -290,7 +290,7 @@ public void Execute() } [BurstCompile] - public struct LayerLayerPart1 : IJobParallelFor + public struct LayerLayerPart1 : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layerA; [ReadOnly] public CollisionLayer layerB; @@ -306,7 +306,7 @@ public void Execute(int index) // Schedule for 2 iterations [BurstCompile] - public struct LayerLayerPart2 : IJobParallelFor + public struct LayerLayerPart2 : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layerA; [ReadOnly] public CollisionLayer layerB; @@ -337,7 +337,7 @@ public void Execute(int index) // Schedule for (3 * layer.BucketCount - 2) iterations [BurstCompile] - public struct LayerLayerParallelUnsafe : IJobFor + public struct LayerLayerParallelUnsafe : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layerA; [ReadOnly] public CollisionLayer layerB; @@ -404,7 +404,7 @@ public static void RunImmediate(CollisionLayer layerA, CollisionLayer layerB, T // Schedule for 3 iterations [BurstCompile] - public struct LayerLayerPart2_WithSafety : IJobParallelFor + public struct LayerLayerPart2_WithSafety : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layerA; [ReadOnly] public CollisionLayer layerB; @@ -479,7 +479,7 @@ internal static class FindPairsInternal // Schedule for (3 * layer.BucketCount - 2) iterations [BurstCompile] - public struct LayerLayerPart1 : IJobParallelFor, IFindPairsProcessor + public struct LayerLayerPart1 : IJobParallelForBurstSchedulable, IFindPairsProcessor { [ReadOnly] public CollisionLayer layerA; [ReadOnly] public CollisionLayer layerB; @@ -524,7 +524,7 @@ public void Execute(in FindPairsResult result) // Schedule for 2 iterations [BurstCompile] - public struct LayerLayerPart2 : IJobParallelFor + public struct LayerLayerPart2 : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layerA; [ReadOnly] public CollisionLayer layerB; @@ -673,7 +673,7 @@ public void Execute() } [BurstCompile] - public struct LayerSelfPart1 : IJobParallelFor + public struct LayerSelfPart1 : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layer; public T processor; @@ -833,7 +833,7 @@ public void Execute() } [BurstCompile] - public struct LayerLayerPart1 : IJobParallelFor + public struct LayerLayerPart1 : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layerA; [ReadOnly] public CollisionLayer layerB; @@ -853,7 +853,7 @@ public void Execute(int index) } [BurstCompile] - public struct LayerLayerPart2 : IJobParallelFor + public struct LayerLayerPart2 : IJobParallelForBurstSchedulable { [ReadOnly] public CollisionLayer layerA; [ReadOnly] public CollisionLayer layerB; diff --git a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Spatial/Queries/Physics.DistanceBetween.cs b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Spatial/Queries/Physics.DistanceBetween.cs index 4e76b28..effac54 100644 --- a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Spatial/Queries/Physics.DistanceBetween.cs +++ b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Spatial/Queries/Physics.DistanceBetween.cs @@ -577,6 +577,7 @@ public static bool DistanceBetween(in CompoundCollider compoundA, in RigidTransf #endregion + #region Layer public static bool DistanceBetween(Collider collider, RigidTransform transform, CollisionLayer layer, @@ -584,10 +585,14 @@ public static bool DistanceBetween(Collider collider, out ColliderDistanceResult result, out LayerBodyInfo layerBodyInfo) { - result = default; - layerBodyInfo = default; - var processor = new LayerQueryProcessors.ColliderDistanceClosestImmediateProcessor(collider, transform, maxDistance, ref result, ref layerBodyInfo); - FindObjects(AabbFrom(in collider, in transform), layer, processor).RunImmediate(); + result = default; + layerBodyInfo = default; + var processor = new LayerQueryProcessors.ColliderDistanceClosestImmediateProcessor(collider, transform, maxDistance, ref result, ref layerBodyInfo); + var aabb = AabbFrom(in collider, in transform); + var offsetDistance = math.max(maxDistance, 0f); + aabb.min -= offsetDistance; + aabb.max += offsetDistance; + FindObjects(aabb, layer, processor).RunImmediate(); var hit = result.subColliderIndexB >= 0; result.subColliderIndexB = math.max(result.subColliderIndexB, 0); return hit; @@ -600,17 +605,18 @@ public static bool DistanceBetweenAny(Collider collider, out ColliderDistanceResult result, out LayerBodyInfo layerBodyInfo) { - result = default; - layerBodyInfo = default; - var processor = new LayerQueryProcessors.ColliderDistanceAnyImmediateProcessor(collider, transform, maxDistance, ref result, ref layerBodyInfo); - FindObjects(AabbFrom(in collider, in transform), layer, processor).RunImmediate(); + result = default; + layerBodyInfo = default; + var processor = new LayerQueryProcessors.ColliderDistanceAnyImmediateProcessor(collider, transform, maxDistance, ref result, ref layerBodyInfo); + var aabb = AabbFrom(in collider, in transform); + var offsetDistance = math.max(maxDistance, 0f); + aabb.min -= offsetDistance; + aabb.max += offsetDistance; + FindObjects(aabb, layer, processor).RunImmediate(); var hit = result.subColliderIndexB >= 0; result.subColliderIndexB = math.max(result.subColliderIndexB, 0); return hit; } - - #region Layer - #endregion private static ColliderDistanceResult FlipResult(in ColliderDistanceResult resultToFlip) @@ -749,10 +755,11 @@ public static bool DistanceBetween(float3 point, in CompoundCollider compound, i public static bool DistanceBetween(float3 point, in CollisionLayer layer, float maxDistance, out PointDistanceResult result, out LayerBodyInfo layerBodyInfo) { - result = default; - layerBodyInfo = default; - var processor = new LayerQueryProcessors.PointDistanceClosestImmediateProcessor(point, maxDistance, ref result, ref layerBodyInfo); - FindObjects(AabbFrom(point - maxDistance, point + maxDistance), layer, processor).RunImmediate(); + result = default; + layerBodyInfo = default; + var processor = new LayerQueryProcessors.PointDistanceClosestImmediateProcessor(point, maxDistance, ref result, ref layerBodyInfo); + var offsetDistance = math.max(maxDistance, 0f); + FindObjects(AabbFrom(point - offsetDistance, point + offsetDistance), layer, processor).RunImmediate(); var hit = result.subColliderIndex >= 0; result.subColliderIndex = math.max(result.subColliderIndex, 0); return hit; @@ -760,10 +767,11 @@ public static bool DistanceBetween(float3 point, in CollisionLayer layer, float public static bool DistanceBetweenAny(float3 point, in CollisionLayer layer, float maxDistance, out PointDistanceResult result, out LayerBodyInfo layerBodyInfo) { - result = default; - layerBodyInfo = default; - var processor = new LayerQueryProcessors.PointDistanceAnyImmediateProcessor(point, maxDistance, ref result, ref layerBodyInfo); - FindObjects(AabbFrom(point - maxDistance, point + maxDistance), layer, processor).RunImmediate(); + result = default; + layerBodyInfo = default; + var processor = new LayerQueryProcessors.PointDistanceAnyImmediateProcessor(point, maxDistance, ref result, ref layerBodyInfo); + var offsetDistance = math.max(maxDistance, 0f); + FindObjects(AabbFrom(point - offsetDistance, point + offsetDistance), layer, processor).RunImmediate(); var hit = result.subColliderIndex >= 0; result.subColliderIndex = math.max(result.subColliderIndex, 0); return hit; diff --git a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Spatial/Queries/Physics.FindPairs.cs b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Spatial/Queries/Physics.FindPairs.cs index cf3f7e0..dc39c0a 100644 --- a/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Spatial/Queries/Physics.FindPairs.cs +++ b/Packages/com.latios.latios-framework/PsyshockPhysics/Physics/Spatial/Queries/Physics.FindPairs.cs @@ -307,7 +307,7 @@ public JobHandle ScheduleParallel(JobHandle inputDeps = default) { layer = layer, processor = processor - }.ScheduleParallel(2, 1, jh); + }.Schedule(2, 1, jh); } #else jh = new FindPairsInternal.LayerSelfPart2 @@ -330,7 +330,7 @@ public JobHandle ScheduleParallelUnsafe(JobHandle inputDeps = default) { layer = layer, processor = processor - }.ScheduleParallel(2 * layer.BucketCount - 1, 1, inputDeps); + }.Schedule(2 * layer.BucketCount - 1, 1, inputDeps); } #endregion Schedulers } @@ -388,7 +388,7 @@ public JobHandle ScheduleParallel(JobHandle inputDeps = default) layer = layer, processor = processor, cache = cache.AsReader() - }.ScheduleParallel(2, 1, jh); + }.Schedule(2, 1, jh); } #else jh = new FindPairsInternal.LayerSelfPart2 @@ -533,7 +533,7 @@ public JobHandle ScheduleParallelUnsafe(JobHandle inputDeps = default) layerA = layerA, layerB = layerB, processor = processor - }.ScheduleParallel(3 * layerA.BucketCount - 2, 1, inputDeps); + }.Schedule(3 * layerA.BucketCount - 2, 1, inputDeps); } #endregion Schedulers }