本文整理汇总了C++中USceneComponent::GetOwner方法的典型用法代码示例。如果您正苦于以下问题:C++ USceneComponent::GetOwner方法的具体用法?C++ USceneComponent::GetOwner怎么用?C++ USceneComponent::GetOwner使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类USceneComponent
的用法示例。
在下文中一共展示了USceneComponent::GetOwner方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: GetActorsToIgnore
static void GetActorsToIgnore( AActor* Actor, TSet< TWeakObjectPtr<AActor> >& ActorsToIgnore )
{
if( !ActorsToIgnore.Contains( Actor ) )
{
ActorsToIgnore.Add( Actor );
// We cannot snap to any attached children or actors in the same group as moving this actor will also move the children as we are snapping to them,
// causing a cascading effect and unexpected results
TArray<USceneComponent*>& AttachedChildren = Actor->GetRootComponent()->AttachChildren;
for( int32 ChildIndex = 0; ChildIndex < AttachedChildren.Num(); ++ChildIndex )
{
USceneComponent* Child = AttachedChildren[ChildIndex];
if( Child && Child->GetOwner() )
{
ActorsToIgnore.Add( Child->GetOwner() );
}
}
AGroupActor* ParentGroup = AGroupActor::GetRootForActor(Actor, true, true);
if( ParentGroup )
{
TArray<AActor*> GroupActors;
ParentGroup->GetGroupActors(GroupActors, true);
for( int32 GroupActorIndex = 0; GroupActorIndex < GroupActors.Num(); ++GroupActorIndex )
{
ActorsToIgnore.Add( GroupActors[GroupActorIndex] );
}
}
}
}
示例2: if
FTransform FMovieScene3DTransformSectionRecorder::GetTransformToRecord()
{
if(USceneComponent* SceneComponent = Cast<USceneComponent>(ObjectToRecord.Get()))
{
return SceneComponent->GetRelativeTransform();
}
else if(AActor* Actor = Cast<AActor>(ObjectToRecord.Get()))
{
bool bCaptureWorldSpaceTransform = false;
USceneComponent* RootComponent = Actor->GetRootComponent();
USceneComponent* AttachParent = RootComponent ? RootComponent->GetAttachParent() : nullptr;
bWasAttached = AttachParent != nullptr;
if (AttachParent)
{
// We capture world space transforms for actors if they're attached, but we're not recording the attachment parent
bCaptureWorldSpaceTransform = !FSequenceRecorder::Get().FindRecording(AttachParent->GetOwner());
}
return (bCaptureWorldSpaceTransform || !RootComponent) ? Actor->ActorToWorld() : RootComponent->GetRelativeTransform();
}
return FTransform::Identity;
}
示例3: InputWidgetDelta
bool FSCSEditorViewportClient::InputWidgetDelta( FViewport* Viewport, EAxisList::Type CurrentAxis, FVector& Drag, FRotator& Rot, FVector& Scale )
{
bool bHandled = false;
if(bIsManipulating && CurrentAxis != EAxisList::None)
{
bHandled = true;
AActor* PreviewActor = GetPreviewActor();
auto BlueprintEditor = BlueprintEditorPtr.Pin();
if (PreviewActor && BlueprintEditor.IsValid())
{
TArray<FSCSEditorTreeNodePtrType> SelectedNodes = BlueprintEditor->GetSelectedSCSEditorTreeNodes();
if(SelectedNodes.Num() > 0)
{
FVector ModifiedScale = Scale;
if( GEditor->UsePercentageBasedScaling() )
{
ModifiedScale = Scale * ((GEditor->GetScaleGridSize() / 100.0f) / GEditor->GetGridSize());
}
TSet<USceneComponent*> UpdatedComponents;
for(auto It(SelectedNodes.CreateIterator());It;++It)
{
FSCSEditorTreeNodePtrType SelectedNodePtr = *It;
// Don't allow editing of a root node, inherited SCS node or child node that also has a movable (non-root) parent node selected
const bool bCanEdit = !SelectedNodePtr->IsRootComponent() && !SelectedNodePtr->IsInherited()
&& !IsMovableParentNodeSelected(SelectedNodePtr, SelectedNodes);
if(bCanEdit)
{
USceneComponent* SceneComp = Cast<USceneComponent>(SelectedNodePtr->FindComponentInstanceInActor(PreviewActor));
USceneComponent* SelectedTemplate = Cast<USceneComponent>(SelectedNodePtr->GetEditableComponentTemplate(BlueprintEditor->GetBlueprintObj()));
if(SceneComp != NULL && SelectedTemplate != NULL)
{
// Cache the current default values for propagation
FVector OldRelativeLocation = SelectedTemplate->RelativeLocation;
FRotator OldRelativeRotation = SelectedTemplate->RelativeRotation;
FVector OldRelativeScale3D = SelectedTemplate->RelativeScale3D;
// Adjust the deltas as necessary
FComponentEditorUtils::AdjustComponentDelta(SceneComp, Drag, Rot);
TSharedPtr<ISCSEditorCustomization> Customization = BlueprintEditor->CustomizeSCSEditor(SceneComp);
if(Customization.IsValid() && Customization->HandleViewportDrag(SceneComp, SelectedTemplate, Drag, Rot, ModifiedScale, GetWidgetLocation()))
{
UpdatedComponents.Add(SceneComp);
UpdatedComponents.Add(SelectedTemplate);
}
else
{
// Apply delta to the preview actor's scene component
GEditor->ApplyDeltaToComponent(
SceneComp,
true,
&Drag,
&Rot,
&ModifiedScale,
SceneComp->RelativeLocation );
UpdatedComponents.Add(SceneComp);
// Apply delta to the template component object
GEditor->ApplyDeltaToComponent(
SelectedTemplate,
true,
&Drag,
&Rot,
&ModifiedScale,
SelectedTemplate->RelativeLocation );
UpdatedComponents.Add(SelectedTemplate);
}
UBlueprint* PreviewBlueprint = UBlueprint::GetBlueprintFromClass(PreviewActor->GetClass());
if(PreviewBlueprint != NULL)
{
// Like PostEditMove(), but we only need to re-run construction scripts
if(PreviewBlueprint && PreviewBlueprint->bRunConstructionScriptOnDrag)
{
PreviewActor->RerunConstructionScripts();
}
SceneComp->PostEditComponentMove(true); // @TODO HACK passing 'finished' every frame...
// If a constraint, copy back updated constraint frames to template
UPhysicsConstraintComponent* ConstraintComp = Cast<UPhysicsConstraintComponent>(SceneComp);
UPhysicsConstraintComponent* TemplateComp = Cast<UPhysicsConstraintComponent>(SelectedTemplate);
if(ConstraintComp && TemplateComp)
{
TemplateComp->ConstraintInstance.CopyConstraintGeometryFrom(&ConstraintComp->ConstraintInstance);
}
// Iterate over all the active archetype instances and propagate the change(s) to the matching component instance
TArray<UObject*> ArchetypeInstances;
if(SelectedTemplate->HasAnyFlags(RF_ArchetypeObject))
{
SelectedTemplate->GetArchetypeInstances(ArchetypeInstances);
for(int32 InstanceIndex = 0; InstanceIndex < ArchetypeInstances.Num(); ++InstanceIndex)
{
SceneComp = Cast<USceneComponent>(ArchetypeInstances[InstanceIndex]);
if(SceneComp && SceneComp->GetOwner() != PreviewActor)
{
//.........这里部分代码省略.........
示例4: ProcessNewComponentArray
void UActorRecording::ProcessNewComponentArray(TInlineComponentArray<USceneComponent*>& ProspectiveComponents) const
{
// Only iterate as far as the current size of the array (it may grow inside the loop)
int32 LastIndex = ProspectiveComponents.Num();
for(int32 Index = 0; Index < LastIndex; ++Index)
{
USceneComponent* NewComponent = ProspectiveComponents[Index];
USceneComponent* Parent = ProspectiveComponents[Index]->GetAttachParent();
while (Parent)
{
TWeakObjectPtr<USceneComponent> WeakParent(Parent);
if (TrackedComponents.Contains(WeakParent) || ProspectiveComponents.Contains(Parent) || Parent->GetOwner() != NewComponent->GetOwner())
{
break;
}
else
{
ProspectiveComponents.Add(Parent);
}
Parent = Parent->GetAttachParent();
}
}
// Sort parent first, to ensure that attachments get added properly
TMap<USceneComponent*, int32> AttachmentDepths;
for (USceneComponent* Component : ProspectiveComponents)
{
AttachmentDepths.Add(Component, GetAttachmentDepth(Component));
}
ProspectiveComponents.Sort(
[&](USceneComponent& A, USceneComponent& B)
{
return *AttachmentDepths.Find(&A) < *AttachmentDepths.Find(&B);
}
);
}