afxPath.h 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  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_PATH_H_
  25. #define _AFX_PATH_H_
  26. #include "core/util/tVector.h"
  27. class afxPathData : public GameBaseData
  28. {
  29. typedef GameBaseData Parent;
  30. static StringTableEntry POINTS_FIELD;
  31. static StringTableEntry ROLL_FIELD;
  32. static StringTableEntry TIMES_FIELD;
  33. bool resolved;
  34. bool update_points;
  35. bool update_rolls;
  36. bool update_times;
  37. void update_derived_values();
  38. void clear_arrays();
  39. void derive_points_array();
  40. void derive_rolls_array();
  41. void derive_times_array();
  42. static void extract_floats_from_string(Vector<F32>& values, const char* points_str);
  43. static Point3F* build_points_array(Vector<F32>& values, U32& n_points, bool reverse=false);
  44. static F32* build_floats_array(Vector<F32>& values, U32& n_floats, bool reverse=false);
  45. public:
  46. U32 num_points;
  47. StringTableEntry points_string;
  48. Point3F* points;
  49. StringTableEntry roll_string;
  50. F32* rolls;
  51. StringTableEntry times_string;
  52. F32* times;
  53. StringTableEntry loop_string;
  54. F32 delay;
  55. F32 lifetime;
  56. U32 loop_type;
  57. F32 mult;
  58. F32 time_offset;
  59. bool reverse;
  60. Point3F offset;
  61. bool echo;
  62. bool concentric;
  63. public:
  64. /*C*/ afxPathData();
  65. /*C*/ afxPathData(const afxPathData&, bool = false);
  66. /*D*/ ~afxPathData();
  67. virtual bool onAdd();
  68. virtual void onRemove();
  69. virtual void packData(BitStream*);
  70. virtual void unpackData(BitStream*);
  71. bool preload(bool server, String &errorStr);
  72. virtual void onStaticModified(const char* slotName, const char* newValue = NULL);
  73. virtual void onPerformSubstitutions();
  74. virtual bool allowSubstitutions() const { return true; }
  75. static void initPersistFields();
  76. DECLARE_CONOBJECT(afxPathData);
  77. DECLARE_CATEGORY("AFX");
  78. };
  79. //~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  80. #endif // _AFX_PATH_H_