Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

CLerpNodePathInterval Class Reference

An interval that lerps one or more properties (like pos, hpr, etc.) on a NodePath over time. More...

#include <cLerpNodePathInterval.h>

Inheritance diagram for CLerpNodePathInterval:

CLerpInterval CInterval TypedReferenceCount TypedObject ReferenceCount List of all members.

Public Types

enum  BlendType {
  BT_no_blend, BT_ease_in, BT_ease_out, BT_ease_in_out,
  BT_invalid
}
enum  EventType {
  ET_initialize, ET_instant, ET_step, ET_finalize,
  ET_reverse_initialize, ET_reverse_instant, ET_reverse_finalize, ET_interrupt
}
enum  State { S_initial, S_started, S_paused, S_final }

Public Member Functions

 CLerpNodePathInterval (const string &name, double duration, BlendType blend_type, bool bake_in_start, const NodePath &node, const NodePath &other)
 Constructs a lerp interval that will lerp some properties on the indicated node, possibly relative to the indicated other node (if other is nonempty).

const NodePathget_node () const
 Returns the node being lerped.

const NodePathget_other () const
 Returns the "other" node, which the lerped node is being moved relative to.

void set_start_pos (const LVecBase3f &pos)
 Indicates the initial position of the lerped node.

void set_end_pos (const LVecBase3f &pos)
 Indicates that the position of the node should be lerped, and specifies the final position of the node.

void set_start_hpr (const LVecBase3f &hpr)
 Indicates the initial rotation of the lerped node.

void set_end_hpr (const LVecBase3f &hpr)
 Indicates that the rotation of the node should be lerped, and specifies the final rotation of the node.

void set_start_scale (const LVecBase3f &scale)
 Indicates the initial scale of the lerped node.

void set_start_scale (float scale)
 Indicates the initial scale of the lerped node.

void set_end_scale (const LVecBase3f &scale)
 Indicates that the scale of the node should be lerped, and specifies the final scale of the node.

void set_end_scale (float scale)
 Indicates that the scale of the node should be lerped, and specifies the final scale of the node.

void set_start_color (const LVecBase4f &color)
 Indicates the initial color of the lerped node.

void set_end_color (const LVecBase4f &color)
 Indicates that the color of the node should be lerped, and specifies the final color of the node.

void set_start_color_scale (const LVecBase4f &color_scale)
 Indicates the initial color scale of the lerped node.

void set_end_color_scale (const LVecBase4f &color_scale)
 Indicates that the color scale of the node should be lerped, and specifies the final color scale of the node.

virtual void priv_initialize (double t)
 This replaces the first call to priv_step(), and indicates that the interval has just begun.

virtual void priv_instant ()
 This is called in lieu of priv_initialize() ..

virtual void priv_step (double t)
 Advances the time on the interval.

virtual void priv_reverse_initialize (double t)
 Similar to priv_initialize(), but this is called when the interval is being played backwards; it indicates that the interval should start at the finishing state and undo any intervening intervals.

virtual void priv_reverse_instant ()
 This is called in lieu of priv_reverse_initialize() ..

virtual void output (ostream &out) const
virtual TypeHandle get_type () const
virtual TypeHandle force_init_type ()
BlendType get_blend_type () const
 Returns the blend type specified for the interval.

const string & get_name () const
 Returns the interval's name.

double get_duration () const
 Returns the duration of the interval in seconds.

bool get_open_ended () const
 Returns the state of the "open_ended" flag.

State get_state () const
 Indicates the state the interval believes it is in: whether it has been started, is currently in the middle, or has been finalized.

bool is_stopped () const
 Returns true if the interval is in either its initial or final states (but not in a running or paused state).

void set_done_event (const string &event)
 Sets the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own.

const string & get_done_event () const
 Returns the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own.

void set_t (double t)
 Explicitly sets the time within the interval.

double get_t () const
 Returns the current time of the interval: the last value of t passed to priv_initialize(), priv_step(), or priv_finalize().

void set_auto_pause (bool auto_pause)
 Changes the state of the 'auto_pause' flag.

bool get_auto_pause () const
 Returns the state of the 'auto_pause' flag.

void set_auto_finish (bool auto_finish)
 Changes the state of the 'auto_finish' flag.

bool get_auto_finish () const
 Returns the state of the 'auto_finish' flag.

void set_wants_t_callback (bool wants_t_callback)
 Changes the state of the 'wants_t_callback' flag.

bool get_wants_t_callback () const
 Returns the state of the 'wants_t_callback' flag.

void set_manager (CIntervalManager *manager)
 Indicates the CIntervalManager object which will be responsible for playing this interval.

CIntervalManagerget_manager () const
 Returns the CIntervalManager object which will be responsible for playing this interval.

void start (double start_t=0.0, double end_t=-1.0, double play_rate=1.0)
 Starts the interval playing by registering it with the current CIntervalManager.

void loop (double start_t=0.0, double end_t=-1.0, double play_rate=1.0)
 Starts the interval playing by registering it with the current CIntervalManager.

double pause ()
 Stops the interval from playing but leaves it in its current state.

void resume ()
 Restarts the interval from its current point after a previous call to pause().

void resume (double start_t)
 Restarts the interval from the indicated point after a previous call to pause().

void finish ()
 Stops the interval from playing and sets it to its final state.

bool is_playing () const
 Returns true if the interval is currently playing, false otherwise.

void priv_do_event (double t, EventType event)
 Calls the appropriate event function indicated by the EventType.

virtual void priv_finalize ()
 This is called to stop an interval, forcing it to whatever state it would be after it played all the way through.

virtual void priv_reverse_finalize ()
 Called generally following a priv_reverse_initialize(), this indicates the interval should set itself to the initial state.

virtual void priv_interrupt ()
 This is called while the interval is playing to indicate that it is about to be interrupted; that is, priv_step() will not be called for a length of time.

virtual void write (ostream &out, int indent_level) const
void setup_play (double start_time, double end_time, double play_rate, bool do_loop)
 Called to prepare the interval for automatic timed playback, e.g.

void setup_resume ()
 Called to prepare the interval for restarting at the current point within the interval after an interruption.

bool step_play ()
 Should be called once per frame to execute the automatic timed playback begun with setup_play().

void mark_dirty ()
 Called by a derived class to indicate the interval has been changed internally and must be recomputed before its duration may be returned.

bool check_t_callback ()
 Returns true if the wants_t_callback() flag is true and the interval's t value has changed since the last call to check_t_callback(), false otherwise.

int get_type_index () const
bool is_of_type (TypeHandle handle) const
bool is_exact_type (TypeHandle handle) const
int get_ref_count () const
int ref () const
int unref () const
void test_ref_count_integrity () const

Static Public Member Functions

TypeHandle get_class_type ()
void init_type ()
BlendType string_blend_type (const string &blend_type)
 Returns the BlendType enumerated value corresponding to the indicated string, or BT_invalid if the string doesn't match anything.


Protected Member Functions

double compute_delta (double t) const
 Given a t value in the range [0, get_duration()], returns the corresponding delta value clamped to the range [0, 1], after scaling by duration and applying the blend type.

void interval_done ()
 Called internally whenever the interval reaches its final state.

void recompute () const
 Calls do_recompute() if the dirty flag has been set.

virtual void do_recompute ()
 Does whatever processing is necessary to recompute the interval after a call to mark_dirty() has indicated a recomputation is necessary.

void check_stopped (TypeHandle type, const char *method_name) const
 Issues a warning if our internal state is not in one of the stopped states.

void check_started (TypeHandle type, const char *method_name) const
 Issues a warning if our internal state is not in one of the started states.


Protected Attributes

State _state
double _curr_t
string _name
string _done_event
double _duration
bool _auto_pause
bool _auto_finish
bool _wants_t_callback
double _last_t_callback
CIntervalManager_manager
double _clock_start
double _start_t
double _end_t
bool _end_t_at_end
bool _start_t_at_start
double _play_rate
bool _do_loop
int _loop_count
int _ref_count

Private Types

enum  Flags {
  F_end_pos = 0x0001, F_end_hpr = 0x0002, F_end_scale = 0x0004, F_end_color = 0x0008,
  F_end_color_scale = 0x0010, F_start_pos = 0x0100, F_start_hpr = 0x0200, F_start_scale = 0x0400,
  F_start_color = 0x0800, F_start_color_scale = 0x1000, F_bake_in_start = 0x8000
}

Private Attributes

NodePath _node
NodePath _other
unsigned int _flags
LPoint3f _start_pos
LPoint3f _end_pos
LVecBase3f _start_hpr
LVecBase3f _end_hpr
LVecBase3f _start_scale
LVecBase3f _end_scale
Colorf _start_color
Colorf _end_color
LVecBase4f _start_color_scale
LVecBase4f _end_color_scale
double _prev_d

Static Private Attributes

TypeHandle _type_handle

Detailed Description

An interval that lerps one or more properties (like pos, hpr, etc.) on a NodePath over time.

Definition at line 38 of file cLerpNodePathInterval.h.


Member Enumeration Documentation

enum CLerpInterval::BlendType [inherited]
 

Enumeration values:
BT_no_blend 
BT_ease_in 
BT_ease_out 
BT_ease_in_out 
BT_invalid 

Definition at line 41 of file cLerpInterval.h.

Referenced by CLerpInterval::CLerpInterval().

enum CInterval::EventType [inherited]
 

Enumeration values:
ET_initialize 
ET_instant 
ET_step 
ET_finalize 
ET_reverse_initialize 
ET_reverse_instant 
ET_reverse_finalize 
ET_interrupt 

Definition at line 66 of file cInterval.h.

enum CLerpNodePathInterval::Flags [private]
 

Enumeration values:
F_end_pos 
F_end_hpr 
F_end_scale 
F_end_color 
F_end_color_scale 
F_start_pos 
F_start_hpr 
F_start_scale 
F_start_color 
F_start_color_scale 
F_bake_in_start 

Definition at line 72 of file cLerpNodePathInterval.h.

