Navigation
API > API/Plugins > API/Plugins/SmartObjectsModule
Deprecated * This type is deprecated and no longer being used.
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- USubsystem
- UWorldSubsystem
- USmartObjectSubsystem
- USmartObjectTestSubsystem
References
| Module | SmartObjectsModule |
| Header | /Engine/Plugins/Runtime/SmartObjects/Source/SmartObjectsModule/Public/SmartObjectSubsystem.h |
| Include | #include "SmartObjectSubsystem.h" |
Syntax
UCLASS&40;Config&61;SmartObjects, defaultconfig, Transient&41;
class USmartObjectSubsystem : public UWorldSubsystem
Remarks
Mode that indicates how the unregistration of the SmartObjectComponent affects its runtime instance.Subsystem that holds all registered smart object instances and offers the API for spatial queries and reservations.
Variables
| Type | Name | Description | |
|---|---|---|---|
| bool | bAutoInitializeEditorInstances | ||
| bool | bIsPartitionedWorld | Set in OnWorldComponentsUpdated and used to control special logic required to build collections in Editor mode | |
| bool | bRuntimeInitialized | ||
| uint32 | NextFreeUserID | ||
| FOnMainCollectionEvent | OnMainCollectionChanged | ||
| FOnMainCollectionEvent | OnMainCollectionDirtied | ||
| TArray< TObjectPtr< USmartObjectComponent > > | PendingSmartObjectRegistration | Smart objects that attempted to register while no collection was being present | |
| TArray< TWeakObjectPtr< ASmartObjectPersistentCollection > > | RegisteredCollections | ||
| TArray< TObjectPtr< USmartObjectComponent > > | RegisteredSOComponents | List of registered components. | |
| TObjectPtr< ASmartObjectSubsystemRenderingActor > | RenderingActor | ||
| TMap< FSmartObjectHandle, FSmartObjectRuntime > | RuntimeSmartObjects | ||
| FSmartObjectContainer | SmartObjectContainer | ||
| TObjectPtr< USmartObjectSpacePartition > | SpacePartition | ||
| TSubclassOf< USmartObjectSpacePartition > | SpacePartitionClass | ||
| FSoftClassPath | SpacePartitionClassName | Name of the Space partition class to use. | |
| friend | UWorldPartitionSmartObjectCollectionBuilder |
Constructors
| Type | Name | Description | |
|---|---|---|---|
Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AbortAll
(
const FSmartObjectHandle Handle, |
||
| FSmartObjectRuntime * | AddCollectionEntryToSimulation
(
const FSmartObjectCollectionEntry& Entry, |
Registers a collection entry to the simulation and creates its associated runtime instance. | |
| FSmartObjectRuntime * | AddComponentToSimulation
(
USmartObjectComponent& SmartObjectComponent, |
Registers a collection entry to the simulation and creates its associated runtime instance. | |
| void | AddContainerToSimulation
(
const FSmartObjectContainer& InSmartObjectContainer |
||
| void | AddSlotData
(
const FSmartObjectClaimHandle& ClaimHandle, |
Adds state data to a slot instance. | |
| void | AddTagToInstance
(
const FSmartObjectHandle Handle, |
Adds a single tag to the smart object instance represented by the provided handle. | |
| void | AddTagToInstance
(
FSmartObjectRuntime& SmartObjectRuntime, |
||
| void | AddTagToSlot
(
const FSmartObjectSlotHandle SlotHandle, |
Adds a single tag to the smart object slot represented by the provided handle. | |
| void | BindComponentToSimulation
(
USmartObjectComponent& SmartObjectComponent |
Binds a smartobject component to an existing instance in the simulation. | |
| void | BindComponentToSimulationInternal
(
USmartObjectComponent& SmartObjectComponent, |
Notifies SmartObjectComponent that it has been bound to a runtime instance, and sets SmartObjectComponent-related properties of SmartObjectRuntime | |
| void | BindPropertiesFromStruct
(
FWorldConditionContextData& ContextData, |
Binds properties of the context data to property values of the user data struct when they match type and name. | |
| bool | CanBeClaimed
(
const FSmartObjectSlotHandle SlotHandle |
Checks whether given slot is free and can be claimed (i.e. slot and its parent are both enabled) | |
| void | Removes all runtime data | ||
| FBox | ComputeBounds
(
const UWorld& World |
Compute bounds from the given world | |
| void | CreatePersistentCollectionFromDeprecatedData
(
UWorld& World, |
Special-purpose function used to set up an instance of ASmartObjectPersistentCollection with data from a given instance of ADEPRECATED_SmartObjectCollection | |
| void | Debugging helper to emulate the stop of the simulation to destroy all runtime data | ||
| void | DebugDraw
(
FDebugRenderSceneProxy* DebugProxy |
||
| void | DebugDrawCanvas
(
UCanvas* Canvas, |
||
| uint32 | |||
| uint32 | |||
| const TMap< FSmartObjectHandle, FSmartObjectRuntime > & | |||
| void | Debugging helper to emulate the start of the simulation to create all runtime data | ||
| void | Debugging helpers to add all registered smart objects to the simulation | ||
| void | Debugging helper to remove all registered smart objects from the simulation | ||
| void | DestroyRuntimeInstanceInternal
(
const FSmartObjectHandle Handle, |
Destroy SmartObjectRuntime contents as Handle's representation. | |
| bool | EvaluateConditionsForFiltering
(
const FSmartObjectRuntime& SmartObjectRuntime, |
Internal helper for filter methods to build the list of accepted slots by reusing context data and schema as much as possible. | |
| bool | EvaluateObjectConditions
(
const FWorldConditionContextData& ConditionContextData, |
Use the provided context data that is expected to be already filled by calling 'SetupConditionContextCommonData' and evaluates all conditions associated to the specified object. | |
| bool | EvaluateSelectionConditions
(
const FSmartObjectSlotHandle SlotHandle, |
Evaluates conditions of the specified slot and its parent smart object. | |
| bool | EvaluateSlotConditions
(
FWorldConditionContextData& ConditionContextData, |
Use the provided context data that is expected to be already filled by calling 'SetupConditionContextCommonData' and adds the slot related part. | |
| TArray< FSmartObjectRequestResult > | FilterResultsBySelectionConditions
(
const TConstArrayView< FSmartObjectRequestResult >& ResultsToFilter, |
Evaluates conditions of the slot specified by each request result and add to the result array on success. | |
| TArray< FSmartObjectSlotHandle > | FilterSlotsBySelectionConditions
(
const TConstArrayView< FSmartObjectSlotHandle >& SlotsToFilter, |
Evaluates conditions of each slot and add to the result array on success. | |
| bool | FindEntranceLocationForSlot
(
const FSmartObjectSlotHandle SlotHandle, |
Finds entrance location for a specific slot. | |
| bool | FindEntranceLocationInternal
(
const FSmartObjectSlotHandle SlotHandle, |
Finds entrance location for a specific slot. | |
| void | FindMatchingSlotDefinitionIndices
(
const USmartObjectDefinition& Definition, |
Applies filter on provided definition and fills OutValidIndices with indices of all valid slots. | |
| void | FindSlots
(
const FSmartObjectHandle Handle, |
Goes through all defined slots of smart object represented by SmartObjectRuntime and finds the ones matching the filter. | |
| void | FindSlots
(
const FSmartObjectHandle Handle, |
Returns slots of a given smart object matching the filter. | |
| FSmartObjectRequestResult | FindSmartObject
(
const FSmartObjectRequest& Request, |
Spatial lookup for first slot in range respecting request criteria and selection conditions. | |
| FSmartObjectRequestResult | FindSmartObject
(
const FSmartObjectRequest& Request, |
Spatial lookup for first slot in range respecting request criteria and selection conditions. | |
| bool | FindSmartObjects
(
const FSmartObjectRequest& Request, |
Spatial lookup for slot candidates respecting request criteria and selection conditions. | |
| bool | FindSmartObjects
(
const FSmartObjectRequest& Request, |
Spatial lookup for slot candidates respecting request criteria and selection conditions. | |
| bool | FindSmartObjects_BP
(
const FSmartObjectRequest& Request, |
Blueprint function for spatial lookup for slot candidates respecting request criteria and selection conditions. | |
| void | GetAllSlots
(
const FSmartObjectHandle Handle, |
Return all slots of a given smart object. | |
| const DefinitionType * | GetBehaviorDefinition
(
const FSmartObjectClaimHandle& ClaimHandle |
Return the behavior definition of a given type from a claimed object. | |
| const USmartObjectBehaviorDefinition * | GetBehaviorDefinition
(
const FSmartObjectClaimHandle& ClaimHandle, |
Return the behavior definition of a given type from a claimed object. | |
| const DefinitionType * | GetBehaviorDefinition
(
const FSmartObjectRequestResult& RequestResult |
Return the behavior definition of a given type from a claimed object. | |
| const USmartObjectBehaviorDefinition * | GetBehaviorDefinition
(
const FSmartObjectRuntime& SmartObjectRuntime, |
||
| const USmartObjectBehaviorDefinition * | GetBehaviorDefinitionByRequestResult
(
const FSmartObjectRequestResult& RequestResult, |
Return the behavior definition of a given type from a request result. | |
| USmartObjectSubsystem * | GetCurrent
(
const UWorld* World |
||
| FOnSmartObjectEvent * | GetEventDelegate
(
const FSmartObjectHandle SmartObjectHandle |
Returns pointer to the smart object instance event delegate. | |
| const FGameplayTagContainer & | GetInstanceTags
(
const FSmartObjectHandle Handle |
Returns the list of tags associated to the smart object instance represented by the provided handle. | |
| TArrayView< TWeakObjectPtr< ASmartObjectPersistentCollection > > | |||
| FSmartObjectContainer & | |||
| TConstArrayView< TWeakObjectPtr< ASmartObjectPersistentCollection > > | |||
| int32 | GetRegisteredSmartObjectsCompatibleWithCollection
(
const ASmartObjectPersistentCollection& InCollection, |
||
| const FSmartObjectRuntime * | GetRuntimeInstance
(
const FSmartObjectHandle SmartObjectHandle |
Returns the const runtime instance associated to the provided handle | |
| FSmartObjectRuntime * | GetRuntimeInstance
(
const FSmartObjectHandle SmartObjectHandle |
Returns the runtime instance associated to the provided handle | |
| FOnSmartObjectEvent * | GetSlotEventDelegate
(
const FSmartObjectSlotHandle SlotHandle |
Returns pointer to the smart object changed delegate associated to the provided handle. | |
| TOptional< FVector > | GetSlotLocation
(
const FSmartObjectClaimHandle& ClaimHandle |
Returns the position (in world space) of the slot associated to the given claim handle. | |
| TOptional< FVector > | GetSlotLocation
(
const FSmartObjectSlotHandle SlotHandle |
Returns the position (in world space) of the slot represented by the provided slot handle. | |
| bool | GetSlotLocation
(
const FSmartObjectClaimHandle& ClaimHandle, |
Returns the position (in world space) of the slot associated to the given claim handle. | |
| TOptional< FVector > | GetSlotLocation
(
const FSmartObjectRequestResult& Result |
Returns the position (in world space) of the slot associated to the given request result. | |
| ESmartObjectSlotState | GetSlotState
(
const FSmartObjectSlotHandle SlotHandle |
||
| const FGameplayTagContainer & | GetSlotTags
(
const FSmartObjectSlotHandle SlotHandle |
Returns the list of tags associated to the smart object slot represented by the provided handle. | |
| bool | GetSlotTransform
(
const FSmartObjectClaimHandle& ClaimHandle, |
Returns the transform (in world space) of the slot associated to the given claim handle. | |
| TOptional< FTransform > | GetSlotTransform
(
const FSmartObjectSlotHandle SlotHandle |
Returns the transform (in world space) of the slot represented by the provided slot handle. | |
| TOptional< FTransform > | GetSlotTransform
(
const FSmartObjectRequestResult& Result |
Returns the transform (in world space) of the slot associated to the given request result. | |
| TOptional< FTransform > | GetSlotTransform
(
const FSmartObjectClaimHandle& ClaimHandle |
Returns the transform (in world space) of the slot associated to the given claim handle. | |
| FTransform | GetSlotTransformChecked
(
const FSmartObjectSlotHandle SlotHandle |
Similarly to GetSlotTransform fetches the transform (in world space) of the indicated slot, but assumes the slot handle is valid and that the EntityManager is known. | |
| bool | GetSlotTransformFromRequestResult
(
const FSmartObjectRequestResult& RequestResult, |
Returns the transform (in world space) of the slot associated to the given RequestResult. | |
| FSmartObjectSlotView | GetSlotView
(
const FSmartObjectSlotHandle SlotHandle |
Creates and returns a view to the data associated to a slot handle. | |
| USmartObjectComponent * | GetSmartObjectComponent
(
const FSmartObjectClaimHandle& ClaimHandle |
Returns the component associated to the claim handle if still accessible. | |
| USmartObjectComponent * | GetSmartObjectComponentByRequestResult
(
const FSmartObjectRequestResult& Result |
Returns the component associated to the given request result In some scenarios the component may no longer exist but its smart object data could (e.g. streaming) | |
| const FSmartObjectContainer & | |||
| FSmartObjectRuntime * | GetValidatedMutableRuntime
(
const FSmartObjectHandle Handle, |
Returns the mutable runtime instance associated to the provided handle Method produces log messages with provided context if provided handle is not set or associated instance can't be found. | |
| bool | GetValidatedMutableRuntimeAndSlot
(
const FSmartObjectSlotHandle SlotHandle, |
Returns the mutable runtime instance associated to the provided handle Method produces log messages with provided context if provided handle is not set or associated instance can't be found. | |
| const FSmartObjectRuntime * | GetValidatedRuntime
(
const FSmartObjectHandle Handle, |
Returns the const runtime instance associated to the provided handle. | |
| bool | GetValidatedRuntimeAndSlot
(
const FSmartObjectSlotHandle SlotHandle, |
Returns the const runtime instance associated to the provided handle. | |
| void | Creates all runtime data using main collection | ||
| bool | IsClaimedSmartObjectValid
(
const FSmartObjectClaimHandle& ClaimHandle |
Indicates if the object/slot referred to by the given handle are still accessible in the simulation. | |
| bool | IsEnabled
(
const FSmartObjectHandle Handle |
Returns the enabled state of the smart object represented by the provided handle. | |
| bool | IsSlotValidVerbose
(
const FSmartObjectSlotHandle SlotHandle, |
Indicates if the handle is set and the slot referred to is still accessible in the simulation. | |
| bool | IsSmartObjectSlotValid
(
const FSmartObjectSlotHandle SlotHandle |
Indicates if the slot referred to by the given handle is still accessible in the simulation. | |
| bool | IsSmartObjectValid
(
const FSmartObjectHandle Handle |
Indicates if the object referred to by the given handle is still accessible in the simulation. | |
| void | Iteratively adds items to registered collections. Expected to be called in World Partitined worlds. | ||
| FSmartObjectClaimHandle | MarkSlotAsClaimed
(
const FSmartObjectSlotHandle SlotHandle, |
Marks a smart object slot as claimed. | |
| bool | MarkSlotAsFree
(
const FSmartObjectClaimHandle& ClaimHandle |
Marks a claimed or occupied smart object as free. | |
| const DefinitionType * | MarkSlotAsOccupied
(
const FSmartObjectClaimHandle& ClaimHandle |
Marks a previously claimed smart object slot as occupied. | |
| const USmartObjectBehaviorDefinition * | MarkSlotAsOccupied
(
const FSmartObjectClaimHandle& ClaimHandle, |
Marks a previously claimed smart object slot as occupied. | |
| const USmartObjectBehaviorDefinition * | MarkSlotAsOccupied
(
FSmartObjectRuntime& SmartObjectRuntime, |
||
| void | OnSlotChanged
(
const FSmartObjectRuntime& SmartObjectRuntime, |
||
| void | PopulateCollection
(
ASmartObjectPersistentCollection& InCollection |
||
| ESmartObjectCollectionRegistrationResult | RegisterCollection
(
ASmartObjectPersistentCollection& InCollection |
||
| void | Make sure that all SmartObjectCollection actors from our associated world are registered. | ||
| void | RegisterSlotInvalidationCallback
(
const FSmartObjectClaimHandle& ClaimHandle, |
Register a callback to be notified if the claimed slot is no longer available and user need to perform cleanup. | |
| bool | RegisterSmartObject
(
USmartObjectComponent& SmartObjectComponent |
Registers a SmartObject components to the runtime simulation. | |
| bool | RegisterSmartObjectActor
(
const AActor& SmartObjectActor |
Registers to the runtime simulation all SmartObject components for a given actor. | |
| bool | RegisterSmartObjectInternal
(
USmartObjectComponent& SmartObjectComponent |
||
| bool | Release
(
const FSmartObjectClaimHandle& ClaimHandle |
Release claim on a smart object. | |
| bool | RemoveCollectionEntryFromSimulation
(
const FSmartObjectCollectionEntry& Entry |
||
| void | RemoveComponentFromSimulation
(
USmartObjectComponent& SmartObjectComponent |
||
| bool | RemoveRuntimeInstanceFromSimulation
(
const FSmartObjectHandle Handle, |
||
| bool | RemoveSmartObject
(
USmartObjectComponent& SmartObjectComponent |
Unbinds a SmartObject component from the runtime simulation and removes its runtime data. | |
| bool | RemoveSmartObjectActor
(
const AActor& SmartObjectActor |
Removes all data associated to SmartObject components of a given actor from the simulation. | |
| void | RemoveTagFromInstance
(
FSmartObjectRuntime& SmartObjectRuntime, |
||
| void | RemoveTagFromInstance
(
const FSmartObjectHandle Handle, |
Removes a single tag from the smartobject instance represented by the provided handle. | |
| bool | RemoveTagFromSlot
(
const FSmartObjectSlotHandle SlotHandle, |
Removes a single tag from the smart object slot represented by the provided handle. | |
| bool | SendSlotEvent
(
const FSmartObjectSlotHandle SlotHandle, |
Sends event to a Smart Object slot. | |
| bool | SetEnabled
(
const FSmartObjectHandle Handle, |
Enables or disables the entire smart object represented by the provided handle. | |
| bool | SetSlotEnabled
(
const FSmartObjectSlotHandle SlotHandle, |
Enables or disables the smart object slot represented by the provided handle. | |
| bool | SetSmartObjectActorEnabled
(
const AActor& SmartObjectActor, |
Enables or disables all smart objects associated to the provided actor (multiple components). | |
| void | SetupConditionContextCommonData
(
FWorldConditionContextData& ContextData, |
Fills the provided context data with the smartobject actor and handle associated to 'SmartObjectRuntime' and the subsystem. | |
| void | UnbindComponentFromSimulation
(
USmartObjectComponent& SmartObjectComponent |
Unbinds a smartobject component from an existing instance in the simulation. | |
| void | UnbindComponentFromSimulationInternal
(
USmartObjectComponent& SmartObjectComponent, |
Unbinds a smartobject component from the given FSmartObjectRuntime instance. | |
| void | UnregisterCollection
(
ASmartObjectPersistentCollection& InCollection |
||
| void | UnregisterSlotInvalidationCallback
(
const FSmartObjectClaimHandle& ClaimHandle |
Unregisters a callback to be notified if the claimed slot is no longer available and user need to perform cleanup. | |
| bool | UnregisterSmartObject
(
USmartObjectComponent& SmartObjectComponent |
Unbinds a SmartObject component from the runtime simulation and handles the associated runtime data according to the component registration type (i.e. runtime data associated to components from persistent collections will remain in the simulation). | |
| bool | UnregisterSmartObjectActor
(
const AActor& SmartObjectActor |
Unregisters from the simulation all SmartObject components for a given actor. | |
| bool | UnregisterSmartObjectInternal
(
USmartObjectComponent& SmartObjectComponent, |
||
| bool | UpdateEntranceLocation
(
const FSmartObjectSlotEntranceHandle EntranceHandle, |
Runs the same logic as FindEntranceLocationForSlot() but for a specific entrance location. |
Overridden from UWorldSubsystem
| Type | Name | Description | |
|---|---|---|---|
| void | OnWorldBeginPlay
(
UWorld& World |
BeginPlay will push all objects stored in the collection to the runtime simulation and initialize octree using collection bounds. | |
| void | OnWorldComponentsUpdated
(
UWorld& World |
Callback overridden to gather loaded collections, spawn missing one and set the main collection. |
Overridden from USubsystem
| Type | Name | Description | |
|---|---|---|---|
| void | Deinitialize () |
USubsystem BEGIN. | |
| bool | ShouldCreateSubsystem
(
UObject* Outer |
Override to control if the Subsystem should be created at all. |
Deprecated Functions
| Type | Name | Description | |
|---|---|---|---|
| void | AbortAll
(
const FSmartObjectRuntime& SmartObjectRuntime |
AbortAll() was changed to require object handle as parameter too. | |
| FSmartObjectRuntime * | AddCollectionEntryToSimulation
(
const FSmartObjectCollectionEntry& Entry, |
bCommitChanges is not used anymore, use the version without. | |
| FSmartObjectRuntime * | AddComponentToSimulation
(
USmartObjectComponent& SmartObjectComponent, |
bCommitChanges is not used anymore, use the version without. | |
| void | AddSlotDataDeferred
(
const FSmartObjectClaimHandle& ClaimHandle, |
Data is now added synchronously, use AddSlotData instead. | |
| FSmartObjectClaimHandle | Claim
(
const FSmartObjectSlotHandle SlotHandle, |
Please use MarkSlotAsClaimed instead | |
| FSmartObjectClaimHandle | Claim
(
const FSmartObjectHandle Handle, |
Please use MarkSlotAsClaimed passing only the slot handle | |
| FSmartObjectClaimHandle | Claim
(
const FSmartObjectHandle Handle, |
Please use both FindSlots and MarkSlotAsClaimed using only the slot handle. This will allow proper support of selection conditions. | |
| FSmartObjectClaimHandle | Claim
(
const FSmartObjectRequestResult& RequestResult, |
Please use MarkSmartObjectSlotAsClaimed instead | |
| const TMap< FSmartObjectSlotHandle, FSmartObjectRuntimeSlot > & | DebugGetRuntimeSlots() is not supported anymore, slots are accessed via object runtime instead. | ||
| void | DestroyRuntimeInstanceInternal
(
const FSmartObjectHandle Handle, |
EntityManagerRef is not used anymore, use the version without. | |
| bool | EvaluateConditionsForFiltering
(
const FSmartObjectSlotHandle SlotHandle, |
EvaluateConditionsForFiltering() was changed to rewuire smart object runtime as parameter. | |
| bool | EvaluateSlotConditions
(
FWorldConditionContextData& ConditionContextData, |
Use the version that takes smart object runtime and slot handle. | |
| void | FindSlots
(
const FSmartObjectRuntime& SmartObjectRuntime, |
FindSlots() was changed to require object handle as parameter too. | |
| FSmartObjectRuntimeSlot * | GetMutableSlot
(
const FSmartObjectClaimHandle& ClaimHandle |
Use GetValidatedMutableRuntimeAndSlot() instead. | |
| FSmartObjectRuntimeSlot * | GetMutableSlotVerbose
(
const FSmartObjectSlotHandle SlotHandle, |
Use GetValidatedMutableRuntimeAndSlot() instead. | |
| const FSmartObjectRuntimeSlot * | GetSlotVerbose
(
const FSmartObjectSlotHandle SlotHandle, |
Use GetValidatedRuntimeAndSlot() instead. | |
| void | InitializeRuntime
(
const TSharedPtr< FMassEntityManager >& InEntityManager |
Use InitializeRuntime() without Mass entity manager. | |
| const USmartObjectBehaviorDefinition * | MarkSlotAsOccupied
(
const FSmartObjectRuntime& SmartObjectRuntime, |
MarkSlotAsOccupied() was changed to require SmartObjectRuntime to be passed as mutable. | |
| PRAGMA_DISABLE_DEPRECATION_WARNINGSbool | UnregisterSmartObjectInternal
(
USmartObjectComponent& SmartObjectComponent, |
This flavor of UnregisterSmartObjectInternal is deprecated. Please use UnregisterSmartObjectInternal(USmartObjectComponent&, const bool) instead. | |
| const DefinitionType * | Use
(
const FSmartObjectClaimHandle& ClaimHandle |
Please use MarkSlotAsOccupied instead | |
| const USmartObjectBehaviorDefinition * | Use
(
const FSmartObjectClaimHandle& ClaimHandle, |
Please use MarkSmartObjectSlotAsOccupied instead |