7 Commits

Author SHA1 Message Date
crosstyan 0bfcfe5901 fix: track full-motion scene bounds and ignore runtime files
Accumulate scene bounds from actual geometry and marker samples across the full trajectory instead of seeding Range3D with sentinel extrema and only joining against the first sample.

Why this loader change is necessary:

- Viewer camera framing and reference sizing derive from scene.initialBounds.

- The old code only incorporated sample==0 geometry and marker positions, so motions that travel away from the initial pose could be framed incorrectly.

- The old sentinel initialization depended on joining with artificial min/max values instead of real bounds.

What changed:

- Use first-real-bound initialization in scaledBounds(), transformBounds(), and buildCpuMesh().

- Accumulate scene.initialBounds across all trajectory samples in src/OpenSimLoader.cpp.

- Ignore generated runtime files imgui.ini and opensim.log in .gitignore.

Validation:

- Rebuilt successfully with: cmake --build build -j
2026-03-11 11:56:25 +08:00
crosstyan ab728c7e9a fix: use shortest-path rotation interpolation in playback
Switch viewer playback from Magnum Math::slerp() to Math::slerpShortestPath() when interpolating adjacent OpenSim frame orientations.

Why:

- Adjacent OpenSim quaternions can cross sign while representing nearly identical orientations.

- Non-shortest-path interpolation can create artificial long-arc spins between valid sampled poses.

- That makes playback exaggerate or invent visible bone flips that are not present in the sampled frame states.

What changed:

- Updated playback interpolation in src/ViewerApp.cpp to use shortest-path quaternion slerp.

- Added docs/motion-troubleshooting.md documenting the distinction between viewer interpolation artifacts and upstream IK discontinuities.

- Added a README pointer to the troubleshooting note.

Investigation log:

- Verified the viewer loads .mot through OpenSim state storage and renders PhysicalFrame transforms directly.

- Reproduced the target Sports2D/Pose2Sim/OpenSim clip and confirmed the .mot already contains large coordinate discontinuities and limit clamping, indicating upstream IK failure.

- Confirmed the viewer also had a separate interpolation issue due to non-shortest-path quaternion slerp.

Validation:

- Rebuilt with: cmake --build build -j

- Relaunched the viewer successfully against the problematic .osim/.mot pair after the fix.
2026-03-11 11:54:41 +08:00
crosstyan 3e7ef53799 Improve viewer camera controls and playback seeking 2026-03-11 11:37:45 +08:00
crosstyan 81925f436f build(deps): convert third-party dependencies to submodules 2026-03-10 20:21:35 +08:00
crosstyan 7d2de93ff3 Trim vendored dependency trees 2026-03-10 20:09:57 +08:00
crosstyan 5638714000 Vendor Magnum and Corrade sources 2026-03-10 19:55:20 +08:00
crosstyan c382cfc3df Initial native OpenSim viewer prototype 2026-03-10 19:54:09 +08:00