enum CInterval::State [inherited]
 

Enumeration values:
S_initial 
S_started 
S_paused 
S_final 

Definition at line 77 of file cInterval.h.


Constructor & Destructor Documentation

CLerpNodePathInterval::CLerpNodePathInterval const string &  name,
double  duration,
CLerpInterval::BlendType  blend_type,
bool  bake_in_start,
const NodePath node,
const NodePath other
 

Constructs a lerp interval that will lerp some properties on the indicated node, possibly relative to the indicated other node (if other is nonempty).

You must call set_end_pos(), etc. for the various properties you wish to lerp before the first call to priv_initialize(). If you want to set a starting value for any of the properties, you may call set_start_pos(), etc.; otherwise, the starting value is taken from the actual node's value at the time the lerp is performed.

The starting values may be explicitly specified or omitted. The value of bake_in_start determines the behavior if the starting values are omitted. If bake_in_start is true, the values are obtained the first time the lerp runs, and thenceforth are stored within the interval. If bake_in_start is false, the starting value is computed each frame, based on assuming the current value represents the value set from the last time the interval was run. This "smart" behavior allows code to manipulate the object event while it is being lerped, and the lerp continues to apply in a sensible way.

Definition at line 88 of file cLerpNodePathInterval.cxx.


Member Function Documentation

void CInterval::check_started TypeHandle  type,
const char *  method_name
const [inline, protected, inherited]
 

Issues a warning if our internal state is not in one of the started states.

Definition at line 392 of file cInterval.I.

Referenced by CMetaInterval::priv_initialize(), and CInterval::priv_step().

void CInterval::check_stopped TypeHandle  type,
const char *  method_name
const [inline, protected, inherited]
 

Issues a warning if our internal state is not in one of the stopped states.

Definition at line 372 of file cInterval.I.

Referenced by CMetaInterval::get_interval_end_time(), CInterval::is_playing(), CInterval::priv_do_event(), CInterval::priv_initialize(), ShowInterval::priv_instant(), HideInterval::priv_instant(), and CMetaInterval::priv_step().

bool CInterval::check_t_callback  )  [inline, inherited]
 

Returns true if the wants_t_callback() flag is true and the interval's t value has changed since the last call to check_t_callback(), false otherwise.

Definition at line 338 of file cInterval.I.

double CLerpInterval::compute_delta double  t  )  const [protected, inherited]
 

Given a t value in the range [0, get_duration()], returns the corresponding delta value clamped to the range [0, 1], after scaling by duration and applying the blend type.

Definition at line 69 of file cLerpInterval.cxx.

References t.

void CInterval::do_recompute  )  [protected, virtual, inherited]
 

Does whatever processing is necessary to recompute the interval after a call to mark_dirty() has indicated a recomputation is necessary.

Reimplemented in CMetaInterval.

Definition at line 781 of file cInterval.cxx.

void CInterval::finish  )  [inherited]
 

Stops the interval from playing and sets it to its final state.

Definition at line 216 of file cInterval.cxx.

References CInterval::ET_finalize, CInterval::ET_interrupt, CInterval::ET_reverse_finalize, CInterval::ET_reverse_initialize, CInterval::ET_reverse_instant, and CInterval::ET_step.

virtual TypeHandle CLerpNodePathInterval::force_init_type void   )  [inline, virtual]
 

Reimplemented from CLerpInterval.

Definition at line 109 of file cLerpNodePathInterval.h.

bool CInterval::get_auto_finish  )  const [inline, inherited]
 

Returns the state of the 'auto_finish' flag.

See set_auto_finish().

Definition at line 240 of file cInterval.I.

bool CInterval::get_auto_pause  )  const [inline, inherited]
 

Returns the state of the 'auto_pause' flag.

See set_auto_pause().

Definition at line 200 of file cInterval.I.

References CInterval::_manager, and INLINE.

CLerpInterval::BlendType CLerpInterval::get_blend_type void   )  const [inline, inherited]
 

Returns the blend type specified for the interval.

This controls how the linear interpolation behaves near the beginning and end of the lerp period.

Definition at line 52 of file cLerpInterval.I.

TypeHandle CLerpNodePathInterval::get_class_type void   )  [inline, static]
 

Reimplemented from CLerpInterval.

Definition at line 98 of file cLerpNodePathInterval.h.

const string & CInterval::get_done_event  )  const [inline, inherited]
 

Returns the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own.

Definition at line 143 of file cInterval.I.

References CInterval::_auto_pause.

double CInterval::get_duration void   )  const [inline, inherited]
 

Returns the duration of the interval in seconds.

Definition at line 45 of file cInterval.I.

References CInterval::_open_ended, and INLINE.

Referenced by CMetaInterval::get_interval_end_time(), CInterval::priv_do_event(), CInterval::priv_finalize(), CMetaInterval::priv_instant(), CInterval::priv_interrupt(), and CInterval::priv_reverse_initialize().

CIntervalManager * CInterval::get_manager  )  const [inline, inherited]
 

Returns the CIntervalManager object which will be responsible for playing this interval.

