Add Model::setLightPosition.

+ Convert some std::strings to QStrings.
This commit is contained in:
2025-03-23 09:29:06 -04:00
parent 5984763d43
commit 6528e872e5
9 changed files with 32 additions and 22 deletions

View File

@@ -485,13 +485,7 @@ void QtkScene::update()
// Helper lambda to set the light position used by GLSL shaders on the model.
// TODO: This could be a helper function on the Model class.
auto setLightPosition = [](const std::string & lightName, Model * model) {
if (auto light = MeshRenderer::getInstance(lightName.c_str()); light) {
QVector3D position = light->getTransform().getTranslation();
model->setUniform("uLight.position", position);
} else {
qDebug() << "[QtkScene] Failed to set light position: "
<< lightName.c_str();
}
};
QMatrix4x4 posMatrix;