Atoms Crowd  7.0.0
Atoms::AgentsSimulation Class Reference

Agent simulation. More...

#include <AgentsSimulation.h>

Public Member Functions

 AgentsSimulation ()
 Constructor.
 
 ~AgentsSimulation ()
 Destructor.
 
void initSimulation ()
 Init simulation. More...
 
void initFrame ()
 Init Frame. More...
 
void computeFrame ()
 Compute frame. More...
 
void endFrame ()
 End frame. More...
 
void endSimulation ()
 End simulation. More...
 
void resetSimulation ()
 Reset simulation. More...
 
void initDynamics (double scale=1.0, bool debug=false)
 
void computeDynamics ()
 Compute dynamics. More...
 
void addAgentGroup (AtomsPtr< AgentGroup > &aGroup)
 Adds an agent group. More...
 
AtomsPtr< AgentGroupagentGroup (unsigned int i)
 Gets an agent group. More...
 
unsigned int numAgentGroups ()
 Get number of agent groups.
 
void agentGroupsByTag (const std::string &tag, std::vector< AgentGroup * > &groups)
 Fill the groups vector with all the agent group that have the tag name.
 
void removeAgentGroup (AtomsPtr< AgentGroup > &aGroup)
 Removes an agent group. More...
 
std::vector< std::string > agentGroupNames () const
 Gets all agent group names.
 
void addSimulationEvent (AtomsPtr< SimulationEvent > &simEvent, bool replace=true)
 Adds a simulation event. More...
 
void addAnimationClipEvent (AtomsPtr< SimulationEvent > &simEvent, bool replace=true)
 Adds a simulation event. More...
 
void addAgentTypeEvent (AtomsPtr< SimulationEvent > &simEvent, bool replace=true)
 Adds a simulation event. More...
 
void removeSimulationEvent (AtomsPtr< SimulationEvent > &simEvent)
 Removes a simulation event. More...
 
void removeSimulationEvent (const std::string &name)
 Removes a simulation event. More...
 
void moveSimulationEvent (AtomsPtr< SimulationEvent > &simEvent, unsigned int position, short type=SimulationEvent::kNative|SimulationEvent::kScript)
 Moves the simulation event.
 
void moveSimulationEvent (const std::string &name, unsigned int position, short type=SimulationEvent::kNative|SimulationEvent::kScript)
 Moves the simulation event.
 
std::vector< std::string > simulationEventNames (short type=SimulationEvent::kAll) const
 Gets all simulation events.
 
std::vector< std::string > animationClipEventNames (short type=SimulationEvent::kAnimClipNative|SimulationEvent::kAnimClipScript) const
 Gets all animation clip events.
 
std::vector< std::string > agentTypeEventNames (short type=SimulationEvent::kAgentTypeNative|SimulationEvent::kAgentTypeScript) const
 Gets all agent type events.
 
AtomsPtr< SimulationEventsimulationEvent (const std::string &name)
 Gets the simulation event with the given name.
 
void clear ()
 Remove all the events and agent groups from this simulation.
 
AtomsPhysxphysx ()
 Return the physx object.
 
void setDynamicEnabled (bool value)
 Enable or disable physx solver.
 
bool isDynamicEnabled () const
 Return if the physx solver is enabled.
 

Detailed Description

Agent simulation.

Class responsible for handling the simulation loop. It contains all the agent groups and manages all the simulation event.

Member Function Documentation

◆ addAgentGroup()

void Atoms::AgentsSimulation::addAgentGroup ( AtomsPtr< AgentGroup > &  aGroup)

Adds an agent group.

Parameters
aGroupPointer to an agent group

◆ addAgentTypeEvent()

void Atoms::AgentsSimulation::addAgentTypeEvent ( AtomsPtr< SimulationEvent > &  simEvent,
bool  replace = true 
)

Adds a simulation event.

This method also calls the load function of the simulation event

Parameters
simEventPointer to a simulation event

◆ addAnimationClipEvent()

void Atoms::AgentsSimulation::addAnimationClipEvent ( AtomsPtr< SimulationEvent > &  simEvent,
bool  replace = true 
)

Adds a simulation event.

This method also calls the load function of the simulation event

Parameters
simEventPointer to a simulation event

◆ addSimulationEvent()

void Atoms::AgentsSimulation::addSimulationEvent ( AtomsPtr< SimulationEvent > &  simEvent,
bool  replace = true 
)

Adds a simulation event.

This method also calls the load function of the simulation event

Parameters
simEventPointer to a simulation event

◆ agentGroup()

AtomsPtr<AgentGroup> Atoms::AgentsSimulation::agentGroup ( unsigned int  i)

Gets an agent group.

Parameters
iagent group index

◆ computeDynamics()

void Atoms::AgentsSimulation::computeDynamics ( )

Compute dynamics.

COmpute dynamics sim

◆ computeFrame()

void Atoms::AgentsSimulation::computeFrame ( )

Compute frame.

Called at each frame

◆ endFrame()

void Atoms::AgentsSimulation::endFrame ( )

End frame.

Called at the end of each frame

◆ endSimulation()

void Atoms::AgentsSimulation::endSimulation ( )

End simulation.

Called at the end of the simulation

◆ initFrame()

void Atoms::AgentsSimulation::initFrame ( )

Init Frame.

Called at the beginning of each frame

◆ initSimulation()

void Atoms::AgentsSimulation::initSimulation ( )

Init simulation.

Called at the beginning of the simulation

◆ removeAgentGroup()

void Atoms::AgentsSimulation::removeAgentGroup ( AtomsPtr< AgentGroup > &  aGroup)

Removes an agent group.

Parameters
aGroupPointer to a agent group

◆ removeSimulationEvent() [1/2]

void Atoms::AgentsSimulation::removeSimulationEvent ( AtomsPtr< SimulationEvent > &  simEvent)

Removes a simulation event.

It calls also the unload function of the simulation event

Parameters
simEventPointer to a simulation event

◆ removeSimulationEvent() [2/2]

void Atoms::AgentsSimulation::removeSimulationEvent ( const std::string &  name)

Removes a simulation event.

It calls also the unload function of the simulation event

Parameters
nameSimulation event name

◆ resetSimulation()

void Atoms::AgentsSimulation::resetSimulation ( )

Reset simulation.

Reset the simulation


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