Note that this can only return a C++ object; if the particular CIntervalManager object has been extended in the scripting language, this will return the encapsulated C++ object, not the full extended object.

Definition at line 321 of file cInterval.I.

const string & CInterval::get_name  )  const [inline, inherited]
 

Returns the interval's name.

Definition at line 32 of file cInterval.I.

References CInterval::_duration, INLINE, and CInterval::recompute().

Referenced by CInterval::get_wants_t_callback(), CInterval::priv_finalize(), CMetaInterval::priv_reverse_instant(), CInterval::set_wants_t_callback(), and CIntervalManager::~CIntervalManager().

const NodePath & CLerpNodePathInterval::get_node  )  const [inline]
 

Returns the node being lerped.

Definition at line 32 of file cLerpNodePathInterval.I.

References _other, and INLINE.

bool CInterval::get_open_ended  )  const [inline, inherited]
 

Returns the state of the "open_ended" flag.

This is primarily intended for instantaneous intervals like FunctionIntervals; it indicates true if the interval has some lasting effect that should be applied even if the interval doesn't get started until after its finish time, or false if the interval is a transitive thing that doesn't need to be called late.

Definition at line 71 of file cInterval.I.

References CInterval::_state, INLINE, CInterval::S_final, and CInterval::S_initial.

Referenced by CInterval::setup_play().

const NodePath & CLerpNodePathInterval::get_other  )  const [inline]
 

Returns the "other" node, which the lerped node is being moved relative to.

If this is an empty node path, the lerped node is being moved in its own coordinate system.

Definition at line 51 of file cLerpNodePathInterval.I.

References _flags, _start_pos, F_start_pos, and INLINE.

CInterval::State CInterval::get_state  )  const [inline, inherited]
 

Indicates the state the interval believes it is in: whether it has been started, is currently in the middle, or has been finalized.

Definition at line 88 of file cInterval.I.

References CInterval::_done_event, and INLINE.

Referenced by CInterval::pause().

double CInterval::get_t void   )  const [inline, inherited]
 

Returns the current time of the interval: the last value of t passed to priv_initialize(), priv_step(), or priv_finalize().

Definition at line 160 of file cInterval.I.

Referenced by CInterval::priv_reverse_finalize().

virtual TypeHandle CLerpNodePathInterval::get_type void   )  const [inline, virtual]
 

Reimplemented from CLerpInterval.

Definition at line 106 of file cLerpNodePathInterval.h.

bool CInterval::get_wants_t_callback  )  const [inline, inherited]
 

Returns the state of the 'wants_t_callback' flag.

See set_wants_t_callback().

Definition at line 277 of file cInterval.I.

References CInterval::_state, CInterval::get_name(), TypeHandle::get_name(), INLINE, nassertv, CInterval::S_paused, CInterval::S_started, and verify_intervals.

void CLerpNodePathInterval::init_type void   )  [inline, static]
 

Reimplemented from CLerpInterval.

Definition at line 101 of file cLerpNodePathInterval.h.

void CInterval::interval_done  )  [protected, inherited]
 

Called internally whenever the interval reaches its final state.

Definition at line 762 of file cInterval.cxx.

Referenced by CMetaInterval::get_interval_end_time(), CInterval::priv_do_event(), and CMetaInterval::priv_instant().

bool CInterval::is_playing  )  const [inherited]
 

Returns true if the interval is currently playing, false otherwise.

Definition at line 246 of file cInterval.cxx.

References CInterval::_state, CInterval::check_stopped(), CInterval::get_class_type(), CInterval::priv_step(), CInterval::recompute(), CInterval::S_started, and t.

bool CInterval::is_stopped  )  const [inline, inherited]
 

Returns true if the interval is in either its initial or final states (but not in a running or paused state).

Definition at line 105 of file cInterval.I.

Referenced by CInterval::setup_play().

void CInterval::loop double  start_t = 0.0,
double  end_t = -1.0,
double  play_rate = 1.0
[inherited]
 

Starts the interval playing by registering it with the current CIntervalManager.

The interval will play until it is interrupted with finish() or pause(), looping back to start_t when it reaches end_t.

If end_t is less than zero, it indicates the end of the interval.

Definition at line 143 of file cInterval.cxx.

References CInterval::_manager, CIntervalManager::add_c_interval(), and CInterval::setup_resume().

void CInterval::mark_dirty  )  [inherited]
 

Called by a derived class to indicate the interval has been changed internally and must be recomputed before its duration may be returned.

Definition at line 741 of file cInterval.cxx.

Referenced by CMetaInterval::add_c_interval(), CMetaInterval::add_ext_index(), and CMetaInterval::push_level().

void CLerpNodePathInterval::output ostream &  out  )  const [virtual]
 

Reimplemented from CInterval.

Definition at line 413 of file cLerpNodePathInterval.cxx.

double CInterval::pause  )  [inherited]
 

Stops the interval from playing but leaves it in its current state.

It may later be resumed from this point by calling resume().

Definition at line 161 of file cInterval.cxx.

