Panda3D
|
A single unit of interpolation. More...
#include "colorInterpolationManager.h"
Public Member Functions | |
ColorInterpolationSegment (ColorInterpolationFunction *function, const PN_stdfloat &time_begin, const PN_stdfloat &time_end, const bool is_modulated, const int id) | |
constructor | |
ColorInterpolationSegment (const ColorInterpolationSegment &s) | |
copy constructor | |
virtual | ~ColorInterpolationSegment () |
destructor | |
TypedReferenceCount * | get_function () const |
Returns a reference to the function object corresponding to this segment. | |
int | get_id () const |
Returns the id assigned to this segment by the manager that created it. | |
PN_stdfloat | get_time_begin () const |
Returns the point in the particle's lifetime at which this segment begins its effect. | |
PN_stdfloat | get_time_end () const |
Returns the point in the particle's lifetime at which this segment's effect stops. | |
LColor | interpolateColor (const PN_stdfloat t) const |
Returns the interpolated color according to the segment's function and start and end times. | |
bool | is_enabled () const |
Returns whether the segments effects are being applied. | |
bool | is_modulated () const |
Returns whether the function is additive or modulated. | |
void | set_enabled (const bool enabled) |
Sets whether the segments effects should be applied. | |
void | set_function (ColorInterpolationFunction *function) |
Sets the function that the segment will use for its interpolation calculations. | |
void | set_is_modulated (const bool flag) |
Sets how the function is applied to the final color. | |
void | set_time_begin (const PN_stdfloat time) |
Sets the point in the particle's lifetime at which this segment begins its effect. | |
void | set_time_end (const PN_stdfloat time) |
Sets the point in the particle's lifetime at which this segment's effect ends. | |
Protected Member Functions | |
PT (ColorInterpolationFunction) _color_inter_func | |
Protected Attributes | |
bool | _enabled |
const int | _id |
bool | _is_modulated |
PN_stdfloat | _t_begin |
PN_stdfloat | _t_end |
PN_stdfloat | _t_total |
A single unit of interpolation.
The begin and end times are interpolated over the lifetime of the particle, thus have the range of [0,1]. Each segment also has a function associated with it.
Definition at line 241 of file colorInterpolationManager.h.
ColorInterpolationSegment::ColorInterpolationSegment | ( | ColorInterpolationFunction * | function, |
const PN_stdfloat & | time_begin, | ||
const PN_stdfloat & | time_end, | ||
const bool | is_modulated, | ||
const int | id | ||
) |
constructor
Definition at line 199 of file colorInterpolationManager.cxx.
copy constructor
Definition at line 220 of file colorInterpolationManager.cxx.
ColorInterpolationSegment::~ColorInterpolationSegment | ( | ) | [virtual] |
destructor
Definition at line 237 of file colorInterpolationManager.cxx.
TypedReferenceCount * ColorInterpolationSegment::get_function | ( | ) | const [inline] |
Returns a reference to the function object corresponding to this segment.
Definition at line 138 of file colorInterpolationManager.I.
int ColorInterpolationSegment::get_id | ( | ) | const [inline] |
Returns the id assigned to this segment by the manager that created it.
Definition at line 198 of file colorInterpolationManager.I.
PN_stdfloat ColorInterpolationSegment::get_time_begin | ( | ) | const [inline] |
Returns the point in the particle's lifetime at which this segment begins its effect.
It is an interpolated value in the range [0,1].
Definition at line 151 of file colorInterpolationManager.I.
Referenced by ColorInterpolationManager::generateColor().
PN_stdfloat ColorInterpolationSegment::get_time_end | ( | ) | const [inline] |
Returns the point in the particle's lifetime at which this segment's effect stops.
It is an interpolated value in the range [0,1].
Definition at line 164 of file colorInterpolationManager.I.
Referenced by ColorInterpolationManager::generateColor().
LColor ColorInterpolationSegment::interpolateColor | ( | const PN_stdfloat | t | ) | const |
Returns the interpolated color according to the segment's function and start and end times.
't' is a value in [0-1] where corresponds to beginning of the segment and 1 corresponds to the end.
Definition at line 250 of file colorInterpolationManager.cxx.
Referenced by ColorInterpolationManager::generateColor().
bool ColorInterpolationSegment::is_enabled | ( | ) | const [inline] |
Returns whether the segments effects are being applied.
Definition at line 186 of file colorInterpolationManager.I.
Referenced by ColorInterpolationManager::generateColor().
bool ColorInterpolationSegment::is_modulated | ( | ) | const [inline] |
Returns whether the function is additive or modulated.
Definition at line 175 of file colorInterpolationManager.I.
Referenced by ColorInterpolationManager::generateColor().
void ColorInterpolationSegment::set_enabled | ( | const bool | enabled | ) | [inline] |
Sets whether the segments effects should be applied.
Definition at line 262 of file colorInterpolationManager.I.
void ColorInterpolationSegment::set_function | ( | ColorInterpolationFunction * | function | ) | [inline] |
Sets the function that the segment will use for its interpolation calculations.
Definition at line 210 of file colorInterpolationManager.I.
void ColorInterpolationSegment::set_is_modulated | ( | const bool | flag | ) | [inline] |
Sets how the function is applied to the final color.
If true, the value is multiplied. If false, the value is simply added. Default is true.
Definition at line 251 of file colorInterpolationManager.I.
void ColorInterpolationSegment::set_time_begin | ( | const PN_stdfloat | time | ) | [inline] |
Sets the point in the particle's lifetime at which this segment begins its effect.
It is an interpolated value in the range [0,1].
Definition at line 223 of file colorInterpolationManager.I.
void ColorInterpolationSegment::set_time_end | ( | const PN_stdfloat | time | ) | [inline] |
Sets the point in the particle's lifetime at which this segment's effect ends.
It is an interpolated value in the range [0,1].
Definition at line 237 of file colorInterpolationManager.I.