How to use the babylonjs.Observable function in babylonjs

To help you get started, we’ve selected a few babylonjs examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github BabylonJS / Babylon.js / Viewer / src / templateManager.ts View on Github external
constructor(public name: string, private configuration: TemplateConfiguration) {
        this.onInit = new Observable<template>();
        this.onLoaded = new Observable<template>();
        this.onAppended = new Observable<template>();
        this.onStateChange = new Observable<template>();

        this.isLoaded = false;
        /*
                if (configuration.id) {
                    this.parent.id = configuration.id;
                }
        */
        this.onInit.notifyObservers(this);

        let htmlContentPromise = getTemplateAsHtml(configuration);

        htmlContentPromise.then(htmlTemplate =&gt; {
            if (htmlTemplate) {
                let compiledTemplate = Handlebars.compile(htmlTemplate);
</template></template></template></template>
github BabylonJS / Babylon.js / Viewer / src / managers / observablesManager.ts View on Github external
constructor() {
        this.onSceneInitObservable = new Observable();
        this.onEngineInitObservable = new Observable();
        this.onModelLoadedObservable = new Observable();
        this.onModelLoadProgressObservable = new Observable();
        this.onModelLoadErrorObservable = new Observable();
        this.onModelAddedObservable = new Observable();
        this.onModelRemovedObservable = new Observable();
        this.onViewerInitDoneObservable = new Observable();
        this.onViewerInitStartedObservable = new Observable();
        this.onLoaderInitObservable = new Observable();
        this.onFrameRenderedObservable = new Observable();
        this.onEnteringVRObservable = new Observable();
        this.onExitingVRObservable = new Observable();
    }
github BabylonJS / Babylon.js / Viewer / src / templateManager.ts View on Github external
constructor(public containerElement: HTMLElement) {
        this.templates = {};

        this.onInit = new Observable<template>();
        this.onLoaded = new Observable<template>();
        this.onStateChange = new Observable<template>();
        this.onAllLoaded = new Observable();
    }

</template></template></template>
github BabylonJS / Babylon.js / Viewer / src / managers / observablesManager.ts View on Github external
constructor() {
        this.onSceneInitObservable = new Observable();
        this.onEngineInitObservable = new Observable();
        this.onModelLoadedObservable = new Observable();
        this.onModelLoadProgressObservable = new Observable();
        this.onModelLoadErrorObservable = new Observable();
        this.onModelAddedObservable = new Observable();
        this.onModelRemovedObservable = new Observable();
        this.onViewerInitDoneObservable = new Observable();
        this.onViewerInitStartedObservable = new Observable();
        this.onLoaderInitObservable = new Observable();
        this.onFrameRenderedObservable = new Observable();
        this.onEnteringVRObservable = new Observable();
        this.onExitingVRObservable = new Observable();
    }
github BabylonJS / Babylon.js / Viewer / src / managers / observablesManager.ts View on Github external
constructor() {
        this.onSceneInitObservable = new Observable();
        this.onEngineInitObservable = new Observable();
        this.onModelLoadedObservable = new Observable();
        this.onModelLoadProgressObservable = new Observable();
        this.onModelLoadErrorObservable = new Observable();
        this.onModelAddedObservable = new Observable();
        this.onModelRemovedObservable = new Observable();
        this.onViewerInitDoneObservable = new Observable();
        this.onViewerInitStartedObservable = new Observable();
        this.onLoaderInitObservable = new Observable();
        this.onFrameRenderedObservable = new Observable();
        this.onEnteringVRObservable = new Observable();
        this.onExitingVRObservable = new Observable();
    }
github BabylonJS / Babylon.js / Viewer / src / templateManager.ts View on Github external
constructor(public name: string, private configuration: TemplateConfiguration) {
        this.onInit = new Observable<template>();
        this.onLoaded = new Observable<template>();
        this.onAppended = new Observable<template>();
        this.onStateChange = new Observable<template>();

        this.isLoaded = false;
        /*
                if (configuration.id) {
                    this.parent.id = configuration.id;
                }
        */
        this.onInit.notifyObservers(this);

        let htmlContentPromise = getTemplateAsHtml(configuration);

        htmlContentPromise.then(htmlTemplate =&gt; {
            if (htmlTemplate) {
                let compiledTemplate = Handlebars.compile(htmlTemplate);
                let config = this.configuration.config || {};
                let rawHtml = compiledTemplate(config);
</template></template></template></template>
github BabylonJS / Babylon.js / Viewer / src / managers / observablesManager.ts View on Github external
constructor() {
        this.onSceneInitObservable = new Observable();
        this.onEngineInitObservable = new Observable();
        this.onModelLoadedObservable = new Observable();
        this.onModelLoadProgressObservable = new Observable();
        this.onModelLoadErrorObservable = new Observable();
        this.onModelAddedObservable = new Observable();
        this.onModelRemovedObservable = new Observable();
        this.onViewerInitDoneObservable = new Observable();
        this.onViewerInitStartedObservable = new Observable();
        this.onLoaderInitObservable = new Observable();
        this.onFrameRenderedObservable = new Observable();
        this.onEnteringVRObservable = new Observable();
        this.onExitingVRObservable = new Observable();
    }
github BabylonJS / Babylon.js / Viewer / src / model / viewerModel.ts View on Github external
constructor(private _modelConfiguration: IModelConfiguration, private _scene: Scene, disableAutoLoad = false) {
        this.onLoadedObservable = new Observable();
        this.onLoadErrorObservable = new Observable();
        this.onLoadProgressObservable = new Observable();

        this._animations = [];

        if (!disableAutoLoad) {
            this._initLoad();
        }
    }
github BabylonJS / Babylon.js / Viewer / src / model / viewerModel.ts View on Github external
constructor(private _modelConfiguration: IModelConfiguration, private _scene: Scene, disableAutoLoad = false) {
        this.onLoadedObservable = new Observable();
        this.onLoadErrorObservable = new Observable();
        this.onLoadProgressObservable = new Observable();

        this._animations = [];

        if (!disableAutoLoad) {
            this._initLoad();
        }
    }
github BabylonJS / Babylon.js / Viewer / src / managers / observablesManager.ts View on Github external
constructor() {
        this.onSceneInitObservable = new Observable();
        this.onEngineInitObservable = new Observable();
        this.onModelLoadedObservable = new Observable();
        this.onModelLoadProgressObservable = new Observable();
        this.onModelLoadErrorObservable = new Observable();
        this.onModelAddedObservable = new Observable();
        this.onModelRemovedObservable = new Observable();
        this.onViewerInitDoneObservable = new Observable();
        this.onViewerInitStartedObservable = new Observable();
        this.onLoaderInitObservable = new Observable();
        this.onFrameRenderedObservable = new Observable();
        this.onEnteringVRObservable = new Observable();
        this.onExitingVRObservable = new Observable();
    }