References CInterval::_manager, CIntervalManager::find_c_interval(), CInterval::get_state(), CInterval::priv_finalize(), CInterval::priv_instant(), CInterval::S_final, and CInterval::S_initial.

void CInterval::priv_do_event double  t,
EventType  event
[inherited]
 

Calls the appropriate event function indicated by the EventType.

Definition at line 262 of file cInterval.cxx.

References CInterval::_state, CInterval::check_stopped(), CInterval::get_class_type(), CInterval::get_duration(), CInterval::interval_done(), CInterval::priv_step(), CInterval::recompute(), CInterval::S_final, and CInterval::S_started.

void CInterval::priv_finalize  )  [virtual, inherited]
 

This is called to stop an interval, forcing it to whatever state it would be after it played all the way through.

It's generally invoked by set_final_t().

Reimplemented in CMetaInterval.

Definition at line 381 of file cInterval.cxx.

References CInterval::get_duration(), and CInterval::get_name().

Referenced by CInterval::pause().

void CLerpNodePathInterval::priv_initialize double  t  )  [virtual]
 

This replaces the first call to priv_step(), and indicates that the interval has just begun.

This may be overridden by derived classes that need to do some explicit initialization on the first call.

Reimplemented from CInterval.

Definition at line 118 of file cLerpNodePathInterval.cxx.

References _flags, _node, _other, CInterval::_state, F_end_hpr, F_end_pos, and F_end_scale.

void CLerpNodePathInterval::priv_instant  )  [virtual]
 

This is called in lieu of priv_initialize() ..

priv_step() .. priv_finalize(), when everything is to happen within one frame. The interval should initialize itself, then leave itself in the final state.

Reimplemented from CInterval.

Definition at line 141 of file cLerpNodePathInterval.cxx.

void CInterval::priv_interrupt  )  [virtual, inherited]
 

This is called while the interval is playing to indicate that it is about to be interrupted; that is, priv_step() will not be called for a length of time.

But the interval should remain in its current state in anticipation of being eventually restarted when the calls to priv_step() eventually resume.

The purpose of this function is to allow self-running intervals like sound intervals to stop the actual sound playback during the pause.

Reimplemented in CMetaInterval.

Definition at line 482 of file cInterval.cxx.

References CInterval::_clock_start, CInterval::_end_t, CInterval::_play_rate, CInterval::_start_t, CInterval::get_duration(), and t.

void CInterval::priv_reverse_finalize  )  [virtual, inherited]
 

Called generally following a priv_reverse_initialize(), this indicates the interval should set itself to the initial state.

Reimplemented in CMetaInterval.

Definition at line 449 of file cInterval.cxx.

References CInterval::_clock_start, CInterval::_end_t, CInterval::_loop_count, CInterval::_play_rate, CInterval::_start_t, ClockObject::get_frame_time(), ClockObject::get_global_clock(), and CInterval::get_t().

Referenced by CInterval::setup_play().

void CLerpNodePathInterval::priv_reverse_initialize double  t  )  [virtual]
 

Similar to priv_initialize(), but this is called when the interval is being played backwards; it indicates that the interval should start at the finishing state and undo any intervening intervals.

Reimplemented from CInterval.

Definition at line 370 of file cLerpNodePathInterval.cxx.

References _end_scale, _flags, _start_scale, F_end_scale, and F_start_scale.

void CLerpNodePathInterval::priv_reverse_instant  )  [virtual]
 

This is called in lieu of priv_reverse_initialize() ..

priv_step() .. priv_reverse_finalize(), when everything is to happen within one frame. The interval should initialize itself, then leave itself in the initial state.

Reimplemented from CInterval.

Definition at line 395 of file cLerpNodePathInterval.cxx.

void CLerpNodePathInterval::priv_step double  t  )  [virtual]
 

Advances the time on the interval.

The time may either increase (the normal case) or decrease (e.g. if the interval is being played by a slider).

Reimplemented from CInterval.

Definition at line 163 of file cLerpNodePathInterval.cxx.

void CInterval::recompute  )  const [inline, protected, inherited]
 

Calls do_recompute() if the dirty flag has been set.

Definition at line 355 of file cInterval.I.

Referenced by CMetaInterval::get_interval_end_time(), CInterval::get_name(), CInterval::is_playing(), CMetaInterval::pop_level(), CInterval::priv_do_event(), CInterval::priv_initialize(), CMetaInterval::priv_reverse_instant(), CMetaInterval::priv_step(), and CMetaInterval::set_interval_start_time().

void CInterval::resume double  start_t  )  [inherited]
 

Restarts the interval from the indicated point after a previous call to pause().

Definition at line 199 of file cInterval.cxx.

References CInterval::ET_initialize, CInterval::ET_instant, CInterval::priv_initialize(), CInterval::priv_instant(), and t.

void CInterval::resume void   )  [inherited]
 

Restarts the interval from its current point after a previous call to pause().

Definition at line 183 of file cInterval.cxx.

References CInterval::_manager, and CIntervalManager::remove_c_interval().

void CInterval::set_auto_finish bool  auto_finish  )  [inline, inherited]
 

