ltengineobjects.h 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250
  1. // ----------------------------------------------------------------------- //
  2. //
  3. // MODULE : ltengineobjects.h.
  4. //
  5. // PURPOSE : C++ LithTech engine object class(es) definition(s)
  6. //
  7. // CREATED : 9/17/97
  8. //
  9. // ----------------------------------------------------------------------- //
  10. #ifndef __LTENGINEOBJECTS_H__
  11. #define __LTENGINEOBJECTS_H__
  12. #include "ltbasedefs.h"
  13. #include "ltserverobj.h"
  14. #include "iaggregate.h"
  15. /////////////////////////////////////////////////////////////////////
  16. // C++ BaseClass interface.
  17. // This is the base class of ALL objects. You MUST derive from this!
  18. /////////////////////////////////////////////////////////////////////
  19. class ILTServer;
  20. extern ILTServer *g_pLTServer;
  21. class BaseClass
  22. {
  23. public:
  24. BaseClass(uint8 nType=OT_NORMAL)
  25. {
  26. m_pFirstAggregate = NULL;
  27. m_hObject = NULL;
  28. m_nType = nType;
  29. }
  30. virtual ~BaseClass() {}
  31. uint8 GetType() const { return m_nType; }
  32. void SetType( uint8 type ) { m_nType = type; }
  33. static ILTServer* GetServerDE() { return (ILTServer*)g_pLTServer; }
  34. // If you derive from BaseClass, pass your messages down to here at the
  35. // end of your message loop.
  36. virtual uint32 EngineMessageFn(uint32 messageID, void *pData, LTFLOAT lData);
  37. // Call this when you get an object message function so aggregates will get it.
  38. virtual uint32 ObjectMessageFn(HOBJECT hSender, uint32 messageID, HMESSAGEREAD hRead);
  39. protected:
  40. void AddAggregate(LPAGGREGATE pAggregate);
  41. LTBOOL RemoveAggregate(LPAGGREGATE pAggregate);
  42. public: // Data members
  43. // VERY Important that these data memebers stay in this order.
  44. // This version and the C version must be the same!
  45. LPAGGREGATE m_pFirstAggregate;// The first aggregate in the linked list..
  46. // This is always set.. you can use this to pass in an
  47. // HOBJECT to the functions that require on instead of calling
  48. // ObjectToHandle() every time..
  49. HOBJECT m_hObject;
  50. // C++ only data...
  51. uint8 m_nType; // Type of object (see ltbasedefs.h)
  52. };
  53. // The WorldSection class.
  54. class WorldSection : public BaseClass
  55. {
  56. public:
  57. };
  58. // Terrain.
  59. class Terrain : public BaseClass
  60. {
  61. public:
  62. };
  63. // Container.
  64. class Container : public BaseClass
  65. {
  66. public:
  67. virtual uint32 EngineMessageFn(uint32 messageID, void *pData, float lData);
  68. uint32 m_ContainerCode;
  69. };
  70. // Sound.
  71. class Sound : public BaseClass
  72. {
  73. public:
  74. virtual uint32 EngineMessageFn(uint32 messageID, void *pData, float lData);
  75. char m_Filename[101];
  76. float m_fOuterRadius;
  77. float m_fInnerRadius;
  78. uint8 m_nVolume;
  79. LTBOOL m_bAmbient;
  80. unsigned char m_nPriority;
  81. };
  82. // InsideDef.
  83. // These are used by the preprocessor to define 'inside' areas.
  84. class InsideDef : public BaseClass
  85. {
  86. public:
  87. };
  88. // OutsideDef class.
  89. // These are used if you want the preprocessor to make a leak file for a level.
  90. class OutsideDef : public BaseClass
  91. {
  92. public:
  93. };
  94. // FastApproxArea class.
  95. // This defines an area where only fast approximation vising will occur. The
  96. // area is bounded by hullmakers and portals.
  97. class FastApproxArea : public BaseClass
  98. {
  99. public:
  100. };
  101. // Light class.
  102. class Light : public BaseClass
  103. {
  104. public:
  105. };
  106. // ObjectLight class (these lights only light objects.. they don't light the world). These
  107. // are used for landscape areas lit by GlobalDirLights (which don't light objects).
  108. class ObjectLight : public BaseClass
  109. {
  110. public:
  111. };
  112. // DirLight class.
  113. class DirLight : public BaseClass
  114. {
  115. public:
  116. };
  117. // StaticSunLight class.
  118. class StaticSunLight : public BaseClass
  119. {
  120. public:
  121. virtual uint32 EngineMessageFn(uint32 messageID, void *pData, float lData);
  122. LTVector m_InnerColor;
  123. LTVector m_OuterColor;
  124. float m_BrightScale;
  125. };
  126. // Brush class.
  127. class Brush : public BaseClass
  128. {
  129. public:
  130. };
  131. // DemoSkyWorldModel class. This is a WorldModel that adds itself to the sky object
  132. // list and has properties that level designers can edit to set the sky dimensions.
  133. // If the sky box is set to zero, then it won't set it. (This is so you can have
  134. // multiple DemoSkyWorldModels in the world, and only one sets the sky box).
  135. // The DemoSkyWorldModel uses InnerPercentX, Y, and Z as a percentage of the
  136. // SkyDims box for the inner box.
  137. // Each sky world model must have a (unique) index from 0-30. Ones with
  138. // lower indices get drawn first.
  139. class DemoSkyWorldModel : public BaseClass
  140. {
  141. public:
  142. virtual uint32 EngineMessageFn(uint32 messageID, void *pData, float lData);
  143. LTVector m_SkyDims;
  144. float m_InnerPercentX, m_InnerPercentY, m_InnerPercentZ;
  145. long m_Index;
  146. };
  147. // This works exactly the same as a DemoSkyWorldModel, except you identify the object by name.
  148. class SkyPointer : public BaseClass
  149. {
  150. public:
  151. virtual uint32 EngineMessageFn(
  152. uint32 messageID, void *pData, float lData);
  153. LTVector m_SkyDims;
  154. float m_InnerPercentX, m_InnerPercentY, m_InnerPercentZ;
  155. long m_Index;
  156. char m_ObjectName[100];
  157. };
  158. // These objects, when used with the preprocessor's -RaySelect flag, will cause the
  159. // first brush this object's forward vector hits to be selected in the ED file.
  160. class RaySelecter : public BaseClass
  161. {
  162. public:
  163. };
  164. // This has functionality to be almost any type of engine object.
  165. class GenericObject : public BaseClass
  166. {
  167. public:
  168. virtual uint32 EngineMessageFn(
  169. uint32 messageID, void *pData, float lData);
  170. float m_LightRadius;
  171. float m_ColorR;
  172. float m_ColorG;
  173. float m_ColorB;
  174. float m_ColorA;
  175. };
  176. // Used to assist visibility scheme.
  177. class Zone : public BaseClass
  178. {
  179. public:
  180. };
  181. #endif // __LTENGINEOBJECTS_H__