#pragma once #include #include #include #include namespace fmt { struct AssetResolver; } namespace mtgodot { // W3 —— 静态(无骨骼)GR2 对象。用 gr2_bridge 的 build_parts/build_mesh, // 逐 surface 从 gr2 material binding 取贴图(走 AssetResolver 定位 + dxt 解码), // 不建 Skeleton3D、不逐帧蒙皮。Building / DungeonBlock 用。SHINSOO §9-W3。 // // SHINSOO §9-W3「Metin2StaticModel 新节点 vs 拆 Metin2Model」的决策: // 取轻量方案 —— 一个自由函数产出带材质的共享 ArrayMesh,调用方(Metin2World) // 直接挂到 MeshInstance3D,跨实例共享同一份 mesh。 struct StaticMeshCache { std::map> by_path; int loaded = 0, failed = 0; }; // real_gr2_path = AssetResolver 解析后的真实路径。返回共享 ArrayMesh(含材质)。 // 失败返回 invalid Ref。 godot::Ref get_static_mesh(const std::string &real_gr2_path, const fmt::AssetResolver &res, StaticMeshCache &cache); // 退出时清缓存的 Ref(别拖到 __cxa_finalize)。 void cleanup_static_object_cache(); } // namespace mtgodot