Files
mtgodot-poc/tools/granny-oracle/FORMAT.md
T
shenleiandClaude Opus 5.5 a46093104c layout: restructure into src/ tests/ android/ scripts/ tools/
- extension/src/{port,platform,codepage} -> src/; native_render -> src/host
  (+ dxt, shaders/); libgr2 -> src/gr2; extension/third_party -> third_party
- extension/tests -> tests/port, libgr2/tests -> tests/gr2
- android-native -> android (build.sh, push-client.sh moved in)
- script -> scripts; tools/40250 -> tools/server; oracle -> tools/granny-oracle;
  perf tools -> tools/perf
- all build trees under build/ (native, release, android, port-gate)
- xrender:: CMake aliases -> mt::; port-map ledger impl paths rewritten

No code changes. ctest 15/15, port_gate macos+android PASS, port_map check 0 errors.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-29 19:08:19 +09:00

46 lines
2.0 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# oracle dump 二进制格式
> `oracle.c`(`oracle dump`)产出。libgr2 侧对拍读取器(`tools/oracle_diff/`)必须与本文件一致。
> `oracle dump` 把**层① 世界矩阵**和**mesh N 蒙皮顶点**写进**同一个文件**:先文件头,
> 再 `kind=1` 段,紧接着 `kind=3` 段(`--mesh` 未命中时 `vertex_count=0`)。全部小端。
## 文件头(所有 dump 共用)
```
magic "XORC" 4B
version u32 1
kind u32 1=层① 2=层② 3=蒙皮顶点 1
coord u32 坐标约定编码: 1
bit0 手系 (0=左手 1=右手)
bit1 单位 (0=原始 1=米)
bit2 根变换已 apply
granny_ver char[16] 选定 granny2.dll 版本串
model_path len-prefixed str
anim_path len-prefixed str
t f32 采样时刻
```
## kind=1/2 段(骨骼世界矩阵,紧跟文件头)
```
bone_count u32
matrices f32[bone_count][16] GrannyGetWorldPose4x4Array 直出(骨骼空间→世界),行主序 Granny 原生
```
> ⚠ 不是 `GrannyGetWorldPoseComposite4x4Array` —— 那个返回 `InverseWorld4x4·world` = **蒙皮矩阵**(bind pose 时 ≈ I)。
> `GrannyBuildWorldPose` 的 `Offset4x4` 传的是 model 的 `InitialPlacement`(`GrannyGetModelInitialPlacement4x4`),
> 与 libgr2 `skeleton.initial_placement` 一致;不传的话非单位 IP 的模型(如 assassin 双 root)会差一个平移。
## kind=3 段(mesh N 蒙皮顶点,紧跟 kind=1 段)
```
vertex_count u32 (--mesh 未命中 → 0,无后续)
positions f32[vertex_count][3] GrannyDeformVertices(PositionNormal) 后的位置
```
## 坐标约定
**M0/oracle 全程 raw**:`coord` = 手系按选定 DLL 实际输出、单位=原始、根变换未 apply。
libgr2 的 `gr2::Mat4` 声明同一约定(见 `docs/steps/M0-gr2-reader.md` 「约定」)。
basis fix / 单位缩放是 M1 渲染时才做的事,不进 dump。