diff --git a/panda/src/particlesystem/colorInterpolationManager.cxx b/panda/src/particlesystem/colorInterpolationManager.cxx index 14d39b6721..8e5e950e87 100755 --- a/panda/src/particlesystem/colorInterpolationManager.cxx +++ b/panda/src/particlesystem/colorInterpolationManager.cxx @@ -203,12 +203,13 @@ ColorInterpolationSegment:: ColorInterpolationSegment(ColorInterpolationFunction* function, const float &time_begin, const float &time_end, + const bool is_modulated, const int id) : _color_inter_func(function), _t_begin(time_begin), _t_end(time_end), _t_total(time_end-time_begin), - _is_modulated(true), + _is_modulated(is_modulated), _enabled(true), _id(id) { } @@ -310,9 +311,9 @@ ColorInterpolationManager:: //////////////////////////////////////////////////////////////////// int ColorInterpolationManager:: -add_constant(const float time_begin, const float time_end, const Colorf color) { +add_constant(const float time_begin, const float time_end, const Colorf color, const bool is_modulated) { PT(ColorInterpolationFunctionConstant) fPtr = new ColorInterpolationFunctionConstant(color); - PT(ColorInterpolationSegment) sPtr = new ColorInterpolationSegment(fPtr,time_begin,time_end,_id_generator); + PT(ColorInterpolationSegment) sPtr = new ColorInterpolationSegment(fPtr,time_begin,time_end,is_modulated,_id_generator); _i_segs.push_back(sPtr); @@ -327,9 +328,9 @@ add_constant(const float time_begin, const float time_end, const Colorf color) { //////////////////////////////////////////////////////////////////// int ColorInterpolationManager:: -add_linear(const float time_begin, const float time_end, const Colorf color_a, const Colorf color_b) { +add_linear(const float time_begin, const float time_end, const Colorf color_a, const Colorf color_b, const bool is_modulated) { PT(ColorInterpolationFunctionLinear) fPtr = new ColorInterpolationFunctionLinear(color_a, color_b); - PT(ColorInterpolationSegment) sPtr = new ColorInterpolationSegment(fPtr,time_begin,time_end,_id_generator); + PT(ColorInterpolationSegment) sPtr = new ColorInterpolationSegment(fPtr,time_begin,time_end,is_modulated,_id_generator); _i_segs.push_back(sPtr); @@ -344,9 +345,9 @@ add_linear(const float time_begin, const float time_end, const Colorf color_a, c //////////////////////////////////////////////////////////////////// int ColorInterpolationManager:: -add_stepwave(const float time_begin, const float time_end, const Colorf color_a, const Colorf color_b, const float width_a, const float width_b) { +add_stepwave(const float time_begin, const float time_end, const Colorf color_a, const Colorf color_b, const float width_a, const float width_b,const bool is_modulated) { PT(ColorInterpolationFunctionStepwave) fPtr = new ColorInterpolationFunctionStepwave(color_a, color_b, width_a, width_b); - PT(ColorInterpolationSegment) sPtr = new ColorInterpolationSegment(fPtr,time_begin,time_end,_id_generator); + PT(ColorInterpolationSegment) sPtr = new ColorInterpolationSegment(fPtr,time_begin,time_end,is_modulated,_id_generator); _i_segs.push_back(sPtr); @@ -362,9 +363,9 @@ add_stepwave(const float time_begin, const float time_end, const Colorf color_a, //////////////////////////////////////////////////////////////////// int ColorInterpolationManager:: -add_sinusoid(const float time_begin, const float time_end, const Colorf color_a, const Colorf color_b, const float period) { +add_sinusoid(const float time_begin, const float time_end, const Colorf color_a, const Colorf color_b, const float period,const bool is_modulated) { PT(ColorInterpolationFunctionSinusoid) fPtr = new ColorInterpolationFunctionSinusoid(color_a, color_b, period); - PT(ColorInterpolationSegment) sPtr = new ColorInterpolationSegment(fPtr,time_begin,time_end,_id_generator); + PT(ColorInterpolationSegment) sPtr = new ColorInterpolationSegment(fPtr,time_begin,time_end,is_modulated,_id_generator); _i_segs.push_back(sPtr); diff --git a/panda/src/particlesystem/colorInterpolationManager.h b/panda/src/particlesystem/colorInterpolationManager.h index b6de1add58..4fa3a3bc73 100755 --- a/panda/src/particlesystem/colorInterpolationManager.h +++ b/panda/src/particlesystem/colorInterpolationManager.h @@ -244,7 +244,7 @@ private: class ColorInterpolationSegment : public ReferenceCount { PUBLISHED: - ColorInterpolationSegment(ColorInterpolationFunction* function, const float &time_begin, const float &time_end, const int id); + ColorInterpolationSegment(ColorInterpolationFunction* function, const float &time_begin, const float &time_end, const bool is_modulated, const int id); ColorInterpolationSegment(const ColorInterpolationSegment &s); virtual ~ColorInterpolationSegment(); @@ -291,10 +291,10 @@ ColorInterpolationManager(); ColorInterpolationManager(const ColorInterpolationManager& copy); virtual ~ColorInterpolationManager(); - int add_constant(const float time_begin = 0.0f, const float time_end = 1.0f, const Colorf color = Colorf(1.0f,1.0f,1.0f,1.0f)); - int add_linear(const float time_begin = 0.0f, const float time_end = 1.0f, const Colorf color_a = Colorf(1.0f,0.0f,0.0f,1.0f), const Colorf color_b = Colorf(0.0f,1.0f,0.0f,1.0f)); - int add_stepwave(const float time_begin = 0.0f, const float time_end = 1.0f, const Colorf color_a = Colorf(1.0f,0.0f,0.0f,1.0f), const Colorf color_b = Colorf(0.0f,1.0f,0.0f,1.0f), const float width_a = 0.5f, const float width_b = 0.5f); - int add_sinusoid(const float time_begin = 0.0f, const float time_end = 1.0f, const Colorf color_a = Colorf(1.0f,0.0f,0.0f,1.0f), const Colorf color_b = Colorf(0.0f,1.0f,0.0f,1.0f), const float period = 1.0f); + int add_constant(const float time_begin = 0.0f, const float time_end = 1.0f, const Colorf color = Colorf(1.0f,1.0f,1.0f,1.0f), const bool is_modulated = true); + int add_linear(const float time_begin = 0.0f, const float time_end = 1.0f, const Colorf color_a = Colorf(1.0f,0.0f,0.0f,1.0f), const Colorf color_b = Colorf(0.0f,1.0f,0.0f,1.0f), const bool is_modulated = true); + int add_stepwave(const float time_begin = 0.0f, const float time_end = 1.0f, const Colorf color_a = Colorf(1.0f,0.0f,0.0f,1.0f), const Colorf color_b = Colorf(0.0f,1.0f,0.0f,1.0f), const float width_a = 0.5f, const float width_b = 0.5f, const bool is_modulated = true); + int add_sinusoid(const float time_begin = 0.0f, const float time_end = 1.0f, const Colorf color_a = Colorf(1.0f,0.0f,0.0f,1.0f), const Colorf color_b = Colorf(0.0f,1.0f,0.0f,1.0f), const float period = 1.0f, const bool is_modulated = true); INLINE void set_default_color(const Colorf &c); INLINE ColorInterpolationSegment* get_segment(const int seg_id);