baseIntegrator.h 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. // Filename: baseIntegrator.h
  2. // Created by: charles (11Aug00)
  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 BASEINTEGRATOR_H
  19. #define BASEINTEGRATOR_H
  20. #include <pandabase.h>
  21. #include <pointerTo.h>
  22. #include <referenceCount.h>
  23. #include <luse.h>
  24. #include "linearForce.h"
  25. #include "angularForce.h"
  26. #include "pvector.h"
  27. class Physical;
  28. ////////////////////////////////////////////////////////////////////
  29. // Class : BaseIntegrator
  30. // Description : pure virtual integrator class that holds cached
  31. // matrix information that really should be common to
  32. // any possible child implementation.
  33. ////////////////////////////////////////////////////////////////////
  34. class EXPCL_PANDAPHYSICS BaseIntegrator : public ReferenceCount {
  35. private:
  36. // since the wrt for each physicsobject between its physicalnode
  37. // and however many forces will be the same among one physical,
  38. // the transformation matrices can be pulled out of the inner loop
  39. // and precomputed.
  40. pvector< LMatrix4f > _precomputed_linear_matrices;
  41. pvector< LMatrix4f > _precomputed_angular_matrices;
  42. protected:
  43. BaseIntegrator(void);
  44. INLINE const pvector< LMatrix4f > &get_precomputed_linear_matrices(void) const;
  45. INLINE const pvector< LMatrix4f > &get_precomputed_angular_matrices(void) const;
  46. void precompute_linear_matrices(Physical *physical,
  47. const pvector< PT(LinearForce) > &forces);
  48. void precompute_angular_matrices(Physical *physical,
  49. const pvector< PT(AngularForce) > &forces);
  50. public:
  51. virtual ~BaseIntegrator(void);
  52. };
  53. #include "baseIntegrator.I"
  54. #endif // BASEINTEGRATOR_H