Changes the state of the 'auto_finish' flag.

If this is true, the interval may be arbitrarily finished when the system needs to reset due to some external event by calling CIntervalManager::interrupt(). If this is false (the default), the interval must always be explicitly finished or paused.

Definition at line 225 of file cInterval.I.

References CInterval::_manager.

void CInterval::set_auto_pause bool  auto_pause  )  [inline, inherited]
 

Changes the state of the 'auto_pause' flag.

If this is true, the interval may be arbitrarily interrupted when the system needs to reset due to some external event by calling CIntervalManager::interrupt(). If this is false (the default), the interval must always be explicitly finished or paused.

Definition at line 185 of file cInterval.I.

References CInterval::_last_t_callback.

void CInterval::set_done_event const string &  event  )  [inline, inherited]
 

Sets the event that is generated whenever the interval reaches its final state, whether it is explicitly finished or whether it gets there on its own.

Definition at line 124 of file cInterval.I.

References CInterval::_auto_pause, and INLINE.

void CLerpNodePathInterval::set_end_color const LVecBase4f &  color  )  [inline]
 

Indicates that the color of the node should be lerped, and specifies the final color of the node.

This should be called before priv_initialize(). If this is not called, the node's color will not be affected by the lerp.

Definition at line 268 of file cLerpNodePathInterval.I.

void CLerpNodePathInterval::set_end_color_scale const LVecBase4f &  color_scale  )  [inline]
 

Indicates that the color scale of the node should be lerped, and specifies the final color scale of the node.

This should be called before priv_initialize(). If this is not called, the node's color scale will not be affected by the lerp.

Definition at line 312 of file cLerpNodePathInterval.I.

void CLerpNodePathInterval::set_end_hpr const LVecBase3f &  hpr  )  [inline]
 

Indicates that the rotation of the node should be lerped, and specifies the final rotation of the node.

This should be called before priv_initialize(). If this is not called, the node's rotation will not be affected by the lerp.

Definition at line 138 of file cLerpNodePathInterval.I.

References _end_scale, _flags, F_end_scale, and INLINE.

void CLerpNodePathInterval::set_end_pos const LVecBase3f &  pos  )  [inline]
 

Indicates that the position of the node should be lerped, and specifies the final position of the node.

This should be called before priv_initialize(). If this is not called, the node's position will not be affected by the lerp.

Definition at line 94 of file cLerpNodePathInterval.I.

References _end_hpr, _flags, F_end_hpr, and INLINE.

void CLerpNodePathInterval::set_end_scale float  scale  )  [inline]
 

Indicates that the scale of the node should be lerped, and specifies the final scale of the node.

This should be called before priv_initialize(). If this is not called, the node's scale will not be affected by the lerp.

Definition at line 225 of file cLerpNodePathInterval.I.

void CLerpNodePathInterval::set_end_scale const LVecBase3f &  scale  )  [inline]
 

Indicates that the scale of the node should be lerped, and specifies the final scale of the node.

This should be called before priv_initialize(). If this is not called, the node's scale will not be affected by the lerp.

Definition at line 203 of file cLerpNodePathInterval.I.

References _flags, and F_start_color_scale.

void CInterval::set_manager CIntervalManager manager  )  [inline, inherited]
 

Indicates the CIntervalManager object which will be responsible for playing this interval.

This defaults to the global CIntervalManager; you should need to change this only if you have special requirements for playing this interval.

Definition at line 298 of file cInterval.I.

void CLerpNodePathInterval::set_start_color const LVecBase4f &  color  )  [inline]
 

Indicates the initial color of the lerped node.

This is meaningful only if set_end_color() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual color at the time the lerp is performed.

Definition at line 246 of file cLerpNodePathInterval.I.

void CLerpNodePathInterval::set_start_color_scale const LVecBase4f &  color_scale  )  [inline]
 

Indicates the initial color scale of the lerped node.

This is meaningful only if set_end_color_scale() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual color scale at the time the lerp is performed.

Definition at line 290 of file cLerpNodePathInterval.I.

void CLerpNodePathInterval::set_start_hpr const LVecBase3f &  hpr  )  [inline]
 

Indicates the initial rotation of the lerped node.

This is meaningful only if set_end_hpr() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual rotation at the time the lerp is performed.

Definition at line 116 of file cLerpNodePathInterval.I.

void CLerpNodePathInterval::set_start_pos const LVecBase3f &  pos  )  [inline]
 

Indicates the initial position of the lerped node.

This is meaningful only if set_end_pos() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual position at the time the lerp is performed.

Definition at line 72 of file cLerpNodePathInterval.I.

References _flags, _start_hpr, F_start_hpr, and INLINE.

void CLerpNodePathInterval::set_start_scale float  scale  )  [inline]
 

Indicates the initial scale of the lerped node.

This is meaningful only if set_end_scale() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual scale at the time the lerp is performed.

Definition at line 182 of file cLerpNodePathInterval.I.

References _end_color, _flags, F_end_color, and INLINE.

