diff --git a/src/precomp/skybox.py b/src/precomp/skybox.py index 19ee94431..4f14b4294 100644 --- a/src/precomp/skybox.py +++ b/src/precomp/skybox.py @@ -7,17 +7,34 @@ LOGGER = srctools.logger.get_logger(__name__) -def generate(vmf : VMF, coll): - # Generate our walls +EX_SIZE_MAX = Vec(8832, 8832, 8832) +EX_SIZE_MIN = Vec(5632, 5632, 5632) + +def make_skybox(vmf : VMF, coll): if not precomp.options.get(bool, 'extend_chamber'): return None - size_max = Vec(8832, 8832, 8832) + # Make the box that contains the map + make_skybox_shell(vmf) + + # Move Elevators to valid location if possible and then generate elevator shell + + # Open Walls and add square beams + + # Add exterior decoration + +def make_skybox_shell(vmf : VMF): + # Generate our walls size_pad = Vec(2048, 2048, 128) + pos_min,pos_max = Vec.bbox(POS.min, POS.max) bbox_origin = (POS.min + POS.max) / 2 - bbox_lower = min(-(size_max/2), (POS.min - bbox_origin) - size_pad) + bbox_origin - bbox_upper = min(size_max/2, (POS.max - bbox_origin) + size_pad) + bbox_origin + bbox_lower, bbox_upper = Vec.bbox( + -max(EX_SIZE_MIN / 2, min(EX_SIZE_MAX / 2, -(pos_min - bbox_origin) + size_pad)), + max(EX_SIZE_MIN / 2, min(EX_SIZE_MAX / 2, (pos_max - bbox_origin) + size_pad)) + ) + + for solid in vmf.make_hollow(bbox_lower + bbox_origin, bbox_upper + bbox_origin, 16, consts.Tools.NODRAW, consts.Tools.BLACK): + vmf.add_brush(solid) - for solid in vmf.make_hollow(bbox_lower, bbox_upper, 16, consts.Tools.NODRAW, consts.Tools.BLACK): - vmf.add_brush(solid) \ No newline at end of file + # vmf.add_brush(vmf.make_prism(pos_min, pos_max, consts.Tools.SKIP).solid) \ No newline at end of file diff --git a/src/vbsp.py b/src/vbsp.py index 4e8faec4b..76e5c590f 100644 --- a/src/vbsp.py +++ b/src/vbsp.py @@ -1668,7 +1668,7 @@ async def main() -> None: conditions.check_all(vmf, coll, info) add_extra_ents(vmf, info) - skybox.generate(vmf, coll) + skybox.make_skybox(vmf, coll) tiling.generate_brushes(vmf) faithplate.gen_faithplates(vmf, info.has_attr('superposition'))