Navigation
API > API/Runtime > API/Runtime/Engine > API/Runtime/Engine/GameFramework
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- AActor
- ALightWeightInstanceManager
- ALightWeightInstanceStaticMeshManager
- AMassLWIStaticMeshManager
References
| Module | Engine |
| Header | /Engine/Source/Runtime/Engine/Classes/GameFramework/LightWeightInstanceManager.h |
| Include | #include "GameFramework/LightWeightInstanceManager.h" |
Syntax
class ALightWeightInstanceManager : public AActor
Variables
| Type | Name | Description | |
|---|---|---|---|
| TSubclassOf< AActor > | AcceptedClass | ||
| TMap< int32, TObjectPtr< AActor > > | Actors | Keep track of which instances are currently represented by an actor | |
| FString | BaseInstanceName | ||
| TArray< int32 > | DestroyedActorIndices | ||
| TArray< int32 > | FreeIndices | List of indices that we are no longer using | |
| TArray< int32 > | InstanceToActorConversionsInProgress | ||
| TArray< FTransform > | InstanceTransforms | Current per instance transforms. | |
| TSubclassOf< AActor > | RepresentedClass | ||
| TArray< bool > | ValidIndices | Handy way to check indices quickly so we don't need to iterate through the free indices list |
Constructors
| Type | Name | Description | |
|---|---|---|---|
ALightWeightInstanceManager
(
const FObjectInitializer& ObjectInitializer |
Destructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| int32 | AddNewInstance
(
FLWIData* InitData |
Takes a polymorphic struct to set the initial data for a new instance. | |
| void | AddNewInstanceAt
(
FLWIData* InitData, |
Adds a new instance at the specified index. | |
| FLWIData * | Allocates the appropriate subclass of FLWIData to initialize instances for this manager. The caller is responsible for freeing the memory when they are finished. | ||
| FActorInstanceHandle | ConvertActorToLightWeightInstance
(
AActor* InActor |
Returns a handle to a light weight instance representing the same object as InActor and calls destroy on InActor if successful. | |
| int32 | ConvertCollisionIndexToLightWeightIndex
(
int32 InIndex |
Returns the index used internally by the light weight instance manager that is associated with the instance referred to by InIndex used by collision and rendering. | |
| int32 | ConvertHandleIndexToInternalIndex
(
int32 InHandleIndex |
||
| AActor * | ConvertInstanceToActor
(
const FActorInstanceHandle& Handle |
Creates an actor to replace the instance specified by Handle. | |
| int32 | ConvertInternalIndexToHandleIndex
(
int32 InInternalIndex |
Helper functions for converting between our internal storage indices and the indices used by external bookkeeping. | |
| int32 | ConvertLightWeightIndexToCollisionIndex
(
int32 InIndex |
Returns the index used by collision and rendering that is associated with the instance referred to by InIndex. | |
| FInt32Vector3 | ConvertPositionToCoord
(
const FVector& InPosition |
Helper that converts a position (world space) into a coordinate for the LWI grid. | |
| FBox | ConvertPositionToGridBounds
(
const FVector& InPosition |
Helper that retrieve the world space bounds of the LWI grid cell encompassing the provided coordinate. | |
| UObject * | CreateInterfaceObject
(
const FActorInstanceHandle& Handle |
Create an object that implements interfaces for the light weight instance specified by Handle. | |
| bool | DoesAcceptClass
(
const UClass* OtherClass |
Returns true if this manager is capable of representing objects of type OtherClass. | |
| bool | DoesRepresentClass
(
const UClass* OtherClass |
Returns true if this manager stores instances that can be turned into full weight objects of class OtherClass. | |
| AActor * | FetchActorFromHandle
(
const FActorInstanceHandle& Handle |
Returns the actor associated with Handle if one exists. | |
| I * | FetchInterfaceObject
(
const FActorInstanceHandle& Handle |
||
| bool | FindActorForHandle
(
const FActorInstanceHandle& Handle |
Checks if we already have an actor for this handle. If an actor already exists we set the Actor variable on Handle and return true. | |
| AActor * | FindActorForInstanceIndex
(
const int32 InstanceIndex |
||
| int32 | FindIndexForActor
(
const AActor* InActor |
Returns the index of the light weight instance associated with InActor if one exists; otherwise we return INDEX_NONE. | |
| UClass * | Returns the base class of types that this can manage. | ||
| UClass * | GetActorClassToSpawn
(
const FActorInstanceHandle& Handle |
Returns the class to use when spawning a new actor. | |
| int32 | GetGridSize () |
LWI grid size to use for this manager. | |
| UClass * | Gets the class that implements interfaces for light weight instances owned by this manager. | ||
| FVector | GetLocation
(
const FActorInstanceHandle& Handle |
Returns the location of the instance specified by Handle. | |
| FString | GetName
(
const FActorInstanceHandle& Handle |
Returns the name of the instance specified by Handle. | |
| UClass * | Returns the specific class that this manages. | ||
| FRotator | GetRotation
(
const FActorInstanceHandle& Handle |
Returns the rotation of the instance specified by Handle. | |
| FTransform | GetTransform
(
const FActorInstanceHandle& Handle |
Returns the transform of the instance specified by Handle. | |
| void | Increases the size of all of our data arrays to NewSize. | ||
| bool | |||
| bool | IsIndexValid
(
int32 Index |
Returns true if we have current information for an instance at Index. | |
| bool | |||
| void | |||
| void | OnSpawnedActorDestroyed
(
AActor* DestroyedActor, |
Called after a spawned actor is destroyed. | |
| void | PostActorSpawn
(
const FActorInstanceHandle& Handle |
Called after spawning a new actor from a light weight instance. | |
| void | PreSpawnInitalization
(
const FActorInstanceHandle& Handle, |
Called after actor construction but before other systems see this actor spawn. | |
| void | RemoveInstance
(
int32 Index |
Removes the instance. | |
| bool | SetDataFromActor
(
FLWIData* InData, |
Gathers info from InActor and stores it in InData. Returns true if the relevant data was successfully copied. | |
| void | SetRepresentedClass
(
UClass* ActorClass |
Sets the specific class that this manages. | |
| void | SetSpawnParameters
(
FActorSpawnParameters& SpawnParams |
Sets the parameters for actor spawning. | |
| void | UpdateDataAtIndex
(
FLWIData* InData, |
Populates the data array entries at Index with the data stored in InData;. |
Overridden from AActor
| Type | Name | Description | |
|---|---|---|---|
| void | Tick
(
float DeltaSeconds |
Function called every frame on this Actor. |
Overridden from UObject
| Type | Name | Description | |
|---|---|---|---|
| void | GetLifetimeReplicatedProps
(
TArray< FLifetimeProperty >& OutLifetimeProps |
Data and replication functions | |
| void | PostEditChangeProperty
(
FPropertyChangedEvent& PropertyChangedEvent |
Editor functions |