Beispiel #1
0
 public void Check(IColliderProvider scene, HashSet <(ICollider, ICollider)> collidingSet)
 public CollisionDetection(IColliderProvider scene)
 {
     this.scene = scene;
     Update();
 }
Beispiel #3
0
        public static HashSet <(ICollider, ICollider)> FindAllCollisions(this CollisionGrid <ICollider> collisionGrid, IColliderProvider scene)
        {
            var result = new HashSet <(ICollider, ICollider)>();

            collisionGrid.Clear();
            foreach (var collider in scene.Collider)
            {
                collisionGrid.Add(collider);
            }
            collisionGrid.FindAllCollisions((c1, c2) => CollisionDetection.ExactCollision(result, c1, c2));
            return(result);
        }