angularIntegrator.cxx 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081
  1. // Filename: angularIntegrator.cxx
  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. #include "angularIntegrator.h"
  19. ////////////////////////////////////////////////////////////////////
  20. // Function : AngularIntegrator
  21. // Access : protected
  22. // Description : constructor
  23. ////////////////////////////////////////////////////////////////////
  24. AngularIntegrator::
  25. AngularIntegrator() {
  26. }
  27. ////////////////////////////////////////////////////////////////////
  28. // Function : ~AngularIntegrator
  29. // Access : public, virtual
  30. // Description : destructor
  31. ////////////////////////////////////////////////////////////////////
  32. AngularIntegrator::
  33. ~AngularIntegrator() {
  34. }
  35. ////////////////////////////////////////////////////////////////////
  36. // Function : Integrate
  37. // Access : public
  38. // Description : high-level integration. API.
  39. ////////////////////////////////////////////////////////////////////
  40. void AngularIntegrator::
  41. integrate(Physical *physical, pvector< PT(AngularForce) >& forces,
  42. float dt) {
  43. // intercept in case we want to censor/adjust values
  44. if (dt > _max_angular_dt)
  45. dt = _max_angular_dt;
  46. // this actually does the integration.
  47. child_integrate(physical, forces, dt);
  48. }
  49. ////////////////////////////////////////////////////////////////////
  50. // Function : output
  51. // Access : Public
  52. // Description : Write a string representation of this instance to
  53. // <out>.
  54. ////////////////////////////////////////////////////////////////////
  55. void AngularIntegrator::
  56. output(ostream &out) const {
  57. #ifndef NDEBUG //[
  58. out<<"AngularIntegrator";
  59. #endif //] NDEBUG
  60. }
  61. ////////////////////////////////////////////////////////////////////
  62. // Function : write
  63. // Access : Public
  64. // Description : Write a string representation of this instance to
  65. // <out>.
  66. ////////////////////////////////////////////////////////////////////
  67. void AngularIntegrator::
  68. write(ostream &out, unsigned int indent) const {
  69. #ifndef NDEBUG //[
  70. out.width(indent); out<<""; out<<"AngularIntegrator:\n";
  71. out.width(indent+2); out<<""; out<<"_max_angular_dt "<<_max_angular_dt<<" (class const)\n";
  72. BaseIntegrator::write(out, indent+2);
  73. #endif //] NDEBUG
  74. }