Panda3D
|
00001 // Filename: movingPartMatrix.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 MOVINGPARTMATRIX_H 00016 #define MOVINGPARTMATRIX_H 00017 00018 #include "pandabase.h" 00019 00020 #include "movingPart.h" 00021 #include "animChannel.h" 00022 #include "animChannelFixed.h" 00023 #include "cmath.h" 00024 00025 EXPORT_TEMPLATE_CLASS(EXPCL_PANDA_CHAN, EXPTP_PANDA_CHAN, MovingPart<ACMatrixSwitchType>); 00026 00027 //////////////////////////////////////////////////////////////////// 00028 // Class : MovingPartMatrix 00029 // Description : This is a particular kind of MovingPart that accepts 00030 // a matrix each frame. 00031 //////////////////////////////////////////////////////////////////// 00032 class EXPCL_PANDA_CHAN MovingPartMatrix : public MovingPart<ACMatrixSwitchType> { 00033 protected: 00034 INLINE MovingPartMatrix(const MovingPartMatrix ©); 00035 00036 public: 00037 INLINE MovingPartMatrix(PartGroup *parent, const string &name, 00038 const LMatrix4 &default_value); 00039 virtual ~MovingPartMatrix(); 00040 00041 virtual AnimChannelBase *make_default_channel() const; 00042 virtual void get_blend_value(const PartBundle *root); 00043 00044 virtual bool apply_freeze_matrix(const LVecBase3 &pos, const LVecBase3 &hpr, const LVecBase3 &scale); 00045 virtual bool apply_control(PandaNode *node); 00046 00047 protected: 00048 INLINE MovingPartMatrix(); 00049 00050 public: 00051 static void register_with_read_factory(); 00052 00053 static TypedWritable *make_MovingPartMatrix(const FactoryParams ¶ms); 00054 00055 public: 00056 virtual TypeHandle get_type() const { 00057 return get_class_type(); 00058 } 00059 virtual TypeHandle force_init_type() {init_type(); return get_class_type();} 00060 PUBLISHED: 00061 static TypeHandle get_class_type() { 00062 return _type_handle; 00063 } 00064 public: 00065 static void init_type() { 00066 MovingPart<ACMatrixSwitchType>::init_type(); 00067 AnimChannelFixed<ACMatrixSwitchType>::init_type(); 00068 register_type(_type_handle, "MovingPartMatrix", 00069 MovingPart<ACMatrixSwitchType>::get_class_type()); 00070 } 00071 00072 private: 00073 static TypeHandle _type_handle; 00074 }; 00075 00076 #include "movingPartMatrix.I" 00077 00078 // Tell GCC that we'll take care of the instantiation explicitly here. 00079 #ifdef __GNUC__ 00080 #pragma interface 00081 #endif 00082 00083 #endif 00084 00085 00086