示例#1
0
    public void Query(AABB aabb, List <Body> bodies)
    {
        if (!this.aabb.Contains(aabb))
        {
            return;
        }

        if (this.bodies.Count > 0)
        {
            bodies.AddRange(this.bodies);
        }

        left?.Query(aabb, bodies);
        right?.Query(aabb, bodies);
    }
示例#2
0
    public void Query(AABB aabb, List <Body> bodies)
    {
        if (!this.aabb.Contains(aabb))
        {
            return;
        }
        //<if the aabb is not contained in the bvh node aabb>

        if (this.bodies.Count > 0)
        {
            bodies.AddRange(this.bodies);
        }

        //< check if the left / right node below is not null, use ? operator>
        left?.Query(aabb, bodies);
        //< query the left node passing in aabb and bodies >
        right?.Query(aabb, bodies);
        //< query the right node passing in aabb and bodies >
    }
    public void Query(AABB aabb, List <Body> bodies)
    {
        if (!this.aabb.Contains(aabb))
        {
            return;
        }

        if (this.bodies.Count > 0)
        {
            bodies.AddRange(this.bodies);
        }

        left?.Query(aabb, bodies);
        right?.Query(aabb, bodies);

/*< check if the left / right node below is not null, use ? operator>
 *
 *                 < query the left node passing in aabb and bodies >
 *      < query the right node passing in aabb and bodies >*/
    }
 public override void Query(AABB aabb, List <Body> bodies)
 {
     rootNode.Query(aabb, bodies);
     // update the number of potential collisions
     potentialCollisionCount = potentialCollisionCount + bodies.Count;
 }
示例#5
0
 public override void Query(AABB aabb, List <Body> bodies)
 {
     rootNode.Query(aabb, bodies);
     potentialColCount += bodies.Count;
 }
示例#6
0
文件: BVH.cs 项目: Awesomewott/GAT315
 public override void Query(AABB aabb, List <Body> bodies)
 {
     rootNode.Query(aabb, bodies);
     potientialCollisionCount = potientialCollisionCount + bodies.Count;
 }