Skip to content

Conversation

nightgryphon
Copy link

@nightgryphon nightgryphon commented Jul 5, 2023

While using room scale VR the camera position can change while you are walking so rotation center and teleport origin has to be adjusted according to current camera (user head) position

@vincentfretin
Copy link
Contributor

Thanks @nightgryphon that fixes indeed the issue!
@jure do you have a chance to look at it and merge it?

if (Math.abs(rotation - Math.PI / 2.0) < 0.6) {
rigCameraOffset.sub( rigCameraOffset.clone().applyAxisAngle(new THREE.Vector3( 0, 1, 0 ), +this.snapturnRotation) );
this.cameraRig.object3D.rotateY(+this.snapturnRotation)
this.cameraRig.object3D.position.add(rigCameraOffset);
Copy link
Contributor

Choose a reason for hiding this comment

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

replace the tab by spaces

} else if (Math.abs(rotation - 1.5 * Math.PI) < 0.6) {
rigCameraOffset.sub( rigCameraOffset.clone().applyAxisAngle(new THREE.Vector3( 0, 1, 0 ), -this.snapturnRotation) );
this.cameraRig.object3D.rotateY(-this.snapturnRotation)
this.cameraRig.object3D.position.add(rigCameraOffset);
Copy link
Contributor

Choose a reason for hiding this comment

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

replace the tab by spaces

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.

2 participants