本文整理汇总了C++中TWeakObjectPtr::GetComponents方法的典型用法代码示例。如果您正苦于以下问题:C++ TWeakObjectPtr::GetComponents方法的具体用法?C++ TWeakObjectPtr::GetComponents怎么用?C++ TWeakObjectPtr::GetComponents使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TWeakObjectPtr
的用法示例。
在下文中一共展示了TWeakObjectPtr::GetComponents方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: RemoveViewFromActorViewVisibility
void FLayers::RemoveViewFromActorViewVisibility( FLevelEditorViewportClient* ViewportClient )
{
const int32 ViewIndex = ViewportClient->ViewIndex;
// get the bit for the view index
uint64 ViewBit = ((uint64)1 << ViewIndex);
// get all bits under that that we want to keep
uint64 KeepBits = ViewBit - 1;
// Iterate over all actors, looking for actors in the specified layers.
for( FActorIterator It(ViewportClient->GetWorld()) ; It ; ++It )
{
const TWeakObjectPtr< AActor > Actor = *It;
if( !IsActorValidForLayer( Actor ) )
{
continue;
}
// remember original bits
uint64 OriginalHiddenViews = Actor->HiddenEditorViews;
uint64 Was = Actor->HiddenEditorViews;
// slide all bits higher than ViewIndex down one since the view is being removed from Editor
uint64 LowBits = Actor->HiddenEditorViews & KeepBits;
// now slide the top bits down by ViewIndex + 1 (chopping off ViewBit)
uint64 HighBits = Actor->HiddenEditorViews >> (ViewIndex + 1);
// then slide back up by ViewIndex, which will now have erased ViewBit, as well as leaving 0 in the low bits
HighBits = HighBits << ViewIndex;
// put it all back together
Actor->HiddenEditorViews = LowBits | HighBits;
// reregister if we changed the visibility bits, as the rendering thread needs them
if (OriginalHiddenViews == Actor->HiddenEditorViews)
{
continue;
}
// Find all registered primitive components and update the scene proxy with the actors updated visibility map
TInlineComponentArray<UPrimitiveComponent*> Components;
Actor->GetComponents(Components);
for( int32 ComponentIdx = 0; ComponentIdx < Components.Num(); ++ComponentIdx )
{
UPrimitiveComponent* PrimitiveComponent = Components[ComponentIdx];
if (PrimitiveComponent->IsRegistered())
{
// Push visibility to the render thread
PrimitiveComponent->PushEditorVisibilityToProxy( Actor->HiddenEditorViews );
}
}
}
}