Panda3D
 All Classes Functions Variables Enumerations
Public Member Functions | List of all members
ColorInterpolationSegment Class Reference

A single unit of interpolation. More...

#include "colorInterpolationManager.h"

Inheritance diagram for ColorInterpolationSegment:
ReferenceCount MemoryBase

Public Member Functions

 ColorInterpolationSegment (ColorInterpolationFunction *function, const PN_stdfloat &time_begin, const PN_stdfloat &time_end, const bool is_modulated, const int id)
 constructor More...
 
 ColorInterpolationSegment (const ColorInterpolationSegment &s)
 copy constructor More...
 
virtual ~ColorInterpolationSegment ()
 destructor More...
 
TypedReferenceCountget_function () const
 Returns a reference to the function object corresponding to this segment. More...
 
int get_id () const
 Returns the id assigned to this segment by the manager that created it. More...
 
PN_stdfloat get_time_begin () const
 Returns the point in the particle's lifetime at which this segment begins its effect. More...
 
PN_stdfloat get_time_end () const
 Returns the point in the particle's lifetime at which this segment's effect stops. More...
 
LColor interpolateColor (const PN_stdfloat t) const
 Returns the interpolated color according to the segment's function and start and end times. More...
 
bool is_enabled () const
 Returns whether the segments effects are being applied. More...
 
bool is_modulated () const
 Returns whether the function is additive or modulated. More...
 
void set_enabled (const bool enabled)
 Sets whether the segments effects should be applied. More...
 
void set_function (ColorInterpolationFunction *function)
 Sets the function that the segment will use for its interpolation calculations. More...
 
void set_is_modulated (const bool flag)
 Sets how the function is applied to the final color. More...
 
void set_time_begin (const PN_stdfloat time)
 Sets the point in the particle's lifetime at which this segment begins its effect. More...
 
void set_time_end (const PN_stdfloat time)
 Sets the point in the particle's lifetime at which this segment's effect ends. More...
 
- Public Member Functions inherited from ReferenceCount
int get_ref_count () const
 Returns the current reference count. More...
 
WeakReferenceListget_weak_list () const
 Returns the WeakReferenceList associated with this ReferenceCount object. More...
 
bool has_weak_list () const
 Returns true if this particular ReferenceCount object has a WeakReferenceList created, false otherwise. More...
 
void local_object ()
 This function should be called, once, immediately after creating a new instance of some ReferenceCount-derived object on the stack. More...
 
void ref () const
 Explicitly increments the reference count. More...
 
bool test_ref_count_integrity () const
 Does some easy checks to make sure that the reference count isn't completely bogus. More...
 
bool test_ref_count_nonzero () const
 Does some easy checks to make sure that the reference count isn't zero, or completely bogus. More...
 
virtual bool unref () const
 Explicitly decrements the reference count. More...
 
void weak_ref (WeakPointerToVoid *ptv)
 Adds the indicated PointerToVoid as a weak reference to this object. More...
 
void weak_unref (WeakPointerToVoid *ptv)
 Removes the indicated PointerToVoid as a weak reference to this object. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from ReferenceCount
static TypeHandle get_class_type ()
 
static void init_type ()
 

Detailed Description

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.

Constructor & Destructor Documentation

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.

ColorInterpolationSegment::ColorInterpolationSegment ( const ColorInterpolationSegment s)

copy constructor

Definition at line 220 of file colorInterpolationManager.cxx.

ColorInterpolationSegment::~ColorInterpolationSegment ( )
virtual

destructor

Definition at line 237 of file colorInterpolationManager.cxx.

Member Function Documentation

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.


The documentation for this class was generated from the following files: