From 0333cd2dd44851ba94abc219f432ccaf47de5d43 Mon Sep 17 00:00:00 2001 From: Capostrophic Date: Fri, 12 Apr 2019 16:35:44 +0300 Subject: [PATCH] Fix frozen rain when water refractions are disabled --- apps/openmw/mwrender/sky.cpp | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/apps/openmw/mwrender/sky.cpp b/apps/openmw/mwrender/sky.cpp index a624af0da..a28a9d66e 100644 --- a/apps/openmw/mwrender/sky.cpp +++ b/apps/openmw/mwrender/sky.cpp @@ -266,16 +266,16 @@ public: META_Node(MWRender, CameraRelativeTransform) - const osg::Vec3f& getLastEyePoint() const + const osg::Vec3f& getLastViewPoint() const { - return mEyePoint; + return mViewPoint; } virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix, osg::NodeVisitor* nv) const { if (nv->getVisitorType() == osg::NodeVisitor::CULL_VISITOR) { - mEyePoint = static_cast(nv)->getEyePoint(); + mViewPoint = static_cast(nv)->getViewPoint(); } if (_referenceFrame==RELATIVE_RF) @@ -337,8 +337,8 @@ public: } }; private: - // eyePoint for the current frame - mutable osg::Vec3f mEyePoint; + // viewPoint for the current frame + mutable osg::Vec3f mViewPoint; }; class ModVertexAlphaVisitor : public osg::NodeVisitor @@ -391,7 +391,7 @@ private: /// @brief Hides the node subgraph if the eye point is below water. /// @note Must be added as cull callback. /// @note Meant to be used on a node that is child of a CameraRelativeTransform. -/// The current eye point must be retrieved by the CameraRelativeTransform since we can't get it anymore once we are in camera-relative space. +/// The current view point must be retrieved by the CameraRelativeTransform since we can't get it anymore once we are in camera-relative space. class UnderwaterSwitchCallback : public osg::NodeCallback { public: @@ -404,8 +404,8 @@ public: bool isUnderwater() { - osg::Vec3f eyePoint = mCameraRelativeTransform->getLastEyePoint(); - return mEnabled && eyePoint.z() < mWaterLevel; + osg::Vec3f viewPoint = mCameraRelativeTransform->getLastViewPoint(); + return mEnabled && viewPoint.z() < mWaterLevel; } virtual void operator()(osg::Node* node, osg::NodeVisitor* nv)