进入vr事件。

This commit is contained in:
liteng 2018-06-27 22:07:46 +08:00
parent 6e774b7b3e
commit ad18e0c9d8
2 changed files with 3 additions and 5 deletions

View File

@ -90,10 +90,6 @@ function Viewport(app) {
var controls = new THREE.EditorControls(camera, container.dom);
editor.controls = controls;
this.app.on('enterVR.Viewport', function () {
vrEffect.isPresenting ? vrEffect.exitPresent() : vrEffect.requestPresent();
});
this.app.call('animate');
};

View File

@ -29,11 +29,11 @@ VREvent.prototype.stop = function () {
};
VREvent.prototype.onEnterVR = function () {
var groupVR = this.groupVR;
var editor = this.app.editor;
var viewport = this.app.viewport;
var sidebar = this.app.sidebar;
var vrEffect = editor.vrEffect;
if (groupVR == null) {
@ -67,6 +67,8 @@ VREvent.prototype.onEnterVR = function () {
}
vrEffect.isPresenting ? vrEffect.exitPresent() : vrEffect.requestPresent();
groupVR.visible = true;
};