Skip to content
Open
Changes from all commits
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
12 changes: 2 additions & 10 deletions react-360-keyboard/KeyboardModule.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Module, Math as VRMath, Surface} from 'react-360-web';
import {Module, Surface} from 'react-360-web';

import type {ReactInstance} from 'react-360-web';
import type {Config} from './Keyboard';
Expand All @@ -18,15 +18,7 @@ class KeyboardModule extends Module {
}

_frameHook() {
const cameraDirection = [0, -0.38, -1];
const cameraQuat = this._instance.getCameraQuaternion();
VRMath.rotateByQuaternion(cameraDirection, cameraQuat);
const cx = cameraDirection[0];
const cy = cameraDirection[1];
const cz = cameraDirection[2];
const horizAngle = Math.atan2(cx, -cz);
const vertAngle = Math.asin(cy / Math.sqrt(cx * cx + cy * cy + cz * cz));
this._surface.setAngle(horizAngle, vertAngle);
this._surface.setAngle(0, -0.36);
this._surface.setRadius(3.5);
this._surface.setVisibility(Boolean(this._inputResolver));
}
Expand Down