To recreate the exact pose at the moment of saving, especially when physics constraints are involved, serializing the AnimationState
alone might not be sufficient. The AnimationState
serialization captures the animation tracks and their settings, but it does not account for the dynamic effects introduced by physics constraints. The _time
variable in skeleton.cpp
and the state of the _physicsConstraints
are indeed important for accurately reproducing the physics interactions at a specific moment.
However, the discussions in the provided contexts do not directly address the complete requirements for serializing physics constraints alongside AnimationState
. They do highlight the complexity of serializing game state, including animations and physics, suggesting that a comprehensive approach might involve more than just AnimationState
and _time
. For physics constraints, which depend on previous poses to calculate velocities and other dynamic effects, you might need to serialize additional state information that captures these dynamics.
Given the complexity of physics simulations, which can depend on continuous states rather than discrete events, serializing the entire skeleton state, including all bones and possibly other physics-related data, might be necessary for an accurate recreation. This would ensure that all the nuances of the physics interactions are preserved, not just the animation poses.