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

direct/src/interval/cLerpNodePathInterval.h

Go to the documentation of this file.
00001 // Filename: cLerpNodePathInterval.h
00002 // Created by:  drose (27Aug02)
00003 //
00004 ////////////////////////////////////////////////////////////////////
00005 //
00006 // PANDA 3D SOFTWARE
00007 // Copyright (c) 2001, Disney Enterprises, Inc.  All rights reserved
00008 //
00009 // All use of this software is subject to the terms of the Panda 3d
00010 // Software license.  You should have received a copy of this license
00011 // along with this source code; you will also find a current copy of
00012 // the license at http://www.panda3d.org/license.txt .
00013 //
00014 // To contact the maintainers of this program write to
00015 // panda3d@yahoogroups.com .
00016 //
00017 ////////////////////////////////////////////////////////////////////
00018 
00019 #ifndef CLERPNODEPATHINTERVAL_H
00020 #define CLERPNODEPATHINTERVAL_H
00021 
00022 #include "directbase.h"
00023 #include "cLerpInterval.h"
00024 #include "nodePath.h"
00025 
00026 ////////////////////////////////////////////////////////////////////
00027 //       Class : CLerpNodePathInterval
00028 // Description : An interval that lerps one or more properties (like
00029 //               pos, hpr, etc.) on a NodePath over time.
00030 ////////////////////////////////////////////////////////////////////
00031 class EXPCL_DIRECT CLerpNodePathInterval : public CLerpInterval {
00032 PUBLISHED:
00033   CLerpNodePathInterval(const string &name, double duration, 
00034                         BlendType blend_type, bool bake_in_start,
00035                         const NodePath &node, const NodePath &other);
00036 
00037   INLINE const NodePath &get_node() const;
00038   INLINE const NodePath &get_other() const;
00039 
00040   INLINE void set_start_pos(const LVecBase3f &pos);
00041   INLINE void set_end_pos(const LVecBase3f &pos);
00042   INLINE void set_start_hpr(const LVecBase3f &hpr);
00043   INLINE void set_end_hpr(const LVecBase3f &hpr);
00044   INLINE void set_start_scale(const LVecBase3f &scale);
00045   INLINE void set_start_scale(float scale);
00046   INLINE void set_end_scale(const LVecBase3f &scale);
00047   INLINE void set_end_scale(float scale);
00048   INLINE void set_start_color(const LVecBase4f &color);
00049   INLINE void set_end_color(const LVecBase4f &color);
00050   INLINE void set_start_color_scale(const LVecBase4f &color_scale);
00051   INLINE void set_end_color_scale(const LVecBase4f &color_scale);
00052 
00053   virtual void priv_initialize(double t);
00054   virtual void priv_instant();
00055   virtual void priv_step(double t);
00056   virtual void priv_reverse_initialize(double t);
00057   virtual void priv_reverse_instant();
00058 
00059   virtual void output(ostream &out) const;
00060 
00061 private:
00062   NodePath _node;
00063   NodePath _other;
00064 
00065   enum Flags {
00066     F_end_pos            = 0x0001,
00067     F_end_hpr            = 0x0002,
00068     F_end_scale          = 0x0004,
00069     F_end_color          = 0x0008,
00070     F_end_color_scale    = 0x0010,
00071 
00072     F_start_pos          = 0x0100,
00073     F_start_hpr          = 0x0200,
00074     F_start_scale        = 0x0400,
00075     F_start_color        = 0x0800,
00076     F_start_color_scale  = 0x1000,
00077 
00078     F_bake_in_start      = 0x8000,
00079   };
00080   
00081   unsigned int _flags;
00082   LPoint3f _start_pos, _end_pos;
00083   LVecBase3f _start_hpr, _end_hpr;
00084   LVecBase3f _start_scale, _end_scale;
00085   Colorf _start_color, _end_color;
00086   LVecBase4f _start_color_scale, _end_color_scale;
00087 
00088   double _prev_d;
00089   
00090 public:
00091   static TypeHandle get_class_type() {
00092     return _type_handle;
00093   }
00094   static void init_type() {
00095     CLerpInterval::init_type();
00096     register_type(_type_handle, "CLerpNodePathInterval",
00097                   CLerpInterval::get_class_type());
00098   }
00099   virtual TypeHandle get_type() const {
00100     return get_class_type();
00101   }
00102   virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
00103 
00104 private:
00105   static TypeHandle _type_handle;
00106 };
00107 
00108 #include "cLerpNodePathInterval.I"
00109 
00110 #endif
00111 

Generated on Fri May 2 01:37:45 2003 for Direct by doxygen1.3