Implement playable Mac client and rendering validation

This commit is contained in:
shen
2026-09-11 14:58:22 +08:00
parent 1ab68bd06e
commit 374d4165d8
233 changed files with 6546 additions and 284 deletions
+9 -3
View File
@@ -10,6 +10,7 @@
#include <msa.h>
#include <optional>
#include <memory>
#include <vector>
namespace mtgodot {
@@ -67,8 +68,12 @@ public:
// .msa metadata (empty / zero when anim_path is a raw .gr2).
godot::Vector3 get_accumulation() const { return accumulation; }
godot::Array get_events() const; // [{type,start_time,effect,sound,pos}, ...]
// Full affine pose in model GR2 coordinates, shared by CPU/GPU and blending.
godot::Dictionary get_effect_bone_pose(const godot::String &bone);
godot::Dictionary get_loop_data() const;
godot::Dictionary get_motion_data() const; // {duration,next_combo,attack_start_time,...}
static godot::Dictionary get_clip_cache_stats();
static void clear_clip_cache();
// CLIENT-GAP §3.5 — parse the PC combo tables out of playersettingmodule.py
// (chrmgr.ReserveComboAttackNew / RegisterComboAttackNew → CRaceData). Returns
@@ -86,6 +91,7 @@ protected:
static void _bind_methods();
private:
void emit_motion_event(const fmt::MotionEvent &ev);
godot::String anim_path;
godot::NodePath model_path;
bool playing = true;
@@ -95,14 +101,14 @@ private:
double duration = 0.0;
godot::String last_info;
std::optional<gr2::File> anim_file;
std::shared_ptr<const gr2::File> anim_file;
std::vector<gr2::Mat4> world_buf;
std::vector<gr2::Mat4> skin_buf;
// Crossfade state: the outgoing clip is kept and sampled at a frozen time,
// its pose blended into the incoming clip for `blend_time` seconds.
double blend_time = 0.15;
std::optional<gr2::File> prev_anim_file;
std::shared_ptr<const gr2::File> prev_anim_file;
double prev_anim_time = 0.0;
double prev_anim_duration = 0.0;
bool prev_anim_loop = true;
@@ -119,7 +125,7 @@ private:
void apply_pose(double t);
void dispatch_events(double from, double to);
// .msa path -> real motion .gr2 path; passes plain .gr2 paths through.
static godot::String resolve_anim_gr2(const godot::String &spec);
static godot::String resolve_anim_gr2(const godot::String &spec, const fmt::Msa &metadata);
};
} // namespace mtgodot