angularVectorForce.h 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Filename: angularVectorForce.h
  2. // Created by: charles (09Aug00)
  3. //
  4. ////////////////////////////////////////////////////////////////////
  5. //
  6. // PANDA 3D SOFTWARE
  7. // Copyright (c) 2001, 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://www.panda3d.org/license.txt .
  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. private:
  28. LVector3f _fvec;
  29. virtual AngularForce *make_copy(void) const;
  30. virtual LVector3f get_child_vector(const PhysicsObject *po);
  31. PUBLISHED:
  32. AngularVectorForce(const LVector3f& vec);
  33. AngularVectorForce(float x = 0.0f, float y = 0.0f, float z = 0.0f);
  34. AngularVectorForce(const AngularVectorForce &copy);
  35. virtual ~AngularVectorForce(void);
  36. INLINE void set_vector(const LVector3f& v);
  37. INLINE void set_vector(float x, float y, float z);
  38. INLINE LVector3f get_local_vector(void) const;
  39. public:
  40. static TypeHandle get_class_type(void) {
  41. return _type_handle;
  42. }
  43. static void init_type(void) {
  44. AngularForce::init_type();
  45. register_type(_type_handle, "AngularVectorForce",
  46. AngularForce::get_class_type());
  47. }
  48. virtual TypeHandle get_type(void) const {
  49. return get_class_type();
  50. }
  51. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  52. private:
  53. static TypeHandle _type_handle;
  54. };
  55. #include "angularVectorForce.I"
  56. #endif // ANGULARVECTORFORCE_H