movingPartMatrix.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  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. EXPORT_TEMPLATE_CLASS(EXPCL_PANDA, EXPTP_PANDA, MovingPart<ACMatrixSwitchType>);
  25. ////////////////////////////////////////////////////////////////////
  26. // Class : MovingPartMatrix
  27. // Description : This is a particular kind of MovingPart that accepts
  28. // a matrix each frame.
  29. ////////////////////////////////////////////////////////////////////
  30. class EXPCL_PANDA MovingPartMatrix : public MovingPart<ACMatrixSwitchType> {
  31. protected:
  32. INLINE MovingPartMatrix(const MovingPartMatrix &copy);
  33. public:
  34. INLINE MovingPartMatrix(PartGroup *parent, const string &name,
  35. const LMatrix4f &initial_value =
  36. LMatrix4f::ident_mat());
  37. virtual ~MovingPartMatrix();
  38. virtual void get_blend_value(const PartBundle *root);
  39. protected:
  40. INLINE MovingPartMatrix();
  41. public:
  42. static void register_with_read_factory();
  43. static TypedWritable *make_MovingPartMatrix(const FactoryParams &params);
  44. public:
  45. virtual TypeHandle get_type() const {
  46. return get_class_type();
  47. }
  48. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  49. PUBLISHED:
  50. static TypeHandle get_class_type() {
  51. return _type_handle;
  52. }
  53. public:
  54. static void init_type() {
  55. MovingPart<ACMatrixSwitchType>::init_type();
  56. AnimChannelFixed<ACMatrixSwitchType>::init_type();
  57. register_type(_type_handle, "MovingPartMatrix",
  58. MovingPart<ACMatrixSwitchType>::get_class_type());
  59. }
  60. private:
  61. static TypeHandle _type_handle;
  62. };
  63. #include "movingPartMatrix.I"
  64. // Tell GCC that we'll take care of the instantiation explicitly here.
  65. #ifdef __GNUC__
  66. #pragma interface
  67. #endif
  68. #endif