Add Model::setLightPosition.
+ Convert some std::strings to QStrings.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user