MCPcopy Create free account
hub / github.com/WolfireGames/overgrowth / ApplyAnimationFlags

Method ApplyAnimationFlags

Source/Graphics/animationclient.cpp:51–88  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void AnimationClient::ApplyAnimationFlags(AnimationReader &reader, AnimationAssetRef &new_ref, char _flags) {
52 flags = _flags;
53 bool swap = (flags & _ANM_SWAP) != 0;
54 bool mobile = (flags & _ANM_MOBILE) != 0;
55 bool super_mobile = (flags & _ANM_SUPER_MOBILE) != 0;
56 bool mirrored = (flags & _ANM_MIRRORED) != 0;
57 float last_rotation;
58 float old_time;
59 if (swap) {
60 old_time = reader.GetAbsoluteTime();
61 mobile = reader.GetMobile();
62 super_mobile = reader.GetSuperMobile();
63 mirrored = reader.GetMirrored();
64 last_rotation = reader.GetLastRotation();
65 }
66 reader.AttachTo(new_ref);
67 if (swap) {
68 reader.SetAbsoluteTime(old_time);
69 reader.SetLastRotation(last_rotation);
70 } else {
71 reader.SetSpeedMult(1.0f);
72 }
73 reader.SetMobile(mobile);
74 reader.SetSuperMobile(super_mobile);
75
76 std::vector<mat4> initial_mats(skeleton->physics_bones.size());
77 for (unsigned i = 0; i < skeleton->physics_bones.size(); ++i) {
78 initial_mats[i] = skeleton->physics_bones[i].initial_rotation;
79 }
80
81 if (mirrored) {
82 reader.SetMirrored(true);
83 } else {
84 reader.SetMirrored(false);
85 }
86
87 reader.ClearBlendAnim();
88}
89
90void AnimationClient::SetAnimation(const std::string &path,
91 float fade_speed,

Callers

nothing calls this directly

Calls 14

GetAbsoluteTimeMethod · 0.80
GetSuperMobileMethod · 0.80
GetLastRotationMethod · 0.80
SetAbsoluteTimeMethod · 0.80
SetLastRotationMethod · 0.80
SetMobileMethod · 0.80
SetSuperMobileMethod · 0.80
SetMirroredMethod · 0.80
ClearBlendAnimMethod · 0.80
GetMobileMethod · 0.45
GetMirroredMethod · 0.45
AttachToMethod · 0.45

Tested by

no test coverage detected