absolute snapping: actually fix large world this time

This commit is contained in:
Zode
2024-06-17 22:59:19 +03:00
parent 5780fb7392
commit 7ede250403

View File

@@ -343,20 +343,10 @@ namespace FlaxEditor.Gizmo
_hasAbsoluteSnapped = true;
Vector3 currentTranslationScale = isScaling ? GetSelectedTransform(0).Scale : GetSelectedTransform(0).Translation;
if(LargeWorlds.Enable)
{
absoluteDelta = currentTranslationScale - new Vector3(
Double.Round(currentTranslationScale.X / snapValue.X) * snapValue.X,
Double.Round(currentTranslationScale.Y / snapValue.Y) * snapValue.Y,
Double.Round(currentTranslationScale.Z / snapValue.Z) * snapValue.Z);
}
else
{
absoluteDelta = currentTranslationScale - new Vector3(
Mathf.Round(currentTranslationScale.X / snapValue.X) * snapValue.X,
Mathf.Round(currentTranslationScale.Y / snapValue.Y) * snapValue.Y,
Mathf.Round(currentTranslationScale.Z / snapValue.Z) * snapValue.Z);
}
absoluteDelta = currentTranslationScale - new Vector3(
(Real)Math.Round(currentTranslationScale.X / snapValue.X) * snapValue.X,
(Real)Math.Round(currentTranslationScale.Y / snapValue.Y) * snapValue.Y,
(Real)Math.Round(currentTranslationScale.Z / snapValue.Z) * snapValue.Z);
}
delta = new Vector3(