Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Weather-related fixes (incl. bug #4783) #2562

Merged
merged 1 commit into from
Oct 21, 2019
Merged

Conversation

Capostrophic
Copy link
Collaborator

@Capostrophic Capostrophic commented Oct 19, 2019

  1. Simplify some calculations
    Some calculations added by akortunov to conform to the vanilla research were extraneous.
    In storm direction calculations, storm direction is a 1-unit length vector, so multiplied by wind speed its length would just be wind speed. I removed that part from wind speed calculations.
    In rain angle calculation, both atan2 arguments are positive (mWindSpeed is non-negative), so it is possible to use atan and a single argument. This also allows to avoid a division by zero if the rain weather Morrowind.ini wind speed is somehow 0.

  2. Fix Blizzard weather direction (bug 4783)
    Blizzard is no longer considered a glorified ash storm and moves from south to north instead of Red Mountain to player. Blizzard model is now rotated by 90 degrees clockwise like in Morrowind to look correct. The clouds rotation still uses the normal rotation quaternion to look as intended. Practical storm direction for hand shielding purposes is still correct. I also moved the whole storm direction calculations into weather update because it actually only calculated ash storm direction and not storm direction.

  3. Fix clouds direction
    Now they should consistently move from south to north or follow the storm particle direction. Their direction could be reverse in some situations.

I decided to use model checks instead of weather ID checks to avoid confusion between different storm weathers during transitions and to make it easier to dehardcode clearly Morrowind-specific ash/blight weathers in the future.

Simplify some calculations
Fix Blizzard weather direction
Fix sky direction during storm
@psi29a
Copy link
Member

psi29a commented Oct 21, 2019

lgtm, thanks.

@psi29a psi29a merged commit 36119ec into OpenMW:master Oct 21, 2019
@Capostrophic Capostrophic deleted the weather branch October 21, 2019 20:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants