Use arrow callback instead of function.
This commit is contained in:
parent
fb81e4ff5a
commit
79e344187d
@ -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);
|
||||
}
|
||||
});
|
||||
|
||||
@ -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);
|
||||
},
|
||||
|
||||
Loading…
Reference in New Issue
Block a user