"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.tempScaleCoef = exports.ZSpaceEntity = exports.INSPIRE_WIDTH = void 0;
exports.makeZSpaceEntity = makeZSpaceEntity;
const core_1 = require("@vived/core");
const ZSpaceDisplayEntity_1 = require("./ZSpaceDisplayEntity");
const ZSpaceViewEntity_1 = require("./ZSpaceViewEntity");
exports.INSPIRE_WIDTH = 0.344;
class ZSpaceEntity extends core_1.AppObjectEntity {
    static get(appObjects) {
        return (0, core_1.getSingletonComponent)(ZSpaceEntity.type, appObjects);
    }
}
exports.ZSpaceEntity = ZSpaceEntity;
ZSpaceEntity.type = "ZSpaceEntity";
function makeZSpaceEntity(appObj) {
    return new ZSpaceImp(appObj);
}
exports.tempScaleCoef = 1; // 1 for Inspire, 1.52 for AIO
class ZSpaceImp extends ZSpaceEntity {
    get viewerScale() {
        return this.memoizedViewerScale.val;
    }
    set viewerScale(val) {
        this.memoizedViewerScale.val = val;
    }
    get isSupported() {
        return this.memoizedIsSupported.val;
    }
    set isSupported(val) {
        this.memoizedIsSupported.val = val;
    }
    get enabled() {
        return this.memoizedEnabled.val;
    }
    set enabled(val) {
        this.memoizedEnabled.val = val;
    }
    get emulate() {
        return this.memoizedEmulate.val;
    }
    set emulate(val) {
        this.memoizedEmulate.val = val;
    }
    get isRendering() {
        return this.memoizedIsRendering.val;
    }
    set isRendering(val) {
        this.memoizedIsRendering.val = val;
    }
    constructor(appObj) {
        super(appObj, ZSpaceEntity.type);
        this.memoizedViewerScale = new core_1.MemoizedNumber(1, this.notifyOnChange); // 1 for Inspire, .65 for AIO
        this.memoizedIsSupported = new core_1.MemoizedBoolean(false, this.notifyOnChange);
        this.memoizedEnabled = new core_1.MemoizedBoolean(false, this.notifyOnChange);
        this.memoizedEmulate = new core_1.MemoizedBoolean(false, this.notifyOnChange);
        this.memoizedIsRendering = new core_1.MemoizedBoolean(false, this.notifyOnChange);
        const headView = appObj.appObjectRepo.getOrCreate("zSpaceHeadView");
        this.headView = (0, ZSpaceViewEntity_1.makeZSpaceView)(headView, ZSpaceViewEntity_1.ZSpaceViewType.CENTER);
        const leftEye = appObj.appObjectRepo.getOrCreate("zSpaceLeftEyeView");
        this.leftEyeView = (0, ZSpaceViewEntity_1.makeZSpaceView)(leftEye, ZSpaceViewEntity_1.ZSpaceViewType.LEFT);
        const rightEye = appObj.appObjectRepo.getOrCreate("zSpaceRightEyeView");
        this.rightEyeView = (0, ZSpaceViewEntity_1.makeZSpaceView)(rightEye, ZSpaceViewEntity_1.ZSpaceViewType.RIGHT);
        const displayAO = appObj.appObjectRepo.getOrCreate("zSpaceDisplay");
        this.display = (0, ZSpaceDisplayEntity_1.makeZSpaceDisplayEntity)(displayAO);
    }
}
//# sourceMappingURL=ZSpaceEntity.js.map