From 37ac0ba62ba5628b8830b1a06230035280f4954c Mon Sep 17 00:00:00 2001 From: dexy Date: Mon, 3 May 2021 23:53:34 +1000 Subject: [PATCH] Light hash calculation bounding box fix --- CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs b/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs index 677c4be..a7fa2f2 100644 --- a/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs +++ b/CodeWalker.Core/GameFiles/FileTypes/YmapFile.cs @@ -2109,12 +2109,12 @@ namespace CodeWalker.GameFiles } if (lightAttrs == null) return; - var abmin = db.BoundingBoxMin; - var abmax = db.BoundingBoxMax; + var abmin = Vector3.Min(Archetype.BBMin, db.BoundingBoxMin); + var abmax = Vector3.Max(Archetype.BBMax, db.BoundingBoxMax); if (b != null) { - abmin = b.BoxMin; - abmax = b.BoxMax; + abmin = Vector3.Min(abmin, b.BoxMin); + abmax = Vector3.Max(abmax, b.BoxMax); } var bb = new BoundingBox(abmin, abmax).Transform(Position, Orientation, Scale); var ints = new uint[7];