MeshDeformSaveDefs.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. /*
  2. ** Command & Conquer Generals Zero Hour(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. *** Confidential - Westwood Studios ***
  20. ***********************************************************************************************
  21. * *
  22. * Project Name : Commando / G 3D engine *
  23. * *
  24. * File Name : MeshDeformData.cpp *
  25. * *
  26. * Programmer : Patrick Smith *
  27. * *
  28. * Start Date : 06/07/99 *
  29. * *
  30. * Last Update :
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #ifndef __MESH_DEFORM_SAVE_DEFS_H
  36. #define __MESH_DEFORM_SAVE_DEFS_H
  37. #include <Max.h>
  38. ///////////////////////////////////////////////////////////////////////////
  39. //
  40. // Constants
  41. //
  42. ///////////////////////////////////////////////////////////////////////////
  43. typedef enum
  44. {
  45. DEFORM_CHUNK_INFO = 0x000000001,
  46. DEFORM_CHUNK_SET_INFO,
  47. DEFORM_CHUNK_KEYFRAME_INFO,
  48. DEFORM_CHUNK_POSITION_DATA,
  49. DEFORM_CHUNK_POSITION_VERTS,
  50. DEFORM_CHUNK_COLOR_DATA,
  51. DEFORM_CHUNK_COLOR_VERTS
  52. } DEFORM_CHUNK_IDS;
  53. ///////////////////////////////////////////////////////////////////////////
  54. //
  55. // Structures
  56. //
  57. ///////////////////////////////////////////////////////////////////////////
  58. //
  59. // Deform information. Each mesh can have sets of keyframes of
  60. // deform info associated with it.
  61. //
  62. struct DeformChunk
  63. {
  64. uint32 SetCount;
  65. uint32 reserved[4];
  66. };
  67. //
  68. // Deform set information. Each set is made up of a series
  69. // of keyframes.
  70. //
  71. struct DeformChunkSetInfo
  72. {
  73. uint32 KeyframeCount;
  74. uint32 flags;
  75. uint32 NumVerticies;
  76. uint32 NumVertexColors;
  77. uint32 reserved[2];
  78. };
  79. #define DEFORM_SET_MANUAL_DEFORM 0x00000001 // set is isn't applied during sphere or point tests.
  80. //
  81. // Deform keyframe information. Each keyframe is made up of
  82. // a set of per-vert deform data.
  83. //
  84. struct DeformChunkKeyframeInfo
  85. {
  86. float32 DeformPercent;
  87. uint32 VertexCount;
  88. uint32 ColorCount;
  89. uint32 reserved[2];
  90. };
  91. //
  92. // Deform data. Contains deform information about a vertex
  93. // in the mesh.
  94. //
  95. struct DeformDataChunk
  96. {
  97. uint32 VertexIndex;
  98. uint32 ColorIndex;
  99. Point3 Value;
  100. uint32 reserved[2];
  101. };
  102. #endif //__MESH_DEFORM_SAVE_DEFS_H