From a6624b8c89571406f7627745d9b941f4918402da Mon Sep 17 00:00:00 2001 From: Erik Hofman Date: Sat, 29 Jan 2022 13:29:44 +0100 Subject: [PATCH] Add ALS prodecural lights compatible pointing_x, pointing_y, pointing_z. You can now use the same direction vector for both ALS and the Compositor lights --- simgear/scene/model/SGLight.cxx | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/simgear/scene/model/SGLight.cxx b/simgear/scene/model/SGLight.cxx index 5e472fd4..4f0a9444 100644 --- a/simgear/scene/model/SGLight.cxx +++ b/simgear/scene/model/SGLight.cxx @@ -265,6 +265,11 @@ void SGLight::configure(const SGPropertyNode *configNode) dirNode->getFloatValue("lookat-z-m")); osg::Vec3 dir = lookAt - pos; r.makeRotate(osg::Vec3(0, 0, -1), dir); + } else if (dirNode->hasValue("pointing_x")) { // ALS compatible + r.makeRotate(osg::Vec3(0, 0, -1), + osg::Vec3(-dirNode->getFloatValue("pointing_x"), + -dirNode->getFloatValue("pointing_y"), + -dirNode->getFloatValue("pointing_z"))); } else { r.makeRotate(osg::Vec3(0, 0, -1), osg::Vec3(dirNode->getFloatValue("x"),