movingPartMatrix.h 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. // Filename: movingPartMatrix.h
  2. // Created by: drose (23Feb99)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
  8. //
  9. // All use of this software is subject to the terms of the Panda 3d
  10. // Software license. You should have received a copy of this license
  11. // along with this source code; you will also find a current copy of
  12. // the license at http://etc.cmu.edu/panda3d/docs/license/ .
  13. //
  14. // To contact the maintainers of this program write to
  15. // [email protected] .
  16. //
  17. ////////////////////////////////////////////////////////////////////
  18. #ifndef MOVINGPARTMATRIX_H
  19. #define MOVINGPARTMATRIX_H
  20. #include "pandabase.h"
  21. #include "movingPart.h"
  22. #include "animChannel.h"
  23. #include "animChannelFixed.h"
  24. #include "cmath.h"
  25. EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, MovingPart<ACMatrixSwitchType>);
  26. ////////////////////////////////////////////////////////////////////
  27. // Class : MovingPartMatrix
  28. // Description : This is a particular kind of MovingPart that accepts
  29. // a matrix each frame.
  30. ////////////////////////////////////////////////////////////////////
  31. class EXPCL_PANDA MovingPartMatrix : public MovingPart<ACMatrixSwitchType> {
  32. protected:
  33. INLINE MovingPartMatrix(const MovingPartMatrix &copy);
  34. public:
  35. INLINE MovingPartMatrix(PartGroup *parent, const string &name,
  36. const LMatrix4f &initial_value =
  37. LMatrix4f::ident_mat());
  38. virtual ~MovingPartMatrix();
  39. virtual AnimChannelBase *make_initial_channel() const;
  40. virtual void get_blend_value(const PartBundle *root);
  41. protected:
  42. INLINE MovingPartMatrix();
  43. public:
  44. static void register_with_read_factory();
  45. static TypedWritable *make_MovingPartMatrix(const FactoryParams &params);
  46. public:
  47. virtual TypeHandle get_type() const {
  48. return get_class_type();
  49. }
  50. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  51. PUBLISHED:
  52. static TypeHandle get_class_type() {
  53. return _type_handle;
  54. }
  55. public:
  56. static void init_type() {
  57. MovingPart<ACMatrixSwitchType>::init_type();
  58. AnimChannelFixed<ACMatrixSwitchType>::init_type();
  59. register_type(_type_handle, "MovingPartMatrix",
  60. MovingPart<ACMatrixSwitchType>::get_class_type());
  61. }
  62. private:
  63. static TypeHandle _type_handle;
  64. };
  65. #include "movingPartMatrix.I"
  66. // Tell GCC that we'll take care of the instantiation explicitly here.
  67. #ifdef __GNUC__
  68. #pragma interface
  69. #endif
  70. #endif