Add improvements for objects spawning and snapping in Editor to include object bounds

This commit is contained in:
Wojciech Figat
2022-01-10 17:46:53 +01:00
parent cd72916838
commit d11166082c
11 changed files with 82 additions and 63 deletions

View File

@@ -702,10 +702,9 @@ namespace FlaxEditor.Viewport
private Vector3 PostProcessSpawnedActorLocation(Actor actor, ref Vector3 hitLocation)
{
Editor.GetActorEditorBox(actor, out BoundingBox box);
// Place the object
var location = hitLocation - (box.Size.Length * 0.5f) * ViewDirection;
//var location = hitLocation - (box.Size.Length * 0.5f) * ViewDirection;
var location = hitLocation;
// Apply grid snapping if enabled
if (UseSnapping || TransformGizmo.TranslationSnapEnable)