Advertisement
dcomicboy

ObjectCreateStrut

Jul 5th, 2012
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.50 KB | None | 0 0
  1. void CBaseFX::CreateDummyObject()
  2. {
  3. ObjectCreateStruct ocs;
  4.  
  5. LTVector vScale;
  6. vScale.x = 1.0f;
  7. vScale.y = 1.0f;
  8. vScale.z = 1.0f;
  9. ocs.m_ObjectType = OT_NORMAL;
  10. ocs.m_Pos = m_vCreatePos;
  11. ocs.m_Rotation = m_rCreateRot;
  12. ocs.m_Scale = vScale;
  13.  
  14. if (!m_hObject) m_hObject = m_pLTClient->CreateObject(&ocs);
  15. }
  16.  
  17. struct ContainerPhysics;
  18. struct ObjectCreateStruct;
  19.  
  20. class ILTBaseClass
  21. {
  22. public:
  23. virtual ~ILTBaseClass();
  24. virtual uint32 EngineMessageFn(uint32 messageID, void *pData, float lData);
  25. virtual uint32 ObjectMessageFn(HOBJECT hSender, ILTMessage_Read *pMsg);
  26. uint8 GetType() const { return m_nType; }
  27. void SetType(uint8 type) { m_nType = type; }
  28. virtual uint32 OnPrecreate(ObjectCreateStruct* pOCS, float precreateType );
  29. virtual uint32 OnObjectCreated ( float createType );
  30. virtual uint32 OnUpdate ();
  31. virtual uint32 OnTouch ( HOBJECT object, float force );
  32. virtual uint32 OnLinkBroken ( HOBJECT linkObj );
  33. virtual uint32 OnCrush ( HOBJECT crusherObj );
  34. virtual uint32 OnLoad ( ILTMessage_Read *pMsg, float dwParam );
  35. virtual uint32 OnSave ( ILTMessage_Write *pMsg, float dwParam );
  36. virtual uint32 OnAffectPhysics ( ContainerPhysics* pCP );
  37. virtual uint32 OnParentAttachmentRemoved ();
  38. virtual uint32 OnActivate ();
  39. virtual uint32 OnDeactivate ();
  40. virtual uint32 OnAllObjectsCreated ();
  41. HOBJECT GetHOBJECT() const { return m_hObject; }
  42. void SetHOBJECT(HOBJECT h) { m_hObject = h; }
  43. void AddAggregate(LPAGGREGATE pAggregate);
  44. bool RemoveAggregate(LPAGGREGATE pAggregate);
  45. protected:
  46. ILTBaseClass(uint8 nType = OT_NORMAL)
  47. : m_pFirstAggregate(0),
  48. m_hObject(INVALID_HOBJECT),
  49. m_nType(nType) {}
  50.  
  51. public:
  52. LPAGGREGATE m_pFirstAggregate;
  53. HOBJECT m_hObject;
  54. uint8 m_nType;
  55. };
  56.  
  57. #define PRECREATE_NORMAL 0.0f
  58.  
  59. //! Object is being loaded from a world file. Read props in.
  60. #define PRECREATE_WORLDFILE 1.0f
  61.  
  62. //! Object is created from CreateObjectProps. Use GetPropGeneric to read props.
  63. #define PRECREATE_STRINGPROP 2.0f
  64.  
  65. //! Object comes from a savegame.
  66. #define PRECREATE_SAVEGAME 3.0f
  67.  
  68. //! Object being created on client side (client-only object).
  69. #define PRECREATE_CLIENTOBJ 4.0f
  70.  
  71. //! Deprecated alias for \b OBJECTCREATED_NORMAL
  72. #define INITIALUPDATE_NORMAL 0.0f
  73.  
  74. //! Deprecated alias for \b OBJECTCREATED_WORLDFILE
  75. #define INITIALUPDATE_WORLDFILE 1.0f
  76.  
  77. //! Deprecated alias for \b OBJECTCREATED_STRINGPROP
  78. #define INITIALUPDATE_STRINGPROP 2.0f
  79.  
  80. //! Deprecated alias for \b OBJECTCREATED_SAVEGAME
  81. #define INITIALUPDATE_SAVEGAME 3.0f
  82.  
  83. //! Normal creation.
  84. #define OBJECTCREATED_NORMAL 0.0f
  85.  
  86. //! Being created from a world file.
  87. #define OBJECTCREATED_WORLDFILE 1.0f
  88.  
  89. //! Object is created from CreateObjectProps. Use GetPropGeneric to read props.
  90. #define OBJECTCREATED_STRINGPROP 2.0f
  91.  
  92. //! Created from a savegame.
  93. #define OBJECTCREATED_SAVEGAME 3.0f
  94.  
  95. //! Object created on client side (client-only object).
  96. #define OBJECTCREATED_CLIENTOBJ 4.0f
  97.  
  98. enum
  99. {
  100. MID_PRECREATE = 0,
  101. MID_OBJECTCREATED = 1,
  102. MID_INITIALUPDATE = 1,
  103. MID_UPDATE = 2,
  104. MID_TOUCHNOTIFY = 3,
  105. MID_LINKBROKEN = 4,
  106. MID_MODELSTRINGKEY = 5,
  107. MID_CRUSH = 6,
  108. MID_LOADOBJECT = 7,
  109. MID_SAVEOBJECT = 8,
  110. MID_AFFECTPHYSICS = 9,
  111. MID_PARENTATTACHMENTREMOVED = 10,
  112. MID_ACTIVATING = 12,
  113. MID_DEACTIVATING = 13,
  114. MID_ALLOBJECTSCREATED = 14,
  115. MID_TRANSFORMHINT = 15,
  116. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement