-
Notifications
You must be signed in to change notification settings - Fork 62
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
Fix w3dview camera movement #1142
Fix w3dview camera movement #1142
Conversation
src/tools/w3dviewer/graphicview.cpp
Outdated
@@ -236,7 +236,7 @@ void CGraphicView::OnMouseMove(UINT nFlags, CPoint point) | |||
|
|||
v.X = (((float)point.x - (float)(r.right >> 1)) / (float)(r.right >> 1) | |||
- ((float)m_mousePos.x - (float)(r.right >> 1)) / (float)(r.right >> 1)) | |||
* m_radius * -1.0f; | |||
* m_radius; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The * -1.0f does exist in the original binary.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can absolutely confirm that this * -1.0f
causes inverted movement (camera moves left when moving right).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I tested the latest w3dview from the Thyme trunk alongside the original Westwood w3dview and when I hold down both mouse buttons and move left and right it behaves the same. But if I use the w3dview from this PR, it behaves differently.
That means the left and right movement currently in Thyme is correct to the original as far as I can tell.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok. So the intent was to have inverted movement on both axis. Ok then I will test your proposal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested and worked. Both axis are inverted now.
src/tools/w3dviewer/graphicview.cpp
Outdated
@@ -236,7 +236,7 @@ void CGraphicView::OnMouseMove(UINT nFlags, CPoint point) | |||
|
|||
v.X = (((float)point.x - (float)(r.right >> 1)) / (float)(r.right >> 1) | |||
- ((float)m_mousePos.x - (float)(r.right >> 1)) / (float)(r.right >> 1)) | |||
* m_radius * -1.0f; | |||
* m_radius; | |||
|
|||
v.Y = (((float)point.y - (float)(r.bottom >> 1)) / (float)(r.bottom >> 1) | |||
- ((float)m_mousePos.y - (float)(r.bottom >> 1)) / (float)(r.bottom >> 1)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On this line, the expressions are ((float)(r.bottom >> 1) - (float)point.y) and ((float)(r.bottom >> 1) - (float)m_mousePos.y)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Up and down camera movement is incorrect in Thyme w3dview compared to stock w3dview, the above-mentioned change should fix that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
35b5f68
to
3185148
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, approved.
Left and right camera movement was previously inverted. This fixes it.