MeshDeformSave.h 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110
  1. /*
  2. ** Command & Conquer Generals(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. /* $Header: /Commando/Code/Tools/max2w3d/MeshDeformSave.h 4 7/07/99 11:52a Patrick $ */
  19. /***********************************************************************************************
  20. *** Confidential - Westwood Studios ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Commando / G 3D engine *
  24. * *
  25. * File Name : MeshDeformSafe.H
  26. * *
  27. * Programmer : Patrick Smith *
  28. * *
  29. * Start Date : 05/28/99 *
  30. * *
  31. * Last Update :
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef __MESH_DEFORM_SAVE_H
  37. #define __MESH_DEFORM_SAVE_H
  38. #include <Max.h>
  39. #include "Vector.H"
  40. // Forward declarations
  41. class ChunkSaveClass;
  42. class MeshDeformModData;
  43. class MeshDeformSaveSetClass;
  44. class MeshBuilderClass;
  45. class MeshDeformSaveSetClass;
  46. ///////////////////////////////////////////////////////////////////////////
  47. //
  48. // Typdefs
  49. //
  50. ///////////////////////////////////////////////////////////////////////////
  51. typedef DynamicVectorClass<MeshDeformSaveSetClass *> DEFORM_SAVE_LIST;
  52. ///////////////////////////////////////////////////////////////////////////
  53. //
  54. // MeshDeformSaveClass
  55. //
  56. ///////////////////////////////////////////////////////////////////////////
  57. class MeshDeformSaveClass
  58. {
  59. public:
  60. //////////////////////////////////////////////////////////////////////
  61. // Public constructors/destructors
  62. //////////////////////////////////////////////////////////////////////
  63. MeshDeformSaveClass (void)
  64. : m_AlphaPasses (0) { }
  65. ~MeshDeformSaveClass (void) { Reset (); }
  66. //////////////////////////////////////////////////////////////////////
  67. // Public methods
  68. //////////////////////////////////////////////////////////////////////
  69. void Initialize (MeshBuilderClass &builder, Object *object, Mesh &mesh, Matrix3 *transform = NULL);
  70. void Initialize (MeshBuilderClass &builder, Mesh &mesh, MeshDeformModData &mod_data, Matrix3 *transform = NULL);
  71. //void Re_Index (MeshBuilderClass &builder);
  72. bool Export (ChunkSaveClass &chunk_save);
  73. void Reset (void);
  74. bool Is_Empty (void) const { return m_DeformSets.Count () == 0; }
  75. bool Does_Deformer_Modify_DCG (void);
  76. unsigned int Get_Alpha_Passes (void) const { return m_AlphaPasses; }
  77. void Set_Alpha_Passes (unsigned int pass_mask) { m_AlphaPasses = pass_mask; }
  78. protected:
  79. //////////////////////////////////////////////////////////////////////
  80. // Protected methods
  81. //////////////////////////////////////////////////////////////////////
  82. bool Export_Sets (ChunkSaveClass &chunk_save);
  83. bool Export_Keyframes (ChunkSaveClass &chunk_save, MeshDeformSaveSetClass &set_save);
  84. private:
  85. //////////////////////////////////////////////////////////////////////
  86. // Private member data
  87. //////////////////////////////////////////////////////////////////////
  88. DEFORM_SAVE_LIST m_DeformSets;
  89. unsigned int m_AlphaPasses;
  90. };
  91. #endif //__MESH_DEFORM_SAVE_H