X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-core%2Ftrunk%2Fsrc%2Fsynfig%2Fvaluenode_animated.cpp;h=d354f979500479ed04749eb2e6efe63b8bcc6f0e;hb=37600b4b217caa5e316984ec0b035c5e8f9698af;hp=1c37cbe185dea46ef8699fed2e29b6a3a0c16560;hpb=68dcfc249ef35fac4dadc60c3daa7433d212bc4b;p=synfig.git diff --git a/synfig-core/trunk/src/synfig/valuenode_animated.cpp b/synfig-core/trunk/src/synfig/valuenode_animated.cpp index 1c37cbe..d354f97 100644 --- a/synfig-core/trunk/src/synfig/valuenode_animated.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_animated.cpp @@ -6,6 +6,7 @@ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2007 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -428,7 +429,8 @@ public: value_type Pn; Pn=after_next->get_value().get(T()); // P_{i+1} // TCB - value_type vect(static_cast(subtract_func(Pc,Pp)*(((1.0-t)*(1.0-c)*(1.0+b))/2.0)+(Pn-Pc)*(((1.0-t)*(1.0+c)*(1.0-b))/2.0))); + value_type vect(static_cast(subtract_func(Pc,Pp) * (((1.0-t)*(1.0-c)*(1.0+b))/2.0) + + (Pn-Pc) * (((1.0-t)*(1.0+c)*(1.0-b))/2.0))); // Tension Only //value_type vect((value_type)((Pn-Pp)*(1.0-t))); @@ -457,13 +459,27 @@ public: if(iter_get_after==INTERPOLATION_HALT) curve.second.t1()*=0; + // if this isn't the first curve else if(iter_get_after != INTERPOLATION_LINEAR && !curve_list.empty()) - curve.second.t1()*=(curve.second.get_dt()*(timeadjust+1))/(curve.second.get_dt()*timeadjust+curve_list.back().second.get_dt()); + // adjust it for the curve that came before it + curve.second.t1() *= + // (time span of this curve) * 1.5 + // ----------------------------------------------------------------- + // ((time span of this curve) * 0.5) + (time span of previous curve) + (curve.second.get_dt()*(timeadjust+1)) / + (curve.second.get_dt()*timeadjust + curve_list.back().second.get_dt()); if(next_get_before==INTERPOLATION_HALT) curve.second.t2()*=0; + // if this isn't the last curve else if(next_get_before != INTERPOLATION_LINEAR && after_next!=waypoint_list_.end()) - curve.second.t2()*=(curve.second.get_dt()*(timeadjust+1))/(curve.second.get_dt()*timeadjust+(after_next->get_time()-next->get_time())); + // adjust it for the curve that came after it + curve.second.t2() *= + // (time span of this curve) * 1.5 + // ------------------------------------------------------------- + // ((time span of this curve) * 0.5) + (time span of next curve) + (curve.second.get_dt()*(timeadjust+1)) / + (curve.second.get_dt()*timeadjust+(after_next->get_time()-next->get_time())); } // not CONSTANT }