FGenerationParameters
Overview
This struct holds various properties that define the generation parameters for a mesh instance. It includes an origin point, length vector, and offset settings which can be randomized or fixed.
Properties
Type | Name | Access | Description |
|---|---|---|---|
FVector | Origin | EditAnywhere | The origin point of the mesh generation area. |
FVector | Length | EditAnywhere | The dimensions of the mesh generation area. |
FVector | MeshOffset | EditAnywhere | The fixed offset for each instance along each axis. |
bool | bRandomOffset | EditAnywhere | Whether to use random offsets instead of fixed ones. |
FVector | RandomOffsetMax | EditAnywhere | The maximum value for random offsets along each axis. |
FVector | RandomOffsetMin | EditAnywhere | The minimum value for random offsets along each axis. |
Functions
Return Type | Signature | Description |
|---|---|---|
float | GetOffset(EAxis::Type Axis) const | Returns the offset for a given axis, either fixed or randomly generated based on |
FVector | GetMaxOffset() const | Returns the maximum offset value, which is either |
ULimenMeshInstanceBuilder
Overview
This class extends UInstancedStaticMeshComponent and provides functionality to generate and spawn multiple instances of a static mesh within a specified area. It uses parameters defined in the FGenerationParameters struct to control the generation process.
Properties
Type | Name | Access | Description |
|---|---|---|---|
FGenerationParameters | GenerationParams | EditAnywhere, Category="Generation Parameters" | The generation parameters for mesh instances. |
Functions
Return Type | Signature | Description |
|---|---|---|
void | BeginPlay() override | Called when the component is initialized and ready to begin play. |
void | StartSpawningInstances() | Starts the process of spawning mesh instances based on the generation parameters. |
TArray | CalculatePoints() const | Calculates the positions where mesh instances should be spawned. |
void | SpawnInstances() | Spawns the mesh instances at the calculated positions. |
Usage & Implementation Notes
The component requires a static mesh to be assigned for it to function.
Instances are spawned based on the bounding box of the static mesh and the generation parameters provided.
Random offsets can be applied along each axis if enabled in the
GenerationParams.The component uses the
ULimenGlobalRandomStreamSubsystemfor generating random values.