linearSourceForce.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. // Filename: linearSourceForce.h
  2. // Created by: charles (21Jun00)
  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 LINEARSOURCEFORCE_H
  19. #define LINEARSOURCEFORCE_H
  20. #include "linearDistanceForce.h"
  21. ////////////////////////////////////////////////////////////////////
  22. // Class : LinearSourceForce
  23. // Description : Repellant force.
  24. ////////////////////////////////////////////////////////////////////
  25. class EXPCL_PANDAPHYSICS LinearSourceForce : public LinearDistanceForce {
  26. PUBLISHED:
  27. LinearSourceForce(const LPoint3f& p, FalloffType f, float r, float a = 1.0f,
  28. bool mass = true);
  29. LinearSourceForce();
  30. LinearSourceForce(const LinearSourceForce &copy);
  31. virtual ~LinearSourceForce();
  32. virtual void output(ostream &out) const;
  33. virtual void write(ostream &out, unsigned int indent=0) const;
  34. private:
  35. virtual LVector3f get_child_vector(const PhysicsObject *po);
  36. virtual LinearForce *make_copy();
  37. public:
  38. static TypeHandle get_class_type() {
  39. return _type_handle;
  40. }
  41. static void init_type() {
  42. LinearDistanceForce::init_type();
  43. register_type(_type_handle, "LinearSourceForce",
  44. LinearDistanceForce::get_class_type());
  45. }
  46. virtual TypeHandle get_type() const {
  47. return get_class_type();
  48. }
  49. virtual TypeHandle force_init_type() {init_type(); return get_class_type();}
  50. private:
  51. static TypeHandle _type_handle;
  52. };
  53. #endif // LINEARSOURCEFORCE_H