Atoms Crowd
7.0.0
|
#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< AgentGroup > | agentGroup (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< SimulationEvent > | simulationEvent (const std::string &name) |
Gets the simulation event with the given name. | |
void | clear () |
Remove all the events and agent groups from this simulation. | |
AtomsPhysx & | physx () |
Return the physx object. | |
void | setDynamicEnabled (bool value) |
Enable or disable physx solver. | |
bool | isDynamicEnabled () const |
Return if the physx solver is enabled. | |
Agent simulation.
Class responsible for handling the simulation loop. It contains all the agent groups and manages all the simulation event.
void Atoms::AgentsSimulation::addAgentGroup | ( | AtomsPtr< AgentGroup > & | aGroup | ) |
Adds an agent group.
aGroup | Pointer to an agent group |
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
simEvent | Pointer to a simulation event |
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
simEvent | Pointer to a simulation event |
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
simEvent | Pointer to a simulation event |
AtomsPtr<AgentGroup> Atoms::AgentsSimulation::agentGroup | ( | unsigned int | i | ) |
Gets an agent group.
i | agent group index |
void Atoms::AgentsSimulation::computeDynamics | ( | ) |
Compute dynamics.
COmpute dynamics sim
void Atoms::AgentsSimulation::computeFrame | ( | ) |
Compute frame.
Called at each frame
void Atoms::AgentsSimulation::endFrame | ( | ) |
End frame.
Called at the end of each frame
void Atoms::AgentsSimulation::endSimulation | ( | ) |
End simulation.
Called at the end of the simulation
void Atoms::AgentsSimulation::initFrame | ( | ) |
Init Frame.
Called at the beginning of each frame
void Atoms::AgentsSimulation::initSimulation | ( | ) |
Init simulation.
Called at the beginning of the simulation
void Atoms::AgentsSimulation::removeAgentGroup | ( | AtomsPtr< AgentGroup > & | aGroup | ) |
Removes an agent group.
aGroup | Pointer to a agent group |
void Atoms::AgentsSimulation::removeSimulationEvent | ( | AtomsPtr< SimulationEvent > & | simEvent | ) |
Removes a simulation event.
It calls also the unload function of the simulation event
simEvent | Pointer to a simulation event |
void Atoms::AgentsSimulation::removeSimulationEvent | ( | const std::string & | name | ) |
Removes a simulation event.
It calls also the unload function of the simulation event
name | Simulation event name |
void Atoms::AgentsSimulation::resetSimulation | ( | ) |
Reset simulation.
Reset the simulation