angularVectorForce.cxx 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. /**
  2. * PANDA 3D SOFTWARE
  3. * Copyright (c) Carnegie Mellon University. All rights reserved.
  4. *
  5. * All use of this software is subject to the terms of the revised BSD
  6. * license. You should have received a copy of this license along
  7. * with this source code in a file named "LICENSE."
  8. *
  9. * @file angularVectorForce.cxx
  10. * @author charles
  11. * @date 2000-08-09
  12. */
  13. #include "angularVectorForce.h"
  14. TypeHandle AngularVectorForce::_type_handle;
  15. /**
  16. * constructor
  17. */
  18. AngularVectorForce::
  19. AngularVectorForce(const LRotation &vec) :
  20. AngularForce(), _fvec(vec) {
  21. }
  22. /**
  23. * constructor
  24. */
  25. AngularVectorForce::
  26. AngularVectorForce(PN_stdfloat h, PN_stdfloat p, PN_stdfloat r) :
  27. AngularForce() {
  28. _fvec.set_hpr(LVecBase3(h, p, r));
  29. }
  30. /**
  31. * copy constructor
  32. */
  33. AngularVectorForce::
  34. AngularVectorForce(const AngularVectorForce &copy) :
  35. AngularForce(copy) {
  36. _fvec = copy._fvec;
  37. }
  38. /**
  39. * destructor
  40. */
  41. AngularVectorForce::
  42. ~AngularVectorForce() {
  43. }
  44. /**
  45. * dynamic copier
  46. */
  47. AngularForce *AngularVectorForce::
  48. make_copy() const {
  49. return new AngularVectorForce(*this);
  50. }
  51. /**
  52. * query
  53. */
  54. LRotation AngularVectorForce::
  55. get_child_quat(const PhysicsObject *) {
  56. return _fvec;
  57. }
  58. /**
  59. * Write a string representation of this instance to <out>.
  60. */
  61. void AngularVectorForce::
  62. output(std::ostream &out) const {
  63. #ifndef NDEBUG //[
  64. out<<"AngularVectorForce";
  65. #endif //] NDEBUG
  66. }
  67. /**
  68. * Write a string representation of this instance to <out>.
  69. */
  70. void AngularVectorForce::
  71. write(std::ostream &out, int indent) const {
  72. #ifndef NDEBUG //[
  73. out.width(indent); out<<""; out<<"AngularVectorForce:\n";
  74. out.width(indent+2); out<<""; out<<"_fvec "<<_fvec<<"\n";
  75. AngularForce::write(out, indent+2);
  76. #endif //] NDEBUG
  77. }