void CLerpNodePathInterval::set_start_scale const LVecBase3f &  scale  )  [inline]
 

Indicates the initial scale of the lerped node.

This is meaningful only if set_end_scale() is also called. This parameter is optional; if unspecified, the value will be taken from the node's actual scale at the time the lerp is performed.

Definition at line 160 of file cLerpNodePathInterval.I.

References _flags, _start_color, F_start_color, and INLINE.

void CInterval::set_t double  t  )  [inherited]
 

Explicitly sets the time within the interval.

Normally, you would use start() .. finish() to let the time play normally, but this may be used to set the time to some particular value.

Definition at line 80 of file cInterval.cxx.

void CInterval::set_wants_t_callback bool  wants_t_callback  )  [inline, inherited]
 

Changes the state of the 'wants_t_callback' flag.

If this is true, the interval will be returned by CIntervalManager::get_event() each time the interval's time value has been changed, regardless of whether it has any external events.

Definition at line 261 of file cInterval.I.

References CInterval::_state, CInterval::get_name(), TypeHandle::get_name(), INLINE, nassertv, CInterval::S_started, and verify_intervals.

void CInterval::setup_play double  start_time,
double  end_time,
double  play_rate,
bool  do_loop
[inherited]
 

Called to prepare the interval for automatic timed playback, e.g.

via a Python task. The interval will be played from start_t to end_t, at a time factor specified by play_rate. start_t must always be less than end_t (except for the exception for end_t == -1, below), but if play_rate is negative the interval will be played backwards.

Specify end_t of -1 to play the entire interval from start_t.

Call step_play() repeatedly to execute the interval.

Definition at line 547 of file cInterval.cxx.

References CInterval::_loop_count, CInterval::get_open_ended(), CInterval::is_stopped(), CInterval::priv_reverse_finalize(), and CInterval::priv_reverse_instant().

void CInterval::setup_resume  )  [inherited]
 

Called to prepare the interval for restarting at the current point within the interval after an interruption.

Definition at line 590 of file cInterval.cxx.

References CInterval::_dirty, and CInterval::_parents.

Referenced by CInterval::loop().

void CInterval::start double  start_t = 0.0,
double  end_t = -1.0,
double  play_rate = 1.0
[inherited]
 

Starts the interval playing by registering it with the current CIntervalManager.

The interval will play to the end and stop.

If end_t is less than zero, it indicates the end of the interval.

Definition at line 115 of file cInterval.cxx.

References CInterval::_manager.

bool CInterval::step_play  )  [inherited]
 

Should be called once per frame to execute the automatic timed playback begun with setup_play().

Returns true if the interval should continue, false if it is done and should stop.

Definition at line 618 of file cInterval.cxx.

References CInterval::_dirty.

CLerpInterval::BlendType CLerpInterval::string_blend_type const string &  blend_type  )  [static, inherited]
 

Returns the BlendType enumerated value corresponding to the indicated string, or BT_invalid if the string doesn't match anything.

Definition at line 40 of file cLerpInterval.cxx.

References CLerpInterval::BT_no_blend.

void CInterval::write ostream &  out,
int  indent_level
const [virtual, inherited]
 

Reimplemented in CMetaInterval.

Definition at line 512 of file cInterval.cxx.


Member Data Documentation

bool CInterval::_auto_finish [protected, inherited]
 

Definition at line 157 of file cInterval.h.

Referenced by CInterval::CInterval().

bool CInterval::_auto_pause [protected, inherited]
 

Definition at line 156 of file cInterval.h.

Referenced by CInterval::CInterval(), CInterval::get_done_event(), and CInterval::set_done_event().

double CInterval::_clock_start [protected, inherited]
 

Definition at line 163 of file cInterval.h.

Referenced by CInterval::CInterval(), CInterval::priv_interrupt(), and CInterval::priv_reverse_finalize().

double CInterval::_curr_t [protected, inherited]
 

Definition at line 151 of file cInterval.h.

Referenced by CMetaInterval::get_interval_end_time(), CMetaInterval::priv_initialize(), CMetaInterval::priv_instant(), CMetaInterval::priv_reverse_initialize(), WaitInterval::priv_step(), and CMetaInterval::priv_step().

bool CInterval::_do_loop [protected, inherited]
 

Definition at line 169 of file cInterval.h.

Referenced by CInterval::CInterval().

string CInterval::_done_event [protected, inherited]
 

Definition at line 153 of file cInterval.h.

Referenced by CInterval::get_state().

double CInterval::_duration [protected, inherited]
 

Definition at line 154 of file cInterval.h.

Referenced by CInterval::CInterval(), CInterval::get_name(), and CMetaInterval::priv_interrupt().

Colorf CLerpNodePathInterval::_end_color [private]
 

Definition at line 92 of file cLerpNodePathInterval.h.

Referenced by set_start_scale().

LVecBase4f CLerpNodePathInterval::_end_color_scale [private]
 

Definition at line 93 of file cLerpNodePathInterval.h.

LVecBase3f CLerpNodePathInterval::_end_hpr [private]
 

Definition at line 90 of file cLerpNodePathInterval.h.

