示例#1
0
 public void SetupQuadTree()
 {
     CollisionQuad = new QuadTree(0, new BoundingRectangle(0, 0, Controller.WorldBounds.Width, Controller.WorldBounds.Height));
     CollisionSolver = new CollisionSolver(CollisionQuad);
 }
示例#2
0
 public CollisionSolver(QuadTree quadTree)
 {
     this.Collisions = new List<Collision>();
     this.QuadTree = quadTree;
 }
示例#3
0
        private void split()
        {
            float subWidth = bounds.Width / 2;
            float subHeight = bounds.Height / 2;

            nodes[0] = new QuadTree(level + 1, new BoundingRectangle(bounds.X, bounds.Y, subWidth, subHeight));
            nodes[1] = new QuadTree(level + 1, new BoundingRectangle(bounds.X + subWidth, bounds.Y, subWidth, subHeight));
            nodes[2] = new QuadTree(level + 1, new BoundingRectangle(bounds.X + subWidth, bounds.Y + subHeight, subWidth, subHeight));
            nodes[3] = new QuadTree(level + 1, new BoundingRectangle(bounds.X, bounds.Y + subHeight, subWidth, subHeight));
        }
 public CollisionSolver(QuadTree quadTree)
 {
     this.Collisions = new List <Collision>();
     this.QuadTree   = quadTree;
 }
示例#5
0
 public void setupQuadTree()
 {
     CollisionQuad = new QuadTree(0, new BoundingRectangle(0, 0, GameManager.WorldBounds.Width, GameManager.WorldBounds.Height));
     CollisionSolver = new CollisionSolver(CollisionQuad);
 }