Panda3D
|
High level class for color interpolation. More...
#include "colorInterpolationManager.h"
Public Member Functions | |
ColorInterpolationManager () | |
default constructor | |
ColorInterpolationManager (const LColor &c) | |
constructor | |
ColorInterpolationManager (const ColorInterpolationManager ©) | |
copy constructor | |
virtual | ~ColorInterpolationManager () |
destructor | |
int | add_constant (const PN_stdfloat time_begin=0.0f, const PN_stdfloat time_end=1.0f, const LColor &color=LColor(1.0f, 1.0f, 1.0f, 1.0f), const bool is_modulated=true) |
Adds a constant segment of the specified color to the manager and returns the segment's id as known by the manager. | |
int | add_linear (const PN_stdfloat time_begin=0.0f, const PN_stdfloat time_end=1.0f, const LColor &color_a=LColor(1.0f, 0.0f, 0.0f, 1.0f), const LColor &color_b=LColor(0.0f, 1.0f, 0.0f, 1.0f), const bool is_modulated=true) |
Adds a linear segment between two colors to the manager and returns the segment's id as known by the manager. | |
int | add_sinusoid (const PN_stdfloat time_begin=0.0f, const PN_stdfloat time_end=1.0f, const LColor &color_a=LColor(1.0f, 0.0f, 0.0f, 1.0f), const LColor &color_b=LColor(0.0f, 1.0f, 0.0f, 1.0f), const PN_stdfloat period=1.0f, const bool is_modulated=true) |
Adds a stepwave segment of two colors and a specified period to the manager and returns the segment's id as known by the manager. | |
int | add_stepwave (const PN_stdfloat time_begin=0.0f, const PN_stdfloat time_end=1.0f, const LColor &color_a=LColor(1.0f, 0.0f, 0.0f, 1.0f), const LColor &color_b=LColor(0.0f, 1.0f, 0.0f, 1.0f), const PN_stdfloat width_a=0.5f, const PN_stdfloat width_b=0.5f, const bool is_modulated=true) |
Adds a stepwave segment of two colors to the manager and returns the segment's id as known by the manager. | |
void | clear_segment (const int seg_id) |
Removes the segment of 'id' from the manager. | |
void | clear_to_initial () |
Removes all segments from the manager. | |
LColor | generateColor (const PN_stdfloat interpolated_time) |
For time 'interpolated_time', this returns the additive composite color of all segments that influence that instant in the particle's lifetime. | |
ColorInterpolationSegment * | get_segment (const int seg_id) |
Returns the segment that corresponds to 'seg_id'. | |
string | get_segment_id_list () |
Returns a space delimited list of all of the ids in the manager at the time. | |
void | set_default_color (const LColor &c) |
Sets the color to used if no segments are present. |
High level class for color interpolation.
Segments must be added to the manager in order to achieve results using the "add_*****()" functions. Access to these segments is provided but not necessary general use.
Definition at line 283 of file colorInterpolationManager.h.
default constructor
Definition at line 261 of file colorInterpolationManager.cxx.
constructor
Definition at line 273 of file colorInterpolationManager.cxx.
copy constructor
Definition at line 285 of file colorInterpolationManager.cxx.
ColorInterpolationManager::~ColorInterpolationManager | ( | ) | [virtual] |
destructor
Definition at line 298 of file colorInterpolationManager.cxx.
int ColorInterpolationManager::add_constant | ( | const PN_stdfloat | time_begin = 0.0f , |
const PN_stdfloat | time_end = 1.0f , |
||
const LColor & | color = LColor(1.0f,1.0f,1.0f,1.0f) , |
||
const bool | is_modulated = true |
||
) |
Adds a constant segment of the specified color to the manager and returns the segment's id as known by the manager.
Definition at line 310 of file colorInterpolationManager.cxx.
int ColorInterpolationManager::add_linear | ( | const PN_stdfloat | time_begin = 0.0f , |
const PN_stdfloat | time_end = 1.0f , |
||
const LColor & | color_a = LColor(1.0f,0.0f,0.0f,1.0f) , |
||
const LColor & | color_b = LColor(0.0f,1.0f,0.0f,1.0f) , |
||
const bool | is_modulated = true |
||
) |
Adds a linear segment between two colors to the manager and returns the segment's id as known by the manager.
Definition at line 327 of file colorInterpolationManager.cxx.
int ColorInterpolationManager::add_sinusoid | ( | const PN_stdfloat | time_begin = 0.0f , |
const PN_stdfloat | time_end = 1.0f , |
||
const LColor & | color_a = LColor(1.0f,0.0f,0.0f,1.0f) , |
||
const LColor & | color_b = LColor(0.0f,1.0f,0.0f,1.0f) , |
||
const PN_stdfloat | period = 1.0f , |
||
const bool | is_modulated = true |
||
) |
Adds a stepwave segment of two colors and a specified period to the manager and returns the segment's id as known by the manager.
Definition at line 362 of file colorInterpolationManager.cxx.
int ColorInterpolationManager::add_stepwave | ( | const PN_stdfloat | time_begin = 0.0f , |
const PN_stdfloat | time_end = 1.0f , |
||
const LColor & | color_a = LColor(1.0f,0.0f,0.0f,1.0f) , |
||
const LColor & | color_b = LColor(0.0f,1.0f,0.0f,1.0f) , |
||
const PN_stdfloat | width_a = 0.5f , |
||
const PN_stdfloat | width_b = 0.5f , |
||
const bool | is_modulated = true |
||
) |
Adds a stepwave segment of two colors to the manager and returns the segment's id as known by the manager.
Definition at line 344 of file colorInterpolationManager.cxx.
void ColorInterpolationManager::clear_segment | ( | const int | seg_id | ) |
Removes the segment of 'id' from the manager.
Definition at line 378 of file colorInterpolationManager.cxx.
Removes all segments from the manager.
Definition at line 396 of file colorInterpolationManager.cxx.
LColor ColorInterpolationManager::generateColor | ( | const PN_stdfloat | interpolated_time | ) |
For time 'interpolated_time', this returns the additive composite color of all segments that influence that instant in the particle's lifetime.
If no segments cover that time, the manager's default color is returned.
Definition at line 411 of file colorInterpolationManager.cxx.
References ColorInterpolationSegment::get_time_begin(), ColorInterpolationSegment::get_time_end(), ColorInterpolationSegment::interpolateColor(), ColorInterpolationSegment::is_enabled(), and ColorInterpolationSegment::is_modulated().
ColorInterpolationSegment * ColorInterpolationManager::get_segment | ( | const int | seg_id | ) | [inline] |
Returns the segment that corresponds to 'seg_id'.
Definition at line 284 of file colorInterpolationManager.I.
string ColorInterpolationManager::get_segment_id_list | ( | ) | [inline] |
Returns a space delimited list of all of the ids in the manager at the time.
Definition at line 302 of file colorInterpolationManager.I.
void ColorInterpolationManager::set_default_color | ( | const LColor & | c | ) | [inline] |
Sets the color to used if no segments are present.
Definition at line 273 of file colorInterpolationManager.I.