Atoms Crowd  7.0.0
AtomsModules::BehaviourTreeModule Class Reference
Inheritance diagram for AtomsModules::BehaviourTreeModule:
Atoms::BehaviourModule

Public Member Functions

void initSimulation (Atoms::AgentGroup *agentGroup=nullptr)
 Init simulation. More...
 
void agentsCreated (const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
 Agents Created. More...
 
void agentsKilled (const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
 Post frame. More...
 
void initFrame (const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
 Init frame. More...
 
void endFrame (const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
 End frame. More...
 
void prePhysics (const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
 Pre Physics. More...
 
void postPhysics (const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
 Post Physics. More...
 
void tickTree (const std::vector< Atoms::Agent * > &agents, Atoms::AgentGroup *agentGroup=nullptr)
 
bool hasDynamicAttributes () const
 Check if this module can generate attribute dynamically.
 
void refreshAttributes ()
 Refresh the attribute map metadata.
 
void getContextIndexes (std::vector< int > &indexes) const
 
const Atoms::BehaviourTreeContextgetContext (const int groupId) const
 
- Public Member Functions inherited from Atoms::BehaviourModule
 BehaviourModule ()
 Constructor.
 
virtual ~BehaviourModule ()
 Destructor.
 
virtual void preFrame (AgentGroup *agentGroup=nullptr)
 Pre frame. More...
 
virtual void endSimulation (const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
 End simulation. More...
 
virtual void resetSimulation (const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
 Reset simulation. More...
 
virtual void preDraw (DrawContext *context, const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
 Pre draw. More...
 
virtual void draw (DrawContext *context, const std::vector< Agent * > &agents, AgentGroup *agentGroup=nullptr)
 Draw. More...
 
virtual AtomsCore::MapMetadataattributes ()
 Returns the module attributes map.
 
virtual AtomsCore::MapMetadataattributeProperties ()
 Returns the module attribute properties map.
 
virtual const std::string & typeName () const
 Gets the module type name.
 
virtual void setTypeName (const std::string &typeName)
 Sets the module type name.
 
virtual void addAttribute (const std::string &attributeName, AtomsPtr< AtomsCore::Metadata > &metadata, bool perAgent=false)
 Add an attribute to the module, if the perAgent flag is set to true an extra attribute is added with the same name plus the "_override" suffix. This new attribute stores the agent overrides.
 
virtual void addAttribute (const std::string &attributeName, AtomsCore::Metadata *metadata, bool perAgent=false)
 
virtual void addAttributeProperty (const std::string &attributeName, const std::string &propertyName, AtomsPtr< AtomsCore::Metadata > &metadata)
 Add an attribute property to the module.
 
virtual void addAttributeProperty (const std::string &attributeName, const std::string &propertyName, AtomsCore::Metadata *metadata)
 
virtual bool removeAttribute (const std::string &attributeName)
 Removes an attribute from the module, this also removes the _override entry if present.
 
virtual void setEnabled (bool value)
 Set the enabled state for this module.
 
virtual bool isEnabled () const
 Gets the enabled state for this module.
 
void setSingleThread (bool value)
 Use single thread.
 
bool singleThread () const
 Return true if this module use a single thread.
 
virtual const std::string & name () const
 Gets the module name.
 
virtual void setName (const std::string &name)
 Sets the module name.
 
template<typename T >
getAttributePerAgent (const T &defaultValue, AtomsCore::MapMetadata *overrideMap, const std::string &id)
 Utils to get per agent attributes.
 
template<typename T >
getAttributePerAgent (const T &defaultValue, AtomsCore::MapMetadata *overrideMap, const std::string &id, const AtomsCore::MapMetadata &agentMetadata, const std::string &metadataName)
 Utils to get per agent attributes.
 
size_t profileTime (unsigned short index) const
 Get profile time.
 
void setProfileTime (unsigned short index, size_t us)
 

Static Public Member Functions

static Atoms::BehaviourModulecreator (const std::string &parameter)
 
- Static Public Member Functions inherited from Atoms::BehaviourModule
static bool ignoreCurrentModule (Atoms::Agent *agent, const std::string &currentModuleName, const std::vector< std::string > &moduleNames, const std::string &metadataName)
 
static void enableCurrentActiveModuleMetadata (Atoms::Agent *agent, const std::string &currentModuleName, const std::string &metadataName, const bool enable)
 
static void initializeAngularVelocity (Atoms::Agent *agent)
 
static void setAngularVelocities (Atoms::Agent *agent, const AtomsCore::Vector3 &newDir, const AtomsCore::Vector3 &preMaxTurnAngleDir, const double fps)
 
static void setAngularVelocities (Atoms::Agent *agent, const double angularVelocity, const double frameAngularVelocity)
 

Additional Inherited Members

- Public Types inherited from Atoms::BehaviourModule
enum  ProfileType {
  kInitSimulation = 0 , kPreFrame , kAgentsCreated , kInitFrame ,
  kEndFrame , kPrePhysics , kPostPhysics , kAgentsKilled ,
  kEndSimulation , kResetSimulation
}
 
enum  ModuleTpe { kNative = 0 , kScript = 1 }
 

Member Function Documentation

◆ agentsCreated()

void AtomsModules::BehaviourTreeModule::agentsCreated ( const std::vector< Atoms::Agent * > &  agents,
Atoms::AgentGroup agentGroup = nullptr 
)
virtual

Agents Created.

Called after the layout generators and the pool finished to allocate the memory for the new agents. At this point it is possibe to modify the behaviour network, the pose and metadatas of the agents.

Reimplemented from Atoms::BehaviourModule.

◆ agentsKilled()

void AtomsModules::BehaviourTreeModule::agentsKilled ( const std::vector< Atoms::Agent * > &  agents,
Atoms::AgentGroup agentGroup = nullptr 
)
virtual

Post frame.

Called after the post build pose of the other agents. This is the last point where the killed agents are accessible, the memory of those agents is cleaned straight afterward

Reimplemented from Atoms::BehaviourModule.

◆ endFrame()

void AtomsModules::BehaviourTreeModule::endFrame ( const std::vector< Atoms::Agent * > &  agents,
Atoms::AgentGroup agentGroup = nullptr 
)
virtual

End frame.

Called at the end of each frame after the agent poses are computed

Reimplemented from Atoms::BehaviourModule.

◆ initFrame()

void AtomsModules::BehaviourTreeModule::initFrame ( const std::vector< Atoms::Agent * > &  agents,
Atoms::AgentGroup agentGroup = nullptr 
)
virtual

Init frame.

Called at the beginning of each frame before the agent poses are computed

Reimplemented from Atoms::BehaviourModule.

◆ initSimulation()

void AtomsModules::BehaviourTreeModule::initSimulation ( Atoms::AgentGroup agentGroup = nullptr)
virtual

Init simulation.

Called one time at the beginning of the simulation before the agents are created

Reimplemented from Atoms::BehaviourModule.

◆ postPhysics()

void AtomsModules::BehaviourTreeModule::postPhysics ( const std::vector< Atoms::Agent * > &  agents,
Atoms::AgentGroup agentGroup = nullptr 
)
virtual

Post Physics.

Called after step physx

Reimplemented from Atoms::BehaviourModule.

◆ prePhysics()

void AtomsModules::BehaviourTreeModule::prePhysics ( const std::vector< Atoms::Agent * > &  agents,
Atoms::AgentGroup agentGroup = nullptr 
)
virtual

Pre Physics.

Called before step physx

Reimplemented from Atoms::BehaviourModule.


The documentation for this class was generated from the following file: