linearRandomForce.h 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. // Filename: linearRandomForce.h
  2. // Created by: charles (19Jun00)
  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 LINEARRANDOMFORCE_H
  19. #define LINEARRANDOMFORCE_H
  20. #include <stdlib.h>
  21. #include <math.h>
  22. #include "linearForce.h"
  23. ////////////////////////////////////////////////////////////////////
  24. // Class : LinearRandomForce
  25. // Description : Pure virtual, parent to noiseForce and jitterForce
  26. ////////////////////////////////////////////////////////////////////
  27. class EXPCL_PANDAPHYSICS LinearRandomForce : public LinearForce {
  28. protected:
  29. static float bounded_rand(void);
  30. static LVector3f random_unit_vector(void);
  31. LinearRandomForce(float a = 1.0f, bool m = false);
  32. LinearRandomForce(const LinearRandomForce &copy);
  33. virtual LVector3f get_child_vector(const PhysicsObject *po) = 0;
  34. virtual LinearForce *make_copy(void) = 0;
  35. PUBLISHED:
  36. virtual ~LinearRandomForce(void);
  37. public:
  38. static TypeHandle get_class_type(void) {
  39. return _type_handle;
  40. }
  41. static void init_type(void) {
  42. LinearForce::init_type();
  43. register_type(_type_handle, "LinearRandomForce",
  44. LinearForce::get_class_type());
  45. }
  46. virtual TypeHandle get_type(void) 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. #include "linearRandomForce.I"
  54. #endif // LINEARRANDOMFORCE_H