From 89da62649161571834d3f8df7ce36f9967e6ba04 Mon Sep 17 00:00:00 2001
From: wangzhibo <wangzhibo@shsening.com>
Date: 星期二, 07 九月 2021 14:04:31 +0800
Subject: [PATCH] change cesium version
---
lib/mars3d/plugins/compatible/cesium-version.js | 152 +++++++++++++++++++++++---------------------------
1 files changed, 69 insertions(+), 83 deletions(-)
diff --git a/lib/mars3d/plugins/compatible/cesium-version.js b/lib/mars3d/plugins/compatible/cesium-version.js
index 5cc0bca..1873724 100644
--- a/lib/mars3d/plugins/compatible/cesium-version.js
+++ b/lib/mars3d/plugins/compatible/cesium-version.js
@@ -1,101 +1,87 @@
//鍏煎涓嶅悓鐗堟湰cesium锛岃ˉ鍏呭畼鏂瑰垹闄ゆ洿鏀圭殑鏂规硶鎴栫被鍚� by mars3d.cn
//鍏煎1.73锛�2020-9-1锛夊垹闄ょ殑鏂规硶
-Cesium.BingMapsApi = { defaultKey: "" }
-Cesium.MapboxApi = { defaultAccessToken: "" }
+Cesium.BingMapsApi = { defaultKey: "" };
+Cesium.MapboxApi = { defaultAccessToken: "" };
//鍏煎1.67锛�2020-3-3锛夊垹闄ょ殑鏂规硶
-if (!Cesium.defineProperties)
- Cesium.defineProperties = Object.defineProperties;
-if (!Cesium.isArray)
- Cesium.isArray = Array.isArray;
-
+if (!Cesium.defineProperties) Cesium.defineProperties = Object.defineProperties;
+if (!Cesium.isArray) Cesium.isArray = Array.isArray;
//鍏煎1.62锛�2019-10-01锛夋敼鍚嶇殑鏂规硶
if (!Cesium.Matrix4.getMatrix3)
- Cesium.Matrix4.getMatrix3 = Cesium.Matrix4.getRotation;
+ Cesium.Matrix4.getMatrix3 = Cesium.Matrix4.getRotation;
if (!Cesium.TileMapServiceImageryProvider)
- Cesium.TileMapServiceImageryProvider = Cesium.createTileMapServiceImageryProvider;
+ Cesium.TileMapServiceImageryProvider =
+ Cesium.createTileMapServiceImageryProvider;
if (!Cesium.createTileMapServiceImageryProvider) {
- Cesium.createTileMapServiceImageryProvider = function (options) {
- return new Cesium.TileMapServiceImageryProvider(options);
- }
+ Cesium.createTileMapServiceImageryProvider = function (options) {
+ return new Cesium.TileMapServiceImageryProvider(options);
+ };
}
-
//鍏煎1.50 锛�2018-10-01)鐗堟湰鏇存敼浜嗗悕绉帮紝閫犳垚閮ㄥ垎3dtiles鍙兘浼氬嚭鐜板姞杞戒笉涓婂鑷存覆鏌撳仠姝㈢殑閿欒銆�
//閿欒璇存槑涓猴細RuntimeError: Unsupported glTF Extension: KHR_technique_webgl
//鍘熷洜锛欿HR_technique_webgl鎵╁睍鏂扮増Cesium宸茬粡涓嶆敮鎸佺殑缂樻晠锛岄渶瑕佸崌绾т竴涓媑ltf鏁版嵁锛屼娇鐢↘HR_techniques_webgl鎵╁睍鍗冲彲(娉ㄦ剰澶氫簡涓�涓猻)銆�
try {
- // var fixGltf = function (gltf) {
- // if (!gltf.extensionsUsed || !gltf.extensionsUsed.indexOf || !gltf.extensionsRequired) {
- // return;
- // }
-
- // var v = gltf.extensionsUsed.indexOf('KHR_technique_webgl');
- // if (v == -1) return;
-
- // // 涓嫑浜嗐�傘��
- // var t = gltf.extensionsRequired.indexOf('KHR_technique_webgl');
-
- // gltf.extensionsRequired.splice(t, 1, 'KHR_techniques_webgl');
- // gltf.extensionsUsed.splice(v, 1, 'KHR_techniques_webgl');
- // gltf.extensions = gltf.extensions || {};
- // gltf.extensions['KHR_techniques_webgl'] = {};
- // gltf.extensions['KHR_techniques_webgl'].programs = gltf.programs;
- // gltf.extensions['KHR_techniques_webgl'].shaders = gltf.shaders;
- // gltf.extensions['KHR_techniques_webgl'].techniques = gltf.techniques;
- // var techniques = gltf.extensions['KHR_techniques_webgl'].techniques;
-
- // gltf.materials.forEach(function (mat, index) {
- // gltf.materials[index].extensions || (gltf.materials[index].extensions = { KHR_technique_webgl: {} });
- // gltf.materials[index].extensions['KHR_technique_webgl'].values = gltf.materials[index].values;
- // gltf.materials[index].extensions['KHR_techniques_webgl'] = gltf.materials[index].extensions['KHR_technique_webgl'];
-
- // var myMaterialExtension = gltf.materials[index].extensions['KHR_techniques_webgl'];
- // myMaterialExtension.technique || (myMaterialExtension.technique = gltf.materials[index].technique);
-
- // for (var value in myMaterialExtension.values) {
- // var us = techniques[myMaterialExtension.technique].uniforms;
- // for (var key in us) {
- // if (us[key] === value) {
- // myMaterialExtension.values[key] = myMaterialExtension.values[value];
- // delete myMaterialExtension.values[value];
- // break;
- // }
- // }
- // };
- // });
-
- // techniques.forEach(function (t) {
- // for (var attribute in t.attributes) {
- // var name = t.attributes[attribute];
- // t.attributes[attribute] = t.parameters[name];
- // };
-
- // for (var uniform in t.uniforms) {
- // var name = t.uniforms[uniform];
- // t.uniforms[uniform] = t.parameters[name];
- // };
- // });
-
- // }
-
- // Object.defineProperties(Cesium.Model.prototype, {
- // _cachedGltf: {
- // set: function (value) {
- // this._my_cachedGltf = value;
- // if (this._my_cachedGltf && this._my_cachedGltf._gltf) {
- // fixGltf(this._my_cachedGltf._gltf);
- // }
- // },
- // get: function () {
- // return this._my_cachedGltf;
- // }
- // }
- // });
+ // var fixGltf = function (gltf) {
+ // if (!gltf.extensionsUsed || !gltf.extensionsUsed.indexOf || !gltf.extensionsRequired) {
+ // return;
+ // }
+ // var v = gltf.extensionsUsed.indexOf('KHR_technique_webgl');
+ // if (v == -1) return;
+ // // 涓嫑浜嗐�傘��
+ // var t = gltf.extensionsRequired.indexOf('KHR_technique_webgl');
+ // gltf.extensionsRequired.splice(t, 1, 'KHR_techniques_webgl');
+ // gltf.extensionsUsed.splice(v, 1, 'KHR_techniques_webgl');
+ // gltf.extensions = gltf.extensions || {};
+ // gltf.extensions['KHR_techniques_webgl'] = {};
+ // gltf.extensions['KHR_techniques_webgl'].programs = gltf.programs;
+ // gltf.extensions['KHR_techniques_webgl'].shaders = gltf.shaders;
+ // gltf.extensions['KHR_techniques_webgl'].techniques = gltf.techniques;
+ // var techniques = gltf.extensions['KHR_techniques_webgl'].techniques;
+ // gltf.materials.forEach(function (mat, index) {
+ // gltf.materials[index].extensions || (gltf.materials[index].extensions = { KHR_technique_webgl: {} });
+ // gltf.materials[index].extensions['KHR_technique_webgl'].values = gltf.materials[index].values;
+ // gltf.materials[index].extensions['KHR_techniques_webgl'] = gltf.materials[index].extensions['KHR_technique_webgl'];
+ // var myMaterialExtension = gltf.materials[index].extensions['KHR_techniques_webgl'];
+ // myMaterialExtension.technique || (myMaterialExtension.technique = gltf.materials[index].technique);
+ // for (var value in myMaterialExtension.values) {
+ // var us = techniques[myMaterialExtension.technique].uniforms;
+ // for (var key in us) {
+ // if (us[key] === value) {
+ // myMaterialExtension.values[key] = myMaterialExtension.values[value];
+ // delete myMaterialExtension.values[value];
+ // break;
+ // }
+ // }
+ // };
+ // });
+ // techniques.forEach(function (t) {
+ // for (var attribute in t.attributes) {
+ // var name = t.attributes[attribute];
+ // t.attributes[attribute] = t.parameters[name];
+ // };
+ // for (var uniform in t.uniforms) {
+ // var name = t.uniforms[uniform];
+ // t.uniforms[uniform] = t.parameters[name];
+ // };
+ // });
+ // }
+ // Object.defineProperties(Cesium.Model.prototype, {
+ // _cachedGltf: {
+ // set: function (value) {
+ // this._my_cachedGltf = value;
+ // if (this._my_cachedGltf && this._my_cachedGltf._gltf) {
+ // fixGltf(this._my_cachedGltf._gltf);
+ // }
+ // },
+ // get: function () {
+ // return this._my_cachedGltf;
+ // }
+ // }
+ // });
+} catch (e) {
+ console.log(e);
}
-catch (e) {
- console.log(e)
-}
\ No newline at end of file
--
Gitblit v1.9.1