2
0

afxStaticShape.h 3.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798
  1. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  2. // Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
  3. // Copyright (C) 2015 Faust Logic, Inc.
  4. //
  5. // Permission is hereby granted, free of charge, to any person obtaining a copy
  6. // of this software and associated documentation files (the "Software"), to
  7. // deal in the Software without restriction, including without limitation the
  8. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  9. // sell copies of the Software, and to permit persons to whom the Software is
  10. // furnished to do so, subject to the following conditions:
  11. //
  12. // The above copyright notice and this permission notice shall be included in
  13. // all copies or substantial portions of the Software.
  14. //
  15. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  16. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  17. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  18. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  19. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  20. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  21. // IN THE SOFTWARE.
  22. //
  23. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  24. #ifndef _AFX_STATIC_SHAPE_H_
  25. #define _AFX_STATIC_SHAPE_H_
  26. #include "T3D/staticShape.h"
  27. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  28. // afxStaticShapeData
  29. class afxStaticShapeData : public StaticShapeData
  30. {
  31. typedef StaticShapeData Parent;
  32. public:
  33. StringTableEntry sequence;
  34. bool ignore_scene_amb;
  35. bool use_custom_scene_amb;
  36. LinearColorF custom_scene_amb;
  37. bool do_spawn;
  38. public:
  39. /*C*/ afxStaticShapeData();
  40. /*C*/ afxStaticShapeData(const afxStaticShapeData&, bool = false);
  41. void packData(BitStream* stream);
  42. void unpackData(BitStream* stream);
  43. virtual bool allowSubstitutions() const { return true; }
  44. static void initPersistFields();
  45. DECLARE_CONOBJECT(afxStaticShapeData);
  46. DECLARE_CATEGORY("AFX");
  47. };
  48. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  49. // afxStaticShape
  50. class afxStaticShape : public StaticShape
  51. {
  52. typedef StaticShape Parent;
  53. private:
  54. StaticShapeData* mDataBlock;
  55. afxStaticShapeData* mAFX_data;
  56. bool mIs_visible;
  57. U32 mChor_id;
  58. bool mHookup_with_chor;
  59. StringTableEntry mGhost_cons_name;
  60. protected:
  61. virtual void prepRenderImage(SceneRenderState*);
  62. public:
  63. /*C*/ afxStaticShape();
  64. /*D*/ ~afxStaticShape();
  65. void init(U32 chor_id, StringTableEntry cons_name);
  66. virtual bool onNewDataBlock(GameBaseData* dptr, bool reload);
  67. virtual void advanceTime(F32 dt);
  68. virtual U32 packUpdate(NetConnection*, U32, BitStream*);
  69. virtual void unpackUpdate(NetConnection*, BitStream*);
  70. const char* getShapeFileName() const { return mDataBlock->mShapeAsset->getShapeFileName(); }
  71. void setVisibility(bool flag) { mIs_visible = flag; }
  72. DECLARE_CONOBJECT(afxStaticShape);
  73. DECLARE_CATEGORY("AFX");
  74. };
  75. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  76. #endif // _AFX_STATIC_SHAPE_H_