13 Animate::Animate(GL::Placeable &t, const GL::Animation &a, GL::AnimationPlayer &p):
19 void Animate::validate() const
22 throw logic_error("null target");
24 throw logic_error("null animation");
26 throw logic_error("null player");
29 void Animate::start(float, float d)
31 float speed = (d ? (anim->get_duration()/Time::sec)/d : 1.0f);
32 player->play(*target, *anim, speed);
36 Animate::Loader::Loader(Animate &a, Demo &d):
37 DataFile::DerivedObjectLoader<Animate, Action::Loader>(a, d)
39 a.player = &demo.get_animation_player();
40 add("animation", &Loader::animation);
41 add("target", &Loader::target);
44 void Animate::Loader::animation(const string &n)
46 obj.anim = &demo.get_resources().get<GL::Animation>(n);
49 void Animate::Loader::target(const string &n)
51 obj.target = &demo.get_thing<GL::Placeable>(n);