humanrecoil.h 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /*
  2. ** Command & Conquer Renegade(tm)
  3. ** Copyright 2025 Electronic Arts Inc.
  4. **
  5. ** This program is free software: you can redistribute it and/or modify
  6. ** it under the terms of the GNU General Public License as published by
  7. ** the Free Software Foundation, either version 3 of the License, or
  8. ** (at your option) any later version.
  9. **
  10. ** This program is distributed in the hope that it will be useful,
  11. ** but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. ** GNU General Public License for more details.
  14. **
  15. ** You should have received a copy of the GNU General Public License
  16. ** along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. /***********************************************************************************************
  19. *** C O N F I D E N T I A L --- W E S T W O O D S T U D I O S ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Combat *
  23. * *
  24. * $Archive:: /Commando/Code/Combat/humanrecoil.h $*
  25. * *
  26. * Original Author:: Greg Hjelstrom *
  27. * *
  28. * $Author:: Greg_h $*
  29. * *
  30. * $Modtime:: 8/22/00 8:09a $*
  31. * *
  32. * $Revision:: 2 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #if defined(_MSC_VER)
  38. #pragma once
  39. #endif
  40. #ifndef HUMANRECOIL_H
  41. #define HUMANRECOIL_H
  42. #include "always.h"
  43. class RenderObjClass;
  44. class Matrix3D;
  45. /**
  46. ** HumanRecoilClass
  47. ** This class encapsulates all of the code to perform a programatic 'recoil' animation on
  48. ** a human skeleton in Renegade.
  49. **
  50. ** WARNING: this code assumes that you are using the same bone structure for every model
  51. ** that you apply recoils to. The first time it is called, it caches bone indexes for
  52. ** the named bones that it modifies. If you call it with two totally different skeletons
  53. ** the wrong bones will be moved. If this is needed in the future we can extend this class
  54. ** and store an instance of it per game object or something...
  55. */
  56. class HumanRecoilClass
  57. {
  58. public:
  59. HumanRecoilClass(void);
  60. void Capture_Bones(RenderObjClass * model);
  61. void Apply_Recoil(const Matrix3D & recoil_tm,RenderObjClass * model,float scale);
  62. void Release_Bones(RenderObjClass * model);
  63. protected:
  64. void Initialize(RenderObjClass * model);
  65. static bool IsInitted;
  66. };
  67. #endif //HUMANRECOIL_H