10 #include <Atoms/Globals.h>
11 #include <Atoms/AgentGroup.h>
12 #include <Atoms/SimulationEvent.h>
13 #include <Atoms/Physx/AtomsPhysx.h>
64 void initDynamics(
double scale = 1.0,
bool debug =
false);
129 void moveSimulationEvent(AtomsPtr<SimulationEvent>& simEvent,
unsigned int position,
short type = SimulationEvent::kNative | SimulationEvent::kScript);
132 void moveSimulationEvent(
const std::string& name,
unsigned int position,
short type = SimulationEvent::kNative | SimulationEvent::kScript);
138 std::vector<std::string>
animationClipEventNames(
short type = SimulationEvent::kAnimClipNative | SimulationEvent::kAnimClipScript)
const;
141 std::vector<std::string>
agentTypeEventNames(
short type = SimulationEvent::kAgentTypeNative | SimulationEvent::kAgentTypeScript)
const;
160 std::vector<AtomsPtr<AgentGroup>> m_agentGroups;
162 std::vector<AtomsPtr<AgentGroup>> m_agentGroupsOrder;
164 std::list<AtomsPtr<SimulationEvent>> m_events;
171 mutable std::recursive_mutex m_mutex;
173 bool m_dynamicEnabled;
Agent simulation.
Definition: AgentsSimulation.h:24
void addAgentTypeEvent(AtomsPtr< SimulationEvent > &simEvent, bool replace=true)
Adds a simulation event.
std::vector< std::string > agentGroupNames() const
Gets all agent group names.
unsigned int numAgentGroups()
Get number of agent groups.
std::vector< std::string > agentTypeEventNames(short type=SimulationEvent::kAgentTypeNative|SimulationEvent::kAgentTypeScript) const
Gets all agent type events.
std::vector< std::string > animationClipEventNames(short type=SimulationEvent::kAnimClipNative|SimulationEvent::kAnimClipScript) const
Gets all animation clip events.
void resetSimulation()
Reset simulation.
AgentsSimulation()
Constructor.
void endFrame()
End frame.
void setDynamicEnabled(bool value)
Enable or disable physx solver.
void endSimulation()
End simulation.
void addSimulationEvent(AtomsPtr< SimulationEvent > &simEvent, bool replace=true)
Adds a simulation event.
void computeFrame()
Compute frame.
void initSimulation()
Init simulation.
~AgentsSimulation()
Destructor.
void addAnimationClipEvent(AtomsPtr< SimulationEvent > &simEvent, bool replace=true)
Adds a simulation event.
std::vector< std::string > simulationEventNames(short type=SimulationEvent::kAll) const
Gets all simulation events.
AtomsPtr< AgentGroup > agentGroup(unsigned int i)
Gets an agent group.
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 initFrame()
Init Frame.
void computeDynamics()
Compute dynamics.
void removeSimulationEvent(AtomsPtr< SimulationEvent > &simEvent)
Removes a simulation event.
void removeAgentGroup(AtomsPtr< AgentGroup > &aGroup)
Removes an agent group.
void moveSimulationEvent(const std::string &name, unsigned int position, short type=SimulationEvent::kNative|SimulationEvent::kScript)
Moves the simulation event.
void moveSimulationEvent(AtomsPtr< SimulationEvent > &simEvent, unsigned int position, short type=SimulationEvent::kNative|SimulationEvent::kScript)
Moves the simulation event.
bool isDynamicEnabled() const
Return if the physx solver is enabled.
void addAgentGroup(AtomsPtr< AgentGroup > &aGroup)
Adds an agent group.
void clear()
Remove all the events and agent groups from this simulation.
AtomsPtr< SimulationEvent > simulationEvent(const std::string &name)
Gets the simulation event with the given name.
void removeSimulationEvent(const std::string &name)
Removes a simulation event.
AtomsPhysx & physx()
Return the physx object.
Definition: AtomsPhysx.h:40
Atoms namespace.
Definition: Agent.h:29