DummyObjectNode.h 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182
  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 : LevelEdit *
  23. * *
  24. * $Archive:: /Commando/Code/Tools/LevelEdit/DummyObjectNode.h $*
  25. * *
  26. * Author:: Patrick Smith *
  27. * *
  28. * $Modtime:: 5/02/00 5:56p $*
  29. * *
  30. * $Revision:: 4 $*
  31. * *
  32. *---------------------------------------------------------------------------------------------*
  33. * Functions: *
  34. * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - */
  35. #if defined(_MSC_VER)
  36. #pragma once
  37. #endif
  38. #ifndef __DUMMY_OBJECT_NODE_H
  39. #define __DUMMY_OBJECT_NODE_H
  40. #include "node.h"
  41. #include "icons.h"
  42. #include "decophys.h"
  43. // Forward declarations
  44. class PresetClass;
  45. ////////////////////////////////////////////////////////////////////////////
  46. //
  47. // DummyObjectNodeClass
  48. //
  49. ////////////////////////////////////////////////////////////////////////////
  50. class DummyObjectNodeClass : public NodeClass
  51. {
  52. public:
  53. //////////////////////////////////////////////////////////////////
  54. // Public constructors/destructors
  55. //////////////////////////////////////////////////////////////////
  56. DummyObjectNodeClass (PresetClass *preset = NULL);
  57. DummyObjectNodeClass (const DummyObjectNodeClass &src);
  58. ~DummyObjectNodeClass (void);
  59. //////////////////////////////////////////////////////////////
  60. // Public operators
  61. //////////////////////////////////////////////////////////////
  62. const DummyObjectNodeClass &operator= (const DummyObjectNodeClass &src);
  63. //////////////////////////////////////////////////////////////////
  64. // Public methods
  65. //////////////////////////////////////////////////////////////////
  66. //
  67. // From PersistClass
  68. //
  69. virtual const PersistFactoryClass & Get_Factory (void) const;
  70. //
  71. // From NodeClass
  72. //
  73. NodeClass * Clone (void) { return new DummyObjectNodeClass (*this); }
  74. void Initialize (void);
  75. NODE_TYPE Get_Type (void) const { return NODE_TYPE_DUMMY_OBJECT; }
  76. int Get_Icon_Index (void) const { return OBJECT_ICON; }
  77. PhysClass * Peek_Physics_Obj (void) const;
  78. bool Is_Static (void) const { return false; }
  79. void Add_To_Scene (void);
  80. void Remove_From_Scene (void);
  81. void Handle_Emitter_Transform (void);
  82. //
  83. // Notifications
  84. //
  85. void On_Rotate (void);
  86. void On_Translate (void);
  87. void On_Transform (void);
  88. //
  89. // Export methods
  90. //
  91. void Pre_Export (void);
  92. void Post_Export (void);
  93. protected:
  94. //////////////////////////////////////////////////////////////////
  95. // Protected methods
  96. //////////////////////////////////////////////////////////////////
  97. private:
  98. //////////////////////////////////////////////////////////////////
  99. // Private member data
  100. //////////////////////////////////////////////////////////////////
  101. DecorationPhysClass * m_DisplayObj;
  102. DecorationPhysClass * m_RealObj;
  103. };
  104. //////////////////////////////////////////////////////////////////
  105. // Peek_Physics_Obj
  106. //////////////////////////////////////////////////////////////////
  107. inline PhysClass *
  108. DummyObjectNodeClass::Peek_Physics_Obj (void) const
  109. {
  110. return m_DisplayObj;
  111. }
  112. //////////////////////////////////////////////////////////////////
  113. // On_Rotate
  114. //////////////////////////////////////////////////////////////////
  115. inline void
  116. DummyObjectNodeClass::On_Rotate (void)
  117. {
  118. if (m_RealObj != NULL) {
  119. m_RealObj->Set_Transform (m_Transform);
  120. Handle_Emitter_Transform ();
  121. }
  122. NodeClass::On_Rotate ();
  123. return ;
  124. }
  125. //////////////////////////////////////////////////////////////////
  126. // On_Translate
  127. //////////////////////////////////////////////////////////////////
  128. inline void
  129. DummyObjectNodeClass::On_Translate (void)
  130. {
  131. if (m_RealObj != NULL) {
  132. m_RealObj->Set_Transform (m_Transform);
  133. Handle_Emitter_Transform ();
  134. }
  135. NodeClass::On_Translate ();
  136. return ;
  137. }
  138. //////////////////////////////////////////////////////////////////
  139. // On_Transform
  140. //////////////////////////////////////////////////////////////////
  141. inline void
  142. DummyObjectNodeClass::On_Transform (void)
  143. {
  144. if (m_RealObj != NULL) {
  145. m_RealObj->Set_Transform (m_Transform);
  146. Handle_Emitter_Transform ();
  147. }
  148. NodeClass::On_Transform ();
  149. return ;
  150. }
  151. #endif //__DUMMY_OBJECT_NODE_H