Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AppBase - additional refactor to improve minimal app size #4175

Merged
merged 8 commits into from
Apr 6, 2022
Merged
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
Prev Previous commit
Next Next commit
deprecate4d vr-manager
Martin Valigursky committed Apr 6, 2022

Verified

This commit was signed with the committer’s verified signature.
TarikGul Tarik Gul
commit ccb929b207c60420a54a8cde0883d1c55a19a879
15 changes: 15 additions & 0 deletions src/deprecated/deprecated.js
Original file line number Diff line number Diff line change
@@ -115,6 +115,8 @@ import { basisInitialize } from '../resources/basis.js';
import { EventHandler } from '../core/event-handler.js';
import { Asset } from '../asset/asset.js';

import { VrManager } from '../vr/vr-manager.js';

// CORE

export const log = {
@@ -1070,6 +1072,19 @@ Application.prototype.renderLines = function (position, color, options) {
this._addLines(position, color, options);
};

Application.prototype.enableVr = function () {
if (!this.vr) {
this.vr = new VrManager(this);
}
};

Application.prototype.disableVr = function () {
if (this.vr) {
this.vr.destroy();
this.vr = null;
}
};

Object.defineProperty(CameraComponent.prototype, 'node', {
get: function () {
Debug.deprecated('pc.CameraComponent#node is deprecated. Use pc.CameraComponent#entity instead.');
27 changes: 0 additions & 27 deletions src/framework/app-base.js
Original file line number Diff line number Diff line change
@@ -47,8 +47,6 @@ import { ScriptRegistry } from '../script/script-registry.js';

import { I18n } from '../i18n/i18n.js';

import { VrManager } from '../vr/vr-manager.js';

import { ComponentSystemRegistry } from './components/registry.js';
import { script } from './script.js';
import { ApplicationStats } from './stats.js';
@@ -1635,31 +1633,6 @@ class AppBase extends EventHandler {
}
}

/**
* Create and assign a {@link VrManager} object to allow this application render in VR.
*
* @ignore
* @deprecated
*/
enableVr() {
if (!this.vr) {
this.vr = new VrManager(this);
}
}

/**
* Destroy the {@link VrManager}.
*
* @ignore
* @deprecated
*/
disableVr() {
if (this.vr) {
this.vr.destroy();
this.vr = null;
}
}

/** @private */
_firstBake() {
if (this.lightmapper) {