From 92f7b05e6fa02f5643217e2ff50623f061385a81 Mon Sep 17 00:00:00 2001 From: Kirill <95088806+kirill-mapper@users.noreply.github.com> Date: Sat, 19 Apr 2025 19:06:25 +0300 Subject: [PATCH] ReFix UpdateBBs --- CodeWalker.Core/GameFiles/MetaTypes/Archetype.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CodeWalker.Core/GameFiles/MetaTypes/Archetype.cs b/CodeWalker.Core/GameFiles/MetaTypes/Archetype.cs index f5fa40836..447945fe6 100644 --- a/CodeWalker.Core/GameFiles/MetaTypes/Archetype.cs +++ b/CodeWalker.Core/GameFiles/MetaTypes/Archetype.cs @@ -738,7 +738,7 @@ public void UpdateBBs(Archetype arch) { var earch = rooment.Archetype; var pos = rooment._CEntityDef.position; - var ori = rooment._CEntityDef.rotation.ToQuaternion(); + var ori = Quaternion.Invert(rooment._CEntityDef.rotation.ToQuaternion()); Vector3 abmin = earch.BBMin * rooment.Scale; //entity box Vector3 abmax = earch.BBMax * rooment.Scale; c[0] = abmin; @@ -749,10 +749,9 @@ public void UpdateBBs(Archetype arch) c[5] = new Vector3(abmax.X, abmin.Y, abmax.Z); c[6] = new Vector3(abmax.X, abmax.Y, abmin.Z); c[7] = abmax; - Vector3 center = (abmin + abmax) * 0.5f; for (int n = 0; n < 8; n++) { - Vector3 corn = ori.Multiply(c[n] - center) + center + pos; + Vector3 corn = ori.Multiply(c[n]) + pos; min = Vector3.Min(min, corn); max = Vector3.Max(max, corn); }