//#define _EPSILON 0.0000001
//#endif
-#define ETL_FIXED_DERIVATIVE 1
-
/* === T Y P E D E F S ===================================================== */
/* === C L A S S E S & S T R U C T S ======================================= */
typename T::result_type
operator()(const typename T::argument_type &x)const
{
-#ifdef ETL_FIXED_DERIVATIVE
return (func(x+epsilon)-func(x))/epsilon;
-#else
- return (func(x)-func(x+epsilon))/epsilon;
-#endif
}
};
blinepoint0.get_tangent2(), blinepoint1.get_tangent1());
etl::derivative< etl::hermite<Vector> > deriv(curve);
-#ifdef ETL_FIXED_DERIVATIVE
switch (get_type())
{
case ValueBase::TYPE_ANGLE: return (deriv(amount-from_vertex)*(0.5)).angle();
case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex)*(0.5);
default: assert(0); return ValueBase();
}
-#else
- switch (get_type())
- {
- case ValueBase::TYPE_ANGLE: return (deriv(amount-from_vertex)*(-0.5)).angle();
- case ValueBase::TYPE_VECTOR: return deriv(amount-from_vertex)*(-0.5);
- default: assert(0); return ValueBase();
- }
-#endif
}
String
etl::hermite<Vector> curve(segment.p1,segment.p2,segment.t1,segment.t2);
etl::derivative< etl::hermite<Vector> > deriv(curve);
-#ifdef ETL_FIXED_DERIVATIVE
return deriv((*amount_)(t).get(Real()))*(0.5);
-#else
- return deriv((*amount_)(t).get(Real()))*(-0.5);
-#endif
-
}
bline_point.set_vertex(curve(origin));
bline_point.set_width((next_bline_point.get_width()-prev_bline_point.get_width())*origin+prev_bline_point.get_width());
-#ifdef ETL_FIXED_DERIVATIVE
bline_point.set_tangent1(deriv(origin)*std::min(1.0f-origin,origin));
-#else
- bline_point.set_tangent1(-deriv(origin)*std::min(1.0f-origin,origin));
-#endif
bline_point.set_tangent2(bline_point.get_tangent1());
bline_point.set_split_tangent_flag(false);
bline_point.set_origin(origin);