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 SetRotationNode: don't change rotation of previous objects #2414

Merged
merged 1 commit into from
Jan 1, 2022

Conversation

MoritzBrueckner
Copy link
Collaborator

@MoritzBrueckner MoritzBrueckner commented Dec 31, 2021

Fixes #2413.

Quat is a mutable type and because the SetRotationNode didn't clone the inputted quaternion, all previous usages of that quaternion were also changed and even if only one object would be used for this node, the inputted quaternion might be used in other places where it would also be changed by this node.

In order to prevent an allocation on the heap, the rotation quat of an object is no longer exchanged, only its values are updated instead (setFrom()). Then the cloned quaternion can be inlined by Haxe.

@MoritzBrueckner MoritzBrueckner added the Release Notes: Fixes A pull request that fixes something. Used to generate release notes. label Dec 31, 2021
@luboslenco luboslenco merged commit e597f13 into armory3d:master Jan 1, 2022
@MoritzBrueckner MoritzBrueckner deleted the fix-set-rotation-node branch January 2, 2022 17:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Release Notes: Fixes A pull request that fixes something. Used to generate release notes.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Logic Node: Set Object Rotation - rotates all objects with Rigidbodies (Animated enable)
2 participants