00001 // Filename: movingPartScalar.h 00002 // Created by: drose (23Feb99) 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 MOVINGPARTSCALAR_H 00020 #define MOVINGPARTSCALAR_H 00021 00022 #include <pandabase.h> 00023 00024 #include "movingPart.h" 00025 #include "animChannel.h" 00026 #include "animChannelFixed.h" 00027 00028 EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, MovingPart<ACScalarSwitchType>); 00029 00030 //////////////////////////////////////////////////////////////////// 00031 // Class : MovingPartScalar 00032 // Description : This is a particular kind of MovingPart that accepts 00033 // a scalar each frame. 00034 //////////////////////////////////////////////////////////////////// 00035 class EXPCL_PANDA MovingPartScalar : public MovingPart<ACScalarSwitchType> { 00036 protected: 00037 INLINE MovingPartScalar(const MovingPartScalar ©); 00038 00039 public: 00040 INLINE MovingPartScalar(PartGroup *parent, const string &name, 00041 const float &initial_value = 0); 00042 00043 virtual void get_blend_value(const PartBundle *root); 00044 00045 protected: 00046 INLINE MovingPartScalar(void); 00047 00048 public: 00049 static void register_with_read_factory(void); 00050 00051 static TypedWritable *make_MovingPartScalar(const FactoryParams ¶ms); 00052 00053 public: 00054 virtual TypeHandle get_type() const { 00055 return get_class_type(); 00056 } 00057 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00058 static TypeHandle get_class_type() { 00059 return _type_handle; 00060 } 00061 static void init_type() { 00062 MovingPart<ACScalarSwitchType>::init_type(); 00063 AnimChannelFixed<ACScalarSwitchType>::init_type(); 00064 register_type(_type_handle, "MovingPartScalar", 00065 MovingPart<ACScalarSwitchType>::get_class_type()); 00066 } 00067 00068 private: 00069 static TypeHandle _type_handle; 00070 }; 00071 00072 #include "movingPartScalar.I" 00073 00074 // Tell GCC that we'll take care of the instantiation explicitly here. 00075 #ifdef __GNUC__ 00076 #pragma interface 00077 #endif 00078 00079 #endif 00080 00081 00082