本文整理汇总了C++中ULevel::ApplyWorldOffset方法的典型用法代码示例。如果您正苦于以下问题:C++ ULevel::ApplyWorldOffset方法的具体用法?C++ ULevel::ApplyWorldOffset怎么用?C++ ULevel::ApplyWorldOffset使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ULevel
的用法示例。
在下文中一共展示了ULevel::ApplyWorldOffset方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: SetLevelPosition
void FWorldTileModel::SetLevelPosition(const FIntPoint& InPosition)
{
// Parent absolute position
TSharedPtr<FWorldTileModel> ParentModel = StaticCastSharedPtr<FWorldTileModel>(GetParent());
FIntPoint ParentAbsolutePostion = ParentModel.IsValid() ? ParentModel->GetAbsoluteLevelPosition() : FIntPoint::ZeroValue;
// Actual offset
FIntPoint Offset = InPosition - TileDetails->AbsolutePosition;
// Update absolute position
TileDetails->AbsolutePosition = InPosition;
// Assign new position as relative to parent
TileDetails->Position = TileDetails->AbsolutePosition - ParentAbsolutePostion;
// Flush changes to level package
OnLevelInfoUpdated();
// Move actors if necessary
ULevel* Level = GetLevelObject();
if (Level != NULL && Level->bIsVisible)
{
// Shelve level, if during this translation level will end up out of Editable area
if (!ShouldBeVisible(LevelCollectionModel.EditableWorldArea()))
{
Shelve();
}
// Move actors
if (Offset != FIntPoint::ZeroValue)
{
Level->ApplyWorldOffset(FVector(Offset), false);
}
}
if (IsLandscapeBased())
{
FixLandscapeSectionsOffset();
}
// Transform child levels
for (auto It = AllChildren.CreateIterator(); It; ++It)
{
TSharedPtr<FWorldTileModel> ChildModel = StaticCastSharedPtr<FWorldTileModel>(*It);
FIntPoint ChildPosition = TileDetails->AbsolutePosition + ChildModel->GetRelativeLevelPosition();
ChildModel->SetLevelPosition(ChildPosition);
}
}