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

Method AttachTo

Source/Graphics/animationreader.cpp:198–219  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

196}
197
198void AnimationReader::AttachTo(const AnimationAssetRef &_ref) {
199 anim = _ref;
200 normalized_time = 0.0f;
201 last_offset = vec3(0.0f);
202 last_rotation = 0.0f;
203 skip_offset = false;
204 callback_string.clear();
205 for (int &animated_item_id : animated_item_ids) {
206 animated_item_id = -1;
207 }
208 const AnimationAsset &anim = (*_ref);
209 int anim_id = 0;
210 events = anim.GetEvents(anim_id, mirrored);
211 std::sort(events.begin(),
212 events.end(),
213 NormalizedAnimationEventCompare());
214
215 next_event = 0;
216 while ((int)next_event < (int)events.size() - 1 && events[next_event].time == 0.0f) {
217 next_event++;
218 }
219}
220
221bool AnimationReader::valid() {
222 return anim.valid();

Callers 4

ApplyAnimationFlagsMethod · 0.45
AttachToModelMethod · 0.45
MakeParticleMethod · 0.45
SetDetailObjectLayersMethod · 0.45

Calls 8

vec3Class · 0.50
sortFunction · 0.50
clearMethod · 0.45
GetEventsMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected