using System.Collections.Generic; using System.Runtime.CompilerServices; using Robust.Shared.Maths; using Robust.Shared.Physics.Dynamics; namespace Robust.Shared.Physics { public interface IBroadPhase { void UpdatePairs(BroadPhaseDelegate callback); bool TestOverlap(DynamicTree.Proxy proxyA, DynamicTree.Proxy proxyB); DynamicTree.Proxy AddProxy(ref FixtureProxy proxy); void MoveProxy(DynamicTree.Proxy proxyId, in Box2 aabb, Vector2 displacement); void RemoveProxy(DynamicTree.Proxy proxy); void TouchProxy(DynamicTree.Proxy proxy); void QueryAABB(DynamicTree.QueryCallbackDelegate callback, Box2 aabb, bool approx = false); void QueryAabb( ref TState state, DynamicTree.QueryCallbackDelegate callback, Box2 aabb, bool approx = false); IEnumerable QueryAabb(Box2 aabb, bool approx = false); void QueryPoint(DynamicTree.QueryCallbackDelegate callback, Vector2 point, bool approx = false); void QueryPoint( ref TState state, DynamicTree.QueryCallbackDelegate callback, Vector2 point, bool approx = false); IEnumerable QueryPoint(Vector2 point, bool approx = false); void QueryRay( DynamicTree.RayQueryCallbackDelegate callback, in Ray ray, bool approx = false); void QueryRay( ref TState state, DynamicTree.RayQueryCallbackDelegate callback, in Ray ray, bool approx = false); } public interface IBroadPhase : ICollection where T : notnull { int Capacity { get; } int Height { [MethodImpl(MethodImplOptions.AggressiveInlining)] get; } int MaxBalance { [MethodImpl(MethodImplOptions.AggressiveOptimization | MethodImplOptions.NoInlining)] get; } float AreaRatio { [MethodImpl(MethodImplOptions.AggressiveOptimization | MethodImplOptions.NoInlining)] get; } bool Add(in T item, Box2? newAABB = null); bool Remove(in T item); bool Update(in T item, Box2? newAABB = null); void QueryAabb( DynamicTree.QueryCallbackDelegate callback, Box2 aabb, bool approx = false); void QueryAabb( ref TState state, DynamicTree.QueryCallbackDelegate callback, Box2 aabb, bool approx = false); IEnumerable QueryAabb(Box2 aabb, bool approx = false); void QueryPoint(DynamicTree.QueryCallbackDelegate callback, Vector2 point, bool approx = false); void QueryPoint( ref TState state, DynamicTree.QueryCallbackDelegate callback, Vector2 point, bool approx = false); IEnumerable QueryPoint(Vector2 point, bool approx = false); void QueryRay( DynamicTree.RayQueryCallbackDelegate callback, in Ray ray, bool approx = false); void QueryRay( ref TState state, DynamicTree.RayQueryCallbackDelegate callback, in Ray ray, bool approx = false); } }