mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-19 21:46:36 +00:00
direction of the sun light != direction to the sun
This commit is contained in:
parent
a560aceb2a
commit
855b236ee8
1 changed files with 3 additions and 1 deletions
|
@ -157,9 +157,11 @@ namespace MWLua
|
||||||
|
|
||||||
api["getCurrentSunLightDirection"] = []() {
|
api["getCurrentSunLightDirection"] = []() {
|
||||||
osg::Vec4f sunPos = MWBase::Environment::get().getWorld()->getSunLightPosition();
|
osg::Vec4f sunPos = MWBase::Environment::get().getWorld()->getSunLightPosition();
|
||||||
|
// normalize to get the direction towards the sun
|
||||||
sunPos.normalize();
|
sunPos.normalize();
|
||||||
|
|
||||||
return sunPos;
|
// and invert it to get the direction of the sun light
|
||||||
|
return -sunPos;
|
||||||
};
|
};
|
||||||
api["getCurrentSunVisibility"] = []() { return MWBase::Environment::get().getWorld()->getSunVisibility(); };
|
api["getCurrentSunVisibility"] = []() { return MWBase::Environment::get().getWorld()->getSunVisibility(); };
|
||||||
api["getCurrentSunPercentage"] = []() { return MWBase::Environment::get().getWorld()->getSunPercentage(); };
|
api["getCurrentSunPercentage"] = []() { return MWBase::Environment::get().getWorld()->getSunPercentage(); };
|
||||||
|
|
Loading…
Reference in a new issue