|
@@ -18,8 +18,6 @@ var BABYLON = BABYLON || {};
|
|
this.additionnalRenderLoopLogicCallback = p_additionnalRenderLoopLogicCallback;
|
|
this.additionnalRenderLoopLogicCallback = p_additionnalRenderLoopLogicCallback;
|
|
this.textureLoadingCallback = p_textureLoadingCallback;
|
|
this.textureLoadingCallback = p_textureLoadingCallback;
|
|
this.startingProcessingFilesCallback = p_startingProcessingFilesCallback;
|
|
this.startingProcessingFilesCallback = p_startingProcessingFilesCallback;
|
|
-
|
|
|
|
- this.engine.runRenderLoop(renderFunction);
|
|
|
|
};
|
|
};
|
|
|
|
|
|
// elementToMonitor is the HTML element that will listen to drag'n'drop events
|
|
// elementToMonitor is the HTML element that will listen to drag'n'drop events
|
|
@@ -95,6 +93,7 @@ var BABYLON = BABYLON || {};
|
|
// If a ".babylon" file has been provided
|
|
// If a ".babylon" file has been provided
|
|
if (sceneFileToLoad) {
|
|
if (sceneFileToLoad) {
|
|
if (that.currentScene) {
|
|
if (that.currentScene) {
|
|
|
|
+ that.engine.stopRenderLoop();
|
|
that.currentScene.dispose();
|
|
that.currentScene.dispose();
|
|
}
|
|
}
|
|
|
|
|
|
@@ -104,10 +103,13 @@ var BABYLON = BABYLON || {};
|
|
// Wait for textures and shaders to be ready
|
|
// Wait for textures and shaders to be ready
|
|
that.currentScene.executeWhenReady(function () {
|
|
that.currentScene.executeWhenReady(function () {
|
|
// Attach camera to canvas inputs
|
|
// Attach camera to canvas inputs
|
|
- that.currentScene.activeCamera.attachControl(that.canvas);
|
|
|
|
|
|
+ if (that.currentScene.activeCamera) {
|
|
|
|
+ that.currentScene.activeCamera.attachControl(that.canvas);
|
|
|
|
+ }
|
|
if (that.sceneLoadedCallback) {
|
|
if (that.sceneLoadedCallback) {
|
|
that.sceneLoadedCallback(sceneFileToLoad, that.currentScene);
|
|
that.sceneLoadedCallback(sceneFileToLoad, that.currentScene);
|
|
}
|
|
}
|
|
|
|
+ that.engine.runRenderLoop(renderFunction);
|
|
});
|
|
});
|
|
}, function (progress) {
|
|
}, function (progress) {
|
|
if (that.progressCallback) {
|
|
if (that.progressCallback) {
|