Пример #1
0
    public void Query(AABB aabb, List <Body> bodies)
    {
        if (!this.aABB.Contains(aabb))
        {
            return;
        }

        bodies.AddRange(this.bodies.Where(body => body.shape.aABB.Contains(aabb)));

        if (subDivided)
        {
            northeast.Query(aabb, bodies);
            northwest.Query(aabb, bodies);
            southeast.Query(aabb, bodies);
            southwest.Query(aabb, bodies);
        }
    }
Пример #2
0
 public override void Query(AABB aabb, List <Body> bodies)
 {
     rootNode.Query(aabb, bodies);
     potientialCollisionCount = potientialCollisionCount + bodies.Count;
 }