Skip to content

Commit

Permalink
fix: quaternion rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeronimo97 committed Sep 16, 2023
1 parent 9a85f56 commit 56e30cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import java.util.HashMap;
import java.util.Map;

import com.troblecodings.core.QuaternionWrapper;
import com.troblecodings.guilib.ecs.entitys.UIBlockRender;
import com.troblecodings.guilib.ecs.entitys.UIEntity;
import com.troblecodings.guilib.ecs.entitys.input.UIDrag;
Expand All @@ -26,8 +27,8 @@ public PreviewSideBar(final float height) {
blockRenderEntity.setInheritHeight(true);
blockRenderEntity.setWidth(60);

blockRenderEntity
.add(new UIDrag((x, y) -> blockRender.updateRotation((float) x, (float) y, 0)));
blockRenderEntity.add(new UIDrag((x, y) -> blockRender
.updateRotation(QuaternionWrapper.fromXYZ(0, (float) x * MODIFIER, 0))));

blockRenderEntity.add(new UIScissor());
blockRenderEntity.add(new UIColor(GuiSignalBox.BACKGROUND_COLOR));
Expand Down

0 comments on commit 56e30cf

Please sign in to comment.