com um clique
ammo-mmd-physics-hacks
// 应对 WebGL 端 MMD 物理 (Ammo.js) 炸模、穿模、卡顿等极限边缘工况的终极调优指南与 Hack 技巧。
// 应对 WebGL 端 MMD 物理 (Ammo.js) 炸模、穿模、卡顿等极限边缘工况的终极调优指南与 Hack 技巧。
i18n (internationalization) toolkit for projects using i18next. Provides three main functions: (1) i18n-check - Detect hardcoded Chinese text in HTML/JS files, (2) i18n-fix - Replace hardcoded text with i18n markers, (3) i18n-sync - Align translation keys across multiple languages (zh-CN, zh-TW, en, ja, ko, ru, es, pt). Use when working on internationalization tasks, detecting untranslated strings, or syncing locale files.
Gemini 模型通过 OpenAI 兼容 API 接入指南。包含:(1) 辅助 API 配置(summary/correction/emotion/vision),(2) extra_body 格式用于控制 thinking,(3) 响应格式处理(markdown 代码块)。当需要将 Gemini 作为辅助模型接入、配置 thinking 参数、或处理 Gemini API 返回格式时使用。
When masking httpx.AsyncClient with unittest.mock in Pytest, AsyncMock must be used instead of MagicMock for async methods like post/get to prevent TypeError when awaited.
Best practices for extracting data from modern React/Vue SSR pages (like Next.js or Nuxt.js) by targeting hydration state blocks (__NEXT_DATA__, __NUXT__) using regex and `jmespath`, avoiding brittle DOM selector scraping.
Convention for reporting errors from multiprocessing TTS workers to the main process frontend. Use this skill when modifying, adding, or debugging TTS workers in tts_client.py to ensure connection errors, quotas, and API limits correctly display Toast notifications to the user rather than failing silently.
Dealing with delayed DOM generation, lazy loading, and optimistic state synchronization in vanilla JavaScript without a reactive framework.
| name | ammo-mmd-physics-hacks |
| description | 应对 WebGL 端 MMD 物理 (Ammo.js) 炸模、穿模、卡顿等极限边缘工况的终极调优指南与 Hack 技巧。 |
setWorldTransform 暴力对齐拉扯起刺,曾将其强制降级为 Mode 1。但 Mode 2 对应的刚体(如头发根部)本身没有弹簧连接身体!降级后其失去了固定锚点,只会被重力拉扯落下,动作结束后永远无法归位。setCenterOfMassTransform 并同步 Motion State,来执行无撕裂的中心重置。并附加 body.setActivationState(4) 彻底关闭休眠,防止动作静止时刚体被算法冻住回不去。scale 保留了最大的身躯护盾,但在高速舞蹈下,衣服依然会无伤穿插人体。原因是负责同步骨骼躯干 (Mode 0) 的 _setTransformFromBone 错误使用了 setWorldTransform(),这在物理引擎中等同于“每一帧都在瞬移重置”,使得躯干刚体由于无连续运动状态而在 Bullet 内部毫无撞击动量反馈。setWorldTransform,改为专职喂食 body.getMotionState().setWorldTransform()。Bullet 会在底层的 stepSimulation 中根据上一帧对比自动求导算出极其精确的高速内向动能并激活弹道击退反馈!彻底打破幽灵穿模。update(delta) 的收尾阶段遍历动态刚体,如果发现 LinearVelocity (>50.0) 或 AngularVelocity (>30.0) 超出正常物理空间速度上限,则强行按比例归一化缩减向量。这样既能够不改变动能轨道方向,又像降落伞一样掐死了“超音速”乱飞的势头。quaternion 反算为贴合身体的“局部向脚”重力;同时摒弃水平静止的虚空大地,让承托地板的旋转矩阵直接绑定接驳 mesh.quaternion。人物平躺时,大地瞬间化为贴着背部的立墙。scale = 1.0 且 margin = 0.05 的厚重防撞护盾;衣服/头发刚体缩水为 0.9 体积且超薄 margin = 0.01。这创造了绝对的“屏障与游丝”互补结构,杜绝互相镶嵌。new Ammo.btVector3() 喂给涉及重力的接口,GC 回收不到底层 C++ 堆空间会导致秒级 OOM 卡死。解法:类内部挂载单例向量并重复 setValue()。btStaticPlaneShape 不支持实时的中心变换系统(不支持翻转旋转),充当地板会导致断层穿刺。解法:采用极其巨大的薄 btBoxShape (100x1x100) 并将 Origin Y轴下移 1 单位作为替代品。不要硬刚物理引擎的迭代算力!面对 Ammo.js (Bullet) 多达几百个带有关节约束的高密度模型,直接调高 numIterations 到 100 会彻底废掉浏览器的 60FPS 单线程。最高效的降维打击一定是将物理转化为纯粹的代码空间钳制(锁死、降级、同移、限速)!