mirror of
https://github.com/bdunderscore/modular-avatar.git
synced 2024-12-29 18:55:06 +08:00
fix: automatic bounds does not account for armature scale (#423)
This commit is contained in:
parent
b6537da650
commit
f9c19c6d67
@ -213,7 +213,7 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
else if (Vector3.Distance(bounds.center, skinnedMeshRenderer.bounds.center) > 0.01f
|
||||
|| Vector3.Distance(bounds.extents, skinnedMeshRenderer.bounds.extents) > 0.01f)
|
||||
{
|
||||
bounds = ModularAvatarMeshSettings.DEFAULT_BOUNDS;
|
||||
bounds = TransformBounds(rootBone, ModularAvatarMeshSettings.DEFAULT_BOUNDS);
|
||||
}
|
||||
}
|
||||
|
||||
@ -221,6 +221,13 @@ namespace nadena.dev.modular_avatar.core.editor
|
||||
}
|
||||
}
|
||||
|
||||
private static Bounds TransformBounds(Transform rootBone, Bounds bounds)
|
||||
{
|
||||
bounds.extents = bounds.extents / (Vector3.Dot(rootBone.lossyScale, Vector3.one) / 3);
|
||||
|
||||
return bounds;
|
||||
}
|
||||
|
||||
static bool ValidateSetupOutfit()
|
||||
{
|
||||
errorHeader = S("setup_outfit.err.header.notarget");
|
||||
|
Loading…
Reference in New Issue
Block a user