<output id="qn6qe"></output>

    1. <output id="qn6qe"><tt id="qn6qe"></tt></output>
    2. <strike id="qn6qe"></strike>

      亚洲 日本 欧洲 欧美 视频,日韩中文字幕有码av,一本一道av中文字幕无码,国产线播放免费人成视频播放,人妻少妇偷人无码视频,日夜啪啪一区二区三区,国产尤物精品自在拍视频首页,久热这里只有精品12

      隨手寫的一個子進程

      主進程

      import ClearTouchGroundCacheCode from '../utils/workers/clearTouchGroundCache.worker.js';  
      const blob = new Blob([ClearTouchGroundCacheCode], { type: 'application/javascript' });
          this.clearTouchGroundCacheWorker = new Worker(URL.createObjectURL(blob));
      
       this.clearTouchGroundCacheWorker.postMessage({
                      type: 'clearCache',
                      data: { cache: JSON.stringify(_context.touchGroundCache?.[2]), minGx, maxGx, minGz, maxGz, minX, maxX, minZ, maxZ },
                    });
      
          // 接收 Worker 返回的數據
          this.clearTouchGroundCacheWorker.onmessage = (e) => {
            const msg = e.data;
            if (msg.type === 'clearDone') {
              const { keysToDelete, minX, maxX, minZ, maxZ } = msg.data;
              // 執行刪除
              for (const key of keysToDelete) {
                if (_context.touchGroundCache[2]?.[key]) {
                  // delete _context.touchGroundCache[2][key];
                  _context.touchGroundCache[2][key] = null; //比delete更快
                }
              }
      
              console.log(`? 已清除x:${minX}-${maxX}z:${minZ}- ${maxZ}緩存`);
            }
          };

       子進程:

      /*
       * @Author: Simoon.jia
       * @Date: 2025-10-11 14:57:24
       * @LastEditors: Simoon.jia
       * @LastEditTime: 2025-10-11 15:21:15
       * @Description: 描述
       */
      // clearTouchGroundCache.worker.js
      console.log('[Worker] clearTouchGroundCache.worker.js 已加載');
      
      self.onmessage = (e) => {
        const msg = e.data;
        if (msg.type === 'clearCache') {
          const { cache, minGx, maxGx, minGz, maxGz, minX, maxX, minZ, maxZ } = msg.data;
          const keysToDelete = [];
          const newCache = JSON.parse(cache);
          // 遍歷格子索引,篩選存在的 key
          for (const key in newCache) {
            const [gx, gz] = key.split('_').map(Number);
            if (gx >= minGx && gx <= maxGx && gz >= minGz && gz <= maxGz) {
              keysToDelete.push(key);
            }
          }
      
          // 回傳 key 數組給主線程
          self.postMessage({
            type: 'clearDone',
            data: { keysToDelete, minX, maxX, minZ, maxZ },
          });
        }
      };

      roolup配置:

      import resolve from '@rollup/plugin-node-resolve';
      import commonjs from '@rollup/plugin-commonjs';
      import glslify from 'rollup-plugin-glslify';
      import { string } from 'rollup-plugin-string';
      export default {
        input: 'src/avw.js',
        output: [
          {
            file: 'dist/avw.scene.core.min.js',
            format: 'umd',
            name: 'avwCore',
            sourcemap: true,
          },
          {
            file: '../AVW.Scene/lib/avw.scene.core.module.min.js',
            format: 'esm',
            name: 'avwCore',
            sourcemap: false,
          },
        ],
        plugins: [
          resolve({
            browser: true,
          }),
          commonjs(),
          glslify(),
          string({
            include: '**/*.worker.js', // 把 worker 當作字符串處理
          }),
        ],
        onwarn(warning, warn) {
          if (warning.code === 'EVAL') return;
          warn(warning);
        },
      };

       

      posted @ 2025-10-11 15:45  SimoonJia  閱讀(6)  評論(0)    收藏  舉報
      主站蜘蛛池模板: 成人看的污污超级黄网站免费| 99国产精品99久久久久久| 草草浮力影院| 国产精品麻豆欧美日韩ww| 九九热在线观看免费视频| 一道本AV免费不卡播放| 综合久久婷婷综合久久| 18国产午夜福利一二区| 日日噜噜夜夜狠狠视频| 香港日本三级亚洲三级| 日韩精品人妻av一区二区三区| 国产精品一二三区蜜臀av| 国99久9在线 | 免费| 宫西光有码视频中文字幕| 国产高跟黑色丝袜在线| 国产在线精品福利91香蕉| 伊人色综合久久天天| 又长又粗又爽又高潮的视频| 永福县| 亚洲一区二区三区蜜桃臀| 国产老熟女无套内射不卡| www成人国产高清内射| 亚洲精品日本久久久中文字幕| 人人爽人人爽人人片a免费| 亚洲va久久久噜噜噜久久狠狠| 国产果冻豆传媒麻婆精东| 国产亚洲精品第一综合| 国内精品自国内精品自久久| 怡春院久久国语视频免费| 人妻蜜臀久久av不卡| 亚洲中文字幕成人综合网 | 日本一区二区三区黄色网| 在线 欧美 中文 亚洲 精品| 人人人澡人人肉久久精品| 亚洲国产一区二区三区四| 放荡的少妇2欧美版| 亚洲人成绝网站色www| 国产一区二区三区精美视频| 国产做无码视频在线观看| 最新国产精品精品视频| 九月婷婷人人澡人人添人人爽|