forked from teamnwah/openmw-tes3coop
SunGlareCallback: Fix incorrect view matrix for RELATIVE_RF cameras
This commit is contained in:
parent
49df6b7450
commit
ef5838df7e
1 changed files with 3 additions and 3 deletions
|
@ -741,7 +741,7 @@ private:
|
|||
{
|
||||
osgUtil::CullVisitor* cv = static_cast<osgUtil::CullVisitor*>(nv);
|
||||
|
||||
float angleRadians = getAngleToSunInRadians(cv->getCurrentCamera());
|
||||
float angleRadians = getAngleToSunInRadians(*cv->getCurrentRenderStage()->getInitialViewMatrix());
|
||||
float visibleRatio = getVisibleRatio(cv->getCurrentCamera());
|
||||
|
||||
const float angleMaxRadians = osg::DegreesToRadians(mSunGlareFaderAngleMax);
|
||||
|
@ -784,10 +784,10 @@ private:
|
|||
}
|
||||
|
||||
private:
|
||||
float getAngleToSunInRadians(osg::Camera* camera) const
|
||||
float getAngleToSunInRadians(const osg::Matrix& viewMatrix) const
|
||||
{
|
||||
osg::Vec3d eye, center, up;
|
||||
camera->getViewMatrixAsLookAt(eye, center, up);
|
||||
viewMatrix.getLookAt(eye, center, up);
|
||||
|
||||
osg::Vec3d forward = center - eye;
|
||||
osg::Vec3d sun = mSunTransform->getPosition();
|
||||
|
|
Loading…
Reference in a new issue