From df033d257ce3d6a665e879fa27faee40e4bbe7ca Mon Sep 17 00:00:00 2001 From: kleph Date: Wed, 18 May 2016 23:47:37 +0200 Subject: [PATCH] [Fix] Fix split point in BSP --- 02_dynamic_bsp_rooms.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/02_dynamic_bsp_rooms.py b/02_dynamic_bsp_rooms.py index 146a9ab..bd18e34 100644 --- a/02_dynamic_bsp_rooms.py +++ b/02_dynamic_bsp_rooms.py @@ -45,7 +45,7 @@ class Leaf: return False split_point = random.randint(MIN_LEAF_SIZE, self.width - MIN_LEAF_SIZE) self.left_leaf = Leaf(self.x, self.y, split_point, self.height, self.id+1) - self.right_leaf = Leaf(self.x + split_point-1, self.y, self.width - split_point+1, self.height, self.id+2) + self.right_leaf = Leaf(self.x + split_point, self.y, self.width - split_point, self.height, self.id+2) else: # y @@ -53,7 +53,7 @@ class Leaf: return False split_point = random.randint(MIN_LEAF_SIZE, self.height - MIN_LEAF_SIZE) self.left_leaf = Leaf(self.x, self.y, self.width, split_point, self.id+1) - self.right_leaf = Leaf(self.x, self.y + split_point-1, self.width, self.height - split_point+1, self.id+2) + self.right_leaf = Leaf(self.x, self.y + split_point, self.width, self.height - split_point, self.id+2) return True