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

Fix hsMatrix44::DecompRigid() quat decomposition. #688

Merged
merged 1 commit into from
Jul 23, 2020

Conversation

Hoikas
Copy link
Member

@Hoikas Hoikas commented Jul 22, 2020

At some point, hsQuat::FromMatrix44() was changed to a static method, but hsMatrix44::DecompRigid() was not updated and continued to use it as a member method. This resulted in the quaternion being discarded immediately.

In the interest of preventing these sorts of bugs in the future, I added C++17's [[nodiscard]] attribute where it made sense in hsQuat.

Required by PhysX 4.1.

At some point, `hsQuat::FromMatrix44()` was changed to a static method,
but `hsMatrix44::DecompRigid()` was not updated and continued to use it
as a member method. This resulted in the quaternion being discarded
immediately.
Copy link
Member

@zrax zrax left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You could technically add [[nodiscard]] to the various operator overloads too, but it seems less likely that someone would forget to use the result of an arithmetic expression.... ;)

@Hoikas
Copy link
Member Author

Hoikas commented Jul 22, 2020

:trollface:

@Hoikas Hoikas merged commit 1b50cce into H-uru:master Jul 23, 2020
@Hoikas Hoikas deleted the quat-mat branch July 23, 2020 11:17
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.

None yet

2 participants