mirror of
https://github.com/KillzXGaming/Switch-Toolbox
synced 2024-11-24 13:33:08 +00:00
Fix bounding boxes for rigged models
This commit is contained in:
parent
35216e410f
commit
69a2d2d1fc
1 changed files with 13 additions and 0 deletions
|
@ -1399,6 +1399,19 @@ namespace Bfres.Structs
|
|||
min = CalculateBBMin(vertices);
|
||||
max = CalculateBBMax(vertices);
|
||||
}
|
||||
else
|
||||
{
|
||||
//Find largest bounding box
|
||||
foreach (var bounding in aabb)
|
||||
{
|
||||
min.X = Math.Min(bounding.Min.X, min.X);
|
||||
min.Y = Math.Min(bounding.Min.Y, min.Y);
|
||||
min.Z = Math.Min(bounding.Min.Z, min.Z);
|
||||
max.X = Math.Min(bounding.Max.X, max.X);
|
||||
max.Y = Math.Min(bounding.Max.Y, max.Y);
|
||||
max.Z = Math.Min(bounding.Max.Z, max.Z);
|
||||
}
|
||||
}
|
||||
|
||||
var c = (min + max) / 2.0f;
|
||||
var e = (max - min) / 2.0f;
|
||||
|
|
Loading…
Reference in a new issue