Referenced by set_end_pos().

LPoint3f CLerpNodePathInterval::_end_pos [private]
 

Definition at line 89 of file cLerpNodePathInterval.h.

LVecBase3f CLerpNodePathInterval::_end_scale [private]
 

Definition at line 91 of file cLerpNodePathInterval.h.

Referenced by priv_reverse_initialize(), and set_end_hpr().

double CInterval::_end_t [protected, inherited]
 

Definition at line 165 of file cInterval.h.

Referenced by CInterval::CInterval(), CInterval::priv_interrupt(), and CInterval::priv_reverse_finalize().

bool CInterval::_end_t_at_end [protected, inherited]
 

Definition at line 166 of file cInterval.h.

Referenced by CInterval::CInterval().

unsigned int CLerpNodePathInterval::_flags [private]
 

Definition at line 88 of file cLerpNodePathInterval.h.

Referenced by get_other(), priv_initialize(), priv_reverse_initialize(), set_end_hpr(), set_end_pos(), set_end_scale(), set_start_pos(), and set_start_scale().

double CInterval::_last_t_callback [protected, inherited]
 

Definition at line 159 of file cInterval.h.

Referenced by CInterval::CInterval(), and CInterval::set_auto_pause().

int CInterval::_loop_count [protected, inherited]
 

Definition at line 170 of file cInterval.h.

Referenced by CInterval::CInterval(), CInterval::priv_reverse_finalize(), and CInterval::setup_play().

CIntervalManager* CInterval::_manager [protected, inherited]
 

Definition at line 160 of file cInterval.h.

Referenced by CInterval::CInterval(), CInterval::get_auto_pause(), CInterval::loop(), CInterval::pause(), CInterval::resume(), CInterval::set_auto_finish(), and CInterval::start().

string CInterval::_name [protected, inherited]
 

Definition at line 152 of file cInterval.h.

Referenced by HideInterval::HideInterval(), and ShowInterval::ShowInterval().

NodePath CLerpNodePathInterval::_node [private]
 

Definition at line 69 of file cLerpNodePathInterval.h.

Referenced by priv_initialize().

NodePath CLerpNodePathInterval::_other [private]
 

Definition at line 70 of file cLerpNodePathInterval.h.

Referenced by get_node(), and priv_initialize().

double CInterval::_play_rate [protected, inherited]
 

Definition at line 168 of file cInterval.h.

Referenced by CInterval::CInterval(), CInterval::priv_interrupt(), and CInterval::priv_reverse_finalize().

double CLerpNodePathInterval::_prev_d [private]
 

Definition at line 95 of file cLerpNodePathInterval.h.

Colorf CLerpNodePathInterval::_start_color [private]
 

Definition at line 92 of file cLerpNodePathInterval.h.

Referenced by set_start_scale().

LVecBase4f CLerpNodePathInterval::_start_color_scale [private]
 

Definition at line 93 of file cLerpNodePathInterval.h.

LVecBase3f CLerpNodePathInterval::_start_hpr [private]
 

Definition at line 90 of file cLerpNodePathInterval.h.

Referenced by set_start_pos().

LPoint3f CLerpNodePathInterval::_start_pos [private]
 

Definition at line 89 of file cLerpNodePathInterval.h.

Referenced by get_other().

LVecBase3f CLerpNodePathInterval::_start_scale [private]
 

Definition at line 91 of file cLerpNodePathInterval.h.

Referenced by priv_reverse_initialize().

double CInterval::_start_t [protected, inherited]
 

Definition at line 164 of file cInterval.h.

Referenced by CInterval::CInterval(), CInterval::priv_interrupt(), CInterval::priv_reverse_finalize(), and CInterval::priv_reverse_initialize().

bool CInterval::_start_t_at_start [protected, inherited]
 

Definition at line 167 of file cInterval.h.

Referenced by CInterval::CInterval(), and CInterval::priv_reverse_initialize().

State CInterval::_state [protected, inherited]
 

Definition at line 150 of file cInterval.h.

Referenced by CMetaInterval::get_interval_end_time(), CInterval::get_open_ended(), CInterval::get_wants_t_callback(), CInterval::is_playing(), CInterval::priv_do_event(), CMetaInterval::priv_initialize(), priv_initialize(), CInterval::priv_initialize(), ShowInterval::priv_instant(), HideInterval::priv_instant(), CMetaInterval::priv_instant(), CInterval::priv_instant(), CMetaInterval::priv_reverse_initialize(), WaitInterval::priv_step(), CMetaInterval::priv_step(), CInterval::priv_step(), and CInterval::set_wants_t_callback().

TypeHandle CLerpNodePathInterval::_type_handle [static, private]
 

Reimplemented from CLerpInterval.

Definition at line 31 of file cLerpNodePathInterval.cxx.

bool CInterval::_wants_t_callback [protected, inherited]
 

Definition at line 158 of file cInterval.h.

Referenced by CInterval::CInterval().


The documentation for this class was generated from the following files:
Generated on Fri May 2 01:40:55 2003 for Direct by doxygen1.3