Panda3D
|
00001 // Filename: movingPartScalar.h 00002 // Created by: drose (23Feb99) 00003 // 00004 //////////////////////////////////////////////////////////////////// 00005 // 00006 // PANDA 3D SOFTWARE 00007 // Copyright (c) Carnegie Mellon University. All rights reserved. 00008 // 00009 // All use of this software is subject to the terms of the revised BSD 00010 // license. You should have received a copy of this license along 00011 // with this source code in a file named "LICENSE." 00012 // 00013 //////////////////////////////////////////////////////////////////// 00014 00015 #ifndef MOVINGPARTSCALAR_H 00016 #define MOVINGPARTSCALAR_H 00017 00018 #include "pandabase.h" 00019 00020 #include "movingPart.h" 00021 #include "animChannel.h" 00022 #include "animChannelFixed.h" 00023 00024 EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_CHAN, EXPTP_PANDA_CHAN, MovingPart<ACScalarSwitchType>); 00025 00026 //////////////////////////////////////////////////////////////////// 00027 // Class : MovingPartScalar 00028 // Description : This is a particular kind of MovingPart that accepts 00029 // a scalar each frame. 00030 //////////////////////////////////////////////////////////////////// 00031 class EXPCL_PANDA_CHAN MovingPartScalar : public MovingPart<ACScalarSwitchType> { 00032 protected: 00033 INLINE MovingPartScalar(const MovingPartScalar ©); 00034 00035 public: 00036 INLINE MovingPartScalar(PartGroup *parent, const string &name, 00037 const PN_stdfloat &default_value = 0); 00038 virtual ~MovingPartScalar(); 00039 00040 virtual void get_blend_value(const PartBundle *root); 00041 00042 virtual bool apply_freeze_scalar(PN_stdfloat value); 00043 virtual bool apply_control(PandaNode *node); 00044 00045 protected: 00046 INLINE MovingPartScalar(); 00047 00048 public: 00049 static void register_with_read_factory(); 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 PUBLISHED: 00059 static TypeHandle get_class_type() { 00060 return _type_handle; 00061 } 00062 public: 00063 static void init_type() { 00064 MovingPart<ACScalarSwitchType>::init_type(); 00065 AnimChannelFixed<ACScalarSwitchType>::init_type(); 00066 register_type(_type_handle, "MovingPartScalar", 00067 MovingPart<ACScalarSwitchType>::get_class_type()); 00068 } 00069 00070 private: 00071 static TypeHandle _type_handle; 00072 }; 00073 00074 #include "movingPartScalar.I" 00075 00076 // Tell GCC that we'll take care of the instantiation explicitly here. 00077 #ifdef __GNUC__ 00078 #pragma interface 00079 #endif 00080 00081 #endif 00082 00083 00084