update config filePath

test-headless
ink-soul 2024-04-28 18:15:35 +08:00
parent f598bb1541
commit 088b8adfaf
3 changed files with 24 additions and 1 deletions

View File

@ -52,7 +52,14 @@ void PlumageConfig::PlumageConfiguration::readConfigurationFromToml(std::string
settings.debugMode = toml::find<bool>(debug, "debugMode");
//settings.cleanUpImageSequece = toml::find_or<bool>(debug, "cleanUpImageSequece");
//
/*
get fielPath
*/
auto& tomlFilePath = toml::find(config, "filePath");
// gltf model path
/*
conversion: type and coordinate system
@ -125,6 +132,20 @@ void PlumageConfig::PlumageConfiguration::readConfigurationFromToml(std::string
//settings.cY = settings.cY * ratioY;
}
std::string PlumageConfig::PlumageConfiguration::checkFilePath(std::string configFilePath)
{
std::filesystem::path filesystemConfigFilePath = configFilePath;
if (std::filesystem::exists(filesystemConfigFilePath))
{
return filesystemConfigFilePath.generic_string();
}
else
{
filesystemConfigFilePath = getAssetPath() + configFilePath;
return filesystemConfigFilePath.generic_string();
}
}
glm::vec3 PlumageConfig::PlumageConfiguration::getTranslatedVector(glm::vec3 currentVector,glm::vec3 targetVector)
{
glm::vec3 translate = glm::vec3(0.f,0.f,0.f) - targetVector;

View File

@ -153,6 +153,8 @@ namespace PlumageConfig
void readConfigurationFromToml(std::string configFilePath,Settings& settings);
std::string checkFilePath(std::string configFilePath);
void convertIntToVkSampleCount(uint32_t sampleCount);
glm::vec3 getTranslatedVector(glm::vec3 beforeVector, glm::vec3 afterVector);

Binary file not shown.