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

This commit is contained in:
Erik Hofman 2022-01-29 13:29:44 +01:00
parent 76f1ffa269
commit a6624b8c89

View File

@ -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"),