コード例 #1
0
ファイル: QuadTreeNodes.cs プロジェクト: Awesomewott/GAT315
    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
ファイル: QuadTree.cs プロジェクト: Awesomewott/GAT315
 public override void Query(AABB aabb, List <Body> bodies)
 {
     rootNode.Query(aabb, bodies);
     potientialCollisionCount = potientialCollisionCount + bodies.Count;
 }