cConstrainTransformInterval.h 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file cConstrainTransformInterval.h
  10. * @author pratt
  11. * @date 2006-09-29
  12. */
  13. #ifndef CCONSTRAINTRANSFORMINTERVAL_H
  14. #define CCONSTRAINTRANSFORMINTERVAL_H
  15. #include "directbase.h"
  16. #include "cConstraintInterval.h"
  17. #include "nodePath.h"
  18. /**
  19. * A constraint interval that will constrain the transform of one node to the
  20. * transform of another.
  21. */
  22. class EXPCL_DIRECT_INTERVAL CConstrainTransformInterval : public CConstraintInterval {
  23. PUBLISHED:
  24. explicit CConstrainTransformInterval(const std::string &name, double duration,
  25. const NodePath &node,
  26. const NodePath &target, bool wrt);
  27. INLINE const NodePath &get_node() const;
  28. INLINE const NodePath &get_target() const;
  29. virtual void priv_step(double t);
  30. virtual void output(std::ostream &out) const;
  31. private:
  32. NodePath _node;
  33. NodePath _target;
  34. bool _wrt;
  35. public:
  36. static TypeHandle get_class_type() {
  37. return _type_handle;
  38. }
  39. static void init_type() {
  40. CConstraintInterval::init_type();
  41. register_type(_type_handle, "CConstrainTransformInterval",
  42. CConstraintInterval::get_class_type());
  43. }
  44. virtual TypeHandle get_type() const {
  45. return get_class_type();
  46. }
  47. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  48. private:
  49. static TypeHandle _type_handle;
  50. };
  51. #include "cConstrainTransformInterval.I"
  52. #endif