afxPath.h

Engine/source/afx/util/afxPath.h

More...

Classes:

Detailed Description

  1
  2
  3//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
  4// Arcane-FX for MIT Licensed Open Source version of Torque 3D from GarageGames
  5// Copyright (C) 2015 Faust Logic, Inc.
  6//
  7// Permission is hereby granted, free of charge, to any person obtaining a copy
  8// of this software and associated documentation files (the "Software"), to
  9// deal in the Software without restriction, including without limitation the
 10// rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 11// sell copies of the Software, and to permit persons to whom the Software is
 12// furnished to do so, subject to the following conditions:
 13//
 14// The above copyright notice and this permission notice shall be included in
 15// all copies or substantial portions of the Software.
 16//
 17// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 18// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 19// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
 20// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
 21// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
 22// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
 23// IN THE SOFTWARE.
 24//
 25//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
 26
 27#ifndef _AFX_PATH_H_
 28#define _AFX_PATH_H_
 29
 30#include "core/util/tVector.h"
 31
 32class afxPathData : public GameBaseData
 33{
 34  typedef GameBaseData  Parent;
 35
 36  static StringTableEntry  POINTS_FIELD;
 37  static StringTableEntry  ROLL_FIELD;
 38  static StringTableEntry  TIMES_FIELD;
 39
 40  bool                  resolved;
 41  bool                  update_points;
 42  bool                  update_rolls;
 43  bool                  update_times;
 44
 45  void                  update_derived_values();
 46
 47  void                  clear_arrays();
 48  void                  derive_points_array();
 49  void                  derive_rolls_array();
 50  void                  derive_times_array();
 51
 52  static void           extract_floats_from_string(Vector<F32>& values, const char* points_str);
 53  static Point3F*       build_points_array(Vector<F32>& values, U32& n_points, bool reverse=false);
 54  static F32*           build_floats_array(Vector<F32>& values, U32& n_floats, bool reverse=false);
 55
 56public:  
 57  U32                   num_points;
 58  StringTableEntry      points_string;
 59  Point3F*              points;
 60
 61  StringTableEntry      roll_string;
 62  F32*                  rolls;
 63
 64  StringTableEntry      times_string;
 65  F32*                  times;
 66
 67  StringTableEntry      loop_string;
 68  F32                   delay;              
 69  F32                   lifetime;           
 70
 71  U32                   loop_type;
 72  F32                   mult;
 73  F32                   time_offset;
 74  bool                  reverse;
 75  Point3F               offset;
 76  bool                  echo;
 77  bool                  concentric;
 78
 79public:
 80  /*C*/                 afxPathData();
 81  /*C*/                 afxPathData(const afxPathData&, bool = false);
 82  /*D*/                 ~afxPathData();
 83
 84  virtual bool          onAdd();
 85  virtual void          onRemove();
 86  virtual void          packData(BitStream*);
 87  virtual void          unpackData(BitStream*);
 88
 89  bool                  preload(bool server, String &errorStr);
 90
 91  virtual void          onStaticModified(const char* slotName, const char* newValue = NULL);
 92  virtual void          onPerformSubstitutions();
 93  virtual bool          allowSubstitutions() const { return true; }
 94
 95  static void           initPersistFields();
 96
 97  DECLARE_CONOBJECT(afxPathData);
 98  DECLARE_CATEGORY("AFX");
 99};
100
101//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~//~~~~~~~~~~~~~~~~~~~~~//
102
103#endif // _AFX_PATH_H_
104