-
-
Notifications
You must be signed in to change notification settings - Fork 4.3k
Fix control transform components and rotationOffset #3407
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
Conversation
|
|
||
| object3D.rotateZ(this.data.rotationOffset * THREE.Math.DEG2RAD); | ||
|
|
||
| object3D.updateMatrix(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I haven't tested this PR in a Daydream/GearVR with a 3DoF controller yet. We disable matrixAutoUpdate in init, so I'm not sure how this code could have worked for those controllers without an explicit updateMatrix. Perhaps it was actually broken. I'll test with a 3DoF controller when I get a chance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Confirmed. Daydream controller does not update without this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for testing on it.
src/components/tracked-controls.js
Outdated
|
|
||
| // Apply transforms, if 6DOF and in VR. | ||
| if (vrDisplay) { | ||
| if (vrDisplay && pose.position !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dmarcos After testing in Daydream, I found that this change was necessary as well. Just wanted to ensure it makes sense to you as well.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It makes sense, we can just make position (vrDisplay && pose.position)
| assertVec3(el.getAttribute('position'), [2, 4, 6]); | ||
| }); | ||
|
|
||
| test('applies standing matrix transform', function () { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the tests
|
Thank you @brianpeiris 👍 |
Description:
#3327 changed the way we calculate tracked controller pose:
positionandquaternionproperties of the controller object. This prevents users and libraries (likenetworked-aframe) from reading those properties.tracked-control'srotationOffsetproperty, this lead tohand-controlswith incorrectly rotated hand models when using the Oculus Rift and Touch, as evident in the tracked-controls example.Changes proposed:
rotationOffsetproperty.