public bool Initialize(String behaveXml, String sceneXml, String model, String pluginPath) { if (MengeWrapper.InitSimulator(behaveXml, sceneXml, model, pluginPath)) { FindTriggers(); uint count = MengeWrapper.AgentCount(); for (uint i = 0; i < count; ++i) { Agent agt = new Agent(); float x = 0; float y = 0; float z = 0; MengeWrapper.GetAgentPosition(i, ref x, ref y, ref z); agt._pos = new Vector3(x, y, z); MengeWrapper.GetAgentOrient(i, ref x, ref y); agt._orient = new Vector2(x, y); agt._class = MengeWrapper.GetAgentClass(i); agt._radius = MengeWrapper.GetAgentRadius(i); _agents.Add(agt); } return(true); } else { System.Console.WriteLine("Failed to initialize simulator."); } return(false); }
/// <summary> /// Advances the simulation by the current time step. /// </summary> /// <returns>True if evaluation is successful and the simulation can proceed.</returns> public bool DoStep() { bool running = MengeWrapper.DoStep(); for (int i = 0; i < _agents.Count; ++i) { float x = 0, y = 0, z = 0; MengeWrapper.GetAgentPosition((uint)i, ref x, ref y, ref z); _agents[i].Position.Set(x, y, z); } return(true); }
public bool Initialize(String behaveXml, String sceneXml, String model) { if (MengeWrapper.InitSimulator(behaveXml, sceneXml, model)) { uint count = MengeWrapper.AgentCount(); for (uint i = 0; i < count; ++i) { Agent agt = new Agent(); float x = 0; float y = 0; float z = 0; MengeWrapper.GetAgentPosition(i, ref x, ref y, ref z); agt._pos = new Vector3(x, y, z); _agents.Add(agt); } return(true); } else { System.Console.WriteLine("Failed to initialize simulator."); } return(false); }