Navigation
API > API/Plugins > API/Plugins/WaveFunctionCollapse
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- USubsystem
- UDynamicSubsystem
- UEditorSubsystem
- UWaveFunctionCollapseSubsystem
References
| Module | WaveFunctionCollapse |
| Header | /Engine/Plugins/Experimental/WaveFunctionCollapse/Source/WaveFunctionCollapse/Public/WaveFunctionCollapseSubsystem.h |
| Include | #include "WaveFunctionCollapseSubsystem.h" |
Syntax
UCLASS&40;&41;
class UWaveFunctionCollapseSubsystem : public UEditorSubsystem
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bUseEmptyBorder | ||
| FRotator | Orientation | ||
| FVector | OriginLocation | ||
| FIntVector | Resolution | ||
| TMap< FIntVector, FWaveFunctionCollapseOption > | StarterOptions | ||
| TObjectPtr< UWaveFunctionCollapseModel > | WFCModel |
Functions
| Type | Name | Description | |
|---|---|---|---|
| AActor * | Collapse
(
int32 TryCount, |
Solve a grid using a WFC model. If successful, spawn an actor. | |
| void | DeriveGridFromTransformBounds
(
const TArray< FTransform >& Transforms |
Derive grid from the bounds of an array of transforms Assumptions: -Transforms can only represent a single grid -Sets empty starter option if there is a valid grid position with no transform -Orientation is determined by the yaw of the first transform in the array | |
| void | DeriveGridFromTransforms
(
const TArray< FTransform >& Transforms |
Derive grid from an array of transforms Assumptions: -Every transform represents the center point of a tile position -Sets empty starter option if there is a valid grid position with no transform -Orientation is determined by the yaw of the first transform in the array | |
| void | InitializeWFC
(
TArray< FWaveFunctionCollapseTile >& Tiles, |
Initialize WFC process which sets up Tiles and RemainingTiles arrays Pre-populates Tiles with StarterOptions, BorderOptions and InitialTiles | |
| bool | ObservationPropagation
(
TArray< FWaveFunctionCollapseTile >& Tiles, |
Recursive Observation and Propagation cycle | |
| bool | Observe
(
TArray< FWaveFunctionCollapseTile >& Tiles, |
Observation phase: This process randomly selects one tile from minimum entropy tiles then randomly selects a valid option for that tile | |
| bool | Propagate
(
TArray< FWaveFunctionCollapseTile >& Tiles, |
Propagation phase: This process checks if the selection made during the observation is valid by checking constraint validity with neighboring tiles. |