def grid_bounding_box(self): orient = self.meta & 3 if orient != 3 or orient != 1: gbb = AABB(0.125, 0.0, 0.0, 0.875, 1.0, 1.0) else: gbb = AABB(0.0, 0.0, 0.125, 1.0, 1.0, 0.875) return gbb.offset(self.x, self.y, self.z)
def grid_bounding_box(self): att = self.meta & 7 if att == 1: gbb = AABB(0.25, 0.0, 0.25, 0.75, 0.5, 0.75) elif att == 2: gbb = AABB(0.25, 0.25, 0.5, 0.75, 0.75, 1.0) elif att == 3: gbb = AABB(0.25, 0.25, 0.0, 0.75, 0.75, 0.5) elif att == 4: gbb = AABB(0.5, 0.25, 0.25, 1.0, 0.75, 0.75) elif att == 5: gbb = AABB(0.0, 0.25, 0.25, 0.5, 0.75, 0.75) return gbb.offset(self.x, self.y, self.z)
def grid_bounding_box(self): direction = self.get_direction v7 = (self.meta & 12) >> 2 v8 = 4 + v7 * 2 v9 = 5 + v7 * 2 v10 = v8 / 2.0 if direction == 0: gbb = AABB((8.0 - v10) / 16.0, (12.0 - v9) / 16.0, (15.0 - v8) / 16.0, (8.0 + v10) / 16.0, 0.75, 0.9375) elif direction == 1: gbb = AABB(0.0625, (12.0 - v9) / 16.0, (8.0 - v10) / 16.0, (1.0 + v8) / 16.0, 0.75, (8.0 + v10) / 16.0) elif direction == 2: gbb = AABB((8.0 - v10) / 16.0, (12.0 - v9) / 16.0, 0.0625, (8.0 + v10) / 16.0, 0.75, (1.0 + v8) / 16.0) elif direction == 3: gbb = AABB((15.0 - v8) / 16.0, (12.0 - v9) / 16.0, (8.0 - v10) / 16.0, 0.9375, 0.75, (8.0 + v10) / 16.0) else: raise Exception("undefined cocoa bounding box for %s" % direction) return gbb.offset(self.x, self.y, self.z)