Skip to content
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions src/components/oculus-touch-controls.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,14 +59,14 @@ var CONTROLLER_PROPERTIES = {
'oculus-touch-v2': {
left: {
modelUrl: TOUCH_GEN2_CONTROLLER_MODEL_BASE_URL + 'gen2-left.gltf',
rayOrigin: {origin: {x: -0.01, y: 0, z: -0.02}, direction: {x: 0, y: -0.5, z: -1}},
modelPivotOffset: new THREE.Vector3(0, 0, 0),
rayOrigin: {origin: {x: 0, y: 0, z: 0}, direction: {x: 0, y: 0, z: -1}},
modelPivotOffset: new THREE.Vector3(0.01, 0.005, 0.03),
Copy link
Member

Choose a reason for hiding this comment

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

Why does the model position need to be adjusted? I thought the problem was only with the ray position.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It seems that the model is slightly out of position. I adjusted the offset so that the model position does not change when entering/leaving VR.
However it is only tested on my Oculus Quest, so I'll also consider to reset the change.

Copy link
Member

@dmarcos dmarcos May 7, 2020

Choose a reason for hiding this comment

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

Better to separate changes and put the model shift in a different PR if necessary. I still think that for the rayOrigin we should probably use InputSource values instead of hard coding numbers.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry for late, I reverted the change for model shift.
Also, it seems that XRInputSource.targetRaySpace has already been applied to the pose of controllers. https://github.com/aframevr/aframe/blob/master/src/components/tracked-controls-webxr.js#L115 So rayOrigin and direction may not be needed if XRInputSource is available.

modelPivotRotation: new THREE.Euler(0, 0, 0)
},
right: {
modelUrl: TOUCH_GEN2_CONTROLLER_MODEL_BASE_URL + 'gen2-right.gltf',
rayOrigin: {origin: {x: 0.01, y: 0, z: -0.02}, direction: {x: 0, y: -0.5, z: -1}},
modelPivotOffset: new THREE.Vector3(0, 0, 0),
rayOrigin: {origin: {x: 0, y: 0, z: 0}, direction: {x: 0, y: 0, z: -1}},
modelPivotOffset: new THREE.Vector3(-0.01, 0.005, 0.03),
modelPivotRotation: new THREE.Euler(0, 0, 0)
}
}
Expand Down