Navigation
API > API/Runtime > API/Runtime/Engine
WorldComposition represents world structure:
- Holds list of all level packages participating in this world and theirs base parameters (bounding boxes, offset from origin)
- Holds list of streaming level objects to stream in and out based on distance from current view point
- Handles properly levels repositioning during level loading and saving
| Name | UWorldComposition |
| Type | class |
| Header File | /Engine/Source/Runtime/Engine/Classes/Engine/WorldComposition.h |
| Include Path | #include "Engine/WorldComposition.h" |
Syntax
UCLASS (Config=Engine, MinimalAPI)
class UWorldComposition : public UObject
Inheritance Hierarchy
- UObjectBase → UObjectBaseUtility → UObject → UWorldComposition
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
UWorldComposition
(
const FObjectInitializer& ObjectInitializer |
Engine/WorldComposition.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| FEnableWorldCompositionEvent | TBaseDelegate_TwoParams< bool, UWorld *, bool > | Event to enable/disable world composition in the world. | Engine/WorldComposition.h |
| FTilesList | TArray< FWorldCompositionTile > | Engine/WorldComposition.h | |
| FWorldCompositionChangedEvent | TMulticastDelegate_OneParam< void, UWorld * > | Event when world composition was successfully enabled/disabled in the world. | Engine/WorldComposition.h |
Constants
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| EnableWorldCompositionEvent | FEnableWorldCompositionEvent | Engine/WorldComposition.h | |
| WorldCompositionChangedEvent | FWorldCompositionChangedEvent | Engine/WorldComposition.h |
Variables
Public
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| bLoadAllTilesDuringCinematic | bool | Whether all distance dependent tiles should be loaded and visible during cinematic. | Engine/WorldComposition.h |
|
| bLockTilesLocation | bool | Whether all tiles locations are locked. | Engine/WorldComposition.h | |
| bRebaseOriginIn3DSpace | bool | Whether to rebase origin in 3D space, otherwise only on XY plane. | Engine/WorldComposition.h |
|
| bTemporallyDisableOriginTracking | bool | Engine/WorldComposition.h | ||
| bTemporarilyDisableOriginTracking | bool | Hack for a World Browser to be able to temporarily show hidden levels regardless of current world origin and without offsetting them temporarily | Engine/WorldComposition.h | |
| RebaseOriginDistance | float | Maximum distance to current view point where we should initiate origin rebasing. | Engine/WorldComposition.h |
|
| TilesStreaming | TArray< TObjectPtr< ULevelStreaming > > | Streaming level objects for each tile. | Engine/WorldComposition.h |
|
| TilesStreamingTimeThreshold | double | Time threshold between tile streaming state changes. | Engine/WorldComposition.h |
|
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Tiles | FTilesList | List of all tiles participating in the world composition. | Engine/WorldComposition.h | |
| WorldRoot | FString | Path to current world composition (long PackageName) | Engine/WorldComposition.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Collect tiles package names to cook | Engine/WorldComposition.h | ||
bool DoesTileExists
(
const FName& TilePackageName |
Engine/WorldComposition.h | ||
void EvaluateWorldOriginLocation
(
const FVector& ViewLocation |
Evaluates current world origin location against provided view location Issues request for world origin rebasing in case location is far enough from current origin | Engine/WorldComposition.h | |
TArray< FWorldTileLayer > GetDistanceDependentLayers() |
Engine/WorldComposition.h | ||
void GetDistanceVisibleLevels
(
const FVector* InLocations, |
Engine/WorldComposition.h | ||
void GetDistanceVisibleLevels
(
const FVector& InLocation, |
Returns currently visible and hidden levels based on distance based streaming | Engine/WorldComposition.h | |
FBox GetLevelBounds
(
ULevel* InLevel |
Engine/WorldComposition.h | ||
FIntVector GetLevelOffset
(
ULevel* InLevel |
Engine/WorldComposition.h | ||
FWorldTileInfo GetTileInfo
(
const FName& InPackageName |
Engine/WorldComposition.h | ||
FTilesList & GetTilesList() |
Engine/WorldComposition.h | ||
UWorld * GetWorld() |
Engine/WorldComposition.h | ||
FString GetWorldRoot() |
Engine/WorldComposition.h | ||
bool IsDistanceDependentLevel
(
FName PackageName |
Engine/WorldComposition.h | ||
void OnLevelAddedToWorld
(
ULevel* InLevel |
Handles level is being added to world | Engine/WorldComposition.h | |
void OnLevelPostSave
(
ULevel* InLevel |
Handles level just after it was saved to disk | Engine/WorldComposition.h | |
void OnLevelPreSave
(
ULevel* InLevel |
Handles level just before it going to be saved to disk | Engine/WorldComposition.h | |
void OnLevelRemovedFromWorld
(
ULevel* InLevel |
Handles level is being removed from the world | Engine/WorldComposition.h | |
void OnTileInfoUpdated
(
const FName& InPackageName, |
Notification from World browser about changes in tile info structure | Engine/WorldComposition.h | |
void ReinitializeForPIE() |
Engine/WorldComposition.h | ||
void Rescan() |
Scans world root folder for relevant packages and initializes world composition structures | Engine/WorldComposition.h | |
void RestoreDirtyTilesInfo
(
const FTilesList& TilesPrevState |
Restores dirty tiles information after world composition being rescanned | Engine/WorldComposition.h | |
bool UpdateEditorStreamingState
(
const FVector& InLocation |
Simulates streaming in editor world, only visibility, no loading/unloading, no LOD sub-levels | Engine/WorldComposition.h | |
void UpdateStreamingState
(
const FVector& InLocation |
Adds or removes level streaming objects to world based on distance settings from current view point | Engine/WorldComposition.h | |
void UpdateStreamingState () |
Adds or removes level streaming objects to world based on distance settings from players current view | Engine/WorldComposition.h | |
void UpdateStreamingState
(
const FVector* InLocation, |
Engine/WorldComposition.h | ||
void UpdateStreamingStateCinematic
(
const FVector* InLocation, |
Engine/WorldComposition.h |
Static
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
static void OnLevelPostLoad
(
ULevel* InLevel |
Handles level OnPostLoad event | Engine/WorldComposition.h |