Navigation
API > API/Plugins > API/Plugins/LearningAgents
Inheritance Hierarchy
- UObjectBase
- UObjectBaseUtility
- UObject
- ULearningAgentsHelper
- UCollisionMonitorHelper
References
| Module | LearningAgents |
| Header | /Engine/Plugins/Experimental/LearningAgents/Source/LearningAgents/Public/LearningAgentsHelpers.h |
| Include | #include "LearningAgentsHelpers.h" |
Syntax
UCLASS&40;&41;
class UCollisionMonitorHelper : public ULearningAgentsHelper
Remarks
A helper for monitoring collisions between components.
This object works by monitoring for collisions between a given component and any other components with a given tag. To indicate which component to monitor for collisions SetComponent_ should be called (generally on the ULearningAgentsManagerComponent::AgentsAdded_ event) with the corresponding agent id.
If any collisions occur GetCollisionOccurred_ will report true until it is reset to false either by calling ResetCollisionOccurred_ or `GetAndResetCollisionOccurred_. It will also be automatically reset when the agent is reset.
Functions
| Type | Name | Description | |
|---|---|---|---|
| UCollisionMonitorHelper * | AddCollisionMonitorHelper
(
ULearningAgentsManagerComponent* InManagerComponent, |
Adds a new collision monitor helper to the given manager component. | |
| bool | GetAndResetCollisionOccurred
(
const int32 AgentId |
Gets if a collision has occurred for this agent and resets the state of if a collision has occurred back to false. | |
| bool | GetCollisionOccurred
(
const int32 AgentId |
Gets if a collision has occurred for this agent. | |
| void | Init
(
const int32 MaxAgentNum |
Initialize the internal state for a given maximum number of agents | |
| void | ResetCollisionOccurred
(
const int32 AgentId |
Resets the state of if a collision has occurred back to false. | |
| void | SetComponent
(
const int32 AgentId, |
Sets the component to monitor for collisions. |
Overridden from ULearningAgentsHelper
| Type | Name | Description | |
|---|---|---|---|
| void | OnAgentsRemoved
(
const TArray< int32 >& AgentIds |
Called whenever agents are removed from the associated ULearningAgentsManagerComponent object. | |
| void | OnAgentsReset
(
const TArray< int32 >& AgentIds |
Called whenever agents are reset on the associated ULearningAgentsManagerComponent object. |