File tree 2 files changed +8
-7
lines changed
Source/PrefabricatorRuntime
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -32,8 +32,10 @@ FVector FPrefabricatorAssetUtils::FindPivot(const TArray<AActor*>& InActors)
32
32
FBox ActorBounds = FPrefabTools::GetPrefabBounds (Actor, false );
33
33
Bounds += ActorBounds;
34
34
}
35
+
36
+ AActor* FirstActor = InActors[0 ];
35
37
36
- switch (GetDefault< UPrefabricatorSettings>()->PivotPosition )
38
+ switch (GetDefault<UPrefabricatorSettings>()->PivotPosition )
37
39
{
38
40
case EPrefabricatorPivotPosition::ExtremeLeft:
39
41
Pivot = Bounds.GetCenter () - Bounds.GetExtent ();
@@ -44,16 +46,14 @@ FVector FPrefabricatorAssetUtils::FindPivot(const TArray<AActor*>& InActors)
44
46
case EPrefabricatorPivotPosition::Center:
45
47
Pivot = Bounds.GetCenter ();
46
48
break ;
49
+ case EPrefabricatorPivotPosition::FirstActor:
50
+ Pivot = FirstActor->GetActorLocation ();
51
+ return Pivot;
47
52
default :;
48
53
}
49
54
Pivot.Z = Bounds.Min .Z ;
50
55
}
51
56
52
- TSharedPtr<IPrefabricatorService> Service = FPrefabricatorService::Get ();
53
- if (Service.IsValid ()) {
54
- Pivot = Service->SnapToGrid (Pivot);
55
- }
56
-
57
57
return Pivot;
58
58
}
59
59
Original file line number Diff line number Diff line change @@ -11,7 +11,8 @@ enum class EPrefabricatorPivotPosition : uint8
11
11
{
12
12
ExtremeLeft,
13
13
ExtremeRight,
14
- Center
14
+ Center,
15
+ FirstActor
15
16
};
16
17
17
18
/* *
You can’t perform that action at this time.
0 commit comments