mirror of
https://github.com/OpenMW/openmw.git
synced 2025-10-18 02:46:40 +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"] = []() {
|
||||
osg::Vec4f sunPos = MWBase::Environment::get().getWorld()->getSunLightPosition();
|
||||
// normalize to get the direction towards the sun
|
||||
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["getCurrentSunPercentage"] = []() { return MWBase::Environment::get().getWorld()->getSunPercentage(); };
|
||||
|
|
Loading…
Reference in a new issue