TileDownloader.js 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. import * as THREE from "../../../../../libs/three.js/build/three.module.js";
  2. import TilePrioritizer from './TilePrioritizer.js'
  3. import TileUtils from './TileUtils.js'
  4. import {settings, config} from '../../../settings.js'
  5. import {
  6. http
  7. } from '../../../utils/request.js'
  8. let {TileDownloaderEvents, DownloadStatus} = Potree.defines
  9. window.downloaded = {}
  10. window.startdownloads = [];
  11. class TileDownloader extends THREE.EventDispatcher{
  12. constructor( ) {
  13. super()
  14. this.panos = null;
  15. this.retryMinimumTime = 1e4;
  16. this.panoLoadCallbacks = {};
  17. this.downloadDescriptors = {};
  18. this.priorityQueue = [];
  19. this.forceQueue = [];
  20. this.activeDownloads = [];
  21. this.tilePrioritizer = null;
  22. this.refreshInterval = null;
  23. this.processPriorityQueue = !1;
  24. this.concurrentDownloads = 6;//e.concurrentDownloads || 1;
  25. this.downloadTestResults = {};
  26. this.freeze = Object.freeze({
  27. Testing: 1,
  28. Success: 2,
  29. Fail: 3
  30. });
  31. this.tilesCount = 0 //add 加载好的tile数目
  32. /* viewer.addEventListener('pageVisible', (e)=>{//不可见时不refreshUpdateInterval
  33. //console.log('visibilitychange:', state)
  34. Potree.Utils.updateVisible(this, 'pageVisible', e.v)
  35. this.judgeStart()
  36. })
  37. this.visible = true //add 借用Potree.Utils.updateVisible来判断是否start
  38. if(Potree.settings.useDepthTex){
  39. this.judgeStart() //开始下载depthTex
  40. }else{
  41. Potree.Utils.updateVisible(this,'showPanos', false ) //默认visible = false
  42. } */
  43. }
  44. setPanoData(e, t /* , i */) {
  45. this.panos = e,
  46. this.imagePanos = t
  47. // this.panoGroupId = i
  48. }
  49. start() {
  50. this.downloadCubeTex = true
  51. /* if(!Potree.settings.useDepthTex){
  52. Potree.Utils.updateVisible(this,'showPanos', true )
  53. this.judgeStart()
  54. }else{
  55. //this.refreshInterval || this.judgeStart()
  56. } */
  57. }
  58. stop() {
  59. this.downloadCubeTex = false
  60. /* if(!Potree.settings.useDepthTex){
  61. Potree.Utils.updateVisible(this,'showPanos', false )
  62. this.judgeStart()
  63. } */
  64. }
  65. /* judgeStart(){//add
  66. if(this.visible){
  67. //console.log('judgeStart true')
  68. this.started = true
  69. //this.refreshUpdateInterval(0)
  70. }else{
  71. //console.log('judgeStart false')
  72. this.started = false
  73. //window.clearTimeout(this.refreshInterval)
  74. }
  75. } */
  76. /* refreshUpdateInterval(e) {
  77. e || (e = 0),
  78. this.refreshInterval = window.setTimeout(function() {
  79. var e = this.update();
  80. e ? this.refreshUpdateInterval(TileDownloader.ACTIVE_REFRESH_DELAY) : this.refreshUpdateInterval(TileDownloader.IDLE_REFRESH_DELAY)
  81. }
  82. .bind(this), e)
  83. } */
  84. update() {
  85. if(!this.panos)return
  86. let time = Potree.Common.getBestCountFPS('processPriorityQueue', false, 700, 66 )
  87. if(this.downloadCubeTex){ //可以下载贴图
  88. var e = this.forceQueue.length > 0;
  89. this.processQueueForDownloading(this.forceQueue);
  90. if (this.processPriorityQueue) {
  91. Potree.Common.intervalTool.isWaiting('processPriorityQueue', ()=>{ //延时update,防止崩溃 , 未到时间就拦截(第一次直接执行)
  92. this.downloadCubeTex && this.queuePrioritizedTilesForPanos(this.panos) //这句比较耗时 降四倍时大概1-2毫秒
  93. }, time)
  94. this.priorityQueue.length > 0 && (e = !0);
  95. this.processQueueForDownloading(this.priorityQueue);
  96. }
  97. //return e
  98. }else if( viewer.scene.pointclouds.some(e=>e.hasDepthTex)){//不加载贴图也要获得nearPanos
  99. viewer.lastFrameChanged && Potree.Common.intervalTool.isWaiting('processPriorityQueue2', ()=>{
  100. this.tilePrioritizer.getNearPanos(this.panos)
  101. }, time)
  102. }
  103. let time2 = 1000//Potree.Common.getBestCountFPS('filterDepthTex', false, 5000, 88, 2, 63 )
  104. Potree.Common.intervalTool.isWaiting('filterDepthTex', ()=>{
  105. this.tilePrioritizer.filterDepthTex(this.panos)//下载深度图
  106. }, time2)
  107. }
  108. queuePrioritizedTilesForPanos(e) {
  109. viewer.addTimeMark('queuePrioritizedTilesForPanos','start')
  110. this.tilePrioritizer && (this.clearQueue(this.priorityQueue),
  111. this.tilePrioritizer.filterAndPrioritize(this.priorityQueue, e, this),
  112. this.clearFromQueue(this.priorityQueue, DownloadStatus.None, !0), //去除state为DownloadStatus.None的(可能是去除已经在下载的)
  113. this.setStatusOrRemoveForAllDescriptors(this.priorityQueue, DownloadStatus.Queued))
  114. viewer.addTimeMark('queuePrioritizedTilesForPanos','end')
  115. }
  116. clearQueue(e) {//停止下载并清空
  117. this.setStatusForAllDescriptors(e, DownloadStatus.None),
  118. e.length = 0
  119. }
  120. clearForceQueue() {
  121. this.clearQueue(this.forceQueue)
  122. }
  123. clearFromQueue(e, t, i) {
  124. for (var n = 0; n < e.length; n++) {
  125. var r = e[n];
  126. r && (t === r.status && !i || t !== r.status && i) && (e[n] = null)
  127. }
  128. }
  129. setStatusForAllDescriptors(e, t) {
  130. for (var i = 0; i < e.length; i++) {
  131. var n = e[i];
  132. n && (n.status = t)
  133. }
  134. }
  135. setStatusOrRemoveForAllDescriptors(e, t) {
  136. for (var i = 0; i < e.length; i++) {
  137. var n = e[i];
  138. n && (n.status !== t ? n.status = t : e[i] = null)
  139. }
  140. }
  141. getTileDownloadDescriptors(pano, size) {//获取该pano的该size的全部的tile的descriptor
  142. var i = this.getAllTileDownloadDescriptorsForPano(pano),
  143. n = i[size];
  144. return n || (n = this.buildDownloadDescriptorArray(size),//创建的全部是空的
  145. i[size] = n,
  146. this.initTileDownloadDescriptors(n, pano, size)),//绑定到该pano size
  147. n
  148. }
  149. getAllTileDownloadDescriptorsForPano(pano) {//新建空Descriptors
  150. var t = this.downloadDescriptors[pano.id];
  151. return t || (t = {},
  152. this.downloadDescriptors[pano.id] = t),
  153. t
  154. }
  155. processQueueForDownloading(e, t) {//执行下载任务
  156. this.cleanupActiveDownloads();
  157. if(e.length){
  158. let concurrentDownloads = Potree.Common.getBestCount('concurrentDownloads',1,6, 1.8, 13 /* ,true */ )
  159. if (this.activeDownloads.length < concurrentDownloads || t) {
  160. var i = t ? e.length : concurrentDownloads - this.activeDownloads.length;
  161. for (var n = 0, r = 0; n < i && e.length > 0; r++) {
  162. var o = e.shift();
  163. if(o){
  164. //add 为了防止1024的在512前下载完,这里强行等待512下载完毕再开始下载
  165. if(o.panoSize > 512 && !this.isPanoDownloaded(o.pano, 512) ){
  166. //console.log('512的还没下载好呢!')
  167. e.push(o)
  168. break;//一般512的都是连续下载的,所以后面就都不是512了直接中断
  169. }
  170. this.startDownload(o)
  171. n++
  172. }
  173. }
  174. }
  175. }
  176. }
  177. testDownload(panoSize, tileSize, callback) {
  178. var n = this.downloadTestResults[panoSize];
  179. if (n)
  180. return void(n === this.freeze.Success ? callback(!0) : n === this.freeze.Fail && callback(!1));
  181. this.downloadTestResults[panoSize] = this.freeze.Testing;
  182. var r = this.panos[0],
  183. o = this.getTileUrl({pano:r, panoSize, tileSize, tileIndex:0} /* r.id, panoSize, tileSize, 0 */),
  184. a = function(t) {
  185. this.downloadTestResults[panoSize] = this.freeze.Success,
  186. callback(!0)
  187. }
  188. .bind(this),
  189. s = function() {
  190. this.downloadTestResults[panoSize] = this.freeze.Fail,
  191. callback(!1)
  192. }
  193. .bind(this);
  194. this.loadImage(o, 0, a, s)
  195. }
  196. startDownload(e) {//开始下载啦
  197. startdownloads.push(e)
  198. e.local2SrcFailed = this.local2SrcFailed
  199. e.status = DownloadStatus.Downloading;
  200. var t = this.getTileUrl(e/* e.pano.id, e.panoSize, e.tileSize, e.tileIndex, e.pano.alignmentType */);//xzw add alignmentType
  201. if(!t)return;
  202. this.activeDownloads.push(e);
  203. this.loadImage(t, TileDownloader.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  204. }
  205. downloadFailed(e, t) {
  206. //add
  207. if(Potree.settings.isLocal2 && !e.local2SrcFailed){//为了兼容旧的数据src,如果新src没加载成功,就加载旧的
  208. e.local2SrcFailed = this.local2SrcFailed = true
  209. //this.startDownload(e)//重新下载
  210. var t = this.getTileUrl(e);
  211. this.loadImage(t, TileDownloader.DOWNLOAD_RETRIES, this.downloadComplete.bind(this, e), this.downloadFailed.bind(this, e))
  212. }
  213. }
  214. downloadComplete(e, t) {//下载成功时
  215. //if (e.panoGroupId === this.panoGroupId) {
  216. var i = this.getPanoLoadCallbacks(e.pano, e.panoSize);
  217. e.status = DownloadStatus.Downloaded,
  218. i && i.onProgress && i.onProgress(e.pano, e.panoSize);
  219. var n = {
  220. panoId: e.pano.id,
  221. image: t,
  222. tileSize: e.tileSize,
  223. panoSize: e.panoSize,
  224. tileIndex: e.tileIndex,
  225. faceTileIndex: e.faceTileIndex,
  226. totalTiles: e.totalTiles,
  227. face: e.face,
  228. tileX: e.tileX,
  229. tileY: e.tileY,
  230. direction: e.direction
  231. };
  232. downloaded[e.pano.id] || (downloaded[e.pano.id]={512:[],1024:[],2048:[]})
  233. downloaded[e.pano.id][e.panoSize] || (downloaded[e.pano.id][e.panoSize] = [])
  234. downloaded[e.pano.id][e.panoSize].push(e)
  235. if(e.panoSize != 512 && downloaded[e.pano.id][512].length<6){
  236. console.warn('没下完')
  237. }
  238. this.tilesCount ++; //add
  239. e.image = t,
  240. this.dispatchEvent({type:TileDownloaderEvents.TileDownloadSuccess, desc:n} )
  241. this.isPanoDownloaded(e.pano, e.panoSize) && (n = {
  242. panoId: e.pano.id,
  243. tileSize: e.tileSize,
  244. panoSize: e.panoSize
  245. },
  246. this.dispatchEvent({type:TileDownloaderEvents.PanoDownloadComplete, desc:n}),
  247. i && i.onLoad && i.onLoad(e.pano, e.panoSize))
  248. //}
  249. }
  250. isPanoDownloaded(e, t) {
  251. var i = this.getTileDownloadDescriptors(e, t);
  252. if (i.length <= 0)
  253. return !1;
  254. for (var n = 0; n < i.length; n++) {
  255. var r = i[n];
  256. if (r.status !== DownloadStatus.Downloaded)
  257. return !1
  258. }
  259. return !0
  260. }
  261. setPanoLoadCallbacks(e, t, i, n, r) {
  262. var o = e.id + ":" + this.qualityManager.getPanoSize(t);
  263. this.panoLoadCallbacks[o] = {
  264. onLoad: i,
  265. onFail: n,
  266. onProgress: r
  267. }
  268. }
  269. getPanoLoadCallbacks(e, t) {
  270. var i = e.id + ":" + t;
  271. return this.panoLoadCallbacks[i]
  272. }
  273. buildDownloadDescriptorArray(e) {
  274. for (var t = TileUtils.getTileCountForSize(e), i = [], n = 0; n < t; n++) {
  275. var r = this.buildDownloadDescriptor();
  276. i.push(r)
  277. }
  278. return i
  279. }
  280. buildDownloadDescriptor() {//Descriptor!
  281. var e = {
  282. panoGroupId: null,
  283. pano: null,
  284. panoSize: -1,
  285. tileSize: -1,
  286. tileIndex: -1,
  287. totalTiles: -1,
  288. faceTileIndex: -1,
  289. status: DownloadStatus.None,
  290. url: null,
  291. image: null,
  292. direction: new THREE.Vector3, //该tile在cube中的方向
  293. face: -1,
  294. cubeFace: -1,
  295. tileX: -1,
  296. tileY: -1
  297. };
  298. return e
  299. }
  300. initTileDownloadDescriptors(e, t, i) {
  301. for (var n = 0; n < e.length; n++) {
  302. var r = e[n];
  303. this.initTileDownloadDescriptor(r, t, i, n)
  304. }
  305. }
  306. initTileDownloadDescriptor(desc, pano, size, index) {
  307. var r = size >= TileUtils.TILE_SIZE ? TileUtils.TILE_SIZE : size;
  308. desc.face = TileUtils.getFaceForTile(size, index);//根据顺序得到的face的index
  309. desc.cubeFace = TileUtils.mapFaceToCubemapFace(desc.face);//为了贴图而转化的face index
  310. //desc.panoGroupId = this.panoGroupId;//就是场景号
  311. desc.pano = pano;
  312. desc.panoSize = size;
  313. desc.tileSize = r; //瓦片图size 512
  314. desc.tileIndex = index;
  315. desc.totalTiles = TileUtils.getTileCountForSize(size);
  316. desc.status = DownloadStatus.None;
  317. desc.image = null;
  318. TileUtils.getTileLocation(desc.panoSize, desc.tileIndex, desc);//得到该tile在这个face中的具体位置(tileX等)
  319. TileUtils.getTileVector(desc.panoSize, desc.tileSize, desc.cubeFace, desc.tileX, desc.tileY, TileUtils.LocationOnTile.Center, 0, desc.direction);
  320. }
  321. getTiles(d, sceneNum, useV4url, pointcloud){
  322. let v3OrV4Str = useV4url ? `/scene_view_data/${sceneNum}/images/` : `/images/images${sceneNum}/`
  323. let prefix = Potree.settings.urls.getPrefix(3,pointcloud) //Potree.settings.urls.panoOssRoot || pointcloud.prop?.raw?.panoOssRoot || Potree.settings.urls.prefix3
  324. if(Potree.settings.isLocal && !this.local2SrcFailed && pointcloud.datasetData.mapping && !Potree.settings.isLocal2){ //非离线包的话加mapping
  325. return `${prefix}/${pointcloud.datasetData.mapping}${v3OrV4Str}${d}`
  326. }
  327. return `${prefix}${v3OrV4Str}${d}`
  328. /*
  329. if(Potree.settings.isLocal && !this.local2SrcFailed || useV4url){//新的地址 scene_view_data/场景码/images/tiles
  330. if(pointcloud.datasetData.mapping && !Potree.settings.isLocal2){//非离线包的话加mapping
  331. return `${Potree.settings.urls.prefix3}/${pointcloud.datasetData.mapping}/scene_view_data/${sceneNum}/images/${d}`
  332. }else{
  333. return `${Potree.settings.urls.prefix3}/scene_view_data/${sceneNum}/images/${d}`
  334. }
  335. }
  336. return `${Potree.settings.urls.prefix3}/images/images${sceneNum}/${d}`
  337. */
  338. }
  339. loadImage(e, t, i, n) {
  340. //自己修改了ajax,把getImage改成了loadImg
  341. http.loadImage(e, t).then(function(e) {
  342. i(e)
  343. }).fail(n)
  344. }
  345. }
  346. TileDownloader.prototype.forceQueueTilesForPano = function() {//根据条件开始加载tile
  347. var e = [],
  348. t = [];
  349. return function(pano, size, dir, hFov, vFov, download) {
  350. e.length = 0;
  351. for (var u = this.getTileDownloadDescriptors(pano, size), d = 0; d < u.length; d++) {
  352. var p = u[d];
  353. p.status !== DownloadStatus.None && p.status !== DownloadStatus.Queued || e.push(p)
  354. }//挑出没下载的开始下载
  355. if (dir && e.length > 0) {
  356. TilePrioritizer.sortPanoTiles(e, pano, dir) //按最佳方向排序e
  357. t.length = 0
  358. TileUtils.matchingTilesInDirection(pano, size, dir, hFov, vFov, t);//得到在符合视野标准的集合t
  359. for (var f = 0, g = function(e) {
  360. return e.face === m.face && e.faceTileIndex === m.faceTileIndex
  361. }; f < e.length;) { //过滤掉不符合角度要求的
  362. var m = e[f],
  363. v = t.findIndex(g);
  364. v < 0 ? e.splice(f, 1) : f++
  365. }
  366. }
  367. for (var A = 0; A < e.length; A++){
  368. this.forceQueue.push(e[A]); //装载
  369. }
  370. /* if(e.length){
  371. console.log(e)
  372. } */
  373. this.setStatusForAllDescriptors(this.forceQueue, DownloadStatus.ForceQueued);
  374. this.clearFromQueue(this.priorityQueue, DownloadStatus.ForceQueued, !1);
  375. download && this.processQueueForDownloading(this.forceQueue, !0);
  376. }
  377. }()
  378. TileDownloader.prototype.cleanupActiveDownloads = function() {
  379. var e = [];
  380. return function() {
  381. e.length = 0;
  382. for (var t = 0; t < this.activeDownloads.length; t++) {
  383. var i = this.activeDownloads[t];
  384. i.status !== DownloadStatus.Downloaded && i.status !== DownloadStatus.Failed && e.push(i)
  385. }
  386. this.activeDownloads.length = 0,
  387. this.activeDownloads.push.apply(this.activeDownloads, e)
  388. }
  389. }()
  390. TileDownloader.prototype.getTileUrl = function() {
  391. var e = {
  392. 256: "256",
  393. 512: "512",
  394. 1024: "1k",
  395. 2048: "2k",
  396. 4096: "4k"
  397. },
  398. t = {
  399. face: -1,
  400. faceTileIndex: -1,
  401. tileX: -1,
  402. tileY: -1
  403. };
  404. return function(o={} ) {
  405. var id = o.pano.originID, ////////
  406. panoSize = o.panoSize,
  407. tileSize = o.tileSize,
  408. tileIndex = o.tileIndex,
  409. sceneCode = o.pano.pointcloud.sceneCode,
  410. useV4url = Potree.settings.useV4url && (!o.pano.pointcloud.datasetData || o.pano.pointcloud.datasetData.sceneVersion == 'V4') //v4的全景图等路径不一样
  411. var resolution = o.pano.pointcloud.tileRes || '4k'
  412. var metadata = {sceneScheme:10}
  413. TileUtils.getTileLocation(panoSize, tileIndex, t);
  414. var s = Math.floor(panoSize / tileSize),
  415. l = s * s,
  416. h = Math.floor(tileIndex / l),
  417. u = "",
  418. d = '', g = '';
  419. if(Potree.settings.tileOriginUrl){//原始规则
  420. //1 === config.tiling.customCompression && (u = "_" + config.tiling["q" + e[panoSize]]);
  421. //1 === o.tiling.customCompression && (u = "_" + o.tiling["q" + e[n]]);
  422. d = "tiles/" + id + "/" + e[panoSize] + u + "_face" + h + "_" + t.tileX + "_" + t.tileY + ".jpg"
  423. d = this.getTiles(d, sceneCode, useV4url, o.pano.pointcloud);
  424. g = "?"
  425. }else{//阿里云oss的规则 if (metadata.sceneScheme == 10)
  426. d = 'tiles/'+ resolution +'/' + id + '_skybox' + h + '.jpg?x-oss-process=';
  427. if (e[panoSize] == '512') {
  428. d += 'image/resize,h_512';
  429. } else {
  430. //4k的图,移动端是1k,pc端是2k,放大才是4k
  431. if (e[panoSize] == '1k' || e[panoSize] == '2k') { //https://4dkk.4dage.com/images/imagesx4iqYDG3/tiles/4k/122_skybox0.jpg?x-oss-process=image/resize,m_lfit,w_1024/crop,w_512,h_512,x_511,y_0
  432. d += 'image/resize,m_lfit,w_' + panoSize + '/crop,w_512,h_512,';
  433. } else {
  434. d = 'tiles/'+ resolution +'/' + id + '_skybox' + h + '.jpg?x-oss-process=image/crop,w_512,h_512,';
  435. }
  436. //起始位置
  437. if (t.tileX == 0) {
  438. d += 'x_0,';
  439. } else {
  440. d += 'x_' + (512 * t.tileX /* - 1 */) + ',';
  441. }
  442. if (t.tileY == 0) {
  443. d += 'y_0';
  444. } else {
  445. d += 'y_' + (512 * t.tileY /* - 1 */);
  446. }
  447. }
  448. d = this.getTiles(d, sceneCode, useV4url, o.pano.pointcloud);
  449. g = "&"
  450. }
  451. //Potree.settings.panoVersion = 4
  452. d += g + (Potree.settings.panoVersion ? 'version='+Potree.settings.panoVersion : 'time='+o.pano.pointcloud.timeStamp ) //加后缀
  453. return d;
  454. /* 4dkk
  455. getViewImagesURL(url) {
  456. if (url.indexOf('&_=') !== -1) {
  457. return url
  458. }
  459. let version = url.indexOf('/panorama/') !== -1 ? this.linkVersion : this.imageVersion
  460. if (url.indexOf('?') !== -1) {
  461. return this.$app.config.resource + `scene_view_data/${this.num}/images/${url}&_=${version}`
  462. }
  463. return this.$app.config.resource + `scene_view_data/${this.num}/images/${url}?_=${version}`
  464. }
  465. /**
  466. */
  467. }
  468. }();
  469. TileDownloader.tilegen = true;
  470. TileDownloader.IDLE_REFRESH_DELAY = 500;
  471. TileDownloader.ACTIVE_REFRESH_DELAY = 16;
  472. TileDownloader.DOWNLOAD_RETRIES = 4;
  473. /*
  474. 源:https://4dkk.4dage.com/images/imagesSS-t-ZZR7oKnlIl
  475. 目标:https://4dkk.4dage.com/scene_view_data/SS-t-ZZR7oKnlIl/images
  476. 源:https://4dkk.4dage.com/data/dataSS-t-ZZR7oKnlIl
  477. 目标:https://4dkk.4dage.com/scene_view_data/SS-t-ZZR7oKnlIl/data
  478. 源:https://4dkk.4dage.com/video/videoSS-t-ZZR7oKnlIl
  479. 目标:https://4dkk.4dage.com/scene_view_data/SS-t-ZZR7oKnlIl/video
  480. */
  481. // var tileconc = TileDownloader.tilegen ? 6 : 2;
  482. // publicObjectSet.tileDownloader = new TileDownloader({
  483. // concurrentDownloads: tileconc
  484. // });
  485. // export default new TileDownloader({
  486. // concurrentDownloads: TileDownloader.tilegen ? 6 : 2
  487. // })
  488. /* export default new TileDownloader({
  489. concurrentDownloads: TileDownloader.tilegen ? 6 : 2
  490. }) */
  491. /*
  492. 漫游点的tile虽然tex会被释放,但图片还存在viewer.images360.tileDownloader.downloadDescriptors每个tile的image中
  493. 于是内存会一直增加,是否需要删除呢?
  494. 还有depthTex,一张700k左右。
  495. viewer.images360.tileDownloader.downloadDescriptors
  496. viewer.images360.panoRenderer.tileDirectory
  497. */
  498. export default TileDownloader