afxMooring.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  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_MOORING_H_
  25. #define _AFX_MOORING_H_
  26. #include "renderInstance/renderPassManager.h"
  27. #include "afx/afxEffectDefs.h"
  28. class afxMooringData : public GameBaseData, public afxEffectDefs
  29. {
  30. typedef GameBaseData Parent;
  31. public:
  32. U8 networking;
  33. bool track_pos_only;
  34. bool display_axis_marker;
  35. public:
  36. /*C*/ afxMooringData();
  37. /*C*/ afxMooringData(const afxMooringData&, bool = false);
  38. bool onAdd() override;
  39. void packData(BitStream*) override;
  40. void unpackData(BitStream*) override;
  41. bool allowSubstitutions() const override { return true; }
  42. static void initPersistFields();
  43. DECLARE_CONOBJECT(afxMooringData);
  44. };
  45. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  46. // afxMooring
  47. class afxMooring : public GameBase, public afxEffectDefs
  48. {
  49. typedef GameBase Parent;
  50. private:
  51. afxMooringData* mDataBlock;
  52. U32 chor_id;
  53. bool hookup_with_chor;
  54. StringTableEntry ghost_cons_name;
  55. GFXStateBlockRef axis_sb;
  56. void _renderAxisLines(ObjectRenderInst*, SceneRenderState*, BaseMatInstance*);
  57. protected:
  58. enum MaskBits
  59. {
  60. PositionMask = Parent::NextFreeMask,
  61. NextFreeMask = Parent::NextFreeMask << 1
  62. };
  63. public:
  64. /*C*/ afxMooring();
  65. /*C*/ afxMooring(U32 networking, U32 chor_id, StringTableEntry cons_name);
  66. /*D*/ ~afxMooring();
  67. bool onNewDataBlock(GameBaseData* dptr, bool reload) override;
  68. void advanceTime(F32 dt) override;
  69. bool onAdd() override;
  70. void onRemove() override;
  71. U32 packUpdate(NetConnection*, U32, BitStream*) override;
  72. void unpackUpdate(NetConnection*, BitStream*) override;
  73. void setTransform(const MatrixF&) override;
  74. void prepRenderImage(SceneRenderState*) override;
  75. DECLARE_CONOBJECT(afxMooring);
  76. DECLARE_CATEGORY("UNLISTED");
  77. };
  78. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  79. #endif // _AFX_MOORING_H_