maxworldinfo.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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. /***********************************************************************************************
  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 : Max2W3D *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/max2w3d/maxworldinfo.h $*
  25. * *
  26. * Original Author:: Patrick Smith *
  27. * *
  28. * $Author:: Greg_h $*
  29. * *
  30. * $Modtime:: 10/27/00 6:55p $*
  31. * *
  32. * $Revision:: 2 $*
  33. * *
  34. *---------------------------------------------------------------------------------------------*
  35. * Functions: *
  36. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  37. #ifndef MAXWORLDINFO_H
  38. #define MAXWORLDINFO_H
  39. #include <Max.h>
  40. #include "meshbuild.h"
  41. #include "nodelist.h"
  42. #include "vector.h"
  43. class GeometryExportTaskClass;
  44. /**
  45. ** MaxWorldInfoClass - Provides information about the max 'world' (or scene)
  46. ** This class is used by the plugin to cause the MeshBuilder to smooth normals
  47. ** across adjacent meshes.
  48. */
  49. class MaxWorldInfoClass : public WorldInfoClass
  50. {
  51. public:
  52. MaxWorldInfoClass(DynamicVectorClass<GeometryExportTaskClass *> & mesh_list)
  53. : MeshList (mesh_list),
  54. SmoothBetweenMeshes (true),
  55. CurrentTask(NULL),
  56. CurrentTime(0) { }
  57. virtual ~MaxWorldInfoClass(void) { }
  58. // Public methods
  59. virtual Vector3 Get_Shared_Vertex_Normal(Vector3 pos, int smgroup);
  60. virtual GeometryExportTaskClass * Get_Current_Task(void) const { return CurrentTask; }
  61. virtual void Set_Current_Task(GeometryExportTaskClass * task) { CurrentTask = task; }
  62. virtual TimeValue Get_Current_Time(void) const { return CurrentTime; }
  63. virtual void Set_Current_Time(TimeValue &time) { CurrentTime = time; }
  64. virtual Matrix3 Get_Export_Transform(void) const { return ExportTrans; }
  65. virtual void Set_Export_Transform(const Matrix3 &matrix) { ExportTrans = matrix; }
  66. virtual void Allow_Mesh_Smoothing (bool onoff) { SmoothBetweenMeshes = onoff; }
  67. virtual bool Are_Meshes_Smoothed (void) const { return SmoothBetweenMeshes; }
  68. private:
  69. DynamicVectorClass<GeometryExportTaskClass *> & MeshList;
  70. GeometryExportTaskClass * CurrentTask;
  71. TimeValue CurrentTime;
  72. Matrix3 ExportTrans;
  73. bool SmoothBetweenMeshes;
  74. };
  75. #endif