Added commands for controling triplanar mapping

dev
Tomasz Kapuściński 2021-12-14 21:58:23 +01:00
parent 0207669d61
commit c389156499
1 changed files with 34 additions and 0 deletions

View File

@ -1495,6 +1495,40 @@ void CRobotMain::ExecuteCmd(const std::string& cmd)
return;
}
if (cmd.find("triplanar") != std::string::npos)
{
std::string command, arg;
std::istringstream stream(cmd);
stream >> command >> arg;
if (command == "triplanar_mode")
{
if (arg == "1" || arg == "on")
{
m_engine->SetTriplanarMode(true);
return;
}
if (arg == "0" || arg == "off")
{
m_engine->SetTriplanarMode(false);
return;
}
}
if (command == "triplanar_scale")
{
float scale = std::stof(arg);
if (scale > 0.01f && scale < 1000.0f)
{
m_engine->SetTriplanarScale(scale);
return;
}
}
}
float speed;
if (sscanf(cmd.c_str(), "speed %f", &speed) > 0)
{