- Joined
- Oct 26, 2011
- Messages
- 1,262
- Reaction score
- 727
- Points
- 128
I am running into a problem with trying to animate the rendezvous radar (as an example, it happens with other animations) for the NASSP Lunar Module. It works pretty well, except it snaps into a weird position at staging.
When the descent stage is dropped a function calls ClearMeshes(true), using true there should retain the animations associated with the meshes. The meshes are then loaded in the same order again, so that shouldn't be the cause of the issue.
The problem seems to happen with animation components that are added as a child of others. Here some of the code for the RR:
where, I think, only the animation of ach_RadarYaw has the issue happening.
Interestingly when the RR is in the same state as the mesh by default (so animation states 0.0 and 0.0) then the RR looks the same after staging. It is almost as if, when the meshes are loaded again, Orbiter doesn't keep track of where the animation state currently is or it thinks it's in the same state as before and applies the current animation state twice, so adding a wrong offset. Does that make sense? Could it also be a pre step vs. post step issue? The ClearMeshes gets call in pre step. I am not sure how we can work around this or if it is an Orbiter bug or so. Any help would be appreciated.
When the descent stage is dropped a function calls ClearMeshes(true), using true there should retain the animations associated with the meshes. The meshes are then loaded in the same order again, so that shouldn't be the cause of the issue.
The problem seems to happen with animation components that are added as a child of others. Here some of the code for the RR:
Code:
ach_RadarPitch = lem->AddAnimationComponent(anim_RRPitch, 0.0f, 1.0f, mgt_Radar_pivot);
ach_RadarYaw = lem->AddAnimationComponent(anim_RRYaw, 0.0f, 1.0f, mgt_Radar_Antenna, ach_RadarPitch);
where, I think, only the animation of ach_RadarYaw has the issue happening.
Interestingly when the RR is in the same state as the mesh by default (so animation states 0.0 and 0.0) then the RR looks the same after staging. It is almost as if, when the meshes are loaded again, Orbiter doesn't keep track of where the animation state currently is or it thinks it's in the same state as before and applies the current animation state twice, so adding a wrong offset. Does that make sense? Could it also be a pre step vs. post step issue? The ClearMeshes gets call in pre step. I am not sure how we can work around this or if it is an Orbiter bug or so. Any help would be appreciated.