meshcon.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  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. /* $Header: /Commando/Code/Tools/max2w3d/meshcon.h 26 10/27/00 4:11p Greg_h $ */
  19. /***********************************************************************************************
  20. *** Confidential - Westwood Studios ***
  21. ***********************************************************************************************
  22. * *
  23. * Project Name : Commando / G Tools *
  24. * *
  25. * $Archive:: /Commando/Code/Tools/max2w3d/meshcon.h $*
  26. * *
  27. * $Author:: Greg_h $*
  28. * *
  29. * $Modtime:: 10/27/00 10:31a $*
  30. * *
  31. * $Revision:: 26 $*
  32. * *
  33. *---------------------------------------------------------------------------------------------*
  34. * Functions: *
  35. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  36. #ifndef MESHCON_H
  37. #define MESHCON_H
  38. #ifndef ALWAYS_H
  39. #include "always.h"
  40. #endif
  41. #ifndef CHUNKIO_H
  42. #include "chunkio.h"
  43. #endif
  44. #ifndef NODELIST_H
  45. #include "nodelist.h"
  46. #endif
  47. #ifndef HIERSAVE_H
  48. #include "hiersave.h"
  49. #endif
  50. #ifndef W3D_FILE
  51. #include "w3d_file.h"
  52. #endif
  53. #ifndef VECTOR_H
  54. #include "vector.h"
  55. #endif
  56. class GeometryExportTaskClass;
  57. class GeometryExportContextClass;
  58. struct ConnectionStruct
  59. {
  60. ConnectionStruct(void) : BoneIndex(0),MeshINode(NULL)
  61. {
  62. memset(ObjectName,0,sizeof(ObjectName));
  63. }
  64. int BoneIndex;
  65. char ObjectName[2*W3D_NAME_LEN];
  66. INode * MeshINode;
  67. // required by DynamicVectorClass...
  68. operator == (const ConnectionStruct & that) { return false; }
  69. operator != (const ConnectionStruct & that) { return !(*this==that); }
  70. };
  71. /**
  72. ** MeshConnectionsClass
  73. ** This class is the description of a hierarchical model. It contains an array of "ConnectionStructs" which
  74. ** associate pieces of geometry with nodes in a hierarchy tree.
  75. */
  76. class MeshConnectionsClass
  77. {
  78. public:
  79. MeshConnectionsClass( DynamicVectorClass<GeometryExportTaskClass *> sub_objects,
  80. GeometryExportContextClass & context );
  81. ~MeshConnectionsClass(void);
  82. /*
  83. ** Get the name of the mesh connections object (will be
  84. ** the name of the runtime HierarchyModel that this
  85. ** object is describing.
  86. */
  87. const char * Get_Name(void) const { return Name; }
  88. /*
  89. ** Get the total number of meshes (of all types).
  90. */
  91. int Get_Sub_Object_Count (void) const { return SubObjects.Count(); }
  92. int Get_Aggregate_Count(void) const { return Aggregates.Count(); }
  93. int Get_Proxy_Count(void) const { return ProxyObjects.Count(); }
  94. /*
  95. ** Retrieve data about the mesh of the given index.
  96. ** out_name - name of the mesh is passed back by setting the char* pointed to by this value.
  97. ** out_boneindex - the index of the bone used is passed back by setting the int pointed to by this value.
  98. ** out_inode - mesh INode is passed by setting the INode* pointed to by this value. If this
  99. ** parameter is NULL, the value is not passed back.
  100. */
  101. bool Get_Sub_Object_Data(int index, char **out_name, int *out_boneindex, INode **out_inode = NULL);
  102. bool Get_Aggregate_Data(int index, char **out_name, int *out_boneindex, INode **out_inode = NULL);
  103. bool Get_Proxy_Data(int index, char **out_name, int *out_boneindex, INode **out_inode = NULL);
  104. /*
  105. ** Returns the origin node used by this model.
  106. */
  107. INode * Get_Origin (void) const { return Origin; }
  108. private:
  109. TimeValue CurTime;
  110. INode * Origin;
  111. char Name[W3D_NAME_LEN];
  112. // array of SubObjects
  113. DynamicVectorClass<ConnectionStruct> SubObjects;
  114. DynamicVectorClass<ConnectionStruct> Aggregates;
  115. DynamicVectorClass<ConnectionStruct> ProxyObjects;
  116. };
  117. #endif /*MESHCON_H*/