Panda3D
|
High level class for color interpolation. More...
#include "colorInterpolationManager.h"
Public Member Functions | |
ColorInterpolationManager () | |
default constructor | |
ColorInterpolationManager (const Colorf &c) | |
constructor | |
ColorInterpolationManager (const ColorInterpolationManager ©) | |
copy constructor | |
virtual | ~ColorInterpolationManager () |
destructor | |
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) |
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 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) |
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 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) |
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 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) |
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. | |
Colorf | generateColor (const float 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 Colorf &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.
ColorInterpolationManager::ColorInterpolationManager | ( | ) |
default constructor
Definition at line 261 of file colorInterpolationManager.cxx.
ColorInterpolationManager::ColorInterpolationManager | ( | const Colorf & | c | ) |
constructor
Definition at line 273 of file colorInterpolationManager.cxx.
ColorInterpolationManager::ColorInterpolationManager | ( | const ColorInterpolationManager & | copy | ) |
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 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 |
||
) |
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 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 |
||
) |
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 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 |
||
) |
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 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 |
||
) |
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.
void ColorInterpolationManager::clear_to_initial | ( | ) |
Removes all segments from the manager.
Definition at line 396 of file colorInterpolationManager.cxx.
Colorf ColorInterpolationManager::generateColor | ( | const float | 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 Colorf & | c | ) | [inline] |
Sets the color to used if no segments are present.
Definition at line 273 of file colorInterpolationManager.I.