Panda3D
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes

ColorInterpolationFunctionSinusoid Class Reference

Defines a sinusoidal blending between two colors. More...

#include "colorInterpolationManager.h"

Inheritance diagram for ColorInterpolationFunctionSinusoid:
ColorInterpolationFunctionLinear ColorInterpolationFunctionConstant ColorInterpolationFunction TypedReferenceCount TypedObject ReferenceCount MemoryBase MemoryBase

List of all members.

Public Member Functions

 ColorInterpolationFunctionSinusoid ()
 default constructor
 ColorInterpolationFunctionSinusoid (const Colorf color_a, const Colorf color_b, const float period)
 constructor
virtual TypeHandle force_init_type ()
float get_period () const
 Returns the time to transition from A to B then back to A again.
virtual TypeHandle get_type () const
void set_period (const float p)
 Sets the time to transition from A to B then back to A again.

Static Public Member Functions

static TypeHandle get_class_type ()
static void init_type ()
 This function is declared non-inline to work around a compiler bug in g++ 2.96.

Protected Member Functions

Colorf interpolate (const float t=0) const
 Returns a sinusoidal blended color between A and B.

Protected Attributes

float _period

Detailed Description

Defines a sinusoidal blending between two colors.

A period of "1" corresponds to a single transition from color_a to color_b and then back to color_a over the course of the segment's lifetime. A shorter period will result in a higher frequency cycle.

Definition at line 198 of file colorInterpolationManager.h.


Constructor & Destructor Documentation

ColorInterpolationFunctionSinusoid::ColorInterpolationFunctionSinusoid ( )

default constructor

Definition at line 160 of file colorInterpolationManager.cxx.

ColorInterpolationFunctionSinusoid::ColorInterpolationFunctionSinusoid ( const Colorf  color_a,
const Colorf  color_b,
const float  period 
)

constructor

Definition at line 171 of file colorInterpolationManager.cxx.


Member Function Documentation

float ColorInterpolationFunctionSinusoid::get_period ( ) const [inline]

Returns the time to transition from A to B then back to A again.

Definition at line 114 of file colorInterpolationManager.I.

static void ColorInterpolationFunctionSinusoid::init_type ( ) [inline, static]

This function is declared non-inline to work around a compiler bug in g++ 2.96.

Making it inline seems to cause problems in the optimizer.

Reimplemented from ColorInterpolationFunctionLinear.

Definition at line 219 of file colorInterpolationManager.h.

Colorf ColorInterpolationFunctionSinusoid::interpolate ( const float  t = 0) const [protected, virtual]

Returns a sinusoidal blended color between A and B.

Period defines the time it will take to return to A.

Reimplemented from ColorInterpolationFunctionLinear.

Definition at line 187 of file colorInterpolationManager.cxx.

void ColorInterpolationFunctionSinusoid::set_period ( const float  p) [inline]

Sets the time to transition from A to B then back to A again.

Definition at line 126 of file colorInterpolationManager.I.


The documentation for this class was generated from the following files:
 All Classes Functions Variables Enumerations