-
Notifications
You must be signed in to change notification settings - Fork 555
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a bug with attached entities and origin change
When the origin of a rotated entity changes, we need to update the position of any attached entities. Rotation around an origin is equivalent to shifting to the origin, rotating, and then shifting back. When the origin changes, conceptually we can handle this by reversing the current rotation, changing the origin, and then rotating back. However, this turns out to be equivavent to a simple shift in position, dependent on the current rotation, and the shift in origin. So th implementation calculates this shift and propagates it to child entities.
- Loading branch information
Showing
1 changed file
with
41 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters