-
Notifications
You must be signed in to change notification settings - Fork 231
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
BSFurnitureMarkerNode markers display as rotated in the wrong direction #239
Comments
might just be collision issue, more info here https://forums.nexusmods.com/topic/5140400-problem-with-setting-furniture-markers/ |
@nexustheru Thanks for this link. It gives me some ideas to help solve a different problem I was having. Unfortunately, collision has no effect on the rotation of the furniture marker, which is being displayed in NifSkope incorrectly. Viewing the marker of the NIF in the Creation Kit shows the correct orientation, while viewing the same file in Nifskope shows it incorrectly (see attached screenshots). The marker heading used was -1.570796 radian, or approximately -0.5 π radian, equivalent to -90°. Collision was removed from this mesh, but the result is the same. Changing line 1723 of glnode.cpp to |
oh so u fixed it awsome :) god job ;) |
altho nif xml might also be altered if this happend again, if its not there it should be. |
if its not there it might be a future enhancement? ^^ |
When working with a BSFurnitureMarkerNode, if the heading value is not equal to n * Pi, where n is an integer, the marker will be rendered as rotated in the opposite direction of the heading value.
It seems the game expects a positive heading value to refer to a clockwise rotation around the Z axis, while a negative heading value is a counterclockwise rotation around the Z axis.
The opposite is true in NifSkope. Positive heading values result in counterclockwise rotations and negative heading values result in clockwise rotations.
For example:
A heading value of zero will display the marker correctly because no rotation occurred.
A heading value of Pi will also display correctly because rotation 180° will result in an object facing the same direction, whether it was rotated clockwise or counterclockwise.
A heading value of 2 Pi will display correctly because rotation 360° also gives the same result, regardless of rotation direction.
A heading value of 0.5 Pi will display incorrectly because NifSkope rotates the marker counterclockwise 90°, while the game interprets it as a rotation 90° clockwise.
A heading value of -0.25 Pi will display incorrectly because NifSkope rotates the marker clockwise 45°, while the game interprets it as a rotation 45° counterclockwise.
This can be seen with the attached files. In Nifskope, the markers will look to have the wrong heading values (where not equal to 0 or Pi), but in the Creation Kit the markers will appear correct, and in game the character will sit/lay in the direction indicated in the Creation Kit. With the included plugin, you can use the command "coc aaafurnituretestcell" to teleport to a test cell with the example furniture.
FurnitureMarkerRotationExample.zip
To fix this, I think that in line 1723 of glnode.cpp, "heading" just has to be multiplied by -1? But I have very little knowledge about coding, so that's mostly a guess.
https://github.com/niftools/nifskope/blob/3a85ac55e65cc60abc3434cc4aaca2a5cc712eef/src/gl/glnode.cpp#L1723C18-L1723C18
Let me know if anything is unclear, or if I can provide more information.
The text was updated successfully, but these errors were encountered: