The TransformComponent has a rotation field that is currently populated by the rotation from the loaded scenario file, and presumably this rotation is around the z-axis in radians (that's a guess; I haven't confirmed).
I'm guessing that the mirror_mode, frame_count, and angle_count play a huge role in figuring out which frame has the correct angle.
If you look at SLP 418 in the slp_viewer tool, you can see that the first angle lasts for 6 frames, and then the second angle for another 6, and so on.
The directions appear to be:
0-6: South
6-12: South West
12-18: West
18-24: North West
24-30: North
And that's it--the rest of the directions must be mirrored from the others. I'm guessing there are different ways of mirroring, so the mirror_mode probably plays a role here. We'll probably have to visually examine graphics with different mirror modes to figure out how that works.
The
TransformComponent
has arotation
field that is currently populated by the rotation from the loaded scenario file, and presumably this rotation is around the z-axis in radians (that's a guess; I haven't confirmed).Currently there's a TODO comment to actually use this rotation value when rendering the unit: https://github.com/angered-ghandi/OpenAOE/blob/master/src/ecs/render_system/unit_render_system.rs#L65
Now, examining the graphic data for a simple idle villager:
I'm guessing that the
mirror_mode
,frame_count
, andangle_count
play a huge role in figuring out which frame has the correct angle.If you look at SLP 418 in the
slp_viewer
tool, you can see that the first angle lasts for 6 frames, and then the second angle for another 6, and so on.The directions appear to be:
And that's it--the rest of the directions must be mirrored from the others. I'm guessing there are different ways of mirroring, so the
mirror_mode
probably plays a role here. We'll probably have to visually examine graphics with different mirror modes to figure out how that works.