Skip to content

Fix head rotation (attempt 2)#32

Merged
henryouly merged 1 commit intomainfrom
henryouly-head-rotation
Jun 6, 2022
Merged

Fix head rotation (attempt 2)#32
henryouly merged 1 commit intomainfrom
henryouly-head-rotation

Conversation

@henryouly
Copy link
Collaborator

@henryouly henryouly commented Jun 5, 2022

Change FaceRotation from Euler angle to Quaternion. It appears to fix the issue.

Previous PR (#24) did not fix the issue. The recognition still sometimes get the movement direction (up/down, left/right) inverted. It's hard to 100% repro on each run.

I suspect the previous implementation has problems specific to Euler angles, like gimbal lock.

Side effect: The clamping of face rotation is removed, however, it doesn't seem to be necessary from my current testing, but we can add it back if there's a requirement to clamp at a max angle.

References:
https://answers.unity.com/questions/1266985/convert-rotation-vector-or-matrix-to-quaternion.html
yuenshome/yuenshome.github.io#9

Fix #19

@henryouly henryouly requested a review from wixette June 5, 2022 22:39
Copy link
Contributor

@wixette wixette left a comment

Choose a reason for hiding this comment

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

LGTM

@henryouly henryouly merged commit dfca648 into main Jun 6, 2022
@henryouly henryouly deleted the henryouly-head-rotation branch June 6, 2022 15:55
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.

Debug head rotation

2 participants