afxZodiac.h 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135
  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_ZODIAC_H_
  25. #define _AFX_ZODIAC_H_
  26. #ifndef _ARCANE_FX_H_
  27. #include "afx/arcaneFX.h"
  28. #endif
  29. #ifndef _AFX_ZODIAC_DEFS_H_
  30. #include "afx/ce/afxZodiacDefs.h"
  31. #endif
  32. #include "console/typeValidators.h"
  33. GFX_DeclareTextureProfile(AFX_GFXZodiacTextureProfile);
  34. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  35. // afxZodiacData
  36. class afxZodiacData : public GameBaseData, public afxZodiacDefs
  37. {
  38. typedef GameBaseData Parent;
  39. public:
  40. enum BlendType
  41. {
  42. BLEND_NORMAL = 0x0,
  43. BLEND_ADDITIVE = 0x1,
  44. BLEND_SUBTRACTIVE = 0x2,
  45. BLEND_RESERVED = 0x3,
  46. BLEND_MASK = 0x3
  47. };
  48. static void convertGradientRangeFromDegrees(Point2F& gradrange, const Point2F& gradrange_deg);
  49. void onImageChanged() {}
  50. public:
  51. DECLARE_IMAGEASSET(afxZodiacData, Texture, onImageChanged, AFX_GFXZodiacTextureProfile);
  52. DECLARE_ASSET_SETGET(afxZodiacData, Texture);
  53. F32 radius_xy;
  54. Point2F vert_range;
  55. F32 start_ang;
  56. F32 ang_per_sec;
  57. F32 grow_in_time;
  58. F32 shrink_out_time;
  59. F32 growth_rate;
  60. LinearColorF color;
  61. U32 blend_flags;
  62. bool terrain_ok;
  63. bool interiors_ok;
  64. bool reflected_ok;
  65. bool non_reflected_ok;
  66. bool respect_ori_cons;
  67. bool scale_vert_range;
  68. bool interior_h_only;
  69. bool interior_v_ignore;
  70. bool interior_back_ignore;
  71. bool interior_opaque_ignore;
  72. bool interior_transp_ignore;
  73. U32 zflags;
  74. F32 altitude_max;
  75. F32 altitude_falloff;
  76. bool altitude_shrinks;
  77. bool altitude_fades;
  78. F32 distance_max;
  79. F32 distance_falloff;
  80. bool use_grade_range;
  81. bool prefer_dest_grade;
  82. Point2F grade_range_user;
  83. Point2F grade_range;
  84. bool inv_grade_range;
  85. static StringTableEntry GradientRangeSlot;
  86. static bool sPreferDestinationGradients;
  87. void expand_zflags();
  88. void merge_zflags();
  89. public:
  90. /*C*/ afxZodiacData();
  91. /*C*/ afxZodiacData(const afxZodiacData&, bool = false);
  92. virtual bool onAdd();
  93. virtual void packData(BitStream*);
  94. virtual void unpackData(BitStream*);
  95. bool preload(bool server, String &errorStr);
  96. virtual void onStaticModified(const char* slotName, const char* newValue = NULL);
  97. virtual void onPerformSubstitutions();
  98. virtual bool allowSubstitutions() const { return true; }
  99. F32 calcRotationAngle(F32 elapsed, F32 rate_factor=1.0f);
  100. static void initPersistFields();
  101. DECLARE_CONOBJECT(afxZodiacData);
  102. DECLARE_CATEGORY("AFX");
  103. };
  104. typedef afxZodiacData::BlendType afxZodiac_BlendType;
  105. DefineEnumType( afxZodiac_BlendType );
  106. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  107. #endif // _AFX_ZODIAC_H_