请不要单独购买,在终章会放出静态文件,目前只是放出代码
import {Constant} from ‘./Constant’;
exportclassLoader{
constructor(y, cQ) {
let s = this;
this.scene = y;
this.callback = cQ;
this.taskNumber = 0;
this.tasksLoaded = 0;
this.assetsManager = new BABYLON.AssetsManager(this.scene);
this.assetsManager.useDefaultLoadingScreen = true;
this.loadingScreen = this.scene.getEngine().loadingScreen;
for (let m = 0; m < Constant.GribsName.length; m++) {
let cX = this.assetsManager.addTextureTask(Constant.GribsName[m], Constant.Path_gribs + Constant.GribsName[m], true, false, BABYLON.Texture.NEAREST_SAMPLINGMODE);
cX.onSuccess = function (cI) {
return s.gribsLoading(cI)
};
cX.onError = function (cI) {
return s.error(cI)
};
this.taskNumber++
};
let cV = this.assetsManager.addMeshTask(‘imoca’, ‘’, ‘./static/’, ‘imoca.babylon’);
cV.onSuccess = function (cI) {
return s.meshImocaLoading(cI)
BabylonJS + Vue 构建 风场场景 (九) - 小专栏