Use arrow callback instead of function.

This commit is contained in:
kovacsv 2021-07-22 21:20:50 +02:00
parent fb81e4ff5a
commit 79e344187d
2 changed files with 8 additions and 8 deletions

View File

@ -217,7 +217,7 @@ OV.ConvertModelToThreeMeshes = function (model, params, output, callbacks)
let threeMeshes = [];
let taskRunner = new OV.TaskRunner ();
taskRunner.RunBatch (model.MeshCount (), 100, {
runTask : function (firstIndex, lastIndex, ready) {
runTask : (firstIndex, lastIndex, ready) => {
for (let meshIndex = firstIndex; meshIndex <= lastIndex; meshIndex++) {
let mesh = model.GetMesh (meshIndex);
if (mesh.TriangleCount () > 0) {
@ -227,7 +227,7 @@ OV.ConvertModelToThreeMeshes = function (model, params, output, callbacks)
}
ready ();
},
onReady : function () {
onReady : () => {
callbacks.onModelLoaded (threeMeshes);
}
});

View File

@ -34,26 +34,26 @@ OV.InitModelLoader = function (modelLoader, callbacks)
let errorDialog = null;
let progressDialog = null;
modelLoader.Init ({
onLoadStart : function () {
onLoadStart : () => {
CloseDialogIfOpen (errorDialog);
callbacks.onStart ();
progressDialog = new OV.ProgressDialog ();
progressDialog.Show ('Loading Model');
},
onImportStart : function () {
onImportStart : () => {
progressDialog.SetText ('Importing Model');
},
onVisualizationStart : function () {
onVisualizationStart : () => {
progressDialog.SetText ('Visualizing Model');
},
onModelFinished : function (importResult, threeMeshes) {
onModelFinished : (importResult, threeMeshes) => {
progressDialog.Hide ();
callbacks.onFinish (importResult, threeMeshes);
},
onTextureLoaded : function () {
onTextureLoaded : () => {
callbacks.onRender ();
},
onLoadError : function (importError) {
onLoadError : (importError) => {
progressDialog.Hide ();
errorDialog = OpenErrorDialog (importError);
},