public void SetupQuadTree() { CollisionQuad = new QuadTree(0, new BoundingRectangle(0, 0, Controller.WorldBounds.Width, Controller.WorldBounds.Height)); CollisionSolver = new CollisionSolver(CollisionQuad); }
public CollisionSolver(QuadTree quadTree) { this.Collisions = new List<Collision>(); this.QuadTree = quadTree; }
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; }
public void setupQuadTree() { CollisionQuad = new QuadTree(0, new BoundingRectangle(0, 0, GameManager.WorldBounds.Width, GameManager.WorldBounds.Height)); CollisionSolver = new CollisionSolver(CollisionQuad); }