16
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-07-18 03:09:18 +02:00

obstacle crash event

This commit is contained in:
milek7
2019-04-09 13:04:25 +02:00
parent 3de12ed827
commit a4bd25d47c
5 changed files with 51 additions and 0 deletions

View File

@@ -188,10 +188,12 @@ void state_manager::process_commands() {
std::getline(ss, data, ':');
simulation::State.create_model(data, name, commanddata.location);
simulation::State.create_eventlauncher("node -1 0 launcher eventlauncher 0 0 0 20 none -0.1 obstacle_collision end", name + "_snd", commanddata.location);
}
if (commanddata.command == user_command::deletemodel) {
simulation::State.delete_model(simulation::Instances.find(commanddata.payload));
simulation::State.delete_eventlauncher(simulation::Events.FindEventlauncher(commanddata.payload + "_snd"));
}
if (commanddata.command == user_command::radiostop) {
@@ -288,11 +290,19 @@ TAnimModel * state_manager::create_model(const std::string &src, const std::stri
return m_serializer.create_model(src, name, position);
}
TEventLauncher * state_manager::create_eventlauncher(const std::string &src, const std::string &name, const glm::dvec3 &position) {
return m_serializer.create_eventlauncher(src, name, position);
}
void state_manager::delete_model(TAnimModel *model) {
Region->erase(model);
Instances.purge(model);
}
void state_manager::delete_eventlauncher(TEventLauncher *launcher) {
launcher->dRadius = 0.0f; // disable it
}
void
state_manager::update_clocks() {