angularVectorForce.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869
  1. // Filename: angularVectorForce.h
  2. // Created by: charles (09Aug00)
  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 ANGULARVECTORFORCE_H
  19. #define ANGULARVECTORFORCE_H
  20. #include "angularForce.h"
  21. ////////////////////////////////////////////////////////////////////
  22. // Class : AngularVectorForce
  23. // Description : a simple directed torque force, the angular
  24. // equivalent of simple vector force.
  25. ////////////////////////////////////////////////////////////////////
  26. class EXPCL_PANDAPHYSICS AngularVectorForce : public AngularForce {
  27. PUBLISHED:
  28. AngularVectorForce(const LRotationf& quat);
  29. AngularVectorForce(float h, float p, float r);
  30. AngularVectorForce(const AngularVectorForce &copy);
  31. virtual ~AngularVectorForce();
  32. INLINE void set_quat(const LRotationf& quat);
  33. INLINE void set_hpr(float h, float p, float r);
  34. INLINE LRotationf get_local_quat() const;
  35. virtual void output(ostream &out) const;
  36. virtual void write(ostream &out, unsigned int indent=0) const;
  37. private:
  38. LRotationf _fvec;
  39. virtual AngularForce *make_copy() const;
  40. virtual LRotationf get_child_quat(const PhysicsObject *po);
  41. public:
  42. static TypeHandle get_class_type() {
  43. return _type_handle;
  44. }
  45. static void init_type() {
  46. AngularForce::init_type();
  47. register_type(_type_handle, "AngularVectorForce",
  48. AngularForce::get_class_type());
  49. }
  50. virtual TypeHandle get_type() const {
  51. return get_class_type();
  52. }
  53. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  54. private:
  55. static TypeHandle _type_handle;
  56. };
  57. #include "angularVectorForce.I"
  58. #endif // ANGULARVECTORFORCE_H