Skip to content

Commit

Permalink
Update camera-controls.mjs
Browse files Browse the repository at this point in the history
  • Loading branch information
willeastcott authored Dec 3, 2024
1 parent 0aef7e6 commit dc8b39b
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions scripts/esm/camera-controls.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -319,13 +319,9 @@ class CameraControls extends Script {
const position = new Vec3();
const rotation = new Quat();
this.app.xr.on('start', () => {
// Store the position and rotation of the camera
// Store the camera's position and rotation
position.copy(this.entity.getPosition());
rotation.copy(this.entity.getRotation());

// Set the camera's position to the ground
const pos = this.entity.getPosition();
this.entity.setPosition(pos.x, 0, pos.z);
});
this.app.xr.on('end', () => {
// Restore the camera's position and rotation
Expand Down

0 comments on commit dc8b39b

Please sign in to comment.