00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include "cLerpAnimEffectInterval.h"
00016 #include "lerp_helpers.h"
00017 #include "partBundle.h"
00018
00019 TypeHandle CLerpAnimEffectInterval::_type_handle;
00020
00021
00022
00023
00024
00025
00026
00027
00028 void CLerpAnimEffectInterval::
00029 priv_step(double t) {
00030 check_started(get_class_type(), "priv_step");
00031 _state = S_started;
00032 double d = compute_delta(t);
00033
00034 Controls::iterator ci;
00035 for (ci = _controls.begin(); ci != _controls.end(); ++ci) {
00036 ControlDef &def = (*ci);
00037 float effect;
00038 lerp_value(effect, d, def._begin_effect, def._end_effect);
00039 def._control->get_part()->set_control_effect(def._control, effect);
00040 }
00041
00042 _curr_t = t;
00043 }
00044
00045
00046
00047
00048
00049
00050 void CLerpAnimEffectInterval::
00051 output(ostream &out) const {
00052 out << get_name() << ": ";
00053
00054 if (_controls.empty()) {
00055 out << "(no controls)";
00056 } else {
00057 Controls::const_iterator ci;
00058 ci = _controls.begin();
00059 out << (*ci)._name;
00060 ++ci;
00061 while (ci != _controls.end()) {
00062 out << ", " << (*ci)._name;
00063 ++ci;
00064 }
00065 }
00066
00067 out << " dur " << get_duration